From: Matt Corallo Date: Thu, 1 Aug 2024 17:42:46 +0000 (+0000) Subject: [Java] Update auto-generated bindings X-Git-Tag: v0.0.124.0^2~5 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=209f789d628d943e934d815fddfe7bfb5ce4b6c2;p=ldk-java [Java] Update auto-generated bindings --- diff --git a/src/main/java/org/ldk/enums/BalanceSource.java b/src/main/java/org/ldk/enums/BalanceSource.java new file mode 100644 index 00000000..f7665383 --- /dev/null +++ b/src/main/java/org/ldk/enums/BalanceSource.java @@ -0,0 +1,26 @@ +package org.ldk.enums; + +/** + * Indicates whether the balance is derived from a cooperative close, a force-close + * (for holder or counterparty), or whether it is for an HTLC. + */ +public enum BalanceSource { + /** + * The channel was force closed by the holder. + */ + LDKBalanceSource_HolderForceClosed, + /** + * The channel was force closed by the counterparty. + */ + LDKBalanceSource_CounterpartyForceClosed, + /** + * The channel was cooperatively closed. + */ + LDKBalanceSource_CoopClose, + /** + * This balance is the result of an HTLC. + */ + LDKBalanceSource_Htlc, + ; static native void init(); + static { org.ldk.impl.bindings.run_statics(); init(); } +} \ No newline at end of file diff --git a/src/main/java/org/ldk/enums/Bolt12SemanticError.java b/src/main/java/org/ldk/enums/Bolt12SemanticError.java index ca52e917..998a7232 100644 --- a/src/main/java/org/ldk/enums/Bolt12SemanticError.java +++ b/src/main/java/org/ldk/enums/Bolt12SemanticError.java @@ -112,6 +112,10 @@ public enum Bolt12SemanticError { * An invoice payment hash was expected but was missing. */ LDKBolt12SemanticError_MissingPaymentHash, + /** + * An invoice payment hash was provided but was not expected. + */ + LDKBolt12SemanticError_UnexpectedPaymentHash, /** * A signature was expected but was missing. */ diff --git a/src/main/java/org/ldk/enums/ConfirmationTarget.java b/src/main/java/org/ldk/enums/ConfirmationTarget.java index 30f36343..2ba92480 100644 --- a/src/main/java/org/ldk/enums/ConfirmationTarget.java +++ b/src/main/java/org/ldk/enums/ConfirmationTarget.java @@ -5,13 +5,23 @@ package org.ldk.enums; * estimation. */ public enum ConfirmationTarget { + /** + * The most aggressive (i.e. highest) feerate estimate available. + * + * This is used to sanity-check our counterparty's feerates and should be as conservative as + * possible to ensure that we don't confuse a peer using a very conservative estimator for one + * trying to burn channel balance to dust. + */ + LDKConfirmationTarget_MaximumFeeEstimate, /** * We have some funds available on chain which we need to spend prior to some expiry time at - * which point our counterparty may be able to steal them. Generally we have in the high tens - * to low hundreds of blocks to get our transaction on-chain, but we shouldn't risk too low a - * fee - this should be a relatively high priority feerate. + * which point our counterparty may be able to steal them. + * + * Generally we have in the high tens to low hundreds of blocks to get our transaction + * on-chain (it doesn't have to happen in the next few blocks!), but we shouldn't risk too low + * a fee - this should be a relatively high priority feerate. */ - LDKConfirmationTarget_OnChainSweep, + LDKConfirmationTarget_UrgentOnChainSweep, /** * This is the lowest feerate we will allow our channel counterparty to have in an anchor * channel in order to close the channel if a channel party goes away. @@ -93,14 +103,18 @@ public enum ConfirmationTarget { */ LDKConfirmationTarget_ChannelCloseMinimum, /** - * The feerate [`OutputSweeper`] will use on transactions spending - * [`SpendableOutputDescriptor`]s after a channel closure. + * The feerate used to claim on-chain funds when there is no particular urgency to do so. + * + * It is used to get commitment transactions without any HTLCs confirmed in [`ChannelMonitor`] + * and by [`OutputSweeper`] on transactions spending [`SpendableOutputDescriptor`]s after a + * channel closure. * * Generally spending these outputs is safe as long as they eventually confirm, so a value * (slightly above) the mempool minimum should suffice. However, as this value will influence * how long funds will be unavailable after channel closure, [`FeeEstimator`] implementors * might want to choose a higher feerate to regain control over funds faster. * + * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor * [`OutputSweeper`]: crate::util::sweep::OutputSweeper * [`SpendableOutputDescriptor`]: crate::sign::SpendableOutputDescriptor */ diff --git a/src/main/java/org/ldk/enums/CreationError.java b/src/main/java/org/ldk/enums/CreationError.java index 90e1a5f7..900a508b 100644 --- a/src/main/java/org/ldk/enums/CreationError.java +++ b/src/main/java/org/ldk/enums/CreationError.java @@ -21,16 +21,11 @@ public enum CreationError { */ LDKCreationError_InvalidAmount, /** - * Route hints were required for this invoice and were missing. Applies to - * [phantom invoices]. - * - * [phantom invoices]: crate::utils::create_phantom_invoice + * Route hints were required for this invoice and were missing. */ LDKCreationError_MissingRouteHints, /** - * The provided `min_final_cltv_expiry_delta` was less than [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. - * - * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA + * The provided `min_final_cltv_expiry_delta` was less than rust-lightning's minimum. */ LDKCreationError_MinFinalCltvExpiryDeltaTooShort, ; static native void init(); diff --git a/src/main/java/org/ldk/enums/Direction.java b/src/main/java/org/ldk/enums/Direction.java index 34b6b74c..d133dcc8 100644 --- a/src/main/java/org/ldk/enums/Direction.java +++ b/src/main/java/org/ldk/enums/Direction.java @@ -1,8 +1,8 @@ package org.ldk.enums; /** - * The side of a channel that is the [`IntroductionNode`] in a [`BlindedPath`]. [BOLT 7] defines - * which nodes is which in the [`ChannelAnnouncement`] message. + * The side of a channel that is the [`IntroductionNode`] in a blinded path. [BOLT 7] defines which + * nodes is which in the [`ChannelAnnouncement`] message. * * [BOLT 7]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_announcement-message * [`ChannelAnnouncement`]: crate::ln::msgs::ChannelAnnouncement diff --git a/src/main/java/org/ldk/enums/InboundHTLCStateDetails.java b/src/main/java/org/ldk/enums/InboundHTLCStateDetails.java new file mode 100644 index 00000000..db8e4c46 --- /dev/null +++ b/src/main/java/org/ldk/enums/InboundHTLCStateDetails.java @@ -0,0 +1,51 @@ +package org.ldk.enums; + +/** + * Exposes the state of pending inbound HTLCs. + * + * At a high level, an HTLC being forwarded from one Lightning node to another Lightning node goes + * through the following states in the state machine: + * - Announced for addition by the originating node through the update_add_htlc message. + * - Added to the commitment transaction of the receiving node and originating node in turn + * through the exchange of commitment_signed and revoke_and_ack messages. + * - Announced for resolution (fulfillment or failure) by the receiving node through either one of + * the update_fulfill_htlc, update_fail_htlc, and update_fail_malformed_htlc messages. + * - Removed from the commitment transaction of the originating node and receiving node in turn + * through the exchange of commitment_signed and revoke_and_ack messages. + * + * This can be used to inspect what next message an HTLC is waiting for to advance its state. + */ +public enum InboundHTLCStateDetails { + /** + * We have added this HTLC in our commitment transaction by receiving commitment_signed and + * returning revoke_and_ack. We are awaiting the appropriate revoke_and_ack's from the remote + * before this HTLC is included on the remote commitment transaction. + */ + LDKInboundHTLCStateDetails_AwaitingRemoteRevokeToAdd, + /** + * This HTLC has been included in the commitment_signed and revoke_and_ack messages on both sides + * and is included in both commitment transactions. + * + * This HTLC is now safe to either forward or be claimed as a payment by us. The HTLC will + * remain in this state until the forwarded upstream HTLC has been resolved and we resolve this + * HTLC correspondingly, or until we claim it as a payment. If it is part of a multipart + * payment, it will only be claimed together with other required parts. + */ + LDKInboundHTLCStateDetails_Committed, + /** + * We have received the preimage for this HTLC and it is being removed by fulfilling it with + * update_fulfill_htlc. This HTLC is still on both commitment transactions, but we are awaiting + * the appropriate revoke_and_ack's from the remote before this HTLC is removed from the remote + * commitment transaction after update_fulfill_htlc. + */ + LDKInboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFulfill, + /** + * The HTLC is being removed by failing it with update_fail_htlc or update_fail_malformed_htlc. + * This HTLC is still on both commitment transactions, but we are awaiting the appropriate + * revoke_and_ack's from the remote before this HTLC is removed from the remote commitment + * transaction. + */ + LDKInboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFail, + ; static native void init(); + static { org.ldk.impl.bindings.run_statics(); init(); } +} \ No newline at end of file diff --git a/src/main/java/org/ldk/enums/OutboundHTLCStateDetails.java b/src/main/java/org/ldk/enums/OutboundHTLCStateDetails.java new file mode 100644 index 00000000..9ba57323 --- /dev/null +++ b/src/main/java/org/ldk/enums/OutboundHTLCStateDetails.java @@ -0,0 +1,48 @@ +package org.ldk.enums; + +/** + * Exposes the state of pending outbound HTLCs. + * + * At a high level, an HTLC being forwarded from one Lightning node to another Lightning node goes + * through the following states in the state machine: + * - Announced for addition by the originating node through the update_add_htlc message. + * - Added to the commitment transaction of the receiving node and originating node in turn + * through the exchange of commitment_signed and revoke_and_ack messages. + * - Announced for resolution (fulfillment or failure) by the receiving node through either one of + * the update_fulfill_htlc, update_fail_htlc, and update_fail_malformed_htlc messages. + * - Removed from the commitment transaction of the originating node and receiving node in turn + * through the exchange of commitment_signed and revoke_and_ack messages. + * + * This can be used to inspect what next message an HTLC is waiting for to advance its state. + */ +public enum OutboundHTLCStateDetails { + /** + * We are awaiting the appropriate revoke_and_ack's from the remote before the HTLC is added + * on the remote's commitment transaction after update_add_htlc. + */ + LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToAdd, + /** + * The HTLC has been added to the remote's commitment transaction by sending commitment_signed + * and receiving revoke_and_ack in return. + * + * The HTLC will remain in this state until the remote node resolves the HTLC, or until we + * unilaterally close the channel due to a timeout with an uncooperative remote node. + */ + LDKOutboundHTLCStateDetails_Committed, + /** + * The HTLC has been fulfilled successfully by the remote with a preimage in update_fulfill_htlc, + * and we removed the HTLC from our commitment transaction by receiving commitment_signed and + * returning revoke_and_ack. We are awaiting the appropriate revoke_and_ack's from the remote + * for the removal from its commitment transaction. + */ + LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveSuccess, + /** + * The HTLC has been failed by the remote with update_fail_htlc or update_fail_malformed_htlc, + * and we removed the HTLC from our commitment transaction by receiving commitment_signed and + * returning revoke_and_ack. We are awaiting the appropriate revoke_and_ack's from the remote + * for the removal from its commitment transaction. + */ + LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFailure, + ; static native void init(); + static { org.ldk.impl.bindings.run_statics(); init(); } +} \ No newline at end of file diff --git a/src/main/java/org/ldk/enums/PaymentFailureReason.java b/src/main/java/org/ldk/enums/PaymentFailureReason.java index ea07d0ba..12e33b9a 100644 --- a/src/main/java/org/ldk/enums/PaymentFailureReason.java +++ b/src/main/java/org/ldk/enums/PaymentFailureReason.java @@ -6,6 +6,12 @@ package org.ldk.enums; public enum PaymentFailureReason { /** * The intended recipient rejected our payment. + * + * Also used for [`UnknownRequiredFeatures`] and [`InvoiceRequestRejected`] when downgrading to + * version prior to 0.0.124. + * + * [`UnknownRequiredFeatures`]: Self::UnknownRequiredFeatures + * [`InvoiceRequestRejected`]: Self::InvoiceRequestRejected */ LDKPaymentFailureReason_RecipientRejected, /** @@ -27,7 +33,10 @@ public enum PaymentFailureReason { * The payment expired while retrying, based on the provided * [`PaymentParameters::expiry_time`]. * + * Also used for [`InvoiceRequestExpired`] when downgrading to version prior to 0.0.124. + * * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time + * [`InvoiceRequestExpired`]: Self::InvoiceRequestExpired */ LDKPaymentFailureReason_PaymentExpired, /** @@ -43,6 +52,20 @@ public enum PaymentFailureReason { * your router. */ LDKPaymentFailureReason_UnexpectedError, + /** + * An invoice was received that required unknown features. + */ + LDKPaymentFailureReason_UnknownRequiredFeatures, + /** + * A [`Bolt12Invoice`] was not received in a reasonable amount of time. + */ + LDKPaymentFailureReason_InvoiceRequestExpired, + /** + * An [`InvoiceRequest`] for the payment was rejected by the recipient. + * + * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest + */ + LDKPaymentFailureReason_InvoiceRequestRejected, ; static native void init(); static { org.ldk.impl.bindings.run_statics(); init(); } } \ No newline at end of file diff --git a/src/main/java/org/ldk/enums/RetryableSendFailure.java b/src/main/java/org/ldk/enums/RetryableSendFailure.java index 26a79966..3a93bbcf 100644 --- a/src/main/java/org/ldk/enums/RetryableSendFailure.java +++ b/src/main/java/org/ldk/enums/RetryableSendFailure.java @@ -29,6 +29,14 @@ public enum RetryableSendFailure { * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed */ LDKRetryableSendFailure_DuplicatePayment, + /** + * The [`RecipientOnionFields::payment_metadata`], [`RecipientOnionFields::custom_tlvs`], or + * [`BlindedPaymentPath`]s provided are too large and caused us to exceed the maximum onion + * packet size of 1300 bytes. + * + * [`BlindedPaymentPath`]: crate::blinded_path::payment::BlindedPaymentPath + */ + LDKRetryableSendFailure_OnionPacketSizeExceeded, ; static native void init(); static { org.ldk.impl.bindings.run_statics(); init(); } } \ No newline at end of file diff --git a/src/main/java/org/ldk/enums/Secp256k1Error.java b/src/main/java/org/ldk/enums/Secp256k1Error.java index 15ac4972..dc4deb16 100644 --- a/src/main/java/org/ldk/enums/Secp256k1Error.java +++ b/src/main/java/org/ldk/enums/Secp256k1Error.java @@ -48,6 +48,10 @@ public enum Secp256k1Error { * The only valid parity values are 0 or 1. */ LDKSecp256k1Error_InvalidParityValue, + /** + * Invalid Elligator Swift Value + */ + LDKSecp256k1Error_InvalidEllSwift, ; static native void init(); static { org.ldk.impl.bindings.run_statics(); init(); } } \ No newline at end of file diff --git a/src/main/java/org/ldk/impl/bindings.java b/src/main/java/org/ldk/impl/bindings.java index 80bb46eb..221f9817 100644 --- a/src/main/java/org/ldk/impl/bindings.java +++ b/src/main/java/org/ldk/impl/bindings.java @@ -46,6 +46,7 @@ public class bindings { public static native String get_ldk_c_bindings_version(); public static native String get_ldk_version(); + static { BalanceSource.values(); /* Force enum statics to run */ } static { BlindedFailure.values(); /* Force enum statics to run */ } static { Bolt11SemanticError.values(); /* Force enum statics to run */ } static { Bolt12SemanticError.values(); /* Force enum statics to run */ } @@ -124,24 +125,6 @@ public class bindings { } static { LDKCOption_u64Z.init(); } public static native LDKCOption_u64Z LDKCOption_u64Z_ref_from_ptr(long ptr); - // struct LDKRefund CResult_RefundBolt12ParseErrorZ_get_ok(LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR owner); - public static native long CResult_RefundBolt12ParseErrorZ_get_ok(long owner); - // struct LDKBolt12ParseError CResult_RefundBolt12ParseErrorZ_get_err(LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR owner); - public static native long CResult_RefundBolt12ParseErrorZ_get_err(long owner); - public static class LDKRetry { - private LDKRetry() {} - public final static class Attempts extends LDKRetry { - public int attempts; - Attempts(int attempts) { this.attempts = attempts; } - } - public final static class Timeout extends LDKRetry { - public long timeout; - Timeout(long timeout) { this.timeout = timeout; } - } - static native void init(); - } - static { LDKRetry.init(); } - public static native LDKRetry LDKRetry_ref_from_ptr(long ptr); public static class LDKDecodeError { private LDKDecodeError() {} public final static class UnknownVersion extends LDKDecodeError { @@ -173,6 +156,28 @@ public class bindings { } static { LDKDecodeError.init(); } public static native LDKDecodeError LDKDecodeError_ref_from_ptr(long ptr); + // struct LDKRefund CResult_RefundDecodeErrorZ_get_ok(LDKCResult_RefundDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_RefundDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_RefundDecodeErrorZ_get_err(LDKCResult_RefundDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_RefundDecodeErrorZ_get_err(long owner); + // struct LDKRefund CResult_RefundBolt12ParseErrorZ_get_ok(LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR owner); + public static native long CResult_RefundBolt12ParseErrorZ_get_ok(long owner); + // struct LDKBolt12ParseError CResult_RefundBolt12ParseErrorZ_get_err(LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR owner); + public static native long CResult_RefundBolt12ParseErrorZ_get_err(long owner); + public static class LDKRetry { + private LDKRetry() {} + public final static class Attempts extends LDKRetry { + public int attempts; + Attempts(int attempts) { this.attempts = attempts; } + } + public final static class Timeout extends LDKRetry { + public long timeout; + Timeout(long timeout) { this.timeout = timeout; } + } + static native void init(); + } + static { LDKRetry.init(); } + public static native LDKRetry LDKRetry_ref_from_ptr(long ptr); // struct LDKRetry CResult_RetryDecodeErrorZ_get_ok(LDKCResult_RetryDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_RetryDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_RetryDecodeErrorZ_get_err(LDKCResult_RetryDecodeErrorZ *NONNULL_PTR owner); @@ -335,10 +340,10 @@ public class bindings { public static native byte[] CResult_ThirtyTwoBytesNoneZ_get_ok(long owner); // void CResult_ThirtyTwoBytesNoneZ_get_err(LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR owner); public static native void CResult_ThirtyTwoBytesNoneZ_get_err(long owner); - // struct LDKBlindedPayInfo CResult_BlindedPayInfoDecodeErrorZ_get_ok(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_BlindedPayInfoDecodeErrorZ_get_ok(long owner); - // struct LDKDecodeError CResult_BlindedPayInfoDecodeErrorZ_get_err(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_BlindedPayInfoDecodeErrorZ_get_err(long owner); + // struct LDKBolt12Invoice CResult_Bolt12InvoiceDecodeErrorZ_get_ok(LDKCResult_Bolt12InvoiceDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_Bolt12InvoiceDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_Bolt12InvoiceDecodeErrorZ_get_err(LDKCResult_Bolt12InvoiceDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_Bolt12InvoiceDecodeErrorZ_get_err(long owner); // struct LDKDelayedPaymentOutputDescriptor CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner); @@ -400,14 +405,18 @@ public class bindings { public static native long CResult_HTLCDescriptorDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_HTLCDescriptorDecodeErrorZ_get_err(LDKCResult_HTLCDescriptorDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_HTLCDescriptorDecodeErrorZ_get_err(long owner); - // void CResult_NoneNoneZ_get_ok(LDKCResult_NoneNoneZ *NONNULL_PTR owner); - public static native void CResult_NoneNoneZ_get_ok(long owner); - // void CResult_NoneNoneZ_get_err(LDKCResult_NoneNoneZ *NONNULL_PTR owner); - public static native void CResult_NoneNoneZ_get_err(long owner); // struct LDKPublicKey CResult_PublicKeyNoneZ_get_ok(LDKCResult_PublicKeyNoneZ *NONNULL_PTR owner); public static native byte[] CResult_PublicKeyNoneZ_get_ok(long owner); // void CResult_PublicKeyNoneZ_get_err(LDKCResult_PublicKeyNoneZ *NONNULL_PTR owner); public static native void CResult_PublicKeyNoneZ_get_err(long owner); + // struct LDKThirtyTwoBytes CResult__u832NoneZ_get_ok(LDKCResult__u832NoneZ *NONNULL_PTR owner); + public static native byte[] CResult__u832NoneZ_get_ok(long owner); + // void CResult__u832NoneZ_get_err(LDKCResult__u832NoneZ *NONNULL_PTR owner); + public static native void CResult__u832NoneZ_get_err(long owner); + // void CResult_NoneNoneZ_get_ok(LDKCResult_NoneNoneZ *NONNULL_PTR owner); + public static native void CResult_NoneNoneZ_get_ok(long owner); + // void CResult_NoneNoneZ_get_err(LDKCResult_NoneNoneZ *NONNULL_PTR owner); + public static native void CResult_NoneNoneZ_get_err(long owner); public static class LDKCOption_BigEndianScalarZ { private LDKCOption_BigEndianScalarZ() {} public final static class Some extends LDKCOption_BigEndianScalarZ { @@ -442,18 +451,18 @@ public class bindings { // void CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_get_err(LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ *NONNULL_PTR owner); public static native void CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_get_err(long owner); public interface LDKChannelSigner { - byte[] get_per_commitment_point(long idx); - byte[] release_commitment_secret(long idx); + long get_per_commitment_point(long idx); + long release_commitment_secret(long idx); long validate_holder_commitment(long holder_tx, byte[][] outbound_htlc_preimages); long validate_counterparty_revocation(long idx, byte[] secret); byte[] channel_keys_id(); void provide_channel_parameters(long channel_parameters); } public static native long LDKChannelSigner_new(LDKChannelSigner impl, long pubkeys); - // LDKPublicKey ChannelSigner_get_per_commitment_point LDKChannelSigner *NONNULL_PTR this_arg, uint64_t idx - public static native byte[] ChannelSigner_get_per_commitment_point(long this_arg, long idx); - // LDKThirtyTwoBytes ChannelSigner_release_commitment_secret LDKChannelSigner *NONNULL_PTR this_arg, uint64_t idx - public static native byte[] ChannelSigner_release_commitment_secret(long this_arg, long idx); + // LDKCResult_PublicKeyNoneZ ChannelSigner_get_per_commitment_point LDKChannelSigner *NONNULL_PTR this_arg, uint64_t idx + public static native long ChannelSigner_get_per_commitment_point(long this_arg, long idx); + // LDKCResult__u832NoneZ ChannelSigner_release_commitment_secret LDKChannelSigner *NONNULL_PTR this_arg, uint64_t idx + public static native long ChannelSigner_release_commitment_secret(long this_arg, long idx); // LDKCResult_NoneNoneZ ChannelSigner_validate_holder_commitment LDKChannelSigner *NONNULL_PTR this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR holder_tx, struct LDKCVec_ThirtyTwoBytesZ outbound_htlc_preimages public static native long ChannelSigner_validate_holder_commitment(long this_arg, long holder_tx, byte[][] outbound_htlc_preimages); // LDKCResult_NoneNoneZ ChannelSigner_validate_counterparty_revocation LDKChannelSigner *NONNULL_PTR this_arg, uint64_t idx, const uint8_t (*secret)[32] @@ -495,18 +504,10 @@ public class bindings { public static native long EcdsaChannelSigner_sign_holder_anchor_input(long this_arg, byte[] anchor_tx, long input); // LDKCResult_ECDSASignatureNoneZ EcdsaChannelSigner_sign_channel_announcement_with_funding_key LDKEcdsaChannelSigner *NONNULL_PTR this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg public static native long EcdsaChannelSigner_sign_channel_announcement_with_funding_key(long this_arg, long msg); - public interface LDKWriteableEcdsaChannelSigner { - byte[] write(); - } - public static native long LDKWriteableEcdsaChannelSigner_new(LDKWriteableEcdsaChannelSigner impl, LDKEcdsaChannelSigner EcdsaChannelSigner, LDKChannelSigner ChannelSigner, long pubkeys); - public static native long LDKWriteableEcdsaChannelSigner_get_EcdsaChannelSigner(long arg); - public static native long LDKWriteableEcdsaChannelSigner_get_ChannelSigner(long arg); - // LDKCVec_u8Z WriteableEcdsaChannelSigner_write LDKWriteableEcdsaChannelSigner *NONNULL_PTR this_arg - public static native byte[] WriteableEcdsaChannelSigner_write(long this_arg); - // struct LDKWriteableEcdsaChannelSigner CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_ok(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_ok(long owner); - // struct LDKDecodeError CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_err(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_err(long owner); + // struct LDKEcdsaChannelSigner CResult_EcdsaChannelSignerDecodeErrorZ_get_ok(LDKCResult_EcdsaChannelSignerDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_EcdsaChannelSignerDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_EcdsaChannelSignerDecodeErrorZ_get_err(LDKCResult_EcdsaChannelSignerDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_EcdsaChannelSignerDecodeErrorZ_get_err(long owner); // struct LDKCVec_u8Z CResult_CVec_u8ZNoneZ_get_ok(LDKCResult_CVec_u8ZNoneZ *NONNULL_PTR owner); public static native byte[] CResult_CVec_u8ZNoneZ_get_ok(long owner); // void CResult_CVec_u8ZNoneZ_get_err(LDKCResult_CVec_u8ZNoneZ *NONNULL_PTR owner); @@ -632,26 +633,32 @@ public class bindings { public static native void CResult_NoneIOErrorZ_get_ok(long owner); // enum LDKIOError CResult_NoneIOErrorZ_get_err(LDKCResult_NoneIOErrorZ *NONNULL_PTR owner); public static native IOError CResult_NoneIOErrorZ_get_err(long owner); + // struct LDKThirtyTwoBytes C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_a(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR owner); + public static native byte[] C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_a(long owner); + // struct LDKRecipientOnionFields C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_b(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR owner); + public static native long C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_b(long owner); + // struct LDKRouteParameters C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_c(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR owner); + public static native long C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_c(long owner); + // struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_ok(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR owner); + public static native long CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_ok(long owner); + // void CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_err(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR owner); + public static native void CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_err(long owner); // struct LDKRoute CResult_RouteLightningErrorZ_get_ok(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner); public static native long CResult_RouteLightningErrorZ_get_ok(long owner); // struct LDKLightningError CResult_RouteLightningErrorZ_get_err(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner); public static native long CResult_RouteLightningErrorZ_get_err(long owner); - // struct LDKBlindedPayInfo C2Tuple_BlindedPayInfoBlindedPathZ_get_a(LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR owner); - public static native long C2Tuple_BlindedPayInfoBlindedPathZ_get_a(long owner); - // struct LDKBlindedPath C2Tuple_BlindedPayInfoBlindedPathZ_get_b(LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR owner); - public static native long C2Tuple_BlindedPayInfoBlindedPathZ_get_b(long owner); - // struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_ok(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR owner); - public static native long[] CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_ok(long owner); - // void CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_err(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR owner); - public static native void CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_err(long owner); + // struct LDKCVec_BlindedPaymentPathZ CResult_CVec_BlindedPaymentPathZNoneZ_get_ok(LDKCResult_CVec_BlindedPaymentPathZNoneZ *NONNULL_PTR owner); + public static native long[] CResult_CVec_BlindedPaymentPathZNoneZ_get_ok(long owner); + // void CResult_CVec_BlindedPaymentPathZNoneZ_get_err(LDKCResult_CVec_BlindedPaymentPathZNoneZ *NONNULL_PTR owner); + public static native void CResult_CVec_BlindedPaymentPathZNoneZ_get_err(long owner); // struct LDKOnionMessagePath CResult_OnionMessagePathNoneZ_get_ok(LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR owner); public static native long CResult_OnionMessagePathNoneZ_get_ok(long owner); // void CResult_OnionMessagePathNoneZ_get_err(LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR owner); public static native void CResult_OnionMessagePathNoneZ_get_err(long owner); - // struct LDKCVec_BlindedPathZ CResult_CVec_BlindedPathZNoneZ_get_ok(LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR owner); - public static native long[] CResult_CVec_BlindedPathZNoneZ_get_ok(long owner); - // void CResult_CVec_BlindedPathZNoneZ_get_err(LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR owner); - public static native void CResult_CVec_BlindedPathZNoneZ_get_err(long owner); + // struct LDKCVec_BlindedMessagePathZ CResult_CVec_BlindedMessagePathZNoneZ_get_ok(LDKCResult_CVec_BlindedMessagePathZNoneZ *NONNULL_PTR owner); + public static native long[] CResult_CVec_BlindedMessagePathZNoneZ_get_ok(long owner); + // void CResult_CVec_BlindedMessagePathZNoneZ_get_err(LDKCResult_CVec_BlindedMessagePathZNoneZ *NONNULL_PTR owner); + public static native void CResult_CVec_BlindedMessagePathZNoneZ_get_err(long owner); // struct LDKInFlightHtlcs CResult_InFlightHtlcsDecodeErrorZ_get_ok(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_InFlightHtlcsDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_InFlightHtlcsDecodeErrorZ_get_err(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner); @@ -772,7 +779,8 @@ public class bindings { CounterpartyForceClosed(long peer_msg) { this.peer_msg = peer_msg; } } public final static class HolderForceClosed extends LDKClosureReason { - HolderForceClosed() { } + public long broadcasted_latest_txn; + HolderForceClosed(long broadcasted_latest_txn) { this.broadcasted_latest_txn = broadcasted_latest_txn; } } public final static class LegacyCooperativeClosure extends LDKClosureReason { LegacyCooperativeClosure() { } @@ -808,6 +816,11 @@ public class bindings { public final static class HTLCsTimedOut extends LDKClosureReason { HTLCsTimedOut() { } } + public final static class PeerFeerateTooLow extends LDKClosureReason { + public int peer_feerate_sat_per_kw; + public int required_feerate_sat_per_kw; + PeerFeerateTooLow(int peer_feerate_sat_per_kw, int required_feerate_sat_per_kw) { this.peer_feerate_sat_per_kw = peer_feerate_sat_per_kw; this.required_feerate_sat_per_kw = required_feerate_sat_per_kw; } + } static native void init(); } static { LDKClosureReason.init(); } @@ -894,6 +907,10 @@ public class bindings { public static native long CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_ok(long owner); // enum LDKBolt12SemanticError CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_err(LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR owner); public static native Bolt12SemanticError CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_err(long owner); + // struct LDKOffer CResult_OfferDecodeErrorZ_get_ok(LDKCResult_OfferDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_OfferDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_OfferDecodeErrorZ_get_err(LDKCResult_OfferDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_OfferDecodeErrorZ_get_err(long owner); // struct LDKOffer CResult_OfferBolt12ParseErrorZ_get_ok(LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR owner); public static native long CResult_OfferBolt12ParseErrorZ_get_ok(long owner); // struct LDKBolt12ParseError CResult_OfferBolt12ParseErrorZ_get_err(LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR owner); @@ -908,10 +925,6 @@ public class bindings { public static native Secp256k1Error CResult_PublicKeySecp256k1ErrorZ_get_err(long owner); public static class LDKNetworkUpdate { private LDKNetworkUpdate() {} - public final static class ChannelUpdateMessage extends LDKNetworkUpdate { - public long msg; - ChannelUpdateMessage(long msg) { this.msg = msg; } - } public final static class ChannelFailure extends LDKNetworkUpdate { public long short_channel_id; public boolean is_permanent; @@ -1077,10 +1090,10 @@ public class bindings { public long msg; SendStfu(byte[] node_id, long msg) { this.node_id = node_id; this.msg = msg; } } - public final static class SendSplice extends LDKMessageSendEvent { + public final static class SendSpliceInit extends LDKMessageSendEvent { public byte[] node_id; public long msg; - SendSplice(byte[] node_id, long msg) { this.node_id = node_id; this.msg = msg; } + SendSpliceInit(byte[] node_id, long msg) { this.node_id = node_id; this.msg = msg; } } public final static class SendSpliceAck extends LDKMessageSendEvent { public byte[] node_id; @@ -1269,6 +1282,20 @@ public class bindings { } static { LDKSocketAddress.init(); } public static native LDKSocketAddress LDKSocketAddress_ref_from_ptr(long ptr); + public static class LDKNodeAnnouncementInfo { + private LDKNodeAnnouncementInfo() {} + public final static class Relayed extends LDKNodeAnnouncementInfo { + public long relayed; + Relayed(long relayed) { this.relayed = relayed; } + } + public final static class Local extends LDKNodeAnnouncementInfo { + public long local; + Local(long local) { this.local = local; } + } + static native void init(); + } + static { LDKNodeAnnouncementInfo.init(); } + public static native LDKNodeAnnouncementInfo LDKNodeAnnouncementInfo_ref_from_ptr(long ptr); // struct LDKNodeAnnouncementInfo CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner); @@ -1277,6 +1304,19 @@ public class bindings { public static native long CResult_NodeAliasDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_NodeAliasDecodeErrorZ_get_err(LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_NodeAliasDecodeErrorZ_get_err(long owner); + public static class LDKCOption_NodeAnnouncementInfoZ { + private LDKCOption_NodeAnnouncementInfoZ() {} + public final static class Some extends LDKCOption_NodeAnnouncementInfoZ { + public long some; + Some(long some) { this.some = some; } + } + public final static class None extends LDKCOption_NodeAnnouncementInfoZ { + None() { } + } + static native void init(); + } + static { LDKCOption_NodeAnnouncementInfoZ.init(); } + public static native LDKCOption_NodeAnnouncementInfoZ LDKCOption_NodeAnnouncementInfoZ_ref_from_ptr(long ptr); // struct LDKNodeInfo CResult_NodeInfoDecodeErrorZ_get_ok(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_NodeInfoDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_NodeInfoDecodeErrorZ_get_err(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner); @@ -1502,6 +1542,39 @@ public class bindings { public static native byte[] CResult_ThirtyTwoBytesAPIErrorZ_get_ok(long owner); // struct LDKAPIError CResult_ThirtyTwoBytesAPIErrorZ_get_err(LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR owner); public static native long CResult_ThirtyTwoBytesAPIErrorZ_get_err(long owner); + public static class LDKOffersContext { + private LDKOffersContext() {} + public final static class InvoiceRequest extends LDKOffersContext { + public long nonce; + InvoiceRequest(long nonce) { this.nonce = nonce; } + } + public final static class OutboundPayment extends LDKOffersContext { + public byte[] payment_id; + public long nonce; + public byte[] hmac; + OutboundPayment(byte[] payment_id, long nonce, byte[] hmac) { this.payment_id = payment_id; this.nonce = nonce; this.hmac = hmac; } + } + public final static class InboundPayment extends LDKOffersContext { + public byte[] payment_hash; + InboundPayment(byte[] payment_hash) { this.payment_hash = payment_hash; } + } + static native void init(); + } + static { LDKOffersContext.init(); } + public static native LDKOffersContext LDKOffersContext_ref_from_ptr(long ptr); + public static class LDKCOption_OffersContextZ { + private LDKCOption_OffersContextZ() {} + public final static class Some extends LDKCOption_OffersContextZ { + public long some; + Some(long some) { this.some = some; } + } + public final static class None extends LDKCOption_OffersContextZ { + None() { } + } + static native void init(); + } + static { LDKCOption_OffersContextZ.init(); } + public static native LDKCOption_OffersContextZ LDKCOption_OffersContextZ_ref_from_ptr(long ptr); public static class LDKOffersMessage { private LDKOffersMessage() {} public final static class InvoiceRequest extends LDKOffersMessage { @@ -1520,19 +1593,23 @@ public class bindings { } static { LDKOffersMessage.init(); } public static native LDKOffersMessage LDKOffersMessage_ref_from_ptr(long ptr); - public static class LDKCOption_OffersMessageZ { - private LDKCOption_OffersMessageZ() {} - public final static class Some extends LDKCOption_OffersMessageZ { + // struct LDKOffersMessage C2Tuple_OffersMessageResponseInstructionZ_get_a(LDKC2Tuple_OffersMessageResponseInstructionZ *NONNULL_PTR owner); + public static native long C2Tuple_OffersMessageResponseInstructionZ_get_a(long owner); + // struct LDKResponseInstruction C2Tuple_OffersMessageResponseInstructionZ_get_b(LDKC2Tuple_OffersMessageResponseInstructionZ *NONNULL_PTR owner); + public static native long C2Tuple_OffersMessageResponseInstructionZ_get_b(long owner); + public static class LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ { + private LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ() {} + public final static class Some extends LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ { public long some; Some(long some) { this.some = some; } } - public final static class None extends LDKCOption_OffersMessageZ { + public final static class None extends LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ { None() { } } static native void init(); } - static { LDKCOption_OffersMessageZ.init(); } - public static native LDKCOption_OffersMessageZ LDKCOption_OffersMessageZ_ref_from_ptr(long ptr); + static { LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ.init(); } + public static native LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_ref_from_ptr(long ptr); public static class LDKDestination { private LDKDestination() {} public final static class Node extends LDKDestination { @@ -1547,12 +1624,83 @@ public class bindings { } static { LDKDestination.init(); } public static native LDKDestination LDKDestination_ref_from_ptr(long ptr); - // struct LDKOffersMessage C3Tuple_OffersMessageDestinationBlindedPathZ_get_a(LDKC3Tuple_OffersMessageDestinationBlindedPathZ *NONNULL_PTR owner); - public static native long C3Tuple_OffersMessageDestinationBlindedPathZ_get_a(long owner); - // struct LDKDestination C3Tuple_OffersMessageDestinationBlindedPathZ_get_b(LDKC3Tuple_OffersMessageDestinationBlindedPathZ *NONNULL_PTR owner); - public static native long C3Tuple_OffersMessageDestinationBlindedPathZ_get_b(long owner); - // struct LDKBlindedPath C3Tuple_OffersMessageDestinationBlindedPathZ_get_c(LDKC3Tuple_OffersMessageDestinationBlindedPathZ *NONNULL_PTR owner); - public static native long C3Tuple_OffersMessageDestinationBlindedPathZ_get_c(long owner); + public static class LDKMessageContext { + private LDKMessageContext() {} + public final static class Offers extends LDKMessageContext { + public long offers; + Offers(long offers) { this.offers = offers; } + } + public final static class Custom extends LDKMessageContext { + public byte[] custom; + Custom(byte[] custom) { this.custom = custom; } + } + static native void init(); + } + static { LDKMessageContext.init(); } + public static native LDKMessageContext LDKMessageContext_ref_from_ptr(long ptr); + public static class LDKMessageSendInstructions { + private LDKMessageSendInstructions() {} + public final static class WithSpecifiedReplyPath extends LDKMessageSendInstructions { + public long destination; + public long reply_path; + WithSpecifiedReplyPath(long destination, long reply_path) { this.destination = destination; this.reply_path = reply_path; } + } + public final static class WithReplyPath extends LDKMessageSendInstructions { + public long destination; + public long context; + WithReplyPath(long destination, long context) { this.destination = destination; this.context = context; } + } + public final static class WithoutReplyPath extends LDKMessageSendInstructions { + public long destination; + WithoutReplyPath(long destination) { this.destination = destination; } + } + public final static class ForReply extends LDKMessageSendInstructions { + public long instructions; + ForReply(long instructions) { this.instructions = instructions; } + } + static native void init(); + } + static { LDKMessageSendInstructions.init(); } + public static native LDKMessageSendInstructions LDKMessageSendInstructions_ref_from_ptr(long ptr); + // struct LDKOffersMessage C2Tuple_OffersMessageMessageSendInstructionsZ_get_a(LDKC2Tuple_OffersMessageMessageSendInstructionsZ *NONNULL_PTR owner); + public static native long C2Tuple_OffersMessageMessageSendInstructionsZ_get_a(long owner); + // struct LDKMessageSendInstructions C2Tuple_OffersMessageMessageSendInstructionsZ_get_b(LDKC2Tuple_OffersMessageMessageSendInstructionsZ *NONNULL_PTR owner); + public static native long C2Tuple_OffersMessageMessageSendInstructionsZ_get_b(long owner); + // struct LDKReleaseHeldHtlc C2Tuple_ReleaseHeldHtlcResponseInstructionZ_get_a(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ *NONNULL_PTR owner); + public static native long C2Tuple_ReleaseHeldHtlcResponseInstructionZ_get_a(long owner); + // struct LDKResponseInstruction C2Tuple_ReleaseHeldHtlcResponseInstructionZ_get_b(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ *NONNULL_PTR owner); + public static native long C2Tuple_ReleaseHeldHtlcResponseInstructionZ_get_b(long owner); + public static class LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ { + private LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ() {} + public final static class Some extends LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ { + public long some; + Some(long some) { this.some = some; } + } + public final static class None extends LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ { + None() { } + } + static native void init(); + } + static { LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ.init(); } + public static native LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_ref_from_ptr(long ptr); + public static class LDKAsyncPaymentsMessage { + private LDKAsyncPaymentsMessage() {} + public final static class HeldHtlcAvailable extends LDKAsyncPaymentsMessage { + public long held_htlc_available; + HeldHtlcAvailable(long held_htlc_available) { this.held_htlc_available = held_htlc_available; } + } + public final static class ReleaseHeldHtlc extends LDKAsyncPaymentsMessage { + public long release_held_htlc; + ReleaseHeldHtlc(long release_held_htlc) { this.release_held_htlc = release_held_htlc; } + } + static native void init(); + } + static { LDKAsyncPaymentsMessage.init(); } + public static native LDKAsyncPaymentsMessage LDKAsyncPaymentsMessage_ref_from_ptr(long ptr); + // struct LDKAsyncPaymentsMessage C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_get_a(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ *NONNULL_PTR owner); + public static native long C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_get_a(long owner); + // struct LDKMessageSendInstructions C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_get_b(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ *NONNULL_PTR owner); + public static native long C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_get_b(long owner); // struct LDKPhantomRouteHints CResult_PhantomRouteHintsDecodeErrorZ_get_ok(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_PhantomRouteHintsDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_PhantomRouteHintsDecodeErrorZ_get_err(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR owner); @@ -1650,7 +1798,7 @@ public class bindings { byte[] get_inbound_payment_key_material(); long get_node_id(Recipient recipient); long ecdh(Recipient recipient, byte[] other_key, long tweak); - long sign_invoice(byte[] hrp_bytes, byte[] invoice_data, Recipient recipient); + long sign_invoice(long invoice, Recipient recipient); long sign_bolt12_invoice_request(long invoice_request); long sign_bolt12_invoice(long invoice); long sign_gossip_message(long msg); @@ -1662,8 +1810,8 @@ public class bindings { public static native long NodeSigner_get_node_id(long this_arg, Recipient recipient); // LDKCResult_ThirtyTwoBytesNoneZ NodeSigner_ecdh LDKNodeSigner *NONNULL_PTR this_arg, enum LDKRecipient recipient, struct LDKPublicKey other_key, struct LDKCOption_BigEndianScalarZ tweak public static native long NodeSigner_ecdh(long this_arg, Recipient recipient, byte[] other_key, long tweak); - // LDKCResult_RecoverableSignatureNoneZ NodeSigner_sign_invoice LDKNodeSigner *NONNULL_PTR this_arg, struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z invoice_data, enum LDKRecipient recipient - public static native long NodeSigner_sign_invoice(long this_arg, byte[] hrp_bytes, byte[] invoice_data, Recipient recipient); + // LDKCResult_RecoverableSignatureNoneZ NodeSigner_sign_invoice LDKNodeSigner *NONNULL_PTR this_arg, const struct LDKRawBolt11Invoice *NONNULL_PTR invoice, enum LDKRecipient recipient + public static native long NodeSigner_sign_invoice(long this_arg, long invoice, Recipient recipient); // LDKCResult_SchnorrSignatureNoneZ NodeSigner_sign_bolt12_invoice_request LDKNodeSigner *NONNULL_PTR this_arg, const struct LDKUnsignedInvoiceRequest *NONNULL_PTR invoice_request public static native long NodeSigner_sign_bolt12_invoice_request(long this_arg, long invoice_request); // LDKCResult_SchnorrSignatureNoneZ NodeSigner_sign_bolt12_invoice LDKNodeSigner *NONNULL_PTR this_arg, const struct LDKUnsignedBolt12Invoice *NONNULL_PTR invoice @@ -1680,9 +1828,9 @@ public class bindings { public static native long LDKSignerProvider_new(LDKSignerProvider impl); // LDKThirtyTwoBytes SignerProvider_generate_channel_keys_id LDKSignerProvider *NONNULL_PTR this_arg, bool inbound, uint64_t channel_value_satoshis, struct LDKU128 user_channel_id public static native byte[] SignerProvider_generate_channel_keys_id(long this_arg, boolean inbound, long channel_value_satoshis, byte[] user_channel_id); - // LDKWriteableEcdsaChannelSigner SignerProvider_derive_channel_signer LDKSignerProvider *NONNULL_PTR this_arg, uint64_t channel_value_satoshis, struct LDKThirtyTwoBytes channel_keys_id + // LDKEcdsaChannelSigner SignerProvider_derive_channel_signer LDKSignerProvider *NONNULL_PTR this_arg, uint64_t channel_value_satoshis, struct LDKThirtyTwoBytes channel_keys_id public static native long SignerProvider_derive_channel_signer(long this_arg, long channel_value_satoshis, byte[] channel_keys_id); - // LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ SignerProvider_read_chan_signer LDKSignerProvider *NONNULL_PTR this_arg, struct LDKu8slice reader + // LDKCResult_EcdsaChannelSignerDecodeErrorZ SignerProvider_read_chan_signer LDKSignerProvider *NONNULL_PTR this_arg, struct LDKu8slice reader public static native long SignerProvider_read_chan_signer(long this_arg, byte[] reader); // LDKCResult_CVec_u8ZNoneZ SignerProvider_get_destination_script LDKSignerProvider *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes channel_keys_id public static native long SignerProvider_get_destination_script(long this_arg, byte[] channel_keys_id); @@ -1696,13 +1844,16 @@ public class bindings { public static native int FeeEstimator_get_est_sat_per_1000_weight(long this_arg, ConfirmationTarget confirmation_target); public interface LDKMessageRouter { long find_path(byte[] sender, byte[][] peers, long destination); - long create_blinded_paths(byte[] recipient, byte[][] peers); + long create_blinded_paths(byte[] recipient, long context, byte[][] peers); + long create_compact_blinded_paths(byte[] recipient, long context, long[] peers); } public static native long LDKMessageRouter_new(LDKMessageRouter impl); // LDKCResult_OnionMessagePathNoneZ MessageRouter_find_path LDKMessageRouter *NONNULL_PTR this_arg, struct LDKPublicKey sender, struct LDKCVec_PublicKeyZ peers, struct LDKDestination destination public static native long MessageRouter_find_path(long this_arg, byte[] sender, byte[][] peers, long destination); - // LDKCResult_CVec_BlindedPathZNoneZ MessageRouter_create_blinded_paths LDKMessageRouter *NONNULL_PTR this_arg, struct LDKPublicKey recipient, struct LDKCVec_PublicKeyZ peers - public static native long MessageRouter_create_blinded_paths(long this_arg, byte[] recipient, byte[][] peers); + // LDKCResult_CVec_BlindedMessagePathZNoneZ MessageRouter_create_blinded_paths LDKMessageRouter *NONNULL_PTR this_arg, struct LDKPublicKey recipient, struct LDKMessageContext context, struct LDKCVec_PublicKeyZ peers + public static native long MessageRouter_create_blinded_paths(long this_arg, byte[] recipient, long context, byte[][] peers); + // LDKCResult_CVec_BlindedMessagePathZNoneZ MessageRouter_create_compact_blinded_paths LDKMessageRouter *NONNULL_PTR this_arg, struct LDKPublicKey recipient, struct LDKMessageContext context, struct LDKCVec_MessageForwardNodeZ peers + public static native long MessageRouter_create_compact_blinded_paths(long this_arg, byte[] recipient, long context, long[] peers); public interface LDKRouter { long find_route(byte[] payer, long route_params, long[] first_hops, long inflight_htlcs); long find_route_with_id(byte[] payer, long route_params, long[] first_hops, long inflight_htlcs, byte[] _payment_hash, byte[] _payment_id); @@ -1714,7 +1865,7 @@ public class bindings { public static native long Router_find_route(long this_arg, byte[] payer, long route_params, long[] first_hops, long inflight_htlcs); // LDKCResult_RouteLightningErrorZ Router_find_route_with_id LDKRouter *NONNULL_PTR 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 public static native long Router_find_route_with_id(long this_arg, byte[] payer, long route_params, long[] first_hops, long inflight_htlcs, byte[] _payment_hash, byte[] _payment_id); - // LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ Router_create_blinded_payment_paths LDKRouter *NONNULL_PTR this_arg, struct LDKPublicKey recipient, struct LDKCVec_ChannelDetailsZ first_hops, struct LDKReceiveTlvs tlvs, uint64_t amount_msats + // LDKCResult_CVec_BlindedPaymentPathZNoneZ Router_create_blinded_payment_paths LDKRouter *NONNULL_PTR this_arg, struct LDKPublicKey recipient, struct LDKCVec_ChannelDetailsZ first_hops, struct LDKReceiveTlvs tlvs, uint64_t amount_msats public static native long Router_create_blinded_payment_paths(long this_arg, byte[] recipient, long[] first_hops, long tlvs, long amount_msats); // struct LDKThirtyTwoBytes C2Tuple_ThirtyTwoBytesChannelManagerZ_get_a(LDKC2Tuple_ThirtyTwoBytesChannelManagerZ *NONNULL_PTR owner); public static native byte[] C2Tuple_ThirtyTwoBytesChannelManagerZ_get_a(long owner); @@ -1813,6 +1964,10 @@ public class bindings { public static native byte[] C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_get_a(long owner); // struct LDKCVec_C2Tuple_u32CVec_u8ZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_get_b(LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ *NONNULL_PTR owner); public static native long[] C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_get_b(long owner); + // void CResult_NoneReplayEventZ_get_ok(LDKCResult_NoneReplayEventZ *NONNULL_PTR owner); + public static native void CResult_NoneReplayEventZ_get_ok(long owner); + // struct LDKReplayEvent CResult_NoneReplayEventZ_get_err(LDKCResult_NoneReplayEventZ *NONNULL_PTR owner); + public static native long CResult_NoneReplayEventZ_get_err(long owner); // uint32_t C2Tuple_u32TxOutZ_get_a(LDKC2Tuple_u32TxOutZ *NONNULL_PTR owner); public static native int C2Tuple_u32TxOutZ_get_a(long owner); // struct LDKTxOut C2Tuple_u32TxOutZ_get_b(LDKC2Tuple_u32TxOutZ *NONNULL_PTR owner); @@ -1825,12 +1980,18 @@ public class bindings { private LDKBalance() {} public final static class ClaimableOnChannelClose extends LDKBalance { public long amount_satoshis; - ClaimableOnChannelClose(long amount_satoshis) { this.amount_satoshis = amount_satoshis; } + public long transaction_fee_satoshis; + public long outbound_payment_htlc_rounded_msat; + public long outbound_forwarded_htlc_rounded_msat; + public long inbound_claiming_htlc_rounded_msat; + public long inbound_htlc_rounded_msat; + ClaimableOnChannelClose(long amount_satoshis, long transaction_fee_satoshis, long outbound_payment_htlc_rounded_msat, long outbound_forwarded_htlc_rounded_msat, long inbound_claiming_htlc_rounded_msat, long inbound_htlc_rounded_msat) { this.amount_satoshis = amount_satoshis; this.transaction_fee_satoshis = transaction_fee_satoshis; this.outbound_payment_htlc_rounded_msat = outbound_payment_htlc_rounded_msat; this.outbound_forwarded_htlc_rounded_msat = outbound_forwarded_htlc_rounded_msat; this.inbound_claiming_htlc_rounded_msat = inbound_claiming_htlc_rounded_msat; this.inbound_htlc_rounded_msat = inbound_htlc_rounded_msat; } } public final static class ClaimableAwaitingConfirmations extends LDKBalance { public long amount_satoshis; public int confirmation_height; - ClaimableAwaitingConfirmations(long amount_satoshis, int confirmation_height) { this.amount_satoshis = amount_satoshis; this.confirmation_height = confirmation_height; } + public org.ldk.enums.BalanceSource source; + ClaimableAwaitingConfirmations(long amount_satoshis, int confirmation_height, org.ldk.enums.BalanceSource source) { this.amount_satoshis = amount_satoshis; this.confirmation_height = confirmation_height; this.source = source; } } public final static class ContentiousClaimable extends LDKBalance { public long amount_satoshis; @@ -1843,7 +2004,8 @@ public class bindings { public long amount_satoshis; public int claimable_height; public byte[] payment_hash; - MaybeTimeoutClaimableHTLC(long amount_satoshis, int claimable_height, byte[] payment_hash) { this.amount_satoshis = amount_satoshis; this.claimable_height = claimable_height; this.payment_hash = payment_hash; } + public boolean outbound_payment; + MaybeTimeoutClaimableHTLC(long amount_satoshis, int claimable_height, byte[] payment_hash, boolean outbound_payment) { this.amount_satoshis = amount_satoshis; this.claimable_height = claimable_height; this.payment_hash = payment_hash; this.outbound_payment = outbound_payment; } } public final static class MaybePreimageClaimableHTLC extends LDKBalance { public long amount_satoshis; @@ -1883,22 +2045,38 @@ public class bindings { public static native byte[] C2Tuple_PublicKeyTypeZ_get_a(long owner); // struct LDKType C2Tuple_PublicKeyTypeZ_get_b(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR owner); public static native long C2Tuple_PublicKeyTypeZ_get_b(long owner); - // struct LDKPublicKey C2Tuple_PublicKeyCVec_SocketAddressZZ_get_a(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *NONNULL_PTR owner); - public static native byte[] C2Tuple_PublicKeyCVec_SocketAddressZZ_get_a(long owner); - // struct LDKCVec_SocketAddressZ C2Tuple_PublicKeyCVec_SocketAddressZZ_get_b(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *NONNULL_PTR owner); - public static native long[] C2Tuple_PublicKeyCVec_SocketAddressZZ_get_b(long owner); public interface LDKOnionMessageContents { long tlv_type(); + String msg_type(); byte[] write(); String debug_str(); } public static native long LDKOnionMessageContents_new(LDKOnionMessageContents impl); // uint64_t OnionMessageContents_tlv_type LDKOnionMessageContents *NONNULL_PTR this_arg public static native long OnionMessageContents_tlv_type(long this_arg); + // LDKStr OnionMessageContents_msg_type LDKOnionMessageContents *NONNULL_PTR this_arg + public static native String OnionMessageContents_msg_type(long this_arg); // LDKCVec_u8Z OnionMessageContents_write LDKOnionMessageContents *NONNULL_PTR this_arg public static native byte[] OnionMessageContents_write(long this_arg); // LDKStr OnionMessageContents_debug_str LDKOnionMessageContents *NONNULL_PTR this_arg public static native String OnionMessageContents_debug_str(long this_arg); + // struct LDKOnionMessageContents C2Tuple_OnionMessageContentsResponseInstructionZ_get_a(LDKC2Tuple_OnionMessageContentsResponseInstructionZ *NONNULL_PTR owner); + public static native long C2Tuple_OnionMessageContentsResponseInstructionZ_get_a(long owner); + // struct LDKResponseInstruction C2Tuple_OnionMessageContentsResponseInstructionZ_get_b(LDKC2Tuple_OnionMessageContentsResponseInstructionZ *NONNULL_PTR owner); + public static native long C2Tuple_OnionMessageContentsResponseInstructionZ_get_b(long owner); + public static class LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ { + private LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ() {} + public final static class Some extends LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ { + public long some; + Some(long some) { this.some = some; } + } + public final static class None extends LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ { + None() { } + } + static native void init(); + } + static { LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ.init(); } + public static native LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_ref_from_ptr(long ptr); public static class LDKCOption_OnionMessageContentsZ { private LDKCOption_OnionMessageContentsZ() {} public final static class Some extends LDKCOption_OnionMessageContentsZ { @@ -1916,12 +2094,10 @@ public class bindings { public static native long CResult_COption_OnionMessageContentsZDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_COption_OnionMessageContentsZDecodeErrorZ_get_err(LDKCResult_COption_OnionMessageContentsZDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_COption_OnionMessageContentsZDecodeErrorZ_get_err(long owner); - // struct LDKOnionMessageContents C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_a(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *NONNULL_PTR owner); - public static native long C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_a(long owner); - // struct LDKDestination C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_b(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *NONNULL_PTR owner); - public static native long C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_b(long owner); - // struct LDKBlindedPath C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_c(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *NONNULL_PTR owner); - public static native long C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_c(long owner); + // struct LDKOnionMessageContents C2Tuple_OnionMessageContentsMessageSendInstructionsZ_get_a(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ *NONNULL_PTR owner); + public static native long C2Tuple_OnionMessageContentsMessageSendInstructionsZ_get_a(long owner); + // struct LDKMessageSendInstructions C2Tuple_OnionMessageContentsMessageSendInstructionsZ_get_b(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ *NONNULL_PTR owner); + public static native long C2Tuple_OnionMessageContentsMessageSendInstructionsZ_get_b(long owner); public static class LDKCOption_TypeZ { private LDKCOption_TypeZ() {} public final static class Some extends LDKCOption_TypeZ { @@ -2006,19 +2182,6 @@ public class bindings { public static native long CResult_InvoiceRequestBolt12SemanticErrorZ_get_ok(long owner); // enum LDKBolt12SemanticError CResult_InvoiceRequestBolt12SemanticErrorZ_get_err(LDKCResult_InvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR owner); public static native Bolt12SemanticError CResult_InvoiceRequestBolt12SemanticErrorZ_get_err(long owner); - public static class LDKCOption_SecretKeyZ { - private LDKCOption_SecretKeyZ() {} - public final static class Some extends LDKCOption_SecretKeyZ { - public byte[] some; - Some(byte[] some) { this.some = some; } - } - public final static class None extends LDKCOption_SecretKeyZ { - None() { } - } - static native void init(); - } - static { LDKCOption_SecretKeyZ.init(); } - public static native LDKCOption_SecretKeyZ LDKCOption_SecretKeyZ_ref_from_ptr(long ptr); // struct LDKInvoiceWithExplicitSigningPubkeyBuilder CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR owner); public static native long CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok(long owner); // enum LDKBolt12SemanticError CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_get_err(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR owner); @@ -2081,10 +2244,10 @@ public class bindings { public static native long CResult_StfuDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_StfuDecodeErrorZ_get_err(LDKCResult_StfuDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_StfuDecodeErrorZ_get_err(long owner); - // struct LDKSplice CResult_SpliceDecodeErrorZ_get_ok(LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_SpliceDecodeErrorZ_get_ok(long owner); - // struct LDKDecodeError CResult_SpliceDecodeErrorZ_get_err(LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_SpliceDecodeErrorZ_get_err(long owner); + // struct LDKSpliceInit CResult_SpliceInitDecodeErrorZ_get_ok(LDKCResult_SpliceInitDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_SpliceInitDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_SpliceInitDecodeErrorZ_get_err(LDKCResult_SpliceInitDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_SpliceInitDecodeErrorZ_get_err(long owner); // struct LDKSpliceAck CResult_SpliceAckDecodeErrorZ_get_ok(LDKCResult_SpliceAckDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_SpliceAckDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_SpliceAckDecodeErrorZ_get_err(LDKCResult_SpliceAckDecodeErrorZ *NONNULL_PTR owner); @@ -2145,6 +2308,10 @@ public class bindings { public static native long CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(long owner); + // struct LDKCommitmentSignedBatch CResult_CommitmentSignedBatchDecodeErrorZ_get_ok(LDKCResult_CommitmentSignedBatchDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_CommitmentSignedBatchDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_CommitmentSignedBatchDecodeErrorZ_get_err(LDKCResult_CommitmentSignedBatchDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_CommitmentSignedBatchDecodeErrorZ_get_err(long owner); // struct LDKCommitmentSigned CResult_CommitmentSignedDecodeErrorZ_get_ok(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_CommitmentSignedDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_CommitmentSignedDecodeErrorZ_get_err(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR owner); @@ -2273,23 +2440,6 @@ public class bindings { public static native long CResult_GossipTimestampFilterDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_GossipTimestampFilterDecodeErrorZ_get_err(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_GossipTimestampFilterDecodeErrorZ_get_err(long owner); - public static class LDKSignOrCreationError { - private LDKSignOrCreationError() {} - public final static class SignError extends LDKSignOrCreationError { - SignError() { } - } - public final static class CreationError extends LDKSignOrCreationError { - public org.ldk.enums.CreationError creation_error; - CreationError(org.ldk.enums.CreationError creation_error) { this.creation_error = creation_error; } - } - static native void init(); - } - static { LDKSignOrCreationError.init(); } - public static native LDKSignOrCreationError LDKSignOrCreationError_ref_from_ptr(long ptr); - // struct LDKBolt11Invoice CResult_Bolt11InvoiceSignOrCreationErrorZ_get_ok(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR owner); - public static native long CResult_Bolt11InvoiceSignOrCreationErrorZ_get_ok(long owner); - // struct LDKSignOrCreationError CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR owner); - public static native long CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err(long owner); public static class LDKCOption_InboundHTLCStateDetailsZ { private LDKCOption_InboundHTLCStateDetailsZ() {} public final static class Some extends LDKCOption_InboundHTLCStateDetailsZ { @@ -2361,6 +2511,18 @@ public class bindings { public static native ChannelShutdownState CResult_ChannelShutdownStateDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_ChannelShutdownStateDecodeErrorZ_get_err(LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_ChannelShutdownStateDecodeErrorZ_get_err(long owner); + // struct LDKHeldHtlcAvailable CResult_HeldHtlcAvailableDecodeErrorZ_get_ok(LDKCResult_HeldHtlcAvailableDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_HeldHtlcAvailableDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_HeldHtlcAvailableDecodeErrorZ_get_err(LDKCResult_HeldHtlcAvailableDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_HeldHtlcAvailableDecodeErrorZ_get_err(long owner); + // struct LDKReleaseHeldHtlc CResult_ReleaseHeldHtlcDecodeErrorZ_get_ok(LDKCResult_ReleaseHeldHtlcDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_ReleaseHeldHtlcDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_ReleaseHeldHtlcDecodeErrorZ_get_err(LDKCResult_ReleaseHeldHtlcDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_ReleaseHeldHtlcDecodeErrorZ_get_err(long owner); + // struct LDKAsyncPaymentsMessage CResult_AsyncPaymentsMessageDecodeErrorZ_get_ok(LDKCResult_AsyncPaymentsMessageDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_AsyncPaymentsMessageDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_AsyncPaymentsMessageDecodeErrorZ_get_err(LDKCResult_AsyncPaymentsMessageDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_AsyncPaymentsMessageDecodeErrorZ_get_err(long owner); // struct LDKOffersMessage CResult_OffersMessageDecodeErrorZ_get_ok(LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_OffersMessageDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_OffersMessageDecodeErrorZ_get_err(LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR owner); @@ -2447,6 +2609,24 @@ public class bindings { public static native long CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(long owner); // struct LDKInvalidShutdownScript CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR owner); public static native long CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(long owner); + public static class LDKFundingInfo { + private LDKFundingInfo() {} + public final static class Tx extends LDKFundingInfo { + public byte[] transaction; + Tx(byte[] transaction) { this.transaction = transaction; } + } + public final static class OutPoint extends LDKFundingInfo { + public long outpoint; + OutPoint(long outpoint) { this.outpoint = outpoint; } + } + static native void init(); + } + static { LDKFundingInfo.init(); } + public static native LDKFundingInfo LDKFundingInfo_ref_from_ptr(long ptr); + // struct LDKFundingInfo CResult_FundingInfoDecodeErrorZ_get_ok(LDKCResult_FundingInfoDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_FundingInfoDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_FundingInfoDecodeErrorZ_get_err(LDKCResult_FundingInfoDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_FundingInfoDecodeErrorZ_get_err(long owner); public static class LDKPaymentPurpose { private LDKPaymentPurpose() {} public final static class Bolt11InvoicePayment extends LDKPaymentPurpose { @@ -2573,23 +2753,6 @@ public class bindings { public static native long CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(long owner); - // enum LDKPaymentFailureReason CResult_PaymentFailureReasonDecodeErrorZ_get_ok(LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR owner); - public static native PaymentFailureReason CResult_PaymentFailureReasonDecodeErrorZ_get_ok(long owner); - // struct LDKDecodeError CResult_PaymentFailureReasonDecodeErrorZ_get_err(LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_PaymentFailureReasonDecodeErrorZ_get_err(long owner); - public static class LDKCOption_U128Z { - private LDKCOption_U128Z() {} - public final static class Some extends LDKCOption_U128Z { - public byte[] some; - Some(byte[] some) { this.some = some; } - } - public final static class None extends LDKCOption_U128Z { - None() { } - } - static native void init(); - } - static { LDKCOption_U128Z.init(); } - public static native LDKCOption_U128Z LDKCOption_U128Z_ref_from_ptr(long ptr); public static class LDKCOption_PaymentFailureReasonZ { private LDKCOption_PaymentFailureReasonZ() {} public final static class Some extends LDKCOption_PaymentFailureReasonZ { @@ -2603,6 +2766,23 @@ public class bindings { } static { LDKCOption_PaymentFailureReasonZ.init(); } public static native LDKCOption_PaymentFailureReasonZ LDKCOption_PaymentFailureReasonZ_ref_from_ptr(long ptr); + // struct LDKCOption_PaymentFailureReasonZ CResult_COption_PaymentFailureReasonZDecodeErrorZ_get_ok(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_COption_PaymentFailureReasonZDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_COption_PaymentFailureReasonZDecodeErrorZ_get_err(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_COption_PaymentFailureReasonZDecodeErrorZ_get_err(long owner); + public static class LDKCOption_U128Z { + private LDKCOption_U128Z() {} + public final static class Some extends LDKCOption_U128Z { + public byte[] some; + Some(byte[] some) { this.some = some; } + } + public final static class None extends LDKCOption_U128Z { + None() { } + } + static native void init(); + } + static { LDKCOption_U128Z.init(); } + public static native LDKCOption_U128Z LDKCOption_U128Z_ref_from_ptr(long ptr); public static class LDKBumpTransactionEvent { private LDKBumpTransactionEvent() {} public final static class ChannelClose extends LDKBumpTransactionEvent { @@ -2639,6 +2819,14 @@ public class bindings { public byte[] user_channel_id; FundingGenerationReady(long temporary_channel_id, byte[] counterparty_node_id, long channel_value_satoshis, byte[] output_script, byte[] user_channel_id) { this.temporary_channel_id = temporary_channel_id; this.counterparty_node_id = counterparty_node_id; this.channel_value_satoshis = channel_value_satoshis; this.output_script = output_script; this.user_channel_id = user_channel_id; } } + public final static class FundingTxBroadcastSafe extends LDKEvent { + public long channel_id; + public byte[] user_channel_id; + public long funding_txo; + public byte[] counterparty_node_id; + public long former_temporary_channel_id; + FundingTxBroadcastSafe(long channel_id, byte[] user_channel_id, long funding_txo, byte[] counterparty_node_id, long former_temporary_channel_id) { this.channel_id = channel_id; this.user_channel_id = user_channel_id; this.funding_txo = funding_txo; this.counterparty_node_id = counterparty_node_id; this.former_temporary_channel_id = former_temporary_channel_id; } + } public final static class PaymentClaimable extends LDKEvent { public byte[] receiver_node_id; public byte[] payment_hash; @@ -2658,16 +2846,20 @@ public class bindings { public long purpose; public long[] htlcs; public long sender_intended_total_msat; - PaymentClaimed(byte[] receiver_node_id, byte[] payment_hash, long amount_msat, long purpose, long[] htlcs, long sender_intended_total_msat) { this.receiver_node_id = receiver_node_id; this.payment_hash = payment_hash; this.amount_msat = amount_msat; this.purpose = purpose; this.htlcs = htlcs; this.sender_intended_total_msat = sender_intended_total_msat; } + public long onion_fields; + PaymentClaimed(byte[] receiver_node_id, byte[] payment_hash, long amount_msat, long purpose, long[] htlcs, long sender_intended_total_msat, long onion_fields) { this.receiver_node_id = receiver_node_id; this.payment_hash = payment_hash; this.amount_msat = amount_msat; this.purpose = purpose; this.htlcs = htlcs; this.sender_intended_total_msat = sender_intended_total_msat; this.onion_fields = onion_fields; } } public final static class ConnectionNeeded extends LDKEvent { public byte[] node_id; public long[] addresses; ConnectionNeeded(byte[] node_id, long[] addresses) { this.node_id = node_id; this.addresses = addresses; } } - public final static class InvoiceRequestFailed extends LDKEvent { + public final static class InvoiceReceived extends LDKEvent { public byte[] payment_id; - InvoiceRequestFailed(byte[] payment_id) { this.payment_id = payment_id; } + public long invoice; + public long context; + public long responder; + InvoiceReceived(byte[] payment_id, long invoice, long context, long responder) { this.payment_id = payment_id; this.invoice = invoice; this.context = context; this.responder = responder; } } public final static class PaymentSent extends LDKEvent { public long payment_id; @@ -2678,9 +2870,9 @@ public class bindings { } public final static class PaymentFailed extends LDKEvent { public byte[] payment_id; - public byte[] payment_hash; + public long payment_hash; public long reason; - PaymentFailed(byte[] payment_id, byte[] payment_hash, long reason) { this.payment_id = payment_id; this.payment_hash = payment_hash; this.reason = reason; } + PaymentFailed(byte[] payment_id, long payment_hash, long reason) { this.payment_id = payment_id; this.payment_hash = payment_hash; this.reason = reason; } } public final static class PaymentPathSuccessful extends LDKEvent { public byte[] payment_id; @@ -2765,8 +2957,8 @@ public class bindings { } public final static class DiscardFunding extends LDKEvent { public long channel_id; - public byte[] transaction; - DiscardFunding(long channel_id, byte[] transaction) { this.channel_id = channel_id; this.transaction = transaction; } + public long funding_info; + DiscardFunding(long channel_id, long funding_info) { this.channel_id = channel_id; this.funding_info = funding_info; } } public final static class OpenChannelRequest extends LDKEvent { public long temporary_channel_id; @@ -2774,7 +2966,9 @@ public class bindings { public long funding_satoshis; public long push_msat; public long channel_type; - OpenChannelRequest(long temporary_channel_id, byte[] counterparty_node_id, long funding_satoshis, long push_msat, long channel_type) { this.temporary_channel_id = temporary_channel_id; this.counterparty_node_id = counterparty_node_id; this.funding_satoshis = funding_satoshis; this.push_msat = push_msat; this.channel_type = channel_type; } + public boolean is_announced; + public long params; + OpenChannelRequest(long temporary_channel_id, byte[] counterparty_node_id, long funding_satoshis, long push_msat, long channel_type, boolean is_announced, long params) { this.temporary_channel_id = temporary_channel_id; this.counterparty_node_id = counterparty_node_id; this.funding_satoshis = funding_satoshis; this.push_msat = push_msat; this.channel_type = channel_type; this.is_announced = is_announced; this.params = params; } } public final static class HTLCHandlingFailed extends LDKEvent { public long prev_channel_id; @@ -2785,6 +2979,15 @@ public class bindings { public long bump_transaction; BumpTransaction(long bump_transaction) { this.bump_transaction = bump_transaction; } } + public final static class OnionMessageIntercepted extends LDKEvent { + public byte[] peer_node_id; + public long message; + OnionMessageIntercepted(byte[] peer_node_id, long message) { this.peer_node_id = peer_node_id; this.message = message; } + } + public final static class OnionMessagePeerConnected extends LDKEvent { + public byte[] peer_node_id; + OnionMessagePeerConnected(byte[] peer_node_id) { this.peer_node_id = peer_node_id; } + } static native void init(); } static { LDKEvent.init(); } @@ -2806,6 +3009,10 @@ public class bindings { public static native long CResult_COption_EventZDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_COption_EventZDecodeErrorZ_get_err(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_COption_EventZDecodeErrorZ_get_err(long owner); + // struct LDKNonce CResult_NonceDecodeErrorZ_get_ok(LDKCResult_NonceDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_NonceDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_NonceDecodeErrorZ_get_err(LDKCResult_NonceDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_NonceDecodeErrorZ_get_err(long owner); public static class LDKBolt11ParseError { private LDKBolt11ParseError() {} public final static class Bech32Error extends LDKBolt11ParseError { @@ -2935,6 +3142,10 @@ public class bindings { public static native long CResult_BigSizeDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_BigSizeDecodeErrorZ_get_err(LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_BigSizeDecodeErrorZ_get_err(long owner); + // struct LDKUntrustedString CResult_UntrustedStringDecodeErrorZ_get_ok(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_UntrustedStringDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_UntrustedStringDecodeErrorZ_get_err(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_UntrustedStringDecodeErrorZ_get_err(long owner); // struct LDKHostname CResult_HostnameDecodeErrorZ_get_ok(LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_HostnameDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_HostnameDecodeErrorZ_get_err(LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR owner); @@ -2947,10 +3158,6 @@ public class bindings { public static native long CResult_TransactionU16LenLimitedDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_TransactionU16LenLimitedDecodeErrorZ_get_err(LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_TransactionU16LenLimitedDecodeErrorZ_get_err(long owner); - // struct LDKUntrustedString CResult_UntrustedStringDecodeErrorZ_get_ok(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_UntrustedStringDecodeErrorZ_get_ok(long owner); - // struct LDKDecodeError CResult_UntrustedStringDecodeErrorZ_get_err(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_UntrustedStringDecodeErrorZ_get_err(long owner); // struct LDKChannelId CResult_ChannelIdDecodeErrorZ_get_ok(LDKCResult_ChannelIdDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_ChannelIdDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_ChannelIdDecodeErrorZ_get_err(LDKCResult_ChannelIdDecodeErrorZ *NONNULL_PTR owner); @@ -2959,6 +3166,14 @@ public class bindings { public static native byte[] C2Tuple__u832u16Z_get_a(long owner); // uint16_t C2Tuple__u832u16Z_get_b(LDKC2Tuple__u832u16Z *NONNULL_PTR owner); public static native short C2Tuple__u832u16Z_get_b(long owner); + // struct LDKBlindedPayInfo CResult_BlindedPayInfoDecodeErrorZ_get_ok(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_BlindedPayInfoDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_BlindedPayInfoDecodeErrorZ_get_err(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_BlindedPayInfoDecodeErrorZ_get_err(long owner); + // struct LDKBlindedPaymentPath CResult_BlindedPaymentPathNoneZ_get_ok(LDKCResult_BlindedPaymentPathNoneZ *NONNULL_PTR owner); + public static native long CResult_BlindedPaymentPathNoneZ_get_ok(long owner); + // void CResult_BlindedPaymentPathNoneZ_get_err(LDKCResult_BlindedPaymentPathNoneZ *NONNULL_PTR owner); + public static native void CResult_BlindedPaymentPathNoneZ_get_err(long owner); // struct LDKPaymentRelay CResult_PaymentRelayDecodeErrorZ_get_ok(LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_PaymentRelayDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_PaymentRelayDecodeErrorZ_get_err(LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR owner); @@ -2983,20 +3198,23 @@ public class bindings { public static native long CResult_Bolt12RefundContextDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_Bolt12RefundContextDecodeErrorZ_get_err(LDKCResult_Bolt12RefundContextDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_Bolt12RefundContextDecodeErrorZ_get_err(long owner); - // struct LDKStr CResult_StrSecp256k1ErrorZ_get_ok(LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR owner); - public static native String CResult_StrSecp256k1ErrorZ_get_ok(long owner); - // enum LDKSecp256k1Error CResult_StrSecp256k1ErrorZ_get_err(LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR owner); - public static native Secp256k1Error CResult_StrSecp256k1ErrorZ_get_err(long owner); - // struct LDKThirtyTwoBytes C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_a(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR owner); - public static native byte[] C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_a(long owner); - // struct LDKRecipientOnionFields C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_b(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR owner); - public static native long C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_b(long owner); - // struct LDKRouteParameters C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_c(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR owner); - public static native long C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_c(long owner); - // struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_ok(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR owner); - public static native long CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_ok(long owner); - // void CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_err(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR owner); - public static native void CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_err(long owner); + // struct LDKResponder CResult_ResponderDecodeErrorZ_get_ok(LDKCResult_ResponderDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_ResponderDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_ResponderDecodeErrorZ_get_err(LDKCResult_ResponderDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_ResponderDecodeErrorZ_get_err(long owner); + public static class LDKCOption_MessageContextZ { + private LDKCOption_MessageContextZ() {} + public final static class Some extends LDKCOption_MessageContextZ { + public long some; + Some(long some) { this.some = some; } + } + public final static class None extends LDKCOption_MessageContextZ { + None() { } + } + static native void init(); + } + static { LDKCOption_MessageContextZ.init(); } + public static native LDKCOption_MessageContextZ LDKCOption_MessageContextZ_ref_from_ptr(long ptr); // struct LDKPublicKey C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_get_a(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *NONNULL_PTR owner); public static native byte[] C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_get_a(long owner); // struct LDKOnionMessage C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_get_b(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *NONNULL_PTR owner); @@ -3082,9 +3300,9 @@ public class bindings { } public final static class Receive extends LDKPeeledOnion { public long _0; - public byte[] _1; + public long _1; public long _2; - Receive(long _0, byte[] _1, long _2) { this._0 = _0; this._1 = _1; this._2 = _2; } + Receive(long _0, long _1, long _2) { this._0 = _0; this._1 = _1; this._2 = _2; } } static native void init(); } @@ -3111,22 +3329,31 @@ public class bindings { public static native long CResult_SendSuccessSendErrorZ_get_ok(long owner); // struct LDKSendError CResult_SendSuccessSendErrorZ_get_err(LDKCResult_SendSuccessSendErrorZ *NONNULL_PTR owner); public static native long CResult_SendSuccessSendErrorZ_get_err(long owner); - // struct LDKBlindedPath CResult_BlindedPathNoneZ_get_ok(LDKCResult_BlindedPathNoneZ *NONNULL_PTR owner); - public static native long CResult_BlindedPathNoneZ_get_ok(long owner); - // void CResult_BlindedPathNoneZ_get_err(LDKCResult_BlindedPathNoneZ *NONNULL_PTR owner); - public static native void CResult_BlindedPathNoneZ_get_err(long owner); - // struct LDKC2Tuple_BlindedPayInfoBlindedPathZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_get_ok(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR owner); - public static native long CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_get_ok(long owner); - // void CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_get_err(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR owner); - public static native void CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_get_err(long owner); - // struct LDKBlindedPath CResult_BlindedPathDecodeErrorZ_get_ok(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_BlindedPathDecodeErrorZ_get_ok(long owner); - // struct LDKDecodeError CResult_BlindedPathDecodeErrorZ_get_err(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_BlindedPathDecodeErrorZ_get_err(long owner); + // void CResult_NoneSendErrorZ_get_ok(LDKCResult_NoneSendErrorZ *NONNULL_PTR owner); + public static native void CResult_NoneSendErrorZ_get_ok(long owner); + // struct LDKSendError CResult_NoneSendErrorZ_get_err(LDKCResult_NoneSendErrorZ *NONNULL_PTR owner); + public static native long CResult_NoneSendErrorZ_get_err(long owner); // struct LDKBlindedHop CResult_BlindedHopDecodeErrorZ_get_ok(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_BlindedHopDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_BlindedHopDecodeErrorZ_get_err(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_BlindedHopDecodeErrorZ_get_err(long owner); + public static class LDKSignOrCreationError { + private LDKSignOrCreationError() {} + public final static class SignError extends LDKSignOrCreationError { + SignError() { } + } + public final static class CreationError extends LDKSignOrCreationError { + public org.ldk.enums.CreationError creation_error; + CreationError(org.ldk.enums.CreationError creation_error) { this.creation_error = creation_error; } + } + static native void init(); + } + static { LDKSignOrCreationError.init(); } + public static native LDKSignOrCreationError LDKSignOrCreationError_ref_from_ptr(long ptr); + // struct LDKBolt11Invoice CResult_Bolt11InvoiceSignOrCreationErrorZ_get_ok(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR owner); + public static native long CResult_Bolt11InvoiceSignOrCreationErrorZ_get_ok(long owner); + // struct LDKSignOrCreationError CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR owner); + public static native long CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err(long owner); // struct LDKInvoiceError CResult_InvoiceErrorDecodeErrorZ_get_ok(LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_InvoiceErrorDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_InvoiceErrorDecodeErrorZ_get_err(LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR owner); @@ -3256,10 +3483,26 @@ public class bindings { public static native long C2Tuple_OutPointChannelIdZ_get_a(long owner); // struct LDKChannelId C2Tuple_OutPointChannelIdZ_get_b(LDKC2Tuple_OutPointChannelIdZ *NONNULL_PTR owner); public static native long C2Tuple_OutPointChannelIdZ_get_b(long owner); - // struct LDKOutPoint C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR owner); - public static native long C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(long owner); - // struct LDKCVec_MonitorUpdateIdZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR owner); - public static native long[] C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(long owner); + // struct LDKOutPoint C2Tuple_OutPointCVec_u64ZZ_get_a(LDKC2Tuple_OutPointCVec_u64ZZ *NONNULL_PTR owner); + public static native long C2Tuple_OutPointCVec_u64ZZ_get_a(long owner); + // struct LDKCVec_u64Z C2Tuple_OutPointCVec_u64ZZ_get_b(LDKC2Tuple_OutPointCVec_u64ZZ *NONNULL_PTR owner); + public static native long[] C2Tuple_OutPointCVec_u64ZZ_get_b(long owner); + // struct LDKBlindedMessagePath CResult_BlindedMessagePathDecodeErrorZ_get_ok(LDKCResult_BlindedMessagePathDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_BlindedMessagePathDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_BlindedMessagePathDecodeErrorZ_get_err(LDKCResult_BlindedMessagePathDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_BlindedMessagePathDecodeErrorZ_get_err(long owner); + // struct LDKBlindedMessagePath CResult_BlindedMessagePathNoneZ_get_ok(LDKCResult_BlindedMessagePathNoneZ *NONNULL_PTR owner); + public static native long CResult_BlindedMessagePathNoneZ_get_ok(long owner); + // void CResult_BlindedMessagePathNoneZ_get_err(LDKCResult_BlindedMessagePathNoneZ *NONNULL_PTR owner); + public static native void CResult_BlindedMessagePathNoneZ_get_err(long owner); + // struct LDKMessageContext CResult_MessageContextDecodeErrorZ_get_ok(LDKCResult_MessageContextDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_MessageContextDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_MessageContextDecodeErrorZ_get_err(LDKCResult_MessageContextDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_MessageContextDecodeErrorZ_get_err(long owner); + // struct LDKOffersContext CResult_OffersContextDecodeErrorZ_get_ok(LDKCResult_OffersContextDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_OffersContextDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_OffersContextDecodeErrorZ_get_err(LDKCResult_OffersContextDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_OffersContextDecodeErrorZ_get_err(long owner); public interface LDKPersister { long persist_manager(long channel_manager); long persist_graph(long network_graph); @@ -3273,15 +3516,15 @@ public class bindings { // LDKCResult_NoneIOErrorZ Persister_persist_scorer LDKPersister *NONNULL_PTR this_arg, const struct LDKWriteableScore *NONNULL_PTR scorer public static native long Persister_persist_scorer(long this_arg, long scorer); public interface LDKPersist { - ChannelMonitorUpdateStatus persist_new_channel(long channel_funding_outpoint, long data, long update_id); - ChannelMonitorUpdateStatus update_persisted_channel(long channel_funding_outpoint, long update, long data, long update_id); + ChannelMonitorUpdateStatus persist_new_channel(long channel_funding_outpoint, long monitor); + ChannelMonitorUpdateStatus update_persisted_channel(long channel_funding_outpoint, long monitor_update, long monitor); void archive_persisted_channel(long channel_funding_outpoint); } public static native long LDKPersist_new(LDKPersist impl); - // LDKChannelMonitorUpdateStatus Persist_persist_new_channel LDKPersist *NONNULL_PTR this_arg, struct LDKOutPoint channel_funding_outpoint, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id - public static native ChannelMonitorUpdateStatus Persist_persist_new_channel(long this_arg, long channel_funding_outpoint, long data, long update_id); - // LDKChannelMonitorUpdateStatus Persist_update_persisted_channel LDKPersist *NONNULL_PTR this_arg, struct LDKOutPoint channel_funding_outpoint, struct LDKChannelMonitorUpdate update, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id - public static native ChannelMonitorUpdateStatus Persist_update_persisted_channel(long this_arg, long channel_funding_outpoint, long update, long data, long update_id); + // LDKChannelMonitorUpdateStatus Persist_persist_new_channel LDKPersist *NONNULL_PTR this_arg, struct LDKOutPoint channel_funding_outpoint, const struct LDKChannelMonitor *NONNULL_PTR monitor + public static native ChannelMonitorUpdateStatus Persist_persist_new_channel(long this_arg, long channel_funding_outpoint, long monitor); + // LDKChannelMonitorUpdateStatus Persist_update_persisted_channel LDKPersist *NONNULL_PTR this_arg, struct LDKOutPoint channel_funding_outpoint, struct LDKChannelMonitorUpdate monitor_update, const struct LDKChannelMonitor *NONNULL_PTR monitor + public static native ChannelMonitorUpdateStatus Persist_update_persisted_channel(long this_arg, long channel_funding_outpoint, long monitor_update, long monitor); // void Persist_archive_persisted_channel LDKPersist *NONNULL_PTR this_arg, struct LDKOutPoint channel_funding_outpoint public static native void Persist_archive_persisted_channel(long this_arg, long channel_funding_outpoint); public interface LDKListen { @@ -3332,11 +3575,11 @@ public class bindings { // void FutureCallback_call LDKFutureCallback *NONNULL_PTR this_arg public static native void FutureCallback_call(long this_arg); public interface LDKEventHandler { - void handle_event(long event); + long handle_event(long event); } public static native long LDKEventHandler_new(LDKEventHandler impl); - // void EventHandler_handle_event LDKEventHandler *NONNULL_PTR this_arg, struct LDKEvent event - public static native void EventHandler_handle_event(long this_arg, long event); + // LDKCResult_NoneReplayEventZ EventHandler_handle_event LDKEventHandler *NONNULL_PTR this_arg, struct LDKEvent event + public static native long EventHandler_handle_event(long this_arg, long event); public interface LDKEventsProvider { void process_pending_events(long handler); } @@ -3478,14 +3721,26 @@ public class bindings { // LDKCOption_CVec_ThirtyTwoBytesZZ ChannelMessageHandler_get_chain_hashes LDKChannelMessageHandler *NONNULL_PTR this_arg public static native long ChannelMessageHandler_get_chain_hashes(long this_arg); public interface LDKOffersMessageHandler { - long handle_message(long message); + long handle_message(long message, long context, long responder); long[] release_pending_messages(); } public static native long LDKOffersMessageHandler_new(LDKOffersMessageHandler impl); - // LDKCOption_OffersMessageZ OffersMessageHandler_handle_message LDKOffersMessageHandler *NONNULL_PTR this_arg, struct LDKOffersMessage message - public static native long OffersMessageHandler_handle_message(long this_arg, long message); - // LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ OffersMessageHandler_release_pending_messages LDKOffersMessageHandler *NONNULL_PTR this_arg + // LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ OffersMessageHandler_handle_message LDKOffersMessageHandler *NONNULL_PTR this_arg, struct LDKOffersMessage message, struct LDKCOption_OffersContextZ context, struct LDKResponder responder + public static native long OffersMessageHandler_handle_message(long this_arg, long message, long context, long responder); + // LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ OffersMessageHandler_release_pending_messages LDKOffersMessageHandler *NONNULL_PTR this_arg public static native long[] OffersMessageHandler_release_pending_messages(long this_arg); + public interface LDKAsyncPaymentsMessageHandler { + long held_htlc_available(long message, long responder); + void release_held_htlc(long message); + long[] release_pending_messages(); + } + public static native long LDKAsyncPaymentsMessageHandler_new(LDKAsyncPaymentsMessageHandler impl); + // LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ AsyncPaymentsMessageHandler_held_htlc_available LDKAsyncPaymentsMessageHandler *NONNULL_PTR this_arg, struct LDKHeldHtlcAvailable message, struct LDKResponder responder + public static native long AsyncPaymentsMessageHandler_held_htlc_available(long this_arg, long message, long responder); + // void AsyncPaymentsMessageHandler_release_held_htlc LDKAsyncPaymentsMessageHandler *NONNULL_PTR this_arg, struct LDKReleaseHeldHtlc message + public static native void AsyncPaymentsMessageHandler_release_held_htlc(long this_arg, long message); + // LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ AsyncPaymentsMessageHandler_release_pending_messages LDKAsyncPaymentsMessageHandler *NONNULL_PTR this_arg + public static native long[] AsyncPaymentsMessageHandler_release_pending_messages(long this_arg); public interface LDKNodeIdLookUp { byte[] next_node_id(long short_channel_id); } @@ -3536,7 +3791,6 @@ public class bindings { // LDKInitFeatures RoutingMessageHandler_provided_init_features LDKRoutingMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id public static native long RoutingMessageHandler_provided_init_features(long this_arg, byte[] their_node_id); public interface LDKOnionMessageHandler { - long[] get_and_clear_connections_needed(); void handle_onion_message(byte[] peer_node_id, long msg); long next_onion_message_for_peer(byte[] peer_node_id); long peer_connected(byte[] their_node_id, long init, boolean inbound); @@ -3546,8 +3800,6 @@ public class bindings { long provided_init_features(byte[] their_node_id); } public static native long LDKOnionMessageHandler_new(LDKOnionMessageHandler impl); - // LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ OnionMessageHandler_get_and_clear_connections_needed LDKOnionMessageHandler *NONNULL_PTR this_arg - public static native long[] OnionMessageHandler_get_and_clear_connections_needed(long this_arg); // void OnionMessageHandler_handle_onion_message LDKOnionMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey peer_node_id, const struct LDKOnionMessage *NONNULL_PTR msg public static native void OnionMessageHandler_handle_onion_message(long this_arg, byte[] peer_node_id, long msg); // LDKOnionMessage OnionMessageHandler_next_onion_message_for_peer LDKOnionMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey peer_node_id @@ -3571,6 +3823,8 @@ public class bindings { public interface LDKCustomMessageHandler { long handle_custom_message(long msg, byte[] sender_node_id); long[] get_and_clear_pending_msg(); + void peer_disconnected(byte[] their_node_id); + long peer_connected(byte[] their_node_id, long msg, boolean inbound); long provided_node_features(); long provided_init_features(byte[] their_node_id); } @@ -3580,21 +3834,25 @@ public class bindings { public static native long CustomMessageHandler_handle_custom_message(long this_arg, long msg, byte[] sender_node_id); // LDKCVec_C2Tuple_PublicKeyTypeZZ CustomMessageHandler_get_and_clear_pending_msg LDKCustomMessageHandler *NONNULL_PTR this_arg public static native long[] CustomMessageHandler_get_and_clear_pending_msg(long this_arg); + // void CustomMessageHandler_peer_disconnected LDKCustomMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id + public static native void CustomMessageHandler_peer_disconnected(long this_arg, byte[] their_node_id); + // LDKCResult_NoneNoneZ CustomMessageHandler_peer_connected LDKCustomMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg, bool inbound + public static native long CustomMessageHandler_peer_connected(long this_arg, byte[] their_node_id, long msg, boolean inbound); // LDKNodeFeatures CustomMessageHandler_provided_node_features LDKCustomMessageHandler *NONNULL_PTR this_arg public static native long CustomMessageHandler_provided_node_features(long this_arg); // LDKInitFeatures CustomMessageHandler_provided_init_features LDKCustomMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id public static native long CustomMessageHandler_provided_init_features(long this_arg, byte[] their_node_id); public interface LDKCustomOnionMessageHandler { - long handle_custom_message(long msg); + long handle_custom_message(long message, long context, long responder); long read_custom_message(long message_type, byte[] buffer); long[] release_pending_custom_messages(); } public static native long LDKCustomOnionMessageHandler_new(LDKCustomOnionMessageHandler impl); - // LDKCOption_OnionMessageContentsZ CustomOnionMessageHandler_handle_custom_message LDKCustomOnionMessageHandler *NONNULL_PTR this_arg, struct LDKOnionMessageContents msg - public static native long CustomOnionMessageHandler_handle_custom_message(long this_arg, long msg); + // LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ CustomOnionMessageHandler_handle_custom_message LDKCustomOnionMessageHandler *NONNULL_PTR this_arg, struct LDKOnionMessageContents message, struct LDKCOption_CVec_u8ZZ context, struct LDKResponder responder + public static native long CustomOnionMessageHandler_handle_custom_message(long this_arg, long message, long context, long responder); // LDKCResult_COption_OnionMessageContentsZDecodeErrorZ CustomOnionMessageHandler_read_custom_message LDKCustomOnionMessageHandler *NONNULL_PTR this_arg, uint64_t message_type, struct LDKu8slice buffer public static native long CustomOnionMessageHandler_read_custom_message(long this_arg, long message_type, byte[] buffer); - // LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ CustomOnionMessageHandler_release_pending_custom_messages LDKCustomOnionMessageHandler *NONNULL_PTR this_arg + // LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ CustomOnionMessageHandler_release_pending_custom_messages LDKCustomOnionMessageHandler *NONNULL_PTR this_arg public static native long[] CustomOnionMessageHandler_release_pending_custom_messages(long this_arg); public interface LDKSocketDescriptor { long send_data(byte[] data, boolean resume_read); @@ -3609,6 +3867,25 @@ public class bindings { public static native void SocketDescriptor_disconnect_socket(long this_arg); // uint64_t SocketDescriptor_hash LDKSocketDescriptor *NONNULL_PTR this_arg public static native long SocketDescriptor_hash(long this_arg); + public static class LDKBolt12PaymentError { + private LDKBolt12PaymentError() {} + public final static class UnexpectedInvoice extends LDKBolt12PaymentError { + UnexpectedInvoice() { } + } + public final static class DuplicateInvoice extends LDKBolt12PaymentError { + DuplicateInvoice() { } + } + public final static class UnknownRequiredFeatures extends LDKBolt12PaymentError { + UnknownRequiredFeatures() { } + } + public final static class SendingFailed extends LDKBolt12PaymentError { + public org.ldk.enums.RetryableSendFailure sending_failed; + SendingFailed(org.ldk.enums.RetryableSendFailure sending_failed) { this.sending_failed = sending_failed; } + } + static native void init(); + } + static { LDKBolt12PaymentError.init(); } + public static native LDKBolt12PaymentError LDKBolt12PaymentError_ref_from_ptr(long ptr); public interface LDKSignBolt12InvoiceFn { long sign_invoice(long message); } @@ -3861,8 +4138,20 @@ public class bindings { public static native long COption_u64Z_clone_ptr(long arg); // struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig); public static native long COption_u64Z_clone(long orig); - // void CVec_BlindedPathZ_free(struct LDKCVec_BlindedPathZ _res); - public static native void CVec_BlindedPathZ_free(long[] _res); + // void CVec_BlindedMessagePathZ_free(struct LDKCVec_BlindedMessagePathZ _res); + public static native void CVec_BlindedMessagePathZ_free(long[] _res); + // struct LDKCResult_RefundDecodeErrorZ CResult_RefundDecodeErrorZ_ok(struct LDKRefund o); + public static native long CResult_RefundDecodeErrorZ_ok(long o); + // struct LDKCResult_RefundDecodeErrorZ CResult_RefundDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_RefundDecodeErrorZ_err(long e); + // bool CResult_RefundDecodeErrorZ_is_ok(const struct LDKCResult_RefundDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_RefundDecodeErrorZ_is_ok(long o); + // void CResult_RefundDecodeErrorZ_free(struct LDKCResult_RefundDecodeErrorZ _res); + public static native void CResult_RefundDecodeErrorZ_free(long _res); + // uint64_t CResult_RefundDecodeErrorZ_clone_ptr(LDKCResult_RefundDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_RefundDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_RefundDecodeErrorZ CResult_RefundDecodeErrorZ_clone(const struct LDKCResult_RefundDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_RefundDecodeErrorZ_clone(long orig); // struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_ok(struct LDKRefund o); public static native long CResult_RefundBolt12ParseErrorZ_ok(long o); // struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_err(struct LDKBolt12ParseError e); @@ -3993,6 +4282,8 @@ public class bindings { public static native long CResult_SchnorrSignatureNoneZ_clone_ptr(long arg); // struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_clone(const struct LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR orig); public static native long CResult_SchnorrSignatureNoneZ_clone(long orig); + // void CVec_StrZ_free(struct LDKCVec_StrZ _res); + public static native void CVec_StrZ_free(String[] _res); // void CVec_ThirtyTwoBytesZ_free(struct LDKCVec_ThirtyTwoBytesZ _res); public static native void CVec_ThirtyTwoBytesZ_free(byte[][] _res); // struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_some(struct LDKCVec_ThirtyTwoBytesZ o); @@ -4037,18 +4328,18 @@ public class bindings { public static native long CResult_ThirtyTwoBytesNoneZ_clone_ptr(long arg); // struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_clone(const struct LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR orig); public static native long CResult_ThirtyTwoBytesNoneZ_clone(long orig); - // struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_ok(struct LDKBlindedPayInfo o); - public static native long CResult_BlindedPayInfoDecodeErrorZ_ok(long o); - // struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_err(struct LDKDecodeError e); - public static native long CResult_BlindedPayInfoDecodeErrorZ_err(long e); - // bool CResult_BlindedPayInfoDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR o); - public static native boolean CResult_BlindedPayInfoDecodeErrorZ_is_ok(long o); - // void CResult_BlindedPayInfoDecodeErrorZ_free(struct LDKCResult_BlindedPayInfoDecodeErrorZ _res); - public static native void CResult_BlindedPayInfoDecodeErrorZ_free(long _res); - // uint64_t CResult_BlindedPayInfoDecodeErrorZ_clone_ptr(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR arg); - public static native long CResult_BlindedPayInfoDecodeErrorZ_clone_ptr(long arg); - // struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_clone(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR orig); - public static native long CResult_BlindedPayInfoDecodeErrorZ_clone(long orig); + // struct LDKCResult_Bolt12InvoiceDecodeErrorZ CResult_Bolt12InvoiceDecodeErrorZ_ok(struct LDKBolt12Invoice o); + public static native long CResult_Bolt12InvoiceDecodeErrorZ_ok(long o); + // struct LDKCResult_Bolt12InvoiceDecodeErrorZ CResult_Bolt12InvoiceDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_Bolt12InvoiceDecodeErrorZ_err(long e); + // bool CResult_Bolt12InvoiceDecodeErrorZ_is_ok(const struct LDKCResult_Bolt12InvoiceDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_Bolt12InvoiceDecodeErrorZ_is_ok(long o); + // void CResult_Bolt12InvoiceDecodeErrorZ_free(struct LDKCResult_Bolt12InvoiceDecodeErrorZ _res); + public static native void CResult_Bolt12InvoiceDecodeErrorZ_free(long _res); + // uint64_t CResult_Bolt12InvoiceDecodeErrorZ_clone_ptr(LDKCResult_Bolt12InvoiceDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_Bolt12InvoiceDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_Bolt12InvoiceDecodeErrorZ CResult_Bolt12InvoiceDecodeErrorZ_clone(const struct LDKCResult_Bolt12InvoiceDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_Bolt12InvoiceDecodeErrorZ_clone(long orig); // struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o); public static native long CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(long o); // struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e); @@ -4143,18 +4434,6 @@ public class bindings { public static native long CResult_HTLCDescriptorDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_clone(const struct LDKCResult_HTLCDescriptorDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_HTLCDescriptorDecodeErrorZ_clone(long orig); - // struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void); - public static native long CResult_NoneNoneZ_ok(); - // struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void); - public static native long CResult_NoneNoneZ_err(); - // bool CResult_NoneNoneZ_is_ok(const struct LDKCResult_NoneNoneZ *NONNULL_PTR o); - public static native boolean CResult_NoneNoneZ_is_ok(long o); - // void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res); - public static native void CResult_NoneNoneZ_free(long _res); - // uint64_t CResult_NoneNoneZ_clone_ptr(LDKCResult_NoneNoneZ *NONNULL_PTR arg); - public static native long CResult_NoneNoneZ_clone_ptr(long arg); - // struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_clone(const struct LDKCResult_NoneNoneZ *NONNULL_PTR orig); - public static native long CResult_NoneNoneZ_clone(long orig); // struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_ok(struct LDKPublicKey o); public static native long CResult_PublicKeyNoneZ_ok(byte[] o); // struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_err(void); @@ -4167,6 +4446,30 @@ public class bindings { public static native long CResult_PublicKeyNoneZ_clone_ptr(long arg); // struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_clone(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR orig); public static native long CResult_PublicKeyNoneZ_clone(long orig); + // struct LDKCResult__u832NoneZ CResult__u832NoneZ_ok(struct LDKThirtyTwoBytes o); + public static native long CResult__u832NoneZ_ok(byte[] o); + // struct LDKCResult__u832NoneZ CResult__u832NoneZ_err(void); + public static native long CResult__u832NoneZ_err(); + // bool CResult__u832NoneZ_is_ok(const struct LDKCResult__u832NoneZ *NONNULL_PTR o); + public static native boolean CResult__u832NoneZ_is_ok(long o); + // void CResult__u832NoneZ_free(struct LDKCResult__u832NoneZ _res); + public static native void CResult__u832NoneZ_free(long _res); + // uint64_t CResult__u832NoneZ_clone_ptr(LDKCResult__u832NoneZ *NONNULL_PTR arg); + public static native long CResult__u832NoneZ_clone_ptr(long arg); + // struct LDKCResult__u832NoneZ CResult__u832NoneZ_clone(const struct LDKCResult__u832NoneZ *NONNULL_PTR orig); + public static native long CResult__u832NoneZ_clone(long orig); + // struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void); + public static native long CResult_NoneNoneZ_ok(); + // struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void); + public static native long CResult_NoneNoneZ_err(); + // bool CResult_NoneNoneZ_is_ok(const struct LDKCResult_NoneNoneZ *NONNULL_PTR o); + public static native boolean CResult_NoneNoneZ_is_ok(long o); + // void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res); + public static native void CResult_NoneNoneZ_free(long _res); + // uint64_t CResult_NoneNoneZ_clone_ptr(LDKCResult_NoneNoneZ *NONNULL_PTR arg); + public static native long CResult_NoneNoneZ_clone_ptr(long arg); + // struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_clone(const struct LDKCResult_NoneNoneZ *NONNULL_PTR orig); + public static native long CResult_NoneNoneZ_clone(long orig); // struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_some(struct LDKBigEndianScalar o); public static native long COption_BigEndianScalarZ_some(long o); // struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_none(void); @@ -4177,8 +4480,6 @@ public class bindings { public static native long COption_BigEndianScalarZ_clone_ptr(long arg); // struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_clone(const struct LDKCOption_BigEndianScalarZ *NONNULL_PTR orig); public static native long COption_BigEndianScalarZ_clone(long orig); - // void CVec_U5Z_free(struct LDKCVec_U5Z _res); - public static native void CVec_U5Z_free(byte[] _res); // struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o); public static native long CResult_RecoverableSignatureNoneZ_ok(byte[] o); // struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void); @@ -4215,18 +4516,18 @@ public class bindings { public static native long CResult_TransactionNoneZ_clone_ptr(long arg); // struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig); public static native long CResult_TransactionNoneZ_clone(long orig); - // struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(struct LDKWriteableEcdsaChannelSigner o); - public static native long CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(long o); - // struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err(struct LDKDecodeError e); - public static native long CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err(long e); - // bool CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok(const struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR o); - public static native boolean CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok(long o); - // void CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free(struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ _res); - public static native void CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free(long _res); - // uint64_t CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone_ptr(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR arg); - public static native long CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone_ptr(long arg); - // struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(const struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR orig); - public static native long CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(long orig); + // struct LDKCResult_EcdsaChannelSignerDecodeErrorZ CResult_EcdsaChannelSignerDecodeErrorZ_ok(struct LDKEcdsaChannelSigner o); + public static native long CResult_EcdsaChannelSignerDecodeErrorZ_ok(long o); + // struct LDKCResult_EcdsaChannelSignerDecodeErrorZ CResult_EcdsaChannelSignerDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_EcdsaChannelSignerDecodeErrorZ_err(long e); + // bool CResult_EcdsaChannelSignerDecodeErrorZ_is_ok(const struct LDKCResult_EcdsaChannelSignerDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_EcdsaChannelSignerDecodeErrorZ_is_ok(long o); + // void CResult_EcdsaChannelSignerDecodeErrorZ_free(struct LDKCResult_EcdsaChannelSignerDecodeErrorZ _res); + public static native void CResult_EcdsaChannelSignerDecodeErrorZ_free(long _res); + // uint64_t CResult_EcdsaChannelSignerDecodeErrorZ_clone_ptr(LDKCResult_EcdsaChannelSignerDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_EcdsaChannelSignerDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_EcdsaChannelSignerDecodeErrorZ CResult_EcdsaChannelSignerDecodeErrorZ_clone(const struct LDKCResult_EcdsaChannelSignerDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_EcdsaChannelSignerDecodeErrorZ_clone(long orig); // struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_ok(struct LDKCVec_u8Z o); public static native long CResult_CVec_u8ZNoneZ_ok(byte[] o); // struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_err(void); @@ -4335,6 +4636,26 @@ public class bindings { public static native long CResult_NoneIOErrorZ_clone_ptr(long arg); // struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_clone(const struct LDKCResult_NoneIOErrorZ *NONNULL_PTR orig); public static native long CResult_NoneIOErrorZ_clone(long orig); + // uint64_t C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone_ptr(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR arg); + public static native long C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone_ptr(long arg); + // struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(const struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR orig); + public static native long C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(long orig); + // struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new(struct LDKThirtyTwoBytes a, struct LDKRecipientOnionFields b, struct LDKRouteParameters c); + public static native long C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new(byte[] a, long b, long c); + // void C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ _res); + public static native void C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(long _res); + // struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok(struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ o); + public static native long CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok(long o); + // struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err(void); + public static native long CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err(); + // bool CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok(const struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR o); + public static native boolean CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok(long o); + // void CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ _res); + public static native void CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(long _res); + // uint64_t CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone_ptr(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR arg); + public static native long CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone_ptr(long arg); + // struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone(const struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR orig); + public static native long CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone(long orig); // void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res); public static native void CVec_ChannelDetailsZ_free(long[] _res); // struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o); @@ -4349,28 +4670,20 @@ public class bindings { public static native long CResult_RouteLightningErrorZ_clone_ptr(long arg); // struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig); public static native long CResult_RouteLightningErrorZ_clone(long orig); - // uint64_t C2Tuple_BlindedPayInfoBlindedPathZ_clone_ptr(LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR arg); - public static native long C2Tuple_BlindedPayInfoBlindedPathZ_clone_ptr(long arg); - // struct LDKC2Tuple_BlindedPayInfoBlindedPathZ C2Tuple_BlindedPayInfoBlindedPathZ_clone(const struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR orig); - public static native long C2Tuple_BlindedPayInfoBlindedPathZ_clone(long orig); - // struct LDKC2Tuple_BlindedPayInfoBlindedPathZ C2Tuple_BlindedPayInfoBlindedPathZ_new(struct LDKBlindedPayInfo a, struct LDKBlindedPath b); - public static native long C2Tuple_BlindedPayInfoBlindedPathZ_new(long a, long b); - // void C2Tuple_BlindedPayInfoBlindedPathZ_free(struct LDKC2Tuple_BlindedPayInfoBlindedPathZ _res); - public static native void C2Tuple_BlindedPayInfoBlindedPathZ_free(long _res); - // void CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_free(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ _res); - public static native void CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_free(long[] _res); - // struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_ok(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ o); - public static native long CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_ok(long[] o); - // struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_err(void); - public static native long CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_err(); - // bool CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_is_ok(const struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR o); - public static native boolean CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_is_ok(long o); - // void CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_free(struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ _res); - public static native void CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_free(long _res); - // uint64_t CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone_ptr(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR arg); - public static native long CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone_ptr(long arg); - // struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone(const struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR orig); - public static native long CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone(long orig); + // void CVec_BlindedPaymentPathZ_free(struct LDKCVec_BlindedPaymentPathZ _res); + public static native void CVec_BlindedPaymentPathZ_free(long[] _res); + // struct LDKCResult_CVec_BlindedPaymentPathZNoneZ CResult_CVec_BlindedPaymentPathZNoneZ_ok(struct LDKCVec_BlindedPaymentPathZ o); + public static native long CResult_CVec_BlindedPaymentPathZNoneZ_ok(long[] o); + // struct LDKCResult_CVec_BlindedPaymentPathZNoneZ CResult_CVec_BlindedPaymentPathZNoneZ_err(void); + public static native long CResult_CVec_BlindedPaymentPathZNoneZ_err(); + // bool CResult_CVec_BlindedPaymentPathZNoneZ_is_ok(const struct LDKCResult_CVec_BlindedPaymentPathZNoneZ *NONNULL_PTR o); + public static native boolean CResult_CVec_BlindedPaymentPathZNoneZ_is_ok(long o); + // void CResult_CVec_BlindedPaymentPathZNoneZ_free(struct LDKCResult_CVec_BlindedPaymentPathZNoneZ _res); + public static native void CResult_CVec_BlindedPaymentPathZNoneZ_free(long _res); + // uint64_t CResult_CVec_BlindedPaymentPathZNoneZ_clone_ptr(LDKCResult_CVec_BlindedPaymentPathZNoneZ *NONNULL_PTR arg); + public static native long CResult_CVec_BlindedPaymentPathZNoneZ_clone_ptr(long arg); + // struct LDKCResult_CVec_BlindedPaymentPathZNoneZ CResult_CVec_BlindedPaymentPathZNoneZ_clone(const struct LDKCResult_CVec_BlindedPaymentPathZNoneZ *NONNULL_PTR orig); + public static native long CResult_CVec_BlindedPaymentPathZNoneZ_clone(long orig); // void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res); public static native void CVec_PublicKeyZ_free(byte[][] _res); // struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_ok(struct LDKOnionMessagePath o); @@ -4385,18 +4698,20 @@ public class bindings { public static native long CResult_OnionMessagePathNoneZ_clone_ptr(long arg); // struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_clone(const struct LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR orig); public static native long CResult_OnionMessagePathNoneZ_clone(long orig); - // struct LDKCResult_CVec_BlindedPathZNoneZ CResult_CVec_BlindedPathZNoneZ_ok(struct LDKCVec_BlindedPathZ o); - public static native long CResult_CVec_BlindedPathZNoneZ_ok(long[] o); - // struct LDKCResult_CVec_BlindedPathZNoneZ CResult_CVec_BlindedPathZNoneZ_err(void); - public static native long CResult_CVec_BlindedPathZNoneZ_err(); - // bool CResult_CVec_BlindedPathZNoneZ_is_ok(const struct LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR o); - public static native boolean CResult_CVec_BlindedPathZNoneZ_is_ok(long o); - // void CResult_CVec_BlindedPathZNoneZ_free(struct LDKCResult_CVec_BlindedPathZNoneZ _res); - public static native void CResult_CVec_BlindedPathZNoneZ_free(long _res); - // uint64_t CResult_CVec_BlindedPathZNoneZ_clone_ptr(LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR arg); - public static native long CResult_CVec_BlindedPathZNoneZ_clone_ptr(long arg); - // struct LDKCResult_CVec_BlindedPathZNoneZ CResult_CVec_BlindedPathZNoneZ_clone(const struct LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR orig); - public static native long CResult_CVec_BlindedPathZNoneZ_clone(long orig); + // struct LDKCResult_CVec_BlindedMessagePathZNoneZ CResult_CVec_BlindedMessagePathZNoneZ_ok(struct LDKCVec_BlindedMessagePathZ o); + public static native long CResult_CVec_BlindedMessagePathZNoneZ_ok(long[] o); + // struct LDKCResult_CVec_BlindedMessagePathZNoneZ CResult_CVec_BlindedMessagePathZNoneZ_err(void); + public static native long CResult_CVec_BlindedMessagePathZNoneZ_err(); + // bool CResult_CVec_BlindedMessagePathZNoneZ_is_ok(const struct LDKCResult_CVec_BlindedMessagePathZNoneZ *NONNULL_PTR o); + public static native boolean CResult_CVec_BlindedMessagePathZNoneZ_is_ok(long o); + // void CResult_CVec_BlindedMessagePathZNoneZ_free(struct LDKCResult_CVec_BlindedMessagePathZNoneZ _res); + public static native void CResult_CVec_BlindedMessagePathZNoneZ_free(long _res); + // uint64_t CResult_CVec_BlindedMessagePathZNoneZ_clone_ptr(LDKCResult_CVec_BlindedMessagePathZNoneZ *NONNULL_PTR arg); + public static native long CResult_CVec_BlindedMessagePathZNoneZ_clone_ptr(long arg); + // struct LDKCResult_CVec_BlindedMessagePathZNoneZ CResult_CVec_BlindedMessagePathZNoneZ_clone(const struct LDKCResult_CVec_BlindedMessagePathZNoneZ *NONNULL_PTR orig); + public static native long CResult_CVec_BlindedMessagePathZNoneZ_clone(long orig); + // void CVec_MessageForwardNodeZ_free(struct LDKCVec_MessageForwardNodeZ _res); + public static native void CVec_MessageForwardNodeZ_free(long[] _res); // struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_ok(struct LDKInFlightHtlcs o); public static native long CResult_InFlightHtlcsDecodeErrorZ_ok(long o); // struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_err(struct LDKDecodeError e); @@ -4479,8 +4794,6 @@ public class bindings { public static native long CResult_PaymentParametersDecodeErrorZ_clone(long orig); // void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res); public static native void CVec_RouteHintZ_free(long[] _res); - // void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res); - public static native void CVec_RouteHintHopZ_free(long[] _res); // struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_ok(struct LDKRouteHint o); public static native long CResult_RouteHintDecodeErrorZ_ok(long o); // struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_err(struct LDKDecodeError e); @@ -4761,6 +5074,18 @@ public class bindings { public static native boolean CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_is_ok(long o); // void CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ _res); public static native void CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_free(long _res); + // struct LDKCResult_OfferDecodeErrorZ CResult_OfferDecodeErrorZ_ok(struct LDKOffer o); + public static native long CResult_OfferDecodeErrorZ_ok(long o); + // struct LDKCResult_OfferDecodeErrorZ CResult_OfferDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_OfferDecodeErrorZ_err(long e); + // bool CResult_OfferDecodeErrorZ_is_ok(const struct LDKCResult_OfferDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_OfferDecodeErrorZ_is_ok(long o); + // void CResult_OfferDecodeErrorZ_free(struct LDKCResult_OfferDecodeErrorZ _res); + public static native void CResult_OfferDecodeErrorZ_free(long _res); + // uint64_t CResult_OfferDecodeErrorZ_clone_ptr(LDKCResult_OfferDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_OfferDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_OfferDecodeErrorZ CResult_OfferDecodeErrorZ_clone(const struct LDKCResult_OfferDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_OfferDecodeErrorZ_clone(long orig); // struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_ok(struct LDKOffer o); public static native long CResult_OfferBolt12ParseErrorZ_ok(long o); // struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_err(struct LDKBolt12ParseError e); @@ -4931,6 +5256,16 @@ public class bindings { public static native long CResult_NodeAliasDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_clone(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_NodeAliasDecodeErrorZ_clone(long orig); + // struct LDKCOption_NodeAnnouncementInfoZ COption_NodeAnnouncementInfoZ_some(struct LDKNodeAnnouncementInfo o); + public static native long COption_NodeAnnouncementInfoZ_some(long o); + // struct LDKCOption_NodeAnnouncementInfoZ COption_NodeAnnouncementInfoZ_none(void); + public static native long COption_NodeAnnouncementInfoZ_none(); + // void COption_NodeAnnouncementInfoZ_free(struct LDKCOption_NodeAnnouncementInfoZ _res); + public static native void COption_NodeAnnouncementInfoZ_free(long _res); + // uint64_t COption_NodeAnnouncementInfoZ_clone_ptr(LDKCOption_NodeAnnouncementInfoZ *NONNULL_PTR arg); + public static native long COption_NodeAnnouncementInfoZ_clone_ptr(long arg); + // struct LDKCOption_NodeAnnouncementInfoZ COption_NodeAnnouncementInfoZ_clone(const struct LDKCOption_NodeAnnouncementInfoZ *NONNULL_PTR orig); + public static native long COption_NodeAnnouncementInfoZ_clone(long orig); // struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o); public static native long CResult_NodeInfoDecodeErrorZ_ok(long o); // struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e); @@ -5205,26 +5540,72 @@ public class bindings { public static native long CResult_ThirtyTwoBytesAPIErrorZ_clone_ptr(long arg); // struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_clone(const struct LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR orig); public static native long CResult_ThirtyTwoBytesAPIErrorZ_clone(long orig); - // struct LDKCOption_OffersMessageZ COption_OffersMessageZ_some(struct LDKOffersMessage o); - public static native long COption_OffersMessageZ_some(long o); - // struct LDKCOption_OffersMessageZ COption_OffersMessageZ_none(void); - public static native long COption_OffersMessageZ_none(); - // void COption_OffersMessageZ_free(struct LDKCOption_OffersMessageZ _res); - public static native void COption_OffersMessageZ_free(long _res); - // uint64_t COption_OffersMessageZ_clone_ptr(LDKCOption_OffersMessageZ *NONNULL_PTR arg); - public static native long COption_OffersMessageZ_clone_ptr(long arg); - // struct LDKCOption_OffersMessageZ COption_OffersMessageZ_clone(const struct LDKCOption_OffersMessageZ *NONNULL_PTR orig); - public static native long COption_OffersMessageZ_clone(long orig); - // uint64_t C3Tuple_OffersMessageDestinationBlindedPathZ_clone_ptr(LDKC3Tuple_OffersMessageDestinationBlindedPathZ *NONNULL_PTR arg); - public static native long C3Tuple_OffersMessageDestinationBlindedPathZ_clone_ptr(long arg); - // struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ C3Tuple_OffersMessageDestinationBlindedPathZ_clone(const struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ *NONNULL_PTR orig); - public static native long C3Tuple_OffersMessageDestinationBlindedPathZ_clone(long orig); - // struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ C3Tuple_OffersMessageDestinationBlindedPathZ_new(struct LDKOffersMessage a, struct LDKDestination b, struct LDKBlindedPath c); - public static native long C3Tuple_OffersMessageDestinationBlindedPathZ_new(long a, long b, long c); - // void C3Tuple_OffersMessageDestinationBlindedPathZ_free(struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ _res); - public static native void C3Tuple_OffersMessageDestinationBlindedPathZ_free(long _res); - // void CVec_C3Tuple_OffersMessageDestinationBlindedPathZZ_free(struct LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ _res); - public static native void CVec_C3Tuple_OffersMessageDestinationBlindedPathZZ_free(long[] _res); + // struct LDKCOption_OffersContextZ COption_OffersContextZ_some(struct LDKOffersContext o); + public static native long COption_OffersContextZ_some(long o); + // struct LDKCOption_OffersContextZ COption_OffersContextZ_none(void); + public static native long COption_OffersContextZ_none(); + // void COption_OffersContextZ_free(struct LDKCOption_OffersContextZ _res); + public static native void COption_OffersContextZ_free(long _res); + // uint64_t COption_OffersContextZ_clone_ptr(LDKCOption_OffersContextZ *NONNULL_PTR arg); + public static native long COption_OffersContextZ_clone_ptr(long arg); + // struct LDKCOption_OffersContextZ COption_OffersContextZ_clone(const struct LDKCOption_OffersContextZ *NONNULL_PTR orig); + public static native long COption_OffersContextZ_clone(long orig); + // uint64_t C2Tuple_OffersMessageResponseInstructionZ_clone_ptr(LDKC2Tuple_OffersMessageResponseInstructionZ *NONNULL_PTR arg); + public static native long C2Tuple_OffersMessageResponseInstructionZ_clone_ptr(long arg); + // struct LDKC2Tuple_OffersMessageResponseInstructionZ C2Tuple_OffersMessageResponseInstructionZ_clone(const struct LDKC2Tuple_OffersMessageResponseInstructionZ *NONNULL_PTR orig); + public static native long C2Tuple_OffersMessageResponseInstructionZ_clone(long orig); + // struct LDKC2Tuple_OffersMessageResponseInstructionZ C2Tuple_OffersMessageResponseInstructionZ_new(struct LDKOffersMessage a, struct LDKResponseInstruction b); + public static native long C2Tuple_OffersMessageResponseInstructionZ_new(long a, long b); + // void C2Tuple_OffersMessageResponseInstructionZ_free(struct LDKC2Tuple_OffersMessageResponseInstructionZ _res); + public static native void C2Tuple_OffersMessageResponseInstructionZ_free(long _res); + // struct LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ COption_C2Tuple_OffersMessageResponseInstructionZZ_some(struct LDKC2Tuple_OffersMessageResponseInstructionZ o); + public static native long COption_C2Tuple_OffersMessageResponseInstructionZZ_some(long o); + // struct LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ COption_C2Tuple_OffersMessageResponseInstructionZZ_none(void); + public static native long COption_C2Tuple_OffersMessageResponseInstructionZZ_none(); + // void COption_C2Tuple_OffersMessageResponseInstructionZZ_free(struct LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ _res); + public static native void COption_C2Tuple_OffersMessageResponseInstructionZZ_free(long _res); + // uint64_t COption_C2Tuple_OffersMessageResponseInstructionZZ_clone_ptr(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ *NONNULL_PTR arg); + public static native long COption_C2Tuple_OffersMessageResponseInstructionZZ_clone_ptr(long arg); + // struct LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ COption_C2Tuple_OffersMessageResponseInstructionZZ_clone(const struct LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ *NONNULL_PTR orig); + public static native long COption_C2Tuple_OffersMessageResponseInstructionZZ_clone(long orig); + // uint64_t C2Tuple_OffersMessageMessageSendInstructionsZ_clone_ptr(LDKC2Tuple_OffersMessageMessageSendInstructionsZ *NONNULL_PTR arg); + public static native long C2Tuple_OffersMessageMessageSendInstructionsZ_clone_ptr(long arg); + // struct LDKC2Tuple_OffersMessageMessageSendInstructionsZ C2Tuple_OffersMessageMessageSendInstructionsZ_clone(const struct LDKC2Tuple_OffersMessageMessageSendInstructionsZ *NONNULL_PTR orig); + public static native long C2Tuple_OffersMessageMessageSendInstructionsZ_clone(long orig); + // struct LDKC2Tuple_OffersMessageMessageSendInstructionsZ C2Tuple_OffersMessageMessageSendInstructionsZ_new(struct LDKOffersMessage a, struct LDKMessageSendInstructions b); + public static native long C2Tuple_OffersMessageMessageSendInstructionsZ_new(long a, long b); + // void C2Tuple_OffersMessageMessageSendInstructionsZ_free(struct LDKC2Tuple_OffersMessageMessageSendInstructionsZ _res); + public static native void C2Tuple_OffersMessageMessageSendInstructionsZ_free(long _res); + // void CVec_C2Tuple_OffersMessageMessageSendInstructionsZZ_free(struct LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ _res); + public static native void CVec_C2Tuple_OffersMessageMessageSendInstructionsZZ_free(long[] _res); + // uint64_t C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone_ptr(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ *NONNULL_PTR arg); + public static native long C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone_ptr(long arg); + // struct LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone(const struct LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ *NONNULL_PTR orig); + public static native long C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone(long orig); + // struct LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ C2Tuple_ReleaseHeldHtlcResponseInstructionZ_new(struct LDKReleaseHeldHtlc a, struct LDKResponseInstruction b); + public static native long C2Tuple_ReleaseHeldHtlcResponseInstructionZ_new(long a, long b); + // void C2Tuple_ReleaseHeldHtlcResponseInstructionZ_free(struct LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ _res); + public static native void C2Tuple_ReleaseHeldHtlcResponseInstructionZ_free(long _res); + // struct LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_some(struct LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ o); + public static native long COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_some(long o); + // struct LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_none(void); + public static native long COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_none(); + // void COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_free(struct LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ _res); + public static native void COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_free(long _res); + // uint64_t COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone_ptr(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ *NONNULL_PTR arg); + public static native long COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone_ptr(long arg); + // struct LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone(const struct LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ *NONNULL_PTR orig); + public static native long COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone(long orig); + // uint64_t C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone_ptr(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ *NONNULL_PTR arg); + public static native long C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone_ptr(long arg); + // struct LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone(const struct LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ *NONNULL_PTR orig); + public static native long C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone(long orig); + // struct LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_new(struct LDKAsyncPaymentsMessage a, struct LDKMessageSendInstructions b); + public static native long C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_new(long a, long b); + // void C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_free(struct LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ _res); + public static native void C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_free(long _res); + // void CVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ_free(struct LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ _res); + public static native void CVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ_free(long[] _res); // struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_ok(struct LDKPhantomRouteHints o); public static native long CResult_PhantomRouteHintsDecodeErrorZ_ok(long o); // struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_err(struct LDKDecodeError e); @@ -5429,6 +5810,18 @@ public class bindings { public static native void C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_free(long _res); // void CVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ _res); public static native void CVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ_free(long[] _res); + // struct LDKCResult_NoneReplayEventZ CResult_NoneReplayEventZ_ok(void); + public static native long CResult_NoneReplayEventZ_ok(); + // struct LDKCResult_NoneReplayEventZ CResult_NoneReplayEventZ_err(struct LDKReplayEvent e); + public static native long CResult_NoneReplayEventZ_err(long e); + // bool CResult_NoneReplayEventZ_is_ok(const struct LDKCResult_NoneReplayEventZ *NONNULL_PTR o); + public static native boolean CResult_NoneReplayEventZ_is_ok(long o); + // void CResult_NoneReplayEventZ_free(struct LDKCResult_NoneReplayEventZ _res); + public static native void CResult_NoneReplayEventZ_free(long _res); + // uint64_t CResult_NoneReplayEventZ_clone_ptr(LDKCResult_NoneReplayEventZ *NONNULL_PTR arg); + public static native long CResult_NoneReplayEventZ_clone_ptr(long arg); + // struct LDKCResult_NoneReplayEventZ CResult_NoneReplayEventZ_clone(const struct LDKCResult_NoneReplayEventZ *NONNULL_PTR orig); + public static native long CResult_NoneReplayEventZ_clone(long orig); // void CVec_CommitmentTransactionZ_free(struct LDKCVec_CommitmentTransactionZ _res); public static native void CVec_CommitmentTransactionZ_free(long[] _res); // uint64_t C2Tuple_u32TxOutZ_clone_ptr(LDKC2Tuple_u32TxOutZ *NONNULL_PTR arg); @@ -5483,16 +5876,24 @@ public class bindings { public static native void C2Tuple_PublicKeyTypeZ_free(long _res); // void CVec_C2Tuple_PublicKeyTypeZZ_free(struct LDKCVec_C2Tuple_PublicKeyTypeZZ _res); public static native void CVec_C2Tuple_PublicKeyTypeZZ_free(long[] _res); - // uint64_t C2Tuple_PublicKeyCVec_SocketAddressZZ_clone_ptr(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *NONNULL_PTR arg); - public static native long C2Tuple_PublicKeyCVec_SocketAddressZZ_clone_ptr(long arg); - // struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ C2Tuple_PublicKeyCVec_SocketAddressZZ_clone(const struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *NONNULL_PTR orig); - public static native long C2Tuple_PublicKeyCVec_SocketAddressZZ_clone(long orig); - // struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ C2Tuple_PublicKeyCVec_SocketAddressZZ_new(struct LDKPublicKey a, struct LDKCVec_SocketAddressZ b); - public static native long C2Tuple_PublicKeyCVec_SocketAddressZZ_new(byte[] a, long[] b); - // void C2Tuple_PublicKeyCVec_SocketAddressZZ_free(struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ _res); - public static native void C2Tuple_PublicKeyCVec_SocketAddressZZ_free(long _res); - // void CVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ_free(struct LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ _res); - public static native void CVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ_free(long[] _res); + // uint64_t C2Tuple_OnionMessageContentsResponseInstructionZ_clone_ptr(LDKC2Tuple_OnionMessageContentsResponseInstructionZ *NONNULL_PTR arg); + public static native long C2Tuple_OnionMessageContentsResponseInstructionZ_clone_ptr(long arg); + // struct LDKC2Tuple_OnionMessageContentsResponseInstructionZ C2Tuple_OnionMessageContentsResponseInstructionZ_clone(const struct LDKC2Tuple_OnionMessageContentsResponseInstructionZ *NONNULL_PTR orig); + public static native long C2Tuple_OnionMessageContentsResponseInstructionZ_clone(long orig); + // struct LDKC2Tuple_OnionMessageContentsResponseInstructionZ C2Tuple_OnionMessageContentsResponseInstructionZ_new(struct LDKOnionMessageContents a, struct LDKResponseInstruction b); + public static native long C2Tuple_OnionMessageContentsResponseInstructionZ_new(long a, long b); + // void C2Tuple_OnionMessageContentsResponseInstructionZ_free(struct LDKC2Tuple_OnionMessageContentsResponseInstructionZ _res); + public static native void C2Tuple_OnionMessageContentsResponseInstructionZ_free(long _res); + // struct LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_some(struct LDKC2Tuple_OnionMessageContentsResponseInstructionZ o); + public static native long COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_some(long o); + // struct LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_none(void); + public static native long COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_none(); + // void COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_free(struct LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ _res); + public static native void COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_free(long _res); + // uint64_t COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone_ptr(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ *NONNULL_PTR arg); + public static native long COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone_ptr(long arg); + // struct LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone(const struct LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ *NONNULL_PTR orig); + public static native long COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone(long orig); // struct LDKCOption_OnionMessageContentsZ COption_OnionMessageContentsZ_some(struct LDKOnionMessageContents o); public static native long COption_OnionMessageContentsZ_some(long o); // struct LDKCOption_OnionMessageContentsZ COption_OnionMessageContentsZ_none(void); @@ -5515,16 +5916,16 @@ public class bindings { public static native long CResult_COption_OnionMessageContentsZDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ CResult_COption_OnionMessageContentsZDecodeErrorZ_clone(const struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_COption_OnionMessageContentsZDecodeErrorZ_clone(long orig); - // uint64_t C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone_ptr(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *NONNULL_PTR arg); - public static native long C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone_ptr(long arg); - // struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone(const struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *NONNULL_PTR orig); - public static native long C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone(long orig); - // struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ C3Tuple_OnionMessageContentsDestinationBlindedPathZ_new(struct LDKOnionMessageContents a, struct LDKDestination b, struct LDKBlindedPath c); - public static native long C3Tuple_OnionMessageContentsDestinationBlindedPathZ_new(long a, long b, long c); - // void C3Tuple_OnionMessageContentsDestinationBlindedPathZ_free(struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ _res); - public static native void C3Tuple_OnionMessageContentsDestinationBlindedPathZ_free(long _res); - // void CVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ_free(struct LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ _res); - public static native void CVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ_free(long[] _res); + // uint64_t C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone_ptr(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ *NONNULL_PTR arg); + public static native long C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone_ptr(long arg); + // struct LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone(const struct LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ *NONNULL_PTR orig); + public static native long C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone(long orig); + // struct LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ C2Tuple_OnionMessageContentsMessageSendInstructionsZ_new(struct LDKOnionMessageContents a, struct LDKMessageSendInstructions b); + public static native long C2Tuple_OnionMessageContentsMessageSendInstructionsZ_new(long a, long b); + // void C2Tuple_OnionMessageContentsMessageSendInstructionsZ_free(struct LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ _res); + public static native void C2Tuple_OnionMessageContentsMessageSendInstructionsZ_free(long _res); + // void CVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ_free(struct LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ _res); + public static native void CVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ_free(long[] _res); // struct LDKCOption_TypeZ COption_TypeZ_some(struct LDKType o); public static native long COption_TypeZ_some(long o); // struct LDKCOption_TypeZ COption_TypeZ_none(void); @@ -5615,8 +6016,6 @@ public class bindings { public static native long CResult_CVec_u8ZIOErrorZ_clone_ptr(long arg); // struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_clone(const struct LDKCResult_CVec_u8ZIOErrorZ *NONNULL_PTR orig); public static native long CResult_CVec_u8ZIOErrorZ_clone(long orig); - // void CVec_StrZ_free(struct LDKCVec_StrZ _res); - public static native void CVec_StrZ_free(String[] _res); // struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_ok(struct LDKCVec_StrZ o); public static native long CResult_CVec_StrZIOErrorZ_ok(String[] o); // struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_err(enum LDKIOError e); @@ -5679,16 +6078,6 @@ public class bindings { public static native long CResult_InvoiceRequestBolt12SemanticErrorZ_clone_ptr(long arg); // struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ CResult_InvoiceRequestBolt12SemanticErrorZ_clone(const struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR orig); public static native long CResult_InvoiceRequestBolt12SemanticErrorZ_clone(long orig); - // struct LDKCOption_SecretKeyZ COption_SecretKeyZ_some(struct LDKSecretKey o); - public static native long COption_SecretKeyZ_some(byte[] o); - // struct LDKCOption_SecretKeyZ COption_SecretKeyZ_none(void); - public static native long COption_SecretKeyZ_none(); - // void COption_SecretKeyZ_free(struct LDKCOption_SecretKeyZ _res); - public static native void COption_SecretKeyZ_free(long _res); - // uint64_t COption_SecretKeyZ_clone_ptr(LDKCOption_SecretKeyZ *NONNULL_PTR arg); - public static native long COption_SecretKeyZ_clone_ptr(long arg); - // struct LDKCOption_SecretKeyZ COption_SecretKeyZ_clone(const struct LDKCOption_SecretKeyZ *NONNULL_PTR orig); - public static native long COption_SecretKeyZ_clone(long orig); // struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_ok(struct LDKInvoiceWithExplicitSigningPubkeyBuilder o); public static native long CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_ok(long o); // struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e); @@ -5825,18 +6214,18 @@ public class bindings { public static native long CResult_StfuDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_StfuDecodeErrorZ CResult_StfuDecodeErrorZ_clone(const struct LDKCResult_StfuDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_StfuDecodeErrorZ_clone(long orig); - // struct LDKCResult_SpliceDecodeErrorZ CResult_SpliceDecodeErrorZ_ok(struct LDKSplice o); - public static native long CResult_SpliceDecodeErrorZ_ok(long o); - // struct LDKCResult_SpliceDecodeErrorZ CResult_SpliceDecodeErrorZ_err(struct LDKDecodeError e); - public static native long CResult_SpliceDecodeErrorZ_err(long e); - // bool CResult_SpliceDecodeErrorZ_is_ok(const struct LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR o); - public static native boolean CResult_SpliceDecodeErrorZ_is_ok(long o); - // void CResult_SpliceDecodeErrorZ_free(struct LDKCResult_SpliceDecodeErrorZ _res); - public static native void CResult_SpliceDecodeErrorZ_free(long _res); - // uint64_t CResult_SpliceDecodeErrorZ_clone_ptr(LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR arg); - public static native long CResult_SpliceDecodeErrorZ_clone_ptr(long arg); - // struct LDKCResult_SpliceDecodeErrorZ CResult_SpliceDecodeErrorZ_clone(const struct LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR orig); - public static native long CResult_SpliceDecodeErrorZ_clone(long orig); + // struct LDKCResult_SpliceInitDecodeErrorZ CResult_SpliceInitDecodeErrorZ_ok(struct LDKSpliceInit o); + public static native long CResult_SpliceInitDecodeErrorZ_ok(long o); + // struct LDKCResult_SpliceInitDecodeErrorZ CResult_SpliceInitDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_SpliceInitDecodeErrorZ_err(long e); + // bool CResult_SpliceInitDecodeErrorZ_is_ok(const struct LDKCResult_SpliceInitDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_SpliceInitDecodeErrorZ_is_ok(long o); + // void CResult_SpliceInitDecodeErrorZ_free(struct LDKCResult_SpliceInitDecodeErrorZ _res); + public static native void CResult_SpliceInitDecodeErrorZ_free(long _res); + // uint64_t CResult_SpliceInitDecodeErrorZ_clone_ptr(LDKCResult_SpliceInitDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_SpliceInitDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_SpliceInitDecodeErrorZ CResult_SpliceInitDecodeErrorZ_clone(const struct LDKCResult_SpliceInitDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_SpliceInitDecodeErrorZ_clone(long orig); // struct LDKCResult_SpliceAckDecodeErrorZ CResult_SpliceAckDecodeErrorZ_ok(struct LDKSpliceAck o); public static native long CResult_SpliceAckDecodeErrorZ_ok(long o); // struct LDKCResult_SpliceAckDecodeErrorZ CResult_SpliceAckDecodeErrorZ_err(struct LDKDecodeError e); @@ -6017,6 +6406,18 @@ public class bindings { public static native long CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(long orig); + // struct LDKCResult_CommitmentSignedBatchDecodeErrorZ CResult_CommitmentSignedBatchDecodeErrorZ_ok(struct LDKCommitmentSignedBatch o); + public static native long CResult_CommitmentSignedBatchDecodeErrorZ_ok(long o); + // struct LDKCResult_CommitmentSignedBatchDecodeErrorZ CResult_CommitmentSignedBatchDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_CommitmentSignedBatchDecodeErrorZ_err(long e); + // bool CResult_CommitmentSignedBatchDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentSignedBatchDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_CommitmentSignedBatchDecodeErrorZ_is_ok(long o); + // void CResult_CommitmentSignedBatchDecodeErrorZ_free(struct LDKCResult_CommitmentSignedBatchDecodeErrorZ _res); + public static native void CResult_CommitmentSignedBatchDecodeErrorZ_free(long _res); + // uint64_t CResult_CommitmentSignedBatchDecodeErrorZ_clone_ptr(LDKCResult_CommitmentSignedBatchDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_CommitmentSignedBatchDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_CommitmentSignedBatchDecodeErrorZ CResult_CommitmentSignedBatchDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedBatchDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_CommitmentSignedBatchDecodeErrorZ_clone(long orig); // struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o); public static native long CResult_CommitmentSignedDecodeErrorZ_ok(long o); // struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e); @@ -6401,20 +6802,6 @@ public class bindings { public static native long CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_GossipTimestampFilterDecodeErrorZ_clone(long orig); - // void CVec_PhantomRouteHintsZ_free(struct LDKCVec_PhantomRouteHintsZ _res); - public static native void CVec_PhantomRouteHintsZ_free(long[] _res); - // struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(struct LDKBolt11Invoice o); - public static native long CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(long o); - // struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e); - public static native long CResult_Bolt11InvoiceSignOrCreationErrorZ_err(long e); - // bool CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR o); - public static native boolean CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(long o); - // void CResult_Bolt11InvoiceSignOrCreationErrorZ_free(struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ _res); - public static native void CResult_Bolt11InvoiceSignOrCreationErrorZ_free(long _res); - // uint64_t CResult_Bolt11InvoiceSignOrCreationErrorZ_clone_ptr(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR arg); - public static native long CResult_Bolt11InvoiceSignOrCreationErrorZ_clone_ptr(long arg); - // struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR orig); - public static native long CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(long orig); // struct LDKCOption_InboundHTLCStateDetailsZ COption_InboundHTLCStateDetailsZ_some(enum LDKInboundHTLCStateDetails o); public static native long COption_InboundHTLCStateDetailsZ_some(InboundHTLCStateDetails o); // struct LDKCOption_InboundHTLCStateDetailsZ COption_InboundHTLCStateDetailsZ_none(void); @@ -6547,6 +6934,42 @@ public class bindings { public static native long CResult_ChannelShutdownStateDecodeErrorZ_clone(long orig); // void CVec_FutureZ_free(struct LDKCVec_FutureZ _res); public static native void CVec_FutureZ_free(long[] _res); + // struct LDKCResult_HeldHtlcAvailableDecodeErrorZ CResult_HeldHtlcAvailableDecodeErrorZ_ok(struct LDKHeldHtlcAvailable o); + public static native long CResult_HeldHtlcAvailableDecodeErrorZ_ok(long o); + // struct LDKCResult_HeldHtlcAvailableDecodeErrorZ CResult_HeldHtlcAvailableDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_HeldHtlcAvailableDecodeErrorZ_err(long e); + // bool CResult_HeldHtlcAvailableDecodeErrorZ_is_ok(const struct LDKCResult_HeldHtlcAvailableDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_HeldHtlcAvailableDecodeErrorZ_is_ok(long o); + // void CResult_HeldHtlcAvailableDecodeErrorZ_free(struct LDKCResult_HeldHtlcAvailableDecodeErrorZ _res); + public static native void CResult_HeldHtlcAvailableDecodeErrorZ_free(long _res); + // uint64_t CResult_HeldHtlcAvailableDecodeErrorZ_clone_ptr(LDKCResult_HeldHtlcAvailableDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_HeldHtlcAvailableDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_HeldHtlcAvailableDecodeErrorZ CResult_HeldHtlcAvailableDecodeErrorZ_clone(const struct LDKCResult_HeldHtlcAvailableDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_HeldHtlcAvailableDecodeErrorZ_clone(long orig); + // struct LDKCResult_ReleaseHeldHtlcDecodeErrorZ CResult_ReleaseHeldHtlcDecodeErrorZ_ok(struct LDKReleaseHeldHtlc o); + public static native long CResult_ReleaseHeldHtlcDecodeErrorZ_ok(long o); + // struct LDKCResult_ReleaseHeldHtlcDecodeErrorZ CResult_ReleaseHeldHtlcDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_ReleaseHeldHtlcDecodeErrorZ_err(long e); + // bool CResult_ReleaseHeldHtlcDecodeErrorZ_is_ok(const struct LDKCResult_ReleaseHeldHtlcDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_ReleaseHeldHtlcDecodeErrorZ_is_ok(long o); + // void CResult_ReleaseHeldHtlcDecodeErrorZ_free(struct LDKCResult_ReleaseHeldHtlcDecodeErrorZ _res); + public static native void CResult_ReleaseHeldHtlcDecodeErrorZ_free(long _res); + // uint64_t CResult_ReleaseHeldHtlcDecodeErrorZ_clone_ptr(LDKCResult_ReleaseHeldHtlcDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_ReleaseHeldHtlcDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_ReleaseHeldHtlcDecodeErrorZ CResult_ReleaseHeldHtlcDecodeErrorZ_clone(const struct LDKCResult_ReleaseHeldHtlcDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_ReleaseHeldHtlcDecodeErrorZ_clone(long orig); + // struct LDKCResult_AsyncPaymentsMessageDecodeErrorZ CResult_AsyncPaymentsMessageDecodeErrorZ_ok(struct LDKAsyncPaymentsMessage o); + public static native long CResult_AsyncPaymentsMessageDecodeErrorZ_ok(long o); + // struct LDKCResult_AsyncPaymentsMessageDecodeErrorZ CResult_AsyncPaymentsMessageDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_AsyncPaymentsMessageDecodeErrorZ_err(long e); + // bool CResult_AsyncPaymentsMessageDecodeErrorZ_is_ok(const struct LDKCResult_AsyncPaymentsMessageDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_AsyncPaymentsMessageDecodeErrorZ_is_ok(long o); + // void CResult_AsyncPaymentsMessageDecodeErrorZ_free(struct LDKCResult_AsyncPaymentsMessageDecodeErrorZ _res); + public static native void CResult_AsyncPaymentsMessageDecodeErrorZ_free(long _res); + // uint64_t CResult_AsyncPaymentsMessageDecodeErrorZ_clone_ptr(LDKCResult_AsyncPaymentsMessageDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_AsyncPaymentsMessageDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_AsyncPaymentsMessageDecodeErrorZ CResult_AsyncPaymentsMessageDecodeErrorZ_clone(const struct LDKCResult_AsyncPaymentsMessageDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_AsyncPaymentsMessageDecodeErrorZ_clone(long orig); // struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_ok(struct LDKOffersMessage o); public static native long CResult_OffersMessageDecodeErrorZ_ok(long o); // struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_err(struct LDKDecodeError e); @@ -6737,6 +7160,18 @@ public class bindings { public static native long CResult_ShutdownScriptInvalidShutdownScriptZ_clone(long orig); // void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res); public static native void CVec_TransactionZ_free(byte[][] _res); + // struct LDKCResult_FundingInfoDecodeErrorZ CResult_FundingInfoDecodeErrorZ_ok(struct LDKFundingInfo o); + public static native long CResult_FundingInfoDecodeErrorZ_ok(long o); + // struct LDKCResult_FundingInfoDecodeErrorZ CResult_FundingInfoDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_FundingInfoDecodeErrorZ_err(long e); + // bool CResult_FundingInfoDecodeErrorZ_is_ok(const struct LDKCResult_FundingInfoDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_FundingInfoDecodeErrorZ_is_ok(long o); + // void CResult_FundingInfoDecodeErrorZ_free(struct LDKCResult_FundingInfoDecodeErrorZ _res); + public static native void CResult_FundingInfoDecodeErrorZ_free(long _res); + // uint64_t CResult_FundingInfoDecodeErrorZ_clone_ptr(LDKCResult_FundingInfoDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_FundingInfoDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_FundingInfoDecodeErrorZ CResult_FundingInfoDecodeErrorZ_clone(const struct LDKCResult_FundingInfoDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_FundingInfoDecodeErrorZ_clone(long orig); // struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_ok(struct LDKPaymentPurpose o); public static native long CResult_PaymentPurposeDecodeErrorZ_ok(long o); // struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_err(struct LDKDecodeError e); @@ -6827,18 +7262,28 @@ public class bindings { public static native long CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_clone(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_COption_HTLCDestinationZDecodeErrorZ_clone(long orig); - // struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_ok(enum LDKPaymentFailureReason o); - public static native long CResult_PaymentFailureReasonDecodeErrorZ_ok(PaymentFailureReason o); - // struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_err(struct LDKDecodeError e); - public static native long CResult_PaymentFailureReasonDecodeErrorZ_err(long e); - // bool CResult_PaymentFailureReasonDecodeErrorZ_is_ok(const struct LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR o); - public static native boolean CResult_PaymentFailureReasonDecodeErrorZ_is_ok(long o); - // void CResult_PaymentFailureReasonDecodeErrorZ_free(struct LDKCResult_PaymentFailureReasonDecodeErrorZ _res); - public static native void CResult_PaymentFailureReasonDecodeErrorZ_free(long _res); - // uint64_t CResult_PaymentFailureReasonDecodeErrorZ_clone_ptr(LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR arg); - public static native long CResult_PaymentFailureReasonDecodeErrorZ_clone_ptr(long arg); - // struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_clone(const struct LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR orig); - public static native long CResult_PaymentFailureReasonDecodeErrorZ_clone(long orig); + // struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_some(enum LDKPaymentFailureReason o); + public static native long COption_PaymentFailureReasonZ_some(PaymentFailureReason o); + // struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_none(void); + public static native long COption_PaymentFailureReasonZ_none(); + // void COption_PaymentFailureReasonZ_free(struct LDKCOption_PaymentFailureReasonZ _res); + public static native void COption_PaymentFailureReasonZ_free(long _res); + // uint64_t COption_PaymentFailureReasonZ_clone_ptr(LDKCOption_PaymentFailureReasonZ *NONNULL_PTR arg); + public static native long COption_PaymentFailureReasonZ_clone_ptr(long arg); + // struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_clone(const struct LDKCOption_PaymentFailureReasonZ *NONNULL_PTR orig); + public static native long COption_PaymentFailureReasonZ_clone(long orig); + // struct LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ CResult_COption_PaymentFailureReasonZDecodeErrorZ_ok(struct LDKCOption_PaymentFailureReasonZ o); + public static native long CResult_COption_PaymentFailureReasonZDecodeErrorZ_ok(long o); + // struct LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ CResult_COption_PaymentFailureReasonZDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_COption_PaymentFailureReasonZDecodeErrorZ_err(long e); + // bool CResult_COption_PaymentFailureReasonZDecodeErrorZ_is_ok(const struct LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_COption_PaymentFailureReasonZDecodeErrorZ_is_ok(long o); + // void CResult_COption_PaymentFailureReasonZDecodeErrorZ_free(struct LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ _res); + public static native void CResult_COption_PaymentFailureReasonZDecodeErrorZ_free(long _res); + // uint64_t CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone_ptr(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone(const struct LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone(long orig); // struct LDKCOption_U128Z COption_U128Z_some(struct LDKU128 o); public static native long COption_U128Z_some(byte[] o); // struct LDKCOption_U128Z COption_U128Z_none(void); @@ -6851,16 +7296,6 @@ public class bindings { public static native long COption_U128Z_clone(long orig); // void CVec_ClaimedHTLCZ_free(struct LDKCVec_ClaimedHTLCZ _res); public static native void CVec_ClaimedHTLCZ_free(long[] _res); - // struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_some(enum LDKPaymentFailureReason o); - public static native long COption_PaymentFailureReasonZ_some(PaymentFailureReason o); - // struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_none(void); - public static native long COption_PaymentFailureReasonZ_none(); - // void COption_PaymentFailureReasonZ_free(struct LDKCOption_PaymentFailureReasonZ _res); - public static native void COption_PaymentFailureReasonZ_free(long _res); - // uint64_t COption_PaymentFailureReasonZ_clone_ptr(LDKCOption_PaymentFailureReasonZ *NONNULL_PTR arg); - public static native long COption_PaymentFailureReasonZ_clone_ptr(long arg); - // struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_clone(const struct LDKCOption_PaymentFailureReasonZ *NONNULL_PTR orig); - public static native long COption_PaymentFailureReasonZ_clone(long orig); // struct LDKCOption_EventZ COption_EventZ_some(struct LDKEvent o); public static native long COption_EventZ_some(long o); // struct LDKCOption_EventZ COption_EventZ_none(void); @@ -6883,6 +7318,20 @@ public class bindings { public static native long CResult_COption_EventZDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_clone(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_COption_EventZDecodeErrorZ_clone(long orig); + // struct LDKCResult_NonceDecodeErrorZ CResult_NonceDecodeErrorZ_ok(struct LDKNonce o); + public static native long CResult_NonceDecodeErrorZ_ok(long o); + // struct LDKCResult_NonceDecodeErrorZ CResult_NonceDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_NonceDecodeErrorZ_err(long e); + // bool CResult_NonceDecodeErrorZ_is_ok(const struct LDKCResult_NonceDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_NonceDecodeErrorZ_is_ok(long o); + // void CResult_NonceDecodeErrorZ_free(struct LDKCResult_NonceDecodeErrorZ _res); + public static native void CResult_NonceDecodeErrorZ_free(long _res); + // uint64_t CResult_NonceDecodeErrorZ_clone_ptr(LDKCResult_NonceDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_NonceDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_NonceDecodeErrorZ CResult_NonceDecodeErrorZ_clone(const struct LDKCResult_NonceDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_NonceDecodeErrorZ_clone(long orig); + // void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res); + public static native void CVec_RouteHintHopZ_free(long[] _res); // struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_ok(enum LDKSiPrefix o); public static native long CResult_SiPrefixBolt11ParseErrorZ_ok(SiPrefix o); // struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_err(struct LDKBolt11ParseError e); @@ -7025,6 +7474,18 @@ public class bindings { public static native long CResult_BigSizeDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_clone(const struct LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_BigSizeDecodeErrorZ_clone(long orig); + // struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_ok(struct LDKUntrustedString o); + public static native long CResult_UntrustedStringDecodeErrorZ_ok(long o); + // struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_UntrustedStringDecodeErrorZ_err(long e); + // bool CResult_UntrustedStringDecodeErrorZ_is_ok(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_UntrustedStringDecodeErrorZ_is_ok(long o); + // void CResult_UntrustedStringDecodeErrorZ_free(struct LDKCResult_UntrustedStringDecodeErrorZ _res); + public static native void CResult_UntrustedStringDecodeErrorZ_free(long _res); + // uint64_t CResult_UntrustedStringDecodeErrorZ_clone_ptr(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_UntrustedStringDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_clone(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_UntrustedStringDecodeErrorZ_clone(long orig); // struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_ok(struct LDKHostname o); public static native long CResult_HostnameDecodeErrorZ_ok(long o); // struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_err(struct LDKDecodeError e); @@ -7061,18 +7522,6 @@ public class bindings { public static native long CResult_TransactionU16LenLimitedDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_clone(const struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_TransactionU16LenLimitedDecodeErrorZ_clone(long orig); - // struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_ok(struct LDKUntrustedString o); - public static native long CResult_UntrustedStringDecodeErrorZ_ok(long o); - // struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_err(struct LDKDecodeError e); - public static native long CResult_UntrustedStringDecodeErrorZ_err(long e); - // bool CResult_UntrustedStringDecodeErrorZ_is_ok(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR o); - public static native boolean CResult_UntrustedStringDecodeErrorZ_is_ok(long o); - // void CResult_UntrustedStringDecodeErrorZ_free(struct LDKCResult_UntrustedStringDecodeErrorZ _res); - public static native void CResult_UntrustedStringDecodeErrorZ_free(long _res); - // uint64_t CResult_UntrustedStringDecodeErrorZ_clone_ptr(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR arg); - public static native long CResult_UntrustedStringDecodeErrorZ_clone_ptr(long arg); - // struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_clone(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR orig); - public static native long CResult_UntrustedStringDecodeErrorZ_clone(long orig); // struct LDKCResult_ChannelIdDecodeErrorZ CResult_ChannelIdDecodeErrorZ_ok(struct LDKChannelId o); public static native long CResult_ChannelIdDecodeErrorZ_ok(long o); // struct LDKCResult_ChannelIdDecodeErrorZ CResult_ChannelIdDecodeErrorZ_err(struct LDKDecodeError e); @@ -7093,6 +7542,32 @@ public class bindings { public static native long C2Tuple__u832u16Z_new(byte[] a, short b); // void C2Tuple__u832u16Z_free(struct LDKC2Tuple__u832u16Z _res); public static native void C2Tuple__u832u16Z_free(long _res); + // struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_ok(struct LDKBlindedPayInfo o); + public static native long CResult_BlindedPayInfoDecodeErrorZ_ok(long o); + // struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_BlindedPayInfoDecodeErrorZ_err(long e); + // bool CResult_BlindedPayInfoDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_BlindedPayInfoDecodeErrorZ_is_ok(long o); + // void CResult_BlindedPayInfoDecodeErrorZ_free(struct LDKCResult_BlindedPayInfoDecodeErrorZ _res); + public static native void CResult_BlindedPayInfoDecodeErrorZ_free(long _res); + // uint64_t CResult_BlindedPayInfoDecodeErrorZ_clone_ptr(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_BlindedPayInfoDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_clone(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_BlindedPayInfoDecodeErrorZ_clone(long orig); + // struct LDKCResult_BlindedPaymentPathNoneZ CResult_BlindedPaymentPathNoneZ_ok(struct LDKBlindedPaymentPath o); + public static native long CResult_BlindedPaymentPathNoneZ_ok(long o); + // struct LDKCResult_BlindedPaymentPathNoneZ CResult_BlindedPaymentPathNoneZ_err(void); + public static native long CResult_BlindedPaymentPathNoneZ_err(); + // bool CResult_BlindedPaymentPathNoneZ_is_ok(const struct LDKCResult_BlindedPaymentPathNoneZ *NONNULL_PTR o); + public static native boolean CResult_BlindedPaymentPathNoneZ_is_ok(long o); + // void CResult_BlindedPaymentPathNoneZ_free(struct LDKCResult_BlindedPaymentPathNoneZ _res); + public static native void CResult_BlindedPaymentPathNoneZ_free(long _res); + // uint64_t CResult_BlindedPaymentPathNoneZ_clone_ptr(LDKCResult_BlindedPaymentPathNoneZ *NONNULL_PTR arg); + public static native long CResult_BlindedPaymentPathNoneZ_clone_ptr(long arg); + // struct LDKCResult_BlindedPaymentPathNoneZ CResult_BlindedPaymentPathNoneZ_clone(const struct LDKCResult_BlindedPaymentPathNoneZ *NONNULL_PTR orig); + public static native long CResult_BlindedPaymentPathNoneZ_clone(long orig); + // void CVec_PaymentForwardNodeZ_free(struct LDKCVec_PaymentForwardNodeZ _res); + public static native void CVec_PaymentForwardNodeZ_free(long[] _res); // struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_ok(struct LDKPaymentRelay o); public static native long CResult_PaymentRelayDecodeErrorZ_ok(long o); // struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_err(struct LDKDecodeError e); @@ -7165,38 +7640,6 @@ public class bindings { public static native long CResult_Bolt12RefundContextDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_Bolt12RefundContextDecodeErrorZ CResult_Bolt12RefundContextDecodeErrorZ_clone(const struct LDKCResult_Bolt12RefundContextDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_Bolt12RefundContextDecodeErrorZ_clone(long orig); - // struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_ok(struct LDKStr o); - public static native long CResult_StrSecp256k1ErrorZ_ok(String o); - // struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_err(enum LDKSecp256k1Error e); - public static native long CResult_StrSecp256k1ErrorZ_err(Secp256k1Error e); - // bool CResult_StrSecp256k1ErrorZ_is_ok(const struct LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR o); - public static native boolean CResult_StrSecp256k1ErrorZ_is_ok(long o); - // void CResult_StrSecp256k1ErrorZ_free(struct LDKCResult_StrSecp256k1ErrorZ _res); - public static native void CResult_StrSecp256k1ErrorZ_free(long _res); - // uint64_t CResult_StrSecp256k1ErrorZ_clone_ptr(LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR arg); - public static native long CResult_StrSecp256k1ErrorZ_clone_ptr(long arg); - // struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_clone(const struct LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR orig); - public static native long CResult_StrSecp256k1ErrorZ_clone(long orig); - // uint64_t C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone_ptr(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR arg); - public static native long C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone_ptr(long arg); - // struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(const struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR orig); - public static native long C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(long orig); - // struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new(struct LDKThirtyTwoBytes a, struct LDKRecipientOnionFields b, struct LDKRouteParameters c); - public static native long C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new(byte[] a, long b, long c); - // void C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ _res); - public static native void C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(long _res); - // struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok(struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ o); - public static native long CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok(long o); - // struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err(void); - public static native long CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err(); - // bool CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok(const struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR o); - public static native boolean CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok(long o); - // void CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ _res); - public static native void CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(long _res); - // uint64_t CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone_ptr(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR arg); - public static native long CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone_ptr(long arg); - // struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone(const struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR orig); - public static native long CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone(long orig); // struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_ok(struct LDKTxOut o); public static native long CResult_TxOutUtxoLookupErrorZ_ok(long o); // struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_err(enum LDKUtxoLookupError e); @@ -7209,6 +7652,28 @@ public class bindings { public static native long CResult_TxOutUtxoLookupErrorZ_clone_ptr(long arg); // struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_clone(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR orig); public static native long CResult_TxOutUtxoLookupErrorZ_clone(long orig); + // struct LDKCResult_ResponderDecodeErrorZ CResult_ResponderDecodeErrorZ_ok(struct LDKResponder o); + public static native long CResult_ResponderDecodeErrorZ_ok(long o); + // struct LDKCResult_ResponderDecodeErrorZ CResult_ResponderDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_ResponderDecodeErrorZ_err(long e); + // bool CResult_ResponderDecodeErrorZ_is_ok(const struct LDKCResult_ResponderDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_ResponderDecodeErrorZ_is_ok(long o); + // void CResult_ResponderDecodeErrorZ_free(struct LDKCResult_ResponderDecodeErrorZ _res); + public static native void CResult_ResponderDecodeErrorZ_free(long _res); + // uint64_t CResult_ResponderDecodeErrorZ_clone_ptr(LDKCResult_ResponderDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_ResponderDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_ResponderDecodeErrorZ CResult_ResponderDecodeErrorZ_clone(const struct LDKCResult_ResponderDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_ResponderDecodeErrorZ_clone(long orig); + // struct LDKCOption_MessageContextZ COption_MessageContextZ_some(struct LDKMessageContext o); + public static native long COption_MessageContextZ_some(long o); + // struct LDKCOption_MessageContextZ COption_MessageContextZ_none(void); + public static native long COption_MessageContextZ_none(); + // void COption_MessageContextZ_free(struct LDKCOption_MessageContextZ _res); + public static native void COption_MessageContextZ_free(long _res); + // uint64_t COption_MessageContextZ_clone_ptr(LDKCOption_MessageContextZ *NONNULL_PTR arg); + public static native long COption_MessageContextZ_clone_ptr(long arg); + // struct LDKCOption_MessageContextZ COption_MessageContextZ_clone(const struct LDKCOption_MessageContextZ *NONNULL_PTR orig); + public static native long COption_MessageContextZ_clone(long orig); // uint64_t C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone_ptr(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *NONNULL_PTR arg); public static native long C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone_ptr(long arg); // struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone(const struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *NONNULL_PTR orig); @@ -7253,44 +7718,18 @@ public class bindings { public static native long CResult_SendSuccessSendErrorZ_clone_ptr(long arg); // struct LDKCResult_SendSuccessSendErrorZ CResult_SendSuccessSendErrorZ_clone(const struct LDKCResult_SendSuccessSendErrorZ *NONNULL_PTR orig); public static native long CResult_SendSuccessSendErrorZ_clone(long orig); - // struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_ok(struct LDKBlindedPath o); - public static native long CResult_BlindedPathNoneZ_ok(long o); - // struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_err(void); - public static native long CResult_BlindedPathNoneZ_err(); - // bool CResult_BlindedPathNoneZ_is_ok(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR o); - public static native boolean CResult_BlindedPathNoneZ_is_ok(long o); - // void CResult_BlindedPathNoneZ_free(struct LDKCResult_BlindedPathNoneZ _res); - public static native void CResult_BlindedPathNoneZ_free(long _res); - // uint64_t CResult_BlindedPathNoneZ_clone_ptr(LDKCResult_BlindedPathNoneZ *NONNULL_PTR arg); - public static native long CResult_BlindedPathNoneZ_clone_ptr(long arg); - // struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_clone(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR orig); - public static native long CResult_BlindedPathNoneZ_clone(long orig); - // struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_ok(struct LDKC2Tuple_BlindedPayInfoBlindedPathZ o); - public static native long CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_ok(long o); - // struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_err(void); - public static native long CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_err(); - // bool CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_is_ok(const struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR o); - public static native boolean CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_is_ok(long o); - // void CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free(struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ _res); - public static native void CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free(long _res); - // uint64_t CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone_ptr(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR arg); - public static native long CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone_ptr(long arg); - // struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(const struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR orig); - public static native long CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(long orig); - // void CVec_ForwardNodeZ_free(struct LDKCVec_ForwardNodeZ _res); - public static native void CVec_ForwardNodeZ_free(long[] _res); - // struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_ok(struct LDKBlindedPath o); - public static native long CResult_BlindedPathDecodeErrorZ_ok(long o); - // struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_err(struct LDKDecodeError e); - public static native long CResult_BlindedPathDecodeErrorZ_err(long e); - // bool CResult_BlindedPathDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR o); - public static native boolean CResult_BlindedPathDecodeErrorZ_is_ok(long o); - // void CResult_BlindedPathDecodeErrorZ_free(struct LDKCResult_BlindedPathDecodeErrorZ _res); - public static native void CResult_BlindedPathDecodeErrorZ_free(long _res); - // uint64_t CResult_BlindedPathDecodeErrorZ_clone_ptr(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR arg); - public static native long CResult_BlindedPathDecodeErrorZ_clone_ptr(long arg); - // struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_clone(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR orig); - public static native long CResult_BlindedPathDecodeErrorZ_clone(long orig); + // struct LDKCResult_NoneSendErrorZ CResult_NoneSendErrorZ_ok(void); + public static native long CResult_NoneSendErrorZ_ok(); + // struct LDKCResult_NoneSendErrorZ CResult_NoneSendErrorZ_err(struct LDKSendError e); + public static native long CResult_NoneSendErrorZ_err(long e); + // bool CResult_NoneSendErrorZ_is_ok(const struct LDKCResult_NoneSendErrorZ *NONNULL_PTR o); + public static native boolean CResult_NoneSendErrorZ_is_ok(long o); + // void CResult_NoneSendErrorZ_free(struct LDKCResult_NoneSendErrorZ _res); + public static native void CResult_NoneSendErrorZ_free(long _res); + // uint64_t CResult_NoneSendErrorZ_clone_ptr(LDKCResult_NoneSendErrorZ *NONNULL_PTR arg); + public static native long CResult_NoneSendErrorZ_clone_ptr(long arg); + // struct LDKCResult_NoneSendErrorZ CResult_NoneSendErrorZ_clone(const struct LDKCResult_NoneSendErrorZ *NONNULL_PTR orig); + public static native long CResult_NoneSendErrorZ_clone(long orig); // struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_ok(struct LDKBlindedHop o); public static native long CResult_BlindedHopDecodeErrorZ_ok(long o); // struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_err(struct LDKDecodeError e); @@ -7303,6 +7742,20 @@ public class bindings { public static native long CResult_BlindedHopDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_clone(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_BlindedHopDecodeErrorZ_clone(long orig); + // void CVec_PhantomRouteHintsZ_free(struct LDKCVec_PhantomRouteHintsZ _res); + public static native void CVec_PhantomRouteHintsZ_free(long[] _res); + // struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(struct LDKBolt11Invoice o); + public static native long CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(long o); + // struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e); + public static native long CResult_Bolt11InvoiceSignOrCreationErrorZ_err(long e); + // bool CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR o); + public static native boolean CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(long o); + // void CResult_Bolt11InvoiceSignOrCreationErrorZ_free(struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ _res); + public static native void CResult_Bolt11InvoiceSignOrCreationErrorZ_free(long _res); + // uint64_t CResult_Bolt11InvoiceSignOrCreationErrorZ_clone_ptr(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR arg); + public static native long CResult_Bolt11InvoiceSignOrCreationErrorZ_clone_ptr(long arg); + // struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR orig); + public static native long CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(long orig); // struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_ok(struct LDKInvoiceError o); public static native long CResult_InvoiceErrorDecodeErrorZ_ok(long o); // struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_err(struct LDKDecodeError e); @@ -7457,18 +7910,64 @@ public class bindings { public static native void C2Tuple_OutPointChannelIdZ_free(long _res); // void CVec_C2Tuple_OutPointChannelIdZZ_free(struct LDKCVec_C2Tuple_OutPointChannelIdZZ _res); public static native void CVec_C2Tuple_OutPointChannelIdZZ_free(long[] _res); - // void CVec_MonitorUpdateIdZ_free(struct LDKCVec_MonitorUpdateIdZ _res); - public static native void CVec_MonitorUpdateIdZ_free(long[] _res); - // uint64_t C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR arg); - public static native long C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(long arg); - // struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(const struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR orig); - public static native long C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(long orig); - // struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorUpdateIdZ b); - public static native long C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(long a, long[] b); - // void C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res); - public static native void C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(long _res); - // void CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ _res); - public static native void CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(long[] _res); + // uint64_t C2Tuple_OutPointCVec_u64ZZ_clone_ptr(LDKC2Tuple_OutPointCVec_u64ZZ *NONNULL_PTR arg); + public static native long C2Tuple_OutPointCVec_u64ZZ_clone_ptr(long arg); + // struct LDKC2Tuple_OutPointCVec_u64ZZ C2Tuple_OutPointCVec_u64ZZ_clone(const struct LDKC2Tuple_OutPointCVec_u64ZZ *NONNULL_PTR orig); + public static native long C2Tuple_OutPointCVec_u64ZZ_clone(long orig); + // struct LDKC2Tuple_OutPointCVec_u64ZZ C2Tuple_OutPointCVec_u64ZZ_new(struct LDKOutPoint a, struct LDKCVec_u64Z b); + public static native long C2Tuple_OutPointCVec_u64ZZ_new(long a, long[] b); + // void C2Tuple_OutPointCVec_u64ZZ_free(struct LDKC2Tuple_OutPointCVec_u64ZZ _res); + public static native void C2Tuple_OutPointCVec_u64ZZ_free(long _res); + // void CVec_C2Tuple_OutPointCVec_u64ZZZ_free(struct LDKCVec_C2Tuple_OutPointCVec_u64ZZZ _res); + public static native void CVec_C2Tuple_OutPointCVec_u64ZZZ_free(long[] _res); + // struct LDKCResult_BlindedMessagePathDecodeErrorZ CResult_BlindedMessagePathDecodeErrorZ_ok(struct LDKBlindedMessagePath o); + public static native long CResult_BlindedMessagePathDecodeErrorZ_ok(long o); + // struct LDKCResult_BlindedMessagePathDecodeErrorZ CResult_BlindedMessagePathDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_BlindedMessagePathDecodeErrorZ_err(long e); + // bool CResult_BlindedMessagePathDecodeErrorZ_is_ok(const struct LDKCResult_BlindedMessagePathDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_BlindedMessagePathDecodeErrorZ_is_ok(long o); + // void CResult_BlindedMessagePathDecodeErrorZ_free(struct LDKCResult_BlindedMessagePathDecodeErrorZ _res); + public static native void CResult_BlindedMessagePathDecodeErrorZ_free(long _res); + // uint64_t CResult_BlindedMessagePathDecodeErrorZ_clone_ptr(LDKCResult_BlindedMessagePathDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_BlindedMessagePathDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_BlindedMessagePathDecodeErrorZ CResult_BlindedMessagePathDecodeErrorZ_clone(const struct LDKCResult_BlindedMessagePathDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_BlindedMessagePathDecodeErrorZ_clone(long orig); + // struct LDKCResult_BlindedMessagePathNoneZ CResult_BlindedMessagePathNoneZ_ok(struct LDKBlindedMessagePath o); + public static native long CResult_BlindedMessagePathNoneZ_ok(long o); + // struct LDKCResult_BlindedMessagePathNoneZ CResult_BlindedMessagePathNoneZ_err(void); + public static native long CResult_BlindedMessagePathNoneZ_err(); + // bool CResult_BlindedMessagePathNoneZ_is_ok(const struct LDKCResult_BlindedMessagePathNoneZ *NONNULL_PTR o); + public static native boolean CResult_BlindedMessagePathNoneZ_is_ok(long o); + // void CResult_BlindedMessagePathNoneZ_free(struct LDKCResult_BlindedMessagePathNoneZ _res); + public static native void CResult_BlindedMessagePathNoneZ_free(long _res); + // uint64_t CResult_BlindedMessagePathNoneZ_clone_ptr(LDKCResult_BlindedMessagePathNoneZ *NONNULL_PTR arg); + public static native long CResult_BlindedMessagePathNoneZ_clone_ptr(long arg); + // struct LDKCResult_BlindedMessagePathNoneZ CResult_BlindedMessagePathNoneZ_clone(const struct LDKCResult_BlindedMessagePathNoneZ *NONNULL_PTR orig); + public static native long CResult_BlindedMessagePathNoneZ_clone(long orig); + // struct LDKCResult_MessageContextDecodeErrorZ CResult_MessageContextDecodeErrorZ_ok(struct LDKMessageContext o); + public static native long CResult_MessageContextDecodeErrorZ_ok(long o); + // struct LDKCResult_MessageContextDecodeErrorZ CResult_MessageContextDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_MessageContextDecodeErrorZ_err(long e); + // bool CResult_MessageContextDecodeErrorZ_is_ok(const struct LDKCResult_MessageContextDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_MessageContextDecodeErrorZ_is_ok(long o); + // void CResult_MessageContextDecodeErrorZ_free(struct LDKCResult_MessageContextDecodeErrorZ _res); + public static native void CResult_MessageContextDecodeErrorZ_free(long _res); + // uint64_t CResult_MessageContextDecodeErrorZ_clone_ptr(LDKCResult_MessageContextDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_MessageContextDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_MessageContextDecodeErrorZ CResult_MessageContextDecodeErrorZ_clone(const struct LDKCResult_MessageContextDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_MessageContextDecodeErrorZ_clone(long orig); + // struct LDKCResult_OffersContextDecodeErrorZ CResult_OffersContextDecodeErrorZ_ok(struct LDKOffersContext o); + public static native long CResult_OffersContextDecodeErrorZ_ok(long o); + // struct LDKCResult_OffersContextDecodeErrorZ CResult_OffersContextDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_OffersContextDecodeErrorZ_err(long e); + // bool CResult_OffersContextDecodeErrorZ_is_ok(const struct LDKCResult_OffersContextDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_OffersContextDecodeErrorZ_is_ok(long o); + // void CResult_OffersContextDecodeErrorZ_free(struct LDKCResult_OffersContextDecodeErrorZ _res); + public static native void CResult_OffersContextDecodeErrorZ_free(long _res); + // uint64_t CResult_OffersContextDecodeErrorZ_clone_ptr(LDKCResult_OffersContextDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_OffersContextDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_OffersContextDecodeErrorZ CResult_OffersContextDecodeErrorZ_clone(const struct LDKCResult_OffersContextDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_OffersContextDecodeErrorZ_clone(long orig); // void APIError_free(struct LDKAPIError this_ptr); public static native void APIError_free(long this_ptr); // uint64_t APIError_clone_ptr(LDKAPIError *NONNULL_PTR arg); @@ -7513,6 +8012,10 @@ public class bindings { public static native byte[] BigSize_write(long obj); // struct LDKCResult_BigSizeDecodeErrorZ BigSize_read(struct LDKu8slice ser); public static native long BigSize_read(byte[] ser); + // struct LDKCVec_u8Z UntrustedString_write(const struct LDKUntrustedString *NONNULL_PTR obj); + public static native byte[] UntrustedString_write(long obj); + // struct LDKCResult_UntrustedStringDecodeErrorZ UntrustedString_read(struct LDKu8slice ser); + public static native long UntrustedString_read(byte[] ser); // void Hostname_free(struct LDKHostname this_obj); public static native void Hostname_free(long this_obj); // uint64_t Hostname_clone_ptr(LDKHostname *NONNULL_PTR arg); @@ -7551,14 +8054,12 @@ public class bindings { public static native byte[] TransactionU16LenLimited_write(long obj); // struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ TransactionU16LenLimited_read(struct LDKu8slice ser); public static native long TransactionU16LenLimited_read(byte[] ser); - // struct LDKCResult_StrSecp256k1ErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]); - public static native long sign(byte[] msg, byte[] sk); + // struct LDKStr sign(struct LDKu8slice msg, const uint8_t (*sk)[32]); + public static native String sign(byte[] msg, byte[] sk); // struct LDKCResult_PublicKeySecp256k1ErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig); public static native long recover_pk(byte[] msg, String sig); // bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk); public static native boolean verify(byte[] msg, String sig, byte[] pk); - // struct LDKCVec_u8Z construct_invoice_preimage(struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z data_without_signature); - public static native byte[] construct_invoice_preimage(byte[] hrp_bytes, byte[] data_without_signature); // void KVStore_free(struct LDKKVStore this_ptr); public static native void KVStore_free(long this_ptr); // void Persister_free(struct LDKPersister this_ptr); @@ -7567,12 +8068,12 @@ public class bindings { public static native long read_channel_monitors(long kv_store, long entropy_source, long signer_provider); // void MonitorUpdatingPersister_free(struct LDKMonitorUpdatingPersister this_obj); public static native void MonitorUpdatingPersister_free(long this_obj); - // 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); - public static native long MonitorUpdatingPersister_new(long kv_store, long logger, long maximum_pending_updates, long entropy_source, long signer_provider); - // 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); - public static native long MonitorUpdatingPersister_read_all_channel_monitors_with_updates(long this_arg, long broadcaster, long fee_estimator); - // 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); - public static native long MonitorUpdatingPersister_read_channel_monitor_with_updates(long this_arg, long broadcaster, long fee_estimator, String monitor_key); + // 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, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator); + public static native long MonitorUpdatingPersister_new(long kv_store, long logger, long maximum_pending_updates, long entropy_source, long signer_provider, long broadcaster, long fee_estimator); + // MUST_USE_RES struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ MonitorUpdatingPersister_read_all_channel_monitors_with_updates(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg); + public static native long MonitorUpdatingPersister_read_all_channel_monitors_with_updates(long this_arg); + // MUST_USE_RES struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ MonitorUpdatingPersister_read_channel_monitor_with_updates(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg, struct LDKStr monitor_key); + public static native long MonitorUpdatingPersister_read_channel_monitor_with_updates(long this_arg, String monitor_key); // MUST_USE_RES struct LDKCResult_NoneIOErrorZ MonitorUpdatingPersister_cleanup_stale_updates(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg, bool lazy); public static native long MonitorUpdatingPersister_cleanup_stale_updates(long this_arg, boolean lazy); // struct LDKPersist MonitorUpdatingPersister_as_Persist(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg); @@ -7595,38 +8096,6 @@ public class bindings { public static native short vout_from_scid(long short_channel_id); // struct LDKCResult_u64ShortChannelIdErrorZ scid_from_parts(uint64_t block, uint64_t tx_index, uint64_t vout_index); public static native long scid_from_parts(long block, long tx_index, long vout_index); - // void UntrustedString_free(struct LDKUntrustedString this_obj); - public static native void UntrustedString_free(long this_obj); - // struct LDKStr UntrustedString_get_a(const struct LDKUntrustedString *NONNULL_PTR this_ptr); - public static native String UntrustedString_get_a(long this_ptr); - // void UntrustedString_set_a(struct LDKUntrustedString *NONNULL_PTR this_ptr, struct LDKStr val); - public static native void UntrustedString_set_a(long this_ptr, String val); - // MUST_USE_RES struct LDKUntrustedString UntrustedString_new(struct LDKStr a_arg); - public static native long UntrustedString_new(String a_arg); - // uint64_t UntrustedString_clone_ptr(LDKUntrustedString *NONNULL_PTR arg); - public static native long UntrustedString_clone_ptr(long arg); - // struct LDKUntrustedString UntrustedString_clone(const struct LDKUntrustedString *NONNULL_PTR orig); - public static native long UntrustedString_clone(long orig); - // bool UntrustedString_eq(const struct LDKUntrustedString *NONNULL_PTR a, const struct LDKUntrustedString *NONNULL_PTR b); - public static native boolean UntrustedString_eq(long a, long b); - // uint64_t UntrustedString_hash(const struct LDKUntrustedString *NONNULL_PTR o); - public static native long UntrustedString_hash(long o); - // struct LDKCVec_u8Z UntrustedString_write(const struct LDKUntrustedString *NONNULL_PTR obj); - public static native byte[] UntrustedString_write(long obj); - // struct LDKCResult_UntrustedStringDecodeErrorZ UntrustedString_read(struct LDKu8slice ser); - public static native long UntrustedString_read(byte[] ser); - // struct LDKStr UntrustedString_to_str(const struct LDKUntrustedString *NONNULL_PTR o); - public static native String UntrustedString_to_str(long o); - // void PrintableString_free(struct LDKPrintableString this_obj); - public static native void PrintableString_free(long this_obj); - // struct LDKStr PrintableString_get_a(const struct LDKPrintableString *NONNULL_PTR this_ptr); - public static native String PrintableString_get_a(long this_ptr); - // void PrintableString_set_a(struct LDKPrintableString *NONNULL_PTR this_ptr, struct LDKStr val); - public static native void PrintableString_set_a(long this_ptr, String val); - // MUST_USE_RES struct LDKPrintableString PrintableString_new(struct LDKStr a_arg); - public static native long PrintableString_new(String a_arg); - // struct LDKStr PrintableString_to_str(const struct LDKPrintableString *NONNULL_PTR o); - public static native String PrintableString_to_str(long o); // void TrackedSpendableOutput_free(struct LDKTrackedSpendableOutput this_obj); public static native void TrackedSpendableOutput_free(long this_obj); // struct LDKSpendableOutputDescriptor TrackedSpendableOutput_get_descriptor(const struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr); @@ -7717,6 +8186,8 @@ public class bindings { public static native long Sleeper_from_single_future(long future); // MUST_USE_RES struct LDKSleeper Sleeper_from_two_futures(const struct LDKFuture *NONNULL_PTR fut_a, const struct LDKFuture *NONNULL_PTR fut_b); public static native long Sleeper_from_two_futures(long fut_a, long fut_b); + // MUST_USE_RES struct LDKSleeper Sleeper_from_three_futures(const struct LDKFuture *NONNULL_PTR fut_a, const struct LDKFuture *NONNULL_PTR fut_b, const struct LDKFuture *NONNULL_PTR fut_c); + public static native long Sleeper_from_three_futures(long fut_a, long fut_b, long fut_c); // MUST_USE_RES struct LDKSleeper Sleeper_new(struct LDKCVec_FutureZ futures); public static native long Sleeper_new(long[] futures); // void Sleeper_wait(const struct LDKSleeper *NONNULL_PTR this_arg); @@ -7775,8 +8246,12 @@ public class bindings { public static native int Record_get_line(long this_ptr); // void Record_set_line(struct LDKRecord *NONNULL_PTR this_ptr, uint32_t val); public static native void Record_set_line(long this_ptr, int val); - // 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); - public static native long Record_new(Level level_arg, byte[] peer_id_arg, long channel_id_arg, String args_arg, String module_path_arg, String file_arg, int line_arg); + // struct LDKCOption_ThirtyTwoBytesZ Record_get_payment_hash(const struct LDKRecord *NONNULL_PTR this_ptr); + public static native long Record_get_payment_hash(long this_ptr); + // void Record_set_payment_hash(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val); + public static native void Record_set_payment_hash(long this_ptr, long val); + // 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, struct LDKCOption_ThirtyTwoBytesZ payment_hash_arg); + public static native long Record_new(Level level_arg, byte[] peer_id_arg, long channel_id_arg, String args_arg, String module_path_arg, String file_arg, int line_arg, long payment_hash_arg); // uint64_t Record_clone_ptr(LDKRecord *NONNULL_PTR arg); public static native long Record_clone_ptr(long arg); // struct LDKRecord Record_clone(const struct LDKRecord *NONNULL_PTR orig); @@ -7805,10 +8280,10 @@ public class bindings { public static native boolean ChannelHandshakeConfig_get_negotiate_scid_privacy(long this_ptr); // void ChannelHandshakeConfig_set_negotiate_scid_privacy(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val); public static native void ChannelHandshakeConfig_set_negotiate_scid_privacy(long this_ptr, boolean val); - // bool ChannelHandshakeConfig_get_announced_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr); - public static native boolean ChannelHandshakeConfig_get_announced_channel(long this_ptr); - // void ChannelHandshakeConfig_set_announced_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val); - public static native void ChannelHandshakeConfig_set_announced_channel(long this_ptr, boolean val); + // bool ChannelHandshakeConfig_get_announce_for_forwarding(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr); + public static native boolean ChannelHandshakeConfig_get_announce_for_forwarding(long this_ptr); + // void ChannelHandshakeConfig_set_announce_for_forwarding(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val); + public static native void ChannelHandshakeConfig_set_announce_for_forwarding(long this_ptr, boolean val); // bool ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr); public static native boolean ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(long this_ptr); // void ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val); @@ -7825,8 +8300,8 @@ public class bindings { public static native short ChannelHandshakeConfig_get_our_max_accepted_htlcs(long this_ptr); // void ChannelHandshakeConfig_set_our_max_accepted_htlcs(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val); public static native void ChannelHandshakeConfig_set_our_max_accepted_htlcs(long this_ptr, short val); - // 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); - public static native long ChannelHandshakeConfig_new(int minimum_depth_arg, short our_to_self_delay_arg, long our_htlc_minimum_msat_arg, byte max_inbound_htlc_value_in_flight_percent_of_channel_arg, boolean negotiate_scid_privacy_arg, boolean announced_channel_arg, boolean commit_upfront_shutdown_pubkey_arg, int their_channel_reserve_proportional_millionths_arg, boolean negotiate_anchors_zero_fee_htlc_tx_arg, short our_max_accepted_htlcs_arg); + // 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 announce_for_forwarding_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); + public static native long ChannelHandshakeConfig_new(int minimum_depth_arg, short our_to_self_delay_arg, long our_htlc_minimum_msat_arg, byte max_inbound_htlc_value_in_flight_percent_of_channel_arg, boolean negotiate_scid_privacy_arg, boolean announce_for_forwarding_arg, boolean commit_upfront_shutdown_pubkey_arg, int their_channel_reserve_proportional_millionths_arg, boolean negotiate_anchors_zero_fee_htlc_tx_arg, short our_max_accepted_htlcs_arg); // uint64_t ChannelHandshakeConfig_clone_ptr(LDKChannelHandshakeConfig *NONNULL_PTR arg); public static native long ChannelHandshakeConfig_clone_ptr(long arg); // struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig); @@ -7965,8 +8440,6 @@ public class bindings { public static native void ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis(long this_ptr, long val); // 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); public static native long ChannelConfigUpdate_new(long forwarding_fee_proportional_millionths_arg, long forwarding_fee_base_msat_arg, long cltv_expiry_delta_arg, long max_dust_htlc_exposure_msat_arg, long force_close_avoidance_max_fee_satoshis_arg); - // MUST_USE_RES struct LDKChannelConfigUpdate ChannelConfigUpdate_default(void); - public static native long ChannelConfigUpdate_default(); // void UserConfig_free(struct LDKUserConfig this_obj); public static native void UserConfig_free(long this_obj); // struct LDKChannelHandshakeConfig UserConfig_get_channel_handshake_config(const struct LDKUserConfig *NONNULL_PTR this_ptr); @@ -8001,8 +8474,12 @@ public class bindings { public static native boolean UserConfig_get_accept_mpp_keysend(long this_ptr); // void UserConfig_set_accept_mpp_keysend(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val); public static native void UserConfig_set_accept_mpp_keysend(long this_ptr, boolean val); - // 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); - public static native long UserConfig_new(long channel_handshake_config_arg, long channel_handshake_limits_arg, long channel_config_arg, boolean accept_forwards_to_priv_channels_arg, boolean accept_inbound_channels_arg, boolean manually_accept_inbound_channels_arg, boolean accept_intercept_htlcs_arg, boolean accept_mpp_keysend_arg); + // bool UserConfig_get_manually_handle_bolt12_invoices(const struct LDKUserConfig *NONNULL_PTR this_ptr); + public static native boolean UserConfig_get_manually_handle_bolt12_invoices(long this_ptr); + // void UserConfig_set_manually_handle_bolt12_invoices(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val); + public static native void UserConfig_set_manually_handle_bolt12_invoices(long this_ptr, boolean val); + // 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, bool manually_handle_bolt12_invoices_arg); + public static native long UserConfig_new(long channel_handshake_config_arg, long channel_handshake_limits_arg, long channel_config_arg, boolean accept_forwards_to_priv_channels_arg, boolean accept_inbound_channels_arg, boolean manually_accept_inbound_channels_arg, boolean accept_intercept_htlcs_arg, boolean accept_mpp_keysend_arg, boolean manually_handle_bolt12_invoices_arg); // uint64_t UserConfig_clone_ptr(LDKUserConfig *NONNULL_PTR arg); public static native long UserConfig_clone_ptr(long arg); // struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig); @@ -8081,8 +8558,10 @@ public class bindings { public static native void BroadcasterInterface_free(long this_ptr); // enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig); public static native ConfirmationTarget ConfirmationTarget_clone(long orig); - // enum LDKConfirmationTarget ConfirmationTarget_on_chain_sweep(void); - public static native ConfirmationTarget ConfirmationTarget_on_chain_sweep(); + // enum LDKConfirmationTarget ConfirmationTarget_maximum_fee_estimate(void); + public static native ConfirmationTarget ConfirmationTarget_maximum_fee_estimate(); + // enum LDKConfirmationTarget ConfirmationTarget_urgent_on_chain_sweep(void); + public static native ConfirmationTarget ConfirmationTarget_urgent_on_chain_sweep(); // enum LDKConfirmationTarget ConfirmationTarget_min_allowed_anchor_channel_remote_fee(void); public static native ConfirmationTarget ConfirmationTarget_min_allowed_anchor_channel_remote_fee(); // enum LDKConfirmationTarget ConfirmationTarget_min_allowed_non_anchor_channel_remote_fee(void); @@ -8101,16 +8580,6 @@ public class bindings { public static native boolean ConfirmationTarget_eq(long a, long b); // void FeeEstimator_free(struct LDKFeeEstimator this_ptr); public static native void FeeEstimator_free(long this_ptr); - // void MonitorUpdateId_free(struct LDKMonitorUpdateId this_obj); - public static native void MonitorUpdateId_free(long this_obj); - // uint64_t MonitorUpdateId_clone_ptr(LDKMonitorUpdateId *NONNULL_PTR arg); - public static native long MonitorUpdateId_clone_ptr(long arg); - // struct LDKMonitorUpdateId MonitorUpdateId_clone(const struct LDKMonitorUpdateId *NONNULL_PTR orig); - public static native long MonitorUpdateId_clone(long orig); - // uint64_t MonitorUpdateId_hash(const struct LDKMonitorUpdateId *NONNULL_PTR o); - public static native long MonitorUpdateId_hash(long o); - // bool MonitorUpdateId_eq(const struct LDKMonitorUpdateId *NONNULL_PTR a, const struct LDKMonitorUpdateId *NONNULL_PTR b); - public static native boolean MonitorUpdateId_eq(long a, long b); // void Persist_free(struct LDKPersist this_ptr); public static native void Persist_free(long this_ptr); // void LockedChannelMonitor_free(struct LDKLockedChannelMonitor this_obj); @@ -8125,9 +8594,9 @@ public class bindings { public static native long ChainMonitor_get_monitor(long this_arg, long funding_txo); // MUST_USE_RES struct LDKCVec_C2Tuple_OutPointChannelIdZZ ChainMonitor_list_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg); public static native long[] ChainMonitor_list_monitors(long this_arg); - // MUST_USE_RES struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ChainMonitor_list_pending_monitor_updates(const struct LDKChainMonitor *NONNULL_PTR this_arg); + // MUST_USE_RES struct LDKCVec_C2Tuple_OutPointCVec_u64ZZZ ChainMonitor_list_pending_monitor_updates(const struct LDKChainMonitor *NONNULL_PTR this_arg); public static native long[] ChainMonitor_list_pending_monitor_updates(long this_arg); - // 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); + // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChainMonitor_channel_monitor_updated(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo, uint64_t completed_update_id); public static native long ChainMonitor_channel_monitor_updated(long this_arg, long funding_txo, long completed_update_id); // MUST_USE_RES struct LDKFuture ChainMonitor_get_update_future(const struct LDKChainMonitor *NONNULL_PTR this_arg); public static native long ChainMonitor_get_update_future(long this_arg); @@ -8197,20 +8666,32 @@ public class bindings { public static native byte[] HTLCUpdate_write(long obj); // struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser); public static native long HTLCUpdate_read(byte[] ser); + // enum LDKBalanceSource BalanceSource_clone(const enum LDKBalanceSource *NONNULL_PTR orig); + public static native BalanceSource BalanceSource_clone(long orig); + // enum LDKBalanceSource BalanceSource_holder_force_closed(void); + public static native BalanceSource BalanceSource_holder_force_closed(); + // enum LDKBalanceSource BalanceSource_counterparty_force_closed(void); + public static native BalanceSource BalanceSource_counterparty_force_closed(); + // enum LDKBalanceSource BalanceSource_coop_close(void); + public static native BalanceSource BalanceSource_coop_close(); + // enum LDKBalanceSource BalanceSource_htlc(void); + public static native BalanceSource BalanceSource_htlc(); + // bool BalanceSource_eq(const enum LDKBalanceSource *NONNULL_PTR a, const enum LDKBalanceSource *NONNULL_PTR b); + public static native boolean BalanceSource_eq(long a, long b); // void Balance_free(struct LDKBalance this_ptr); public static native void Balance_free(long this_ptr); // uint64_t Balance_clone_ptr(LDKBalance *NONNULL_PTR arg); public static native long Balance_clone_ptr(long arg); // struct LDKBalance Balance_clone(const struct LDKBalance *NONNULL_PTR orig); public static native long Balance_clone(long orig); - // struct LDKBalance Balance_claimable_on_channel_close(uint64_t amount_satoshis); - public static native long Balance_claimable_on_channel_close(long amount_satoshis); - // struct LDKBalance Balance_claimable_awaiting_confirmations(uint64_t amount_satoshis, uint32_t confirmation_height); - public static native long Balance_claimable_awaiting_confirmations(long amount_satoshis, int confirmation_height); + // struct LDKBalance Balance_claimable_on_channel_close(uint64_t amount_satoshis, uint64_t transaction_fee_satoshis, uint64_t outbound_payment_htlc_rounded_msat, uint64_t outbound_forwarded_htlc_rounded_msat, uint64_t inbound_claiming_htlc_rounded_msat, uint64_t inbound_htlc_rounded_msat); + public static native long Balance_claimable_on_channel_close(long amount_satoshis, long transaction_fee_satoshis, long outbound_payment_htlc_rounded_msat, long outbound_forwarded_htlc_rounded_msat, long inbound_claiming_htlc_rounded_msat, long inbound_htlc_rounded_msat); + // struct LDKBalance Balance_claimable_awaiting_confirmations(uint64_t amount_satoshis, uint32_t confirmation_height, enum LDKBalanceSource source); + public static native long Balance_claimable_awaiting_confirmations(long amount_satoshis, int confirmation_height, BalanceSource source); // struct LDKBalance Balance_contentious_claimable(uint64_t amount_satoshis, uint32_t timeout_height, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_preimage); public static native long Balance_contentious_claimable(long amount_satoshis, int timeout_height, byte[] payment_hash, byte[] payment_preimage); - // struct LDKBalance Balance_maybe_timeout_claimable_htlc(uint64_t amount_satoshis, uint32_t claimable_height, struct LDKThirtyTwoBytes payment_hash); - public static native long Balance_maybe_timeout_claimable_htlc(long amount_satoshis, int claimable_height, byte[] payment_hash); + // struct LDKBalance Balance_maybe_timeout_claimable_htlc(uint64_t amount_satoshis, uint32_t claimable_height, struct LDKThirtyTwoBytes payment_hash, bool outbound_payment); + public static native long Balance_maybe_timeout_claimable_htlc(long amount_satoshis, int claimable_height, byte[] payment_hash, boolean outbound_payment); // struct LDKBalance Balance_maybe_preimage_claimable_htlc(uint64_t amount_satoshis, uint32_t expiry_height, struct LDKThirtyTwoBytes payment_hash); public static native long Balance_maybe_preimage_claimable_htlc(long amount_satoshis, int expiry_height, byte[] payment_hash); // struct LDKBalance Balance_counterparty_revoked_output_claimable(uint64_t amount_satoshis); @@ -8241,8 +8722,8 @@ public class bindings { public static native void ChannelMonitor_load_outputs_to_watch(long this_arg, long filter, long logger); // MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg); public static native long[] ChannelMonitor_get_and_clear_pending_monitor_events(long this_arg); - // void ChannelMonitor_process_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKEventHandler *NONNULL_PTR handler); - public static native void ChannelMonitor_process_pending_events(long this_arg, long handler); + // MUST_USE_RES struct LDKCResult_NoneReplayEventZ ChannelMonitor_process_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKEventHandler *NONNULL_PTR handler); + public static native long ChannelMonitor_process_pending_events(long this_arg, long handler); // MUST_USE_RES struct LDKCommitmentTransaction ChannelMonitor_initial_counterparty_commitment_tx(const struct LDKChannelMonitor *NONNULL_PTR this_arg); public static native long ChannelMonitor_initial_counterparty_commitment_tx(long this_arg); // 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); @@ -8269,6 +8750,8 @@ public class bindings { public static native long ChannelMonitor_current_best_block(long this_arg); // 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); public static native void ChannelMonitor_rebroadcast_pending_claims(long this_arg, long broadcaster, long fee_estimator, long logger); + // MUST_USE_RES bool ChannelMonitor_has_pending_claims(const struct LDKChannelMonitor *NONNULL_PTR this_arg); + public static native boolean ChannelMonitor_has_pending_claims(long this_arg); // void ChannelMonitor_signer_unblocked(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, const struct LDKLogger *NONNULL_PTR logger); public static native void ChannelMonitor_signer_unblocked(long this_arg, long broadcaster, long fee_estimator, long logger); // MUST_USE_RES struct LDKCVec_SpendableOutputDescriptorZ ChannelMonitor_get_spendable_outputs(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKTransaction tx, uint32_t confirmation_height); @@ -8329,7 +8812,7 @@ public class bindings { public static native long InboundHTLCErr_hash(long o); // bool InboundHTLCErr_eq(const struct LDKInboundHTLCErr *NONNULL_PTR a, const struct LDKInboundHTLCErr *NONNULL_PTR b); public static native boolean InboundHTLCErr_eq(long a, long b); - // 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); + // struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ peel_payment_onion(const struct LDKUpdateAddHTLC *NONNULL_PTR msg, struct LDKNodeSigner node_signer, struct LDKLogger logger, uint32_t cur_height, bool accept_mpp_keysend, bool allow_skimmed_fees); public static native long peel_payment_onion(long msg, long node_signer, long logger, int cur_height, boolean accept_mpp_keysend, boolean allow_skimmed_fees); // void PendingHTLCRouting_free(struct LDKPendingHTLCRouting this_ptr); public static native void PendingHTLCRouting_free(long this_ptr); @@ -8353,8 +8836,12 @@ public class bindings { public static native BlindedFailure BlindedForward_get_failure(long this_ptr); // void BlindedForward_set_failure(struct LDKBlindedForward *NONNULL_PTR this_ptr, enum LDKBlindedFailure val); public static native void BlindedForward_set_failure(long this_ptr, BlindedFailure val); - // MUST_USE_RES struct LDKBlindedForward BlindedForward_new(struct LDKPublicKey inbound_blinding_point_arg, enum LDKBlindedFailure failure_arg); - public static native long BlindedForward_new(byte[] inbound_blinding_point_arg, BlindedFailure failure_arg); + // struct LDKPublicKey BlindedForward_get_next_blinding_override(const struct LDKBlindedForward *NONNULL_PTR this_ptr); + public static native byte[] BlindedForward_get_next_blinding_override(long this_ptr); + // void BlindedForward_set_next_blinding_override(struct LDKBlindedForward *NONNULL_PTR this_ptr, struct LDKPublicKey val); + public static native void BlindedForward_set_next_blinding_override(long this_ptr, byte[] val); + // MUST_USE_RES struct LDKBlindedForward BlindedForward_new(struct LDKPublicKey inbound_blinding_point_arg, enum LDKBlindedFailure failure_arg, struct LDKPublicKey next_blinding_override_arg); + public static native long BlindedForward_new(byte[] inbound_blinding_point_arg, BlindedFailure failure_arg, byte[] next_blinding_override_arg); // uint64_t BlindedForward_clone_ptr(LDKBlindedForward *NONNULL_PTR arg); public static native long BlindedForward_clone_ptr(long arg); // struct LDKBlindedForward BlindedForward_clone(const struct LDKBlindedForward *NONNULL_PTR orig); @@ -8493,15 +8980,15 @@ public class bindings { public static native long ChannelManager_close_channel(long this_arg, long channel_id, byte[] counterparty_node_id); // 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); public static native long ChannelManager_close_channel_with_feerate_and_script(long this_arg, long channel_id, byte[] counterparty_node_id, long target_feerate_sats_per_1000_weight, long shutdown_script); - // 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); - public static native long ChannelManager_force_close_broadcasting_latest_txn(long this_arg, long channel_id, byte[] counterparty_node_id); - // 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); - public static native long ChannelManager_force_close_without_broadcasting_txn(long this_arg, long channel_id, byte[] counterparty_node_id); - // void ChannelManager_force_close_all_channels_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg); - public static native void ChannelManager_force_close_all_channels_broadcasting_latest_txn(long this_arg); - // void ChannelManager_force_close_all_channels_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg); - public static native void ChannelManager_force_close_all_channels_without_broadcasting_txn(long this_arg); - // 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); + // 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, struct LDKStr error_message); + public static native long ChannelManager_force_close_broadcasting_latest_txn(long this_arg, long channel_id, byte[] counterparty_node_id, String error_message); + // 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, struct LDKStr error_message); + public static native long ChannelManager_force_close_without_broadcasting_txn(long this_arg, long channel_id, byte[] counterparty_node_id, String error_message); + // void ChannelManager_force_close_all_channels_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKStr error_message); + public static native void ChannelManager_force_close_all_channels_broadcasting_latest_txn(long this_arg, String error_message); + // void ChannelManager_force_close_all_channels_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKStr error_message); + public static native void ChannelManager_force_close_all_channels_without_broadcasting_txn(long this_arg, String error_message); + // MUST_USE_RES struct LDKCResult_NonePaymentSendFailureZ ChannelManager_send_payment_with_route(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKRoute route, struct LDKThirtyTwoBytes payment_hash, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id); public static native long ChannelManager_send_payment_with_route(long this_arg, long route, byte[] payment_hash, long recipient_onion, byte[] payment_id); // 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); public static native long ChannelManager_send_payment(long this_arg, byte[] payment_hash, long recipient_onion, byte[] payment_id, long route_params, long retry_strategy); @@ -8517,8 +9004,10 @@ public class bindings { public static native long ChannelManager_send_spontaneous_preflight_probes(long this_arg, byte[] node_id, long amount_msat, int final_cltv_expiry_delta, long liquidity_limit_multiplier); // 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); public static native long ChannelManager_send_preflight_probes(long this_arg, long route_params, long liquidity_limit_multiplier); - // 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); + // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKChannelId temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKTransaction funding_transaction); public static native long ChannelManager_funding_transaction_generated(long this_arg, long temporary_channel_id, byte[] counterparty_node_id, byte[] funding_transaction); + // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_unsafe_manual_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKChannelId temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKOutPoint funding); + public static native long ChannelManager_unsafe_manual_funding_transaction_generated(long this_arg, long temporary_channel_id, byte[] counterparty_node_id, long funding); // 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); public static native long ChannelManager_batch_funding_transaction_generated(long this_arg, long[] temporary_channels, byte[] funding_transaction); // 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); @@ -8547,8 +9036,8 @@ public class bindings { public static native long ChannelManager_accept_inbound_channel(long this_arg, long temporary_channel_id, byte[] counterparty_node_id, byte[] user_channel_id); // 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); public static native long ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(long this_arg, long temporary_channel_id, byte[] counterparty_node_id, byte[] user_channel_id); - // MUST_USE_RES struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ ChannelManager_create_offer_builder(const struct LDKChannelManager *NONNULL_PTR this_arg); - public static native long ChannelManager_create_offer_builder(long this_arg); + // MUST_USE_RES struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ ChannelManager_create_offer_builder(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_u64Z absolute_expiry); + public static native long ChannelManager_create_offer_builder(long this_arg, long absolute_expiry); // 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); public static native long ChannelManager_create_refund_builder(long this_arg, long amount_msats, long absolute_expiry, byte[] payment_id, long retry_strategy, long max_total_routing_fee_msat); // 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); @@ -8595,6 +9084,8 @@ public class bindings { public static native long ChannelManager_as_ChannelMessageHandler(long this_arg); // struct LDKOffersMessageHandler ChannelManager_as_OffersMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg); public static native long ChannelManager_as_OffersMessageHandler(long this_arg); + // struct LDKAsyncPaymentsMessageHandler ChannelManager_as_AsyncPaymentsMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg); + public static native long ChannelManager_as_AsyncPaymentsMessageHandler(long this_arg); // struct LDKNodeIdLookUp ChannelManager_as_NodeIdLookUp(const struct LDKChannelManager *NONNULL_PTR this_arg); public static native long ChannelManager_as_NodeIdLookUp(long this_arg); // struct LDKInitFeatures provided_init_features(const struct LDKUserConfig *NONNULL_PTR config); @@ -9065,10 +9556,10 @@ public class bindings { public static native boolean ChannelDetails_get_is_usable(long this_ptr); // void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val); public static native void ChannelDetails_set_is_usable(long this_ptr, boolean val); - // bool ChannelDetails_get_is_public(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - public static native boolean ChannelDetails_get_is_public(long this_ptr); - // void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val); - public static native void ChannelDetails_set_is_public(long this_ptr, boolean val); + // bool ChannelDetails_get_is_announced(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + public static native boolean ChannelDetails_get_is_announced(long this_ptr); + // void ChannelDetails_set_is_announced(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val); + public static native void ChannelDetails_set_is_announced(long this_ptr, boolean val); // struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr); public static native long ChannelDetails_get_inbound_htlc_minimum_msat(long this_ptr); // void ChannelDetails_set_inbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); @@ -9089,8 +9580,8 @@ public class bindings { public static native long[] ChannelDetails_get_pending_outbound_htlcs(long this_ptr); // void ChannelDetails_set_pending_outbound_htlcs(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCVec_OutboundHTLCDetailsZ val); public static native void ChannelDetails_set_pending_outbound_htlcs(long this_ptr, long[] val); - // 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); - public static native long ChannelDetails_new(long channel_id_arg, long counterparty_arg, long funding_txo_arg, long channel_type_arg, long short_channel_id_arg, long outbound_scid_alias_arg, long inbound_scid_alias_arg, long channel_value_satoshis_arg, long unspendable_punishment_reserve_arg, byte[] user_channel_id_arg, long feerate_sat_per_1000_weight_arg, long balance_msat_arg, long outbound_capacity_msat_arg, long next_outbound_htlc_limit_msat_arg, long next_outbound_htlc_minimum_msat_arg, long inbound_capacity_msat_arg, long confirmations_required_arg, long confirmations_arg, long force_close_spend_delay_arg, boolean is_outbound_arg, boolean is_channel_ready_arg, long channel_shutdown_state_arg, boolean is_usable_arg, boolean is_public_arg, long inbound_htlc_minimum_msat_arg, long inbound_htlc_maximum_msat_arg, long config_arg, long[] pending_inbound_htlcs_arg, long[] pending_outbound_htlcs_arg); + // 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_announced_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); + public static native long ChannelDetails_new(long channel_id_arg, long counterparty_arg, long funding_txo_arg, long channel_type_arg, long short_channel_id_arg, long outbound_scid_alias_arg, long inbound_scid_alias_arg, long channel_value_satoshis_arg, long unspendable_punishment_reserve_arg, byte[] user_channel_id_arg, long feerate_sat_per_1000_weight_arg, long balance_msat_arg, long outbound_capacity_msat_arg, long next_outbound_htlc_limit_msat_arg, long next_outbound_htlc_minimum_msat_arg, long inbound_capacity_msat_arg, long confirmations_required_arg, long confirmations_arg, long force_close_spend_delay_arg, boolean is_outbound_arg, boolean is_channel_ready_arg, long channel_shutdown_state_arg, boolean is_usable_arg, boolean is_announced_arg, long inbound_htlc_minimum_msat_arg, long inbound_htlc_maximum_msat_arg, long config_arg, long[] pending_inbound_htlcs_arg, long[] pending_outbound_htlcs_arg); // uint64_t ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg); public static native long ChannelDetails_clone_ptr(long arg); // struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig); @@ -9339,6 +9830,44 @@ public class bindings { public static native long CommonOpenChannelFields_hash(long o); // bool CommonOpenChannelFields_eq(const struct LDKCommonOpenChannelFields *NONNULL_PTR a, const struct LDKCommonOpenChannelFields *NONNULL_PTR b); public static native boolean CommonOpenChannelFields_eq(long a, long b); + // MUST_USE_RES struct LDKChannelParameters CommonOpenChannelFields_channel_parameters(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_arg); + public static native long CommonOpenChannelFields_channel_parameters(long this_arg); + // void ChannelParameters_free(struct LDKChannelParameters this_obj); + public static native void ChannelParameters_free(long this_obj); + // uint64_t ChannelParameters_get_dust_limit_satoshis(const struct LDKChannelParameters *NONNULL_PTR this_ptr); + public static native long ChannelParameters_get_dust_limit_satoshis(long this_ptr); + // void ChannelParameters_set_dust_limit_satoshis(struct LDKChannelParameters *NONNULL_PTR this_ptr, uint64_t val); + public static native void ChannelParameters_set_dust_limit_satoshis(long this_ptr, long val); + // uint64_t ChannelParameters_get_max_htlc_value_in_flight_msat(const struct LDKChannelParameters *NONNULL_PTR this_ptr); + public static native long ChannelParameters_get_max_htlc_value_in_flight_msat(long this_ptr); + // void ChannelParameters_set_max_htlc_value_in_flight_msat(struct LDKChannelParameters *NONNULL_PTR this_ptr, uint64_t val); + public static native void ChannelParameters_set_max_htlc_value_in_flight_msat(long this_ptr, long val); + // uint64_t ChannelParameters_get_htlc_minimum_msat(const struct LDKChannelParameters *NONNULL_PTR this_ptr); + public static native long ChannelParameters_get_htlc_minimum_msat(long this_ptr); + // void ChannelParameters_set_htlc_minimum_msat(struct LDKChannelParameters *NONNULL_PTR this_ptr, uint64_t val); + public static native void ChannelParameters_set_htlc_minimum_msat(long this_ptr, long val); + // uint32_t ChannelParameters_get_commitment_feerate_sat_per_1000_weight(const struct LDKChannelParameters *NONNULL_PTR this_ptr); + public static native int ChannelParameters_get_commitment_feerate_sat_per_1000_weight(long this_ptr); + // void ChannelParameters_set_commitment_feerate_sat_per_1000_weight(struct LDKChannelParameters *NONNULL_PTR this_ptr, uint32_t val); + public static native void ChannelParameters_set_commitment_feerate_sat_per_1000_weight(long this_ptr, int val); + // uint16_t ChannelParameters_get_to_self_delay(const struct LDKChannelParameters *NONNULL_PTR this_ptr); + public static native short ChannelParameters_get_to_self_delay(long this_ptr); + // void ChannelParameters_set_to_self_delay(struct LDKChannelParameters *NONNULL_PTR this_ptr, uint16_t val); + public static native void ChannelParameters_set_to_self_delay(long this_ptr, short val); + // uint16_t ChannelParameters_get_max_accepted_htlcs(const struct LDKChannelParameters *NONNULL_PTR this_ptr); + public static native short ChannelParameters_get_max_accepted_htlcs(long this_ptr); + // void ChannelParameters_set_max_accepted_htlcs(struct LDKChannelParameters *NONNULL_PTR this_ptr, uint16_t val); + public static native void ChannelParameters_set_max_accepted_htlcs(long this_ptr, short val); + // MUST_USE_RES struct LDKChannelParameters ChannelParameters_new(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); + public static native long ChannelParameters_new(long dust_limit_satoshis_arg, long max_htlc_value_in_flight_msat_arg, long htlc_minimum_msat_arg, int commitment_feerate_sat_per_1000_weight_arg, short to_self_delay_arg, short max_accepted_htlcs_arg); + // uint64_t ChannelParameters_clone_ptr(LDKChannelParameters *NONNULL_PTR arg); + public static native long ChannelParameters_clone_ptr(long arg); + // struct LDKChannelParameters ChannelParameters_clone(const struct LDKChannelParameters *NONNULL_PTR orig); + public static native long ChannelParameters_clone(long orig); + // uint64_t ChannelParameters_hash(const struct LDKChannelParameters *NONNULL_PTR o); + public static native long ChannelParameters_hash(long o); + // bool ChannelParameters_eq(const struct LDKChannelParameters *NONNULL_PTR a, const struct LDKChannelParameters *NONNULL_PTR b); + public static native boolean ChannelParameters_eq(long a, long b); // void OpenChannel_free(struct LDKOpenChannel this_obj); public static native void OpenChannel_free(long this_obj); // struct LDKCommonOpenChannelFields OpenChannel_get_common_fields(const struct LDKOpenChannel *NONNULL_PTR this_ptr); @@ -9605,60 +10134,60 @@ public class bindings { public static native long Stfu_clone(long orig); // bool Stfu_eq(const struct LDKStfu *NONNULL_PTR a, const struct LDKStfu *NONNULL_PTR b); public static native boolean Stfu_eq(long a, long b); - // void Splice_free(struct LDKSplice this_obj); - public static native void Splice_free(long this_obj); - // struct LDKChannelId Splice_get_channel_id(const struct LDKSplice *NONNULL_PTR this_ptr); - public static native long Splice_get_channel_id(long this_ptr); - // void Splice_set_channel_id(struct LDKSplice *NONNULL_PTR this_ptr, struct LDKChannelId val); - public static native void Splice_set_channel_id(long this_ptr, long val); - // const uint8_t (*Splice_get_chain_hash(const struct LDKSplice *NONNULL_PTR this_ptr))[32]; - public static native byte[] Splice_get_chain_hash(long this_ptr); - // void Splice_set_chain_hash(struct LDKSplice *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void Splice_set_chain_hash(long this_ptr, byte[] val); - // int64_t Splice_get_relative_satoshis(const struct LDKSplice *NONNULL_PTR this_ptr); - public static native long Splice_get_relative_satoshis(long this_ptr); - // void Splice_set_relative_satoshis(struct LDKSplice *NONNULL_PTR this_ptr, int64_t val); - public static native void Splice_set_relative_satoshis(long this_ptr, long val); - // uint32_t Splice_get_funding_feerate_perkw(const struct LDKSplice *NONNULL_PTR this_ptr); - public static native int Splice_get_funding_feerate_perkw(long this_ptr); - // void Splice_set_funding_feerate_perkw(struct LDKSplice *NONNULL_PTR this_ptr, uint32_t val); - public static native void Splice_set_funding_feerate_perkw(long this_ptr, int val); - // uint32_t Splice_get_locktime(const struct LDKSplice *NONNULL_PTR this_ptr); - public static native int Splice_get_locktime(long this_ptr); - // void Splice_set_locktime(struct LDKSplice *NONNULL_PTR this_ptr, uint32_t val); - public static native void Splice_set_locktime(long this_ptr, int val); - // struct LDKPublicKey Splice_get_funding_pubkey(const struct LDKSplice *NONNULL_PTR this_ptr); - public static native byte[] Splice_get_funding_pubkey(long this_ptr); - // void Splice_set_funding_pubkey(struct LDKSplice *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void Splice_set_funding_pubkey(long this_ptr, byte[] val); - // 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); - public static native long Splice_new(long channel_id_arg, byte[] chain_hash_arg, long relative_satoshis_arg, int funding_feerate_perkw_arg, int locktime_arg, byte[] funding_pubkey_arg); - // uint64_t Splice_clone_ptr(LDKSplice *NONNULL_PTR arg); - public static native long Splice_clone_ptr(long arg); - // struct LDKSplice Splice_clone(const struct LDKSplice *NONNULL_PTR orig); - public static native long Splice_clone(long orig); - // bool Splice_eq(const struct LDKSplice *NONNULL_PTR a, const struct LDKSplice *NONNULL_PTR b); - public static native boolean Splice_eq(long a, long b); + // void SpliceInit_free(struct LDKSpliceInit this_obj); + public static native void SpliceInit_free(long this_obj); + // struct LDKChannelId SpliceInit_get_channel_id(const struct LDKSpliceInit *NONNULL_PTR this_ptr); + public static native long SpliceInit_get_channel_id(long this_ptr); + // void SpliceInit_set_channel_id(struct LDKSpliceInit *NONNULL_PTR this_ptr, struct LDKChannelId val); + public static native void SpliceInit_set_channel_id(long this_ptr, long val); + // int64_t SpliceInit_get_funding_contribution_satoshis(const struct LDKSpliceInit *NONNULL_PTR this_ptr); + public static native long SpliceInit_get_funding_contribution_satoshis(long this_ptr); + // void SpliceInit_set_funding_contribution_satoshis(struct LDKSpliceInit *NONNULL_PTR this_ptr, int64_t val); + public static native void SpliceInit_set_funding_contribution_satoshis(long this_ptr, long val); + // uint32_t SpliceInit_get_funding_feerate_perkw(const struct LDKSpliceInit *NONNULL_PTR this_ptr); + public static native int SpliceInit_get_funding_feerate_perkw(long this_ptr); + // void SpliceInit_set_funding_feerate_perkw(struct LDKSpliceInit *NONNULL_PTR this_ptr, uint32_t val); + public static native void SpliceInit_set_funding_feerate_perkw(long this_ptr, int val); + // uint32_t SpliceInit_get_locktime(const struct LDKSpliceInit *NONNULL_PTR this_ptr); + public static native int SpliceInit_get_locktime(long this_ptr); + // void SpliceInit_set_locktime(struct LDKSpliceInit *NONNULL_PTR this_ptr, uint32_t val); + public static native void SpliceInit_set_locktime(long this_ptr, int val); + // struct LDKPublicKey SpliceInit_get_funding_pubkey(const struct LDKSpliceInit *NONNULL_PTR this_ptr); + public static native byte[] SpliceInit_get_funding_pubkey(long this_ptr); + // void SpliceInit_set_funding_pubkey(struct LDKSpliceInit *NONNULL_PTR this_ptr, struct LDKPublicKey val); + public static native void SpliceInit_set_funding_pubkey(long this_ptr, byte[] val); + // enum LDKCOption_NoneZ SpliceInit_get_require_confirmed_inputs(const struct LDKSpliceInit *NONNULL_PTR this_ptr); + public static native COption_NoneZ SpliceInit_get_require_confirmed_inputs(long this_ptr); + // void SpliceInit_set_require_confirmed_inputs(struct LDKSpliceInit *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val); + public static native void SpliceInit_set_require_confirmed_inputs(long this_ptr, COption_NoneZ val); + // MUST_USE_RES struct LDKSpliceInit SpliceInit_new(struct LDKChannelId channel_id_arg, int64_t funding_contribution_satoshis_arg, uint32_t funding_feerate_perkw_arg, uint32_t locktime_arg, struct LDKPublicKey funding_pubkey_arg, enum LDKCOption_NoneZ require_confirmed_inputs_arg); + public static native long SpliceInit_new(long channel_id_arg, long funding_contribution_satoshis_arg, int funding_feerate_perkw_arg, int locktime_arg, byte[] funding_pubkey_arg, COption_NoneZ require_confirmed_inputs_arg); + // uint64_t SpliceInit_clone_ptr(LDKSpliceInit *NONNULL_PTR arg); + public static native long SpliceInit_clone_ptr(long arg); + // struct LDKSpliceInit SpliceInit_clone(const struct LDKSpliceInit *NONNULL_PTR orig); + public static native long SpliceInit_clone(long orig); + // bool SpliceInit_eq(const struct LDKSpliceInit *NONNULL_PTR a, const struct LDKSpliceInit *NONNULL_PTR b); + public static native boolean SpliceInit_eq(long a, long b); // void SpliceAck_free(struct LDKSpliceAck this_obj); public static native void SpliceAck_free(long this_obj); // struct LDKChannelId SpliceAck_get_channel_id(const struct LDKSpliceAck *NONNULL_PTR this_ptr); public static native long SpliceAck_get_channel_id(long this_ptr); // void SpliceAck_set_channel_id(struct LDKSpliceAck *NONNULL_PTR this_ptr, struct LDKChannelId val); public static native void SpliceAck_set_channel_id(long this_ptr, long val); - // const uint8_t (*SpliceAck_get_chain_hash(const struct LDKSpliceAck *NONNULL_PTR this_ptr))[32]; - public static native byte[] SpliceAck_get_chain_hash(long this_ptr); - // void SpliceAck_set_chain_hash(struct LDKSpliceAck *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void SpliceAck_set_chain_hash(long this_ptr, byte[] val); - // int64_t SpliceAck_get_relative_satoshis(const struct LDKSpliceAck *NONNULL_PTR this_ptr); - public static native long SpliceAck_get_relative_satoshis(long this_ptr); - // void SpliceAck_set_relative_satoshis(struct LDKSpliceAck *NONNULL_PTR this_ptr, int64_t val); - public static native void SpliceAck_set_relative_satoshis(long this_ptr, long val); + // int64_t SpliceAck_get_funding_contribution_satoshis(const struct LDKSpliceAck *NONNULL_PTR this_ptr); + public static native long SpliceAck_get_funding_contribution_satoshis(long this_ptr); + // void SpliceAck_set_funding_contribution_satoshis(struct LDKSpliceAck *NONNULL_PTR this_ptr, int64_t val); + public static native void SpliceAck_set_funding_contribution_satoshis(long this_ptr, long val); // struct LDKPublicKey SpliceAck_get_funding_pubkey(const struct LDKSpliceAck *NONNULL_PTR this_ptr); public static native byte[] SpliceAck_get_funding_pubkey(long this_ptr); // void SpliceAck_set_funding_pubkey(struct LDKSpliceAck *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void SpliceAck_set_funding_pubkey(long this_ptr, byte[] val); - // 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); - public static native long SpliceAck_new(long channel_id_arg, byte[] chain_hash_arg, long relative_satoshis_arg, byte[] funding_pubkey_arg); + // enum LDKCOption_NoneZ SpliceAck_get_require_confirmed_inputs(const struct LDKSpliceAck *NONNULL_PTR this_ptr); + public static native COption_NoneZ SpliceAck_get_require_confirmed_inputs(long this_ptr); + // void SpliceAck_set_require_confirmed_inputs(struct LDKSpliceAck *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val); + public static native void SpliceAck_set_require_confirmed_inputs(long this_ptr, COption_NoneZ val); + // MUST_USE_RES struct LDKSpliceAck SpliceAck_new(struct LDKChannelId channel_id_arg, int64_t funding_contribution_satoshis_arg, struct LDKPublicKey funding_pubkey_arg, enum LDKCOption_NoneZ require_confirmed_inputs_arg); + public static native long SpliceAck_new(long channel_id_arg, long funding_contribution_satoshis_arg, byte[] funding_pubkey_arg, COption_NoneZ require_confirmed_inputs_arg); // uint64_t SpliceAck_clone_ptr(LDKSpliceAck *NONNULL_PTR arg); public static native long SpliceAck_clone_ptr(long arg); // struct LDKSpliceAck SpliceAck_clone(const struct LDKSpliceAck *NONNULL_PTR orig); @@ -9671,8 +10200,12 @@ public class bindings { public static native long SpliceLocked_get_channel_id(long this_ptr); // void SpliceLocked_set_channel_id(struct LDKSpliceLocked *NONNULL_PTR this_ptr, struct LDKChannelId val); public static native void SpliceLocked_set_channel_id(long this_ptr, long val); - // MUST_USE_RES struct LDKSpliceLocked SpliceLocked_new(struct LDKChannelId channel_id_arg); - public static native long SpliceLocked_new(long channel_id_arg); + // const uint8_t (*SpliceLocked_get_splice_txid(const struct LDKSpliceLocked *NONNULL_PTR this_ptr))[32]; + public static native byte[] SpliceLocked_get_splice_txid(long this_ptr); + // void SpliceLocked_set_splice_txid(struct LDKSpliceLocked *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + public static native void SpliceLocked_set_splice_txid(long this_ptr, byte[] val); + // MUST_USE_RES struct LDKSpliceLocked SpliceLocked_new(struct LDKChannelId channel_id_arg, struct LDKThirtyTwoBytes splice_txid_arg); + public static native long SpliceLocked_new(long channel_id_arg, byte[] splice_txid_arg); // uint64_t SpliceLocked_clone_ptr(LDKSpliceLocked *NONNULL_PTR arg); public static native long SpliceLocked_clone_ptr(long arg); // struct LDKSpliceLocked SpliceLocked_clone(const struct LDKSpliceLocked *NONNULL_PTR orig); @@ -9701,8 +10234,12 @@ public class bindings { public static native int TxAddInput_get_sequence(long this_ptr); // void TxAddInput_set_sequence(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint32_t val); public static native void TxAddInput_set_sequence(long this_ptr, int val); - // 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); - public static native long TxAddInput_new(long channel_id_arg, long serial_id_arg, long prevtx_arg, int prevtx_out_arg, int sequence_arg); + // struct LDKCOption_ThirtyTwoBytesZ TxAddInput_get_shared_input_txid(const struct LDKTxAddInput *NONNULL_PTR this_ptr); + public static native long TxAddInput_get_shared_input_txid(long this_ptr); + // void TxAddInput_set_shared_input_txid(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val); + public static native void TxAddInput_set_shared_input_txid(long this_ptr, long val); + // 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, struct LDKCOption_ThirtyTwoBytesZ shared_input_txid_arg); + public static native long TxAddInput_new(long channel_id_arg, long serial_id_arg, long prevtx_arg, int prevtx_out_arg, int sequence_arg, long shared_input_txid_arg); // uint64_t TxAddInput_clone_ptr(LDKTxAddInput *NONNULL_PTR arg); public static native long TxAddInput_clone_ptr(long arg); // struct LDKTxAddInput TxAddInput_clone(const struct LDKTxAddInput *NONNULL_PTR orig); @@ -9809,12 +10346,12 @@ public class bindings { public static native byte[][] TxSignatures_get_witnesses(long this_ptr); // void TxSignatures_set_witnesses(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKCVec_WitnessZ val); public static native void TxSignatures_set_witnesses(long this_ptr, byte[][] val); - // struct LDKCOption_ECDSASignatureZ TxSignatures_get_funding_outpoint_sig(const struct LDKTxSignatures *NONNULL_PTR this_ptr); - public static native long TxSignatures_get_funding_outpoint_sig(long this_ptr); - // void TxSignatures_set_funding_outpoint_sig(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKCOption_ECDSASignatureZ val); - public static native void TxSignatures_set_funding_outpoint_sig(long this_ptr, long val); - // 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); - public static native long TxSignatures_new(long channel_id_arg, byte[] tx_hash_arg, byte[][] witnesses_arg, long funding_outpoint_sig_arg); + // struct LDKCOption_ECDSASignatureZ TxSignatures_get_shared_input_signature(const struct LDKTxSignatures *NONNULL_PTR this_ptr); + public static native long TxSignatures_get_shared_input_signature(long this_ptr); + // void TxSignatures_set_shared_input_signature(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKCOption_ECDSASignatureZ val); + public static native void TxSignatures_set_shared_input_signature(long this_ptr, long val); + // 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 shared_input_signature_arg); + public static native long TxSignatures_new(long channel_id_arg, byte[] tx_hash_arg, byte[][] witnesses_arg, long shared_input_signature_arg); // uint64_t TxSignatures_clone_ptr(LDKTxSignatures *NONNULL_PTR arg); public static native long TxSignatures_clone_ptr(long arg); // struct LDKTxSignatures TxSignatures_clone(const struct LDKTxSignatures *NONNULL_PTR orig); @@ -10087,6 +10624,26 @@ public class bindings { public static native long UpdateFailMalformedHTLC_hash(long o); // bool UpdateFailMalformedHTLC_eq(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR a, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR b); public static native boolean UpdateFailMalformedHTLC_eq(long a, long b); + // void CommitmentSignedBatch_free(struct LDKCommitmentSignedBatch this_obj); + public static native void CommitmentSignedBatch_free(long this_obj); + // uint16_t CommitmentSignedBatch_get_batch_size(const struct LDKCommitmentSignedBatch *NONNULL_PTR this_ptr); + public static native short CommitmentSignedBatch_get_batch_size(long this_ptr); + // void CommitmentSignedBatch_set_batch_size(struct LDKCommitmentSignedBatch *NONNULL_PTR this_ptr, uint16_t val); + public static native void CommitmentSignedBatch_set_batch_size(long this_ptr, short val); + // const uint8_t (*CommitmentSignedBatch_get_funding_txid(const struct LDKCommitmentSignedBatch *NONNULL_PTR this_ptr))[32]; + public static native byte[] CommitmentSignedBatch_get_funding_txid(long this_ptr); + // void CommitmentSignedBatch_set_funding_txid(struct LDKCommitmentSignedBatch *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + public static native void CommitmentSignedBatch_set_funding_txid(long this_ptr, byte[] val); + // MUST_USE_RES struct LDKCommitmentSignedBatch CommitmentSignedBatch_new(uint16_t batch_size_arg, struct LDKThirtyTwoBytes funding_txid_arg); + public static native long CommitmentSignedBatch_new(short batch_size_arg, byte[] funding_txid_arg); + // uint64_t CommitmentSignedBatch_clone_ptr(LDKCommitmentSignedBatch *NONNULL_PTR arg); + public static native long CommitmentSignedBatch_clone_ptr(long arg); + // struct LDKCommitmentSignedBatch CommitmentSignedBatch_clone(const struct LDKCommitmentSignedBatch *NONNULL_PTR orig); + public static native long CommitmentSignedBatch_clone(long orig); + // uint64_t CommitmentSignedBatch_hash(const struct LDKCommitmentSignedBatch *NONNULL_PTR o); + public static native long CommitmentSignedBatch_hash(long o); + // bool CommitmentSignedBatch_eq(const struct LDKCommitmentSignedBatch *NONNULL_PTR a, const struct LDKCommitmentSignedBatch *NONNULL_PTR b); + public static native boolean CommitmentSignedBatch_eq(long a, long b); // void CommitmentSigned_free(struct LDKCommitmentSigned this_obj); public static native void CommitmentSigned_free(long this_obj); // struct LDKChannelId CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr); @@ -10101,8 +10658,12 @@ public class bindings { public static native byte[][] CommitmentSigned_get_htlc_signatures(long this_ptr); // void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_ECDSASignatureZ val); public static native void CommitmentSigned_set_htlc_signatures(long this_ptr, byte[][] val); - // MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKChannelId channel_id_arg, struct LDKECDSASignature signature_arg, struct LDKCVec_ECDSASignatureZ htlc_signatures_arg); - public static native long CommitmentSigned_new(long channel_id_arg, byte[] signature_arg, byte[][] htlc_signatures_arg); + // struct LDKCommitmentSignedBatch CommitmentSigned_get_batch(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr); + public static native long CommitmentSigned_get_batch(long this_ptr); + // void CommitmentSigned_set_batch(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCommitmentSignedBatch val); + public static native void CommitmentSigned_set_batch(long this_ptr, long val); + // MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKChannelId channel_id_arg, struct LDKECDSASignature signature_arg, struct LDKCVec_ECDSASignatureZ htlc_signatures_arg, struct LDKCommitmentSignedBatch batch_arg); + public static native long CommitmentSigned_new(long channel_id_arg, byte[] signature_arg, byte[][] htlc_signatures_arg, long batch_arg); // uint64_t CommitmentSigned_clone_ptr(LDKCommitmentSigned *NONNULL_PTR arg); public static native long CommitmentSigned_clone_ptr(long arg); // struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig); @@ -10433,10 +10994,14 @@ public class bindings { public static native int UnsignedChannelUpdate_get_timestamp(long this_ptr); // void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val); public static native void UnsignedChannelUpdate_set_timestamp(long this_ptr, int val); - // uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr); - public static native byte UnsignedChannelUpdate_get_flags(long this_ptr); - // void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val); - public static native void UnsignedChannelUpdate_set_flags(long this_ptr, byte val); + // uint8_t UnsignedChannelUpdate_get_message_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr); + public static native byte UnsignedChannelUpdate_get_message_flags(long this_ptr); + // void UnsignedChannelUpdate_set_message_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val); + public static native void UnsignedChannelUpdate_set_message_flags(long this_ptr, byte val); + // uint8_t UnsignedChannelUpdate_get_channel_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr); + public static native byte UnsignedChannelUpdate_get_channel_flags(long this_ptr); + // void UnsignedChannelUpdate_set_channel_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val); + public static native void UnsignedChannelUpdate_set_channel_flags(long this_ptr, byte val); // uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr); public static native short UnsignedChannelUpdate_get_cltv_expiry_delta(long this_ptr); // void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val); @@ -10461,8 +11026,8 @@ public class bindings { public static native byte[] UnsignedChannelUpdate_get_excess_data(long this_ptr); // void UnsignedChannelUpdate_set_excess_data(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val); public static native void UnsignedChannelUpdate_set_excess_data(long this_ptr, byte[] val); - // 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); - public static native long UnsignedChannelUpdate_new(byte[] chain_hash_arg, long short_channel_id_arg, int timestamp_arg, byte flags_arg, short cltv_expiry_delta_arg, long htlc_minimum_msat_arg, long htlc_maximum_msat_arg, int fee_base_msat_arg, int fee_proportional_millionths_arg, byte[] excess_data_arg); + // MUST_USE_RES struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_new(struct LDKThirtyTwoBytes chain_hash_arg, uint64_t short_channel_id_arg, uint32_t timestamp_arg, uint8_t message_flags_arg, uint8_t channel_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); + public static native long UnsignedChannelUpdate_new(byte[] chain_hash_arg, long short_channel_id_arg, int timestamp_arg, byte message_flags_arg, byte channel_flags_arg, short cltv_expiry_delta_arg, long htlc_minimum_msat_arg, long htlc_maximum_msat_arg, int fee_base_msat_arg, int fee_proportional_millionths_arg, byte[] excess_data_arg); // uint64_t UnsignedChannelUpdate_clone_ptr(LDKUnsignedChannelUpdate *NONNULL_PTR arg); public static native long UnsignedChannelUpdate_clone_ptr(long arg); // struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig); @@ -10773,10 +11338,10 @@ public class bindings { public static native byte[] Stfu_write(long obj); // struct LDKCResult_StfuDecodeErrorZ Stfu_read(struct LDKu8slice ser); public static native long Stfu_read(byte[] ser); - // struct LDKCVec_u8Z Splice_write(const struct LDKSplice *NONNULL_PTR obj); - public static native byte[] Splice_write(long obj); - // struct LDKCResult_SpliceDecodeErrorZ Splice_read(struct LDKu8slice ser); - public static native long Splice_read(byte[] ser); + // struct LDKCVec_u8Z SpliceInit_write(const struct LDKSpliceInit *NONNULL_PTR obj); + public static native byte[] SpliceInit_write(long obj); + // struct LDKCResult_SpliceInitDecodeErrorZ SpliceInit_read(struct LDKu8slice ser); + public static native long SpliceInit_read(byte[] ser); // struct LDKCVec_u8Z SpliceAck_write(const struct LDKSpliceAck *NONNULL_PTR obj); public static native byte[] SpliceAck_write(long obj); // struct LDKCResult_SpliceAckDecodeErrorZ SpliceAck_read(struct LDKu8slice ser); @@ -10837,6 +11402,10 @@ public class bindings { public static native byte[] ClosingSignedFeeRange_write(long obj); // struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ ClosingSignedFeeRange_read(struct LDKu8slice ser); public static native long ClosingSignedFeeRange_read(byte[] ser); + // struct LDKCVec_u8Z CommitmentSignedBatch_write(const struct LDKCommitmentSignedBatch *NONNULL_PTR obj); + public static native byte[] CommitmentSignedBatch_write(long obj); + // struct LDKCResult_CommitmentSignedBatchDecodeErrorZ CommitmentSignedBatch_read(struct LDKu8slice ser); + public static native long CommitmentSignedBatch_read(byte[] ser); // struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj); public static native byte[] CommitmentSigned_write(long obj); // struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser); @@ -10973,8 +11542,6 @@ public class bindings { public static native void IgnoringMessageHandler_free(long this_obj); // MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void); public static native long IgnoringMessageHandler_new(); - // struct LDKEventsProvider IgnoringMessageHandler_as_EventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg); - public static native long IgnoringMessageHandler_as_EventsProvider(long this_arg); // struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg); public static native long IgnoringMessageHandler_as_MessageSendEventsProvider(long this_arg); // struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg); @@ -10983,6 +11550,8 @@ public class bindings { public static native long IgnoringMessageHandler_as_OnionMessageHandler(long this_arg); // struct LDKOffersMessageHandler IgnoringMessageHandler_as_OffersMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg); public static native long IgnoringMessageHandler_as_OffersMessageHandler(long this_arg); + // struct LDKAsyncPaymentsMessageHandler IgnoringMessageHandler_as_AsyncPaymentsMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg); + public static native long IgnoringMessageHandler_as_AsyncPaymentsMessageHandler(long this_arg); // struct LDKCustomOnionMessageHandler IgnoringMessageHandler_as_CustomOnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg); public static native long IgnoringMessageHandler_as_CustomOnionMessageHandler(long this_arg); // struct LDKCustomMessageReader IgnoringMessageHandler_as_CustomMessageReader(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg); @@ -11235,6 +11804,8 @@ public class bindings { public static native long HTLCOutputInCommitment_clone(long orig); // bool HTLCOutputInCommitment_eq(const struct LDKHTLCOutputInCommitment *NONNULL_PTR a, const struct LDKHTLCOutputInCommitment *NONNULL_PTR b); public static native boolean HTLCOutputInCommitment_eq(long a, long b); + // MUST_USE_RES uint64_t HTLCOutputInCommitment_to_bitcoin_amount(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_arg); + public static native long HTLCOutputInCommitment_to_bitcoin_amount(long this_arg); // struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj); public static native byte[] HTLCOutputInCommitment_write(long obj); // struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser); @@ -11457,222 +12028,6 @@ public class bindings { public static native long TrustedCommitmentTransaction_build_to_local_justice_tx(long this_arg, long feerate_per_kw, byte[] destination_script); // uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster); public static native long get_commitment_transaction_number_obscure_factor(byte[] broadcaster_payment_basepoint, byte[] countersignatory_payment_basepoint, boolean outbound_from_broadcaster); - // bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b); - public static native boolean InitFeatures_eq(long a, long b); - // bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b); - public static native boolean NodeFeatures_eq(long a, long b); - // bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b); - public static native boolean ChannelFeatures_eq(long a, long b); - // bool Bolt11InvoiceFeatures_eq(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR b); - public static native boolean Bolt11InvoiceFeatures_eq(long a, long b); - // bool OfferFeatures_eq(const struct LDKOfferFeatures *NONNULL_PTR a, const struct LDKOfferFeatures *NONNULL_PTR b); - public static native boolean OfferFeatures_eq(long a, long b); - // bool InvoiceRequestFeatures_eq(const struct LDKInvoiceRequestFeatures *NONNULL_PTR a, const struct LDKInvoiceRequestFeatures *NONNULL_PTR b); - public static native boolean InvoiceRequestFeatures_eq(long a, long b); - // bool Bolt12InvoiceFeatures_eq(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR b); - public static native boolean Bolt12InvoiceFeatures_eq(long a, long b); - // bool BlindedHopFeatures_eq(const struct LDKBlindedHopFeatures *NONNULL_PTR a, const struct LDKBlindedHopFeatures *NONNULL_PTR b); - public static native boolean BlindedHopFeatures_eq(long a, long b); - // bool ChannelTypeFeatures_eq(const struct LDKChannelTypeFeatures *NONNULL_PTR a, const struct LDKChannelTypeFeatures *NONNULL_PTR b); - public static native boolean ChannelTypeFeatures_eq(long a, long b); - // uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg); - public static native long InitFeatures_clone_ptr(long arg); - // struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig); - public static native long InitFeatures_clone(long orig); - // uint64_t NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg); - public static native long NodeFeatures_clone_ptr(long arg); - // struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig); - public static native long NodeFeatures_clone(long orig); - // uint64_t ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg); - public static native long ChannelFeatures_clone_ptr(long arg); - // struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig); - public static native long ChannelFeatures_clone(long orig); - // uint64_t Bolt11InvoiceFeatures_clone_ptr(LDKBolt11InvoiceFeatures *NONNULL_PTR arg); - public static native long Bolt11InvoiceFeatures_clone_ptr(long arg); - // struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_clone(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR orig); - public static native long Bolt11InvoiceFeatures_clone(long orig); - // uint64_t OfferFeatures_clone_ptr(LDKOfferFeatures *NONNULL_PTR arg); - public static native long OfferFeatures_clone_ptr(long arg); - // struct LDKOfferFeatures OfferFeatures_clone(const struct LDKOfferFeatures *NONNULL_PTR orig); - public static native long OfferFeatures_clone(long orig); - // uint64_t InvoiceRequestFeatures_clone_ptr(LDKInvoiceRequestFeatures *NONNULL_PTR arg); - public static native long InvoiceRequestFeatures_clone_ptr(long arg); - // struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_clone(const struct LDKInvoiceRequestFeatures *NONNULL_PTR orig); - public static native long InvoiceRequestFeatures_clone(long orig); - // uint64_t Bolt12InvoiceFeatures_clone_ptr(LDKBolt12InvoiceFeatures *NONNULL_PTR arg); - public static native long Bolt12InvoiceFeatures_clone_ptr(long arg); - // struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_clone(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR orig); - public static native long Bolt12InvoiceFeatures_clone(long orig); - // uint64_t BlindedHopFeatures_clone_ptr(LDKBlindedHopFeatures *NONNULL_PTR arg); - public static native long BlindedHopFeatures_clone_ptr(long arg); - // struct LDKBlindedHopFeatures BlindedHopFeatures_clone(const struct LDKBlindedHopFeatures *NONNULL_PTR orig); - public static native long BlindedHopFeatures_clone(long orig); - // uint64_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg); - public static native long ChannelTypeFeatures_clone_ptr(long arg); - // struct LDKChannelTypeFeatures ChannelTypeFeatures_clone(const struct LDKChannelTypeFeatures *NONNULL_PTR orig); - public static native long ChannelTypeFeatures_clone(long orig); - // uint64_t InitFeatures_hash(const struct LDKInitFeatures *NONNULL_PTR o); - public static native long InitFeatures_hash(long o); - // uint64_t NodeFeatures_hash(const struct LDKNodeFeatures *NONNULL_PTR o); - public static native long NodeFeatures_hash(long o); - // uint64_t ChannelFeatures_hash(const struct LDKChannelFeatures *NONNULL_PTR o); - public static native long ChannelFeatures_hash(long o); - // uint64_t Bolt11InvoiceFeatures_hash(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR o); - public static native long Bolt11InvoiceFeatures_hash(long o); - // uint64_t OfferFeatures_hash(const struct LDKOfferFeatures *NONNULL_PTR o); - public static native long OfferFeatures_hash(long o); - // uint64_t InvoiceRequestFeatures_hash(const struct LDKInvoiceRequestFeatures *NONNULL_PTR o); - public static native long InvoiceRequestFeatures_hash(long o); - // uint64_t Bolt12InvoiceFeatures_hash(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR o); - public static native long Bolt12InvoiceFeatures_hash(long o); - // uint64_t BlindedHopFeatures_hash(const struct LDKBlindedHopFeatures *NONNULL_PTR o); - public static native long BlindedHopFeatures_hash(long o); - // uint64_t ChannelTypeFeatures_hash(const struct LDKChannelTypeFeatures *NONNULL_PTR o); - public static native long ChannelTypeFeatures_hash(long o); - // void InitFeatures_free(struct LDKInitFeatures this_obj); - public static native void InitFeatures_free(long this_obj); - // void NodeFeatures_free(struct LDKNodeFeatures this_obj); - public static native void NodeFeatures_free(long this_obj); - // void ChannelFeatures_free(struct LDKChannelFeatures this_obj); - public static native void ChannelFeatures_free(long this_obj); - // void Bolt11InvoiceFeatures_free(struct LDKBolt11InvoiceFeatures this_obj); - public static native void Bolt11InvoiceFeatures_free(long this_obj); - // void OfferFeatures_free(struct LDKOfferFeatures this_obj); - public static native void OfferFeatures_free(long this_obj); - // void InvoiceRequestFeatures_free(struct LDKInvoiceRequestFeatures this_obj); - public static native void InvoiceRequestFeatures_free(long this_obj); - // void Bolt12InvoiceFeatures_free(struct LDKBolt12InvoiceFeatures this_obj); - public static native void Bolt12InvoiceFeatures_free(long this_obj); - // void BlindedHopFeatures_free(struct LDKBlindedHopFeatures this_obj); - public static native void BlindedHopFeatures_free(long this_obj); - // void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj); - public static native void ChannelTypeFeatures_free(long this_obj); - // MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void); - public static native long InitFeatures_empty(); - // MUST_USE_RES bool InitFeatures_requires_unknown_bits_from(const struct LDKInitFeatures *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR other); - public static native boolean InitFeatures_requires_unknown_bits_from(long this_arg, long other); - // MUST_USE_RES bool InitFeatures_requires_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_requires_unknown_bits(long this_arg); - // MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_required_feature_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit); - public static native long InitFeatures_set_required_feature_bit(long this_arg, long bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_optional_feature_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit); - public static native long InitFeatures_set_optional_feature_bit(long this_arg, long bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_required_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit); - public static native long InitFeatures_set_required_custom_bit(long this_arg, long bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_optional_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit); - public static native long InitFeatures_set_optional_custom_bit(long this_arg, long bit); - // MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void); - public static native long NodeFeatures_empty(); - // MUST_USE_RES bool NodeFeatures_requires_unknown_bits_from(const struct LDKNodeFeatures *NONNULL_PTR this_arg, const struct LDKNodeFeatures *NONNULL_PTR other); - public static native boolean NodeFeatures_requires_unknown_bits_from(long this_arg, long other); - // MUST_USE_RES bool NodeFeatures_requires_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_requires_unknown_bits(long this_arg); - // MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_required_feature_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit); - public static native long NodeFeatures_set_required_feature_bit(long this_arg, long bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_optional_feature_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit); - public static native long NodeFeatures_set_optional_feature_bit(long this_arg, long bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_required_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit); - public static native long NodeFeatures_set_required_custom_bit(long this_arg, long bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_optional_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit); - public static native long NodeFeatures_set_optional_custom_bit(long this_arg, long bit); - // MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void); - public static native long ChannelFeatures_empty(); - // MUST_USE_RES bool ChannelFeatures_requires_unknown_bits_from(const struct LDKChannelFeatures *NONNULL_PTR this_arg, const struct LDKChannelFeatures *NONNULL_PTR other); - public static native boolean ChannelFeatures_requires_unknown_bits_from(long this_arg, long other); - // MUST_USE_RES bool ChannelFeatures_requires_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg); - public static native boolean ChannelFeatures_requires_unknown_bits(long this_arg); - // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_required_feature_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit); - public static native long ChannelFeatures_set_required_feature_bit(long this_arg, long bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_optional_feature_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit); - public static native long ChannelFeatures_set_optional_feature_bit(long this_arg, long bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_required_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit); - public static native long ChannelFeatures_set_required_custom_bit(long this_arg, long bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_optional_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit); - public static native long ChannelFeatures_set_optional_custom_bit(long this_arg, long bit); - // MUST_USE_RES struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_empty(void); - public static native long Bolt11InvoiceFeatures_empty(); - // MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR other); - public static native boolean Bolt11InvoiceFeatures_requires_unknown_bits_from(long this_arg, long other); - // MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - public static native boolean Bolt11InvoiceFeatures_requires_unknown_bits(long this_arg); - // MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_required_feature_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit); - public static native long Bolt11InvoiceFeatures_set_required_feature_bit(long this_arg, long bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_optional_feature_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit); - public static native long Bolt11InvoiceFeatures_set_optional_feature_bit(long this_arg, long bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_required_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit); - public static native long Bolt11InvoiceFeatures_set_required_custom_bit(long this_arg, long bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_optional_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit); - public static native long Bolt11InvoiceFeatures_set_optional_custom_bit(long this_arg, long bit); - // MUST_USE_RES struct LDKOfferFeatures OfferFeatures_empty(void); - public static native long OfferFeatures_empty(); - // MUST_USE_RES bool OfferFeatures_requires_unknown_bits_from(const struct LDKOfferFeatures *NONNULL_PTR this_arg, const struct LDKOfferFeatures *NONNULL_PTR other); - public static native boolean OfferFeatures_requires_unknown_bits_from(long this_arg, long other); - // MUST_USE_RES bool OfferFeatures_requires_unknown_bits(const struct LDKOfferFeatures *NONNULL_PTR this_arg); - public static native boolean OfferFeatures_requires_unknown_bits(long this_arg); - // MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_required_feature_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit); - public static native long OfferFeatures_set_required_feature_bit(long this_arg, long bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_optional_feature_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit); - public static native long OfferFeatures_set_optional_feature_bit(long this_arg, long bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_required_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit); - public static native long OfferFeatures_set_required_custom_bit(long this_arg, long bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_optional_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit); - public static native long OfferFeatures_set_optional_custom_bit(long this_arg, long bit); - // MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_empty(void); - public static native long InvoiceRequestFeatures_empty(); - // MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits_from(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, const struct LDKInvoiceRequestFeatures *NONNULL_PTR other); - public static native boolean InvoiceRequestFeatures_requires_unknown_bits_from(long this_arg, long other); - // MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg); - public static native boolean InvoiceRequestFeatures_requires_unknown_bits(long this_arg); - // MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_required_feature_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit); - public static native long InvoiceRequestFeatures_set_required_feature_bit(long this_arg, long bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_optional_feature_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit); - public static native long InvoiceRequestFeatures_set_optional_feature_bit(long this_arg, long bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_required_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit); - public static native long InvoiceRequestFeatures_set_required_custom_bit(long this_arg, long bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_optional_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit); - public static native long InvoiceRequestFeatures_set_optional_custom_bit(long this_arg, long bit); - // MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_empty(void); - public static native long Bolt12InvoiceFeatures_empty(); - // MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR other); - public static native boolean Bolt12InvoiceFeatures_requires_unknown_bits_from(long this_arg, long other); - // MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg); - public static native boolean Bolt12InvoiceFeatures_requires_unknown_bits(long this_arg); - // MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_required_feature_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit); - public static native long Bolt12InvoiceFeatures_set_required_feature_bit(long this_arg, long bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_optional_feature_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit); - public static native long Bolt12InvoiceFeatures_set_optional_feature_bit(long this_arg, long bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_required_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit); - public static native long Bolt12InvoiceFeatures_set_required_custom_bit(long this_arg, long bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_optional_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit); - public static native long Bolt12InvoiceFeatures_set_optional_custom_bit(long this_arg, long bit); - // MUST_USE_RES struct LDKBlindedHopFeatures BlindedHopFeatures_empty(void); - public static native long BlindedHopFeatures_empty(); - // MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits_from(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, const struct LDKBlindedHopFeatures *NONNULL_PTR other); - public static native boolean BlindedHopFeatures_requires_unknown_bits_from(long this_arg, long other); - // MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg); - public static native boolean BlindedHopFeatures_requires_unknown_bits(long this_arg); - // MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_required_feature_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit); - public static native long BlindedHopFeatures_set_required_feature_bit(long this_arg, long bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_optional_feature_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit); - public static native long BlindedHopFeatures_set_optional_feature_bit(long this_arg, long bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_required_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit); - public static native long BlindedHopFeatures_set_required_custom_bit(long this_arg, long bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_optional_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit); - public static native long BlindedHopFeatures_set_optional_custom_bit(long this_arg, long bit); - // MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void); - public static native long ChannelTypeFeatures_empty(); - // MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits_from(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, const struct LDKChannelTypeFeatures *NONNULL_PTR other); - public static native boolean ChannelTypeFeatures_requires_unknown_bits_from(long this_arg, long other); - // MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - public static native boolean ChannelTypeFeatures_requires_unknown_bits(long this_arg); - // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_required_feature_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit); - public static native long ChannelTypeFeatures_set_required_feature_bit(long this_arg, long bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_optional_feature_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit); - public static native long ChannelTypeFeatures_set_optional_feature_bit(long this_arg, long bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_required_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit); - public static native long ChannelTypeFeatures_set_required_custom_bit(long this_arg, long bit); - // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_optional_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit); - public static native long ChannelTypeFeatures_set_optional_custom_bit(long this_arg, long bit); // struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj); public static native byte[] InitFeatures_write(long obj); // struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser); @@ -11701,404 +12056,6 @@ public class bindings { public static native byte[] ChannelTypeFeatures_write(long obj); // struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ ChannelTypeFeatures_read(struct LDKu8slice ser); public static native long ChannelTypeFeatures_read(byte[] ser); - // void InitFeatures_set_data_loss_protect_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_data_loss_protect_optional(long this_arg); - // void InitFeatures_set_data_loss_protect_required(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_data_loss_protect_required(long this_arg); - // MUST_USE_RES bool InitFeatures_supports_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_supports_data_loss_protect(long this_arg); - // void NodeFeatures_set_data_loss_protect_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_data_loss_protect_optional(long this_arg); - // void NodeFeatures_set_data_loss_protect_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_data_loss_protect_required(long this_arg); - // MUST_USE_RES bool NodeFeatures_supports_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_supports_data_loss_protect(long this_arg); - // MUST_USE_RES bool InitFeatures_requires_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_requires_data_loss_protect(long this_arg); - // MUST_USE_RES bool NodeFeatures_requires_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_requires_data_loss_protect(long this_arg); - // void InitFeatures_set_initial_routing_sync_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_initial_routing_sync_optional(long this_arg); - // void InitFeatures_set_initial_routing_sync_required(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_initial_routing_sync_required(long this_arg); - // MUST_USE_RES bool InitFeatures_initial_routing_sync(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_initial_routing_sync(long this_arg); - // void InitFeatures_set_upfront_shutdown_script_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_upfront_shutdown_script_optional(long this_arg); - // void InitFeatures_set_upfront_shutdown_script_required(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_upfront_shutdown_script_required(long this_arg); - // MUST_USE_RES bool InitFeatures_supports_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_supports_upfront_shutdown_script(long this_arg); - // void NodeFeatures_set_upfront_shutdown_script_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_upfront_shutdown_script_optional(long this_arg); - // void NodeFeatures_set_upfront_shutdown_script_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_upfront_shutdown_script_required(long this_arg); - // MUST_USE_RES bool NodeFeatures_supports_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_supports_upfront_shutdown_script(long this_arg); - // MUST_USE_RES bool InitFeatures_requires_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_requires_upfront_shutdown_script(long this_arg); - // MUST_USE_RES bool NodeFeatures_requires_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_requires_upfront_shutdown_script(long this_arg); - // void InitFeatures_set_gossip_queries_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_gossip_queries_optional(long this_arg); - // void InitFeatures_set_gossip_queries_required(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_gossip_queries_required(long this_arg); - // MUST_USE_RES bool InitFeatures_supports_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_supports_gossip_queries(long this_arg); - // void NodeFeatures_set_gossip_queries_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_gossip_queries_optional(long this_arg); - // void NodeFeatures_set_gossip_queries_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_gossip_queries_required(long this_arg); - // MUST_USE_RES bool NodeFeatures_supports_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_supports_gossip_queries(long this_arg); - // MUST_USE_RES bool InitFeatures_requires_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_requires_gossip_queries(long this_arg); - // MUST_USE_RES bool NodeFeatures_requires_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_requires_gossip_queries(long this_arg); - // void InitFeatures_set_variable_length_onion_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_variable_length_onion_optional(long this_arg); - // void InitFeatures_set_variable_length_onion_required(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_variable_length_onion_required(long this_arg); - // MUST_USE_RES bool InitFeatures_supports_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_supports_variable_length_onion(long this_arg); - // void NodeFeatures_set_variable_length_onion_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_variable_length_onion_optional(long this_arg); - // void NodeFeatures_set_variable_length_onion_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_variable_length_onion_required(long this_arg); - // MUST_USE_RES bool NodeFeatures_supports_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_supports_variable_length_onion(long this_arg); - // void Bolt11InvoiceFeatures_set_variable_length_onion_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - public static native void Bolt11InvoiceFeatures_set_variable_length_onion_optional(long this_arg); - // void Bolt11InvoiceFeatures_set_variable_length_onion_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - public static native void Bolt11InvoiceFeatures_set_variable_length_onion_required(long this_arg); - // MUST_USE_RES bool Bolt11InvoiceFeatures_supports_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - public static native boolean Bolt11InvoiceFeatures_supports_variable_length_onion(long this_arg); - // MUST_USE_RES bool InitFeatures_requires_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_requires_variable_length_onion(long this_arg); - // MUST_USE_RES bool NodeFeatures_requires_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_requires_variable_length_onion(long this_arg); - // MUST_USE_RES bool Bolt11InvoiceFeatures_requires_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - public static native boolean Bolt11InvoiceFeatures_requires_variable_length_onion(long this_arg); - // void InitFeatures_set_static_remote_key_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_static_remote_key_optional(long this_arg); - // void InitFeatures_set_static_remote_key_required(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_static_remote_key_required(long this_arg); - // MUST_USE_RES bool InitFeatures_supports_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_supports_static_remote_key(long this_arg); - // void NodeFeatures_set_static_remote_key_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_static_remote_key_optional(long this_arg); - // void NodeFeatures_set_static_remote_key_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_static_remote_key_required(long this_arg); - // MUST_USE_RES bool NodeFeatures_supports_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_supports_static_remote_key(long this_arg); - // void ChannelTypeFeatures_set_static_remote_key_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - public static native void ChannelTypeFeatures_set_static_remote_key_optional(long this_arg); - // void ChannelTypeFeatures_set_static_remote_key_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - public static native void ChannelTypeFeatures_set_static_remote_key_required(long this_arg); - // MUST_USE_RES bool ChannelTypeFeatures_supports_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - public static native boolean ChannelTypeFeatures_supports_static_remote_key(long this_arg); - // MUST_USE_RES bool InitFeatures_requires_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_requires_static_remote_key(long this_arg); - // MUST_USE_RES bool NodeFeatures_requires_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_requires_static_remote_key(long this_arg); - // MUST_USE_RES bool ChannelTypeFeatures_requires_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - public static native boolean ChannelTypeFeatures_requires_static_remote_key(long this_arg); - // void InitFeatures_set_payment_secret_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_payment_secret_optional(long this_arg); - // void InitFeatures_set_payment_secret_required(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_payment_secret_required(long this_arg); - // MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_supports_payment_secret(long this_arg); - // void NodeFeatures_set_payment_secret_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_payment_secret_optional(long this_arg); - // void NodeFeatures_set_payment_secret_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_payment_secret_required(long this_arg); - // MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_supports_payment_secret(long this_arg); - // void Bolt11InvoiceFeatures_set_payment_secret_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - public static native void Bolt11InvoiceFeatures_set_payment_secret_optional(long this_arg); - // void Bolt11InvoiceFeatures_set_payment_secret_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - public static native void Bolt11InvoiceFeatures_set_payment_secret_required(long this_arg); - // MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - public static native boolean Bolt11InvoiceFeatures_supports_payment_secret(long this_arg); - // MUST_USE_RES bool InitFeatures_requires_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_requires_payment_secret(long this_arg); - // MUST_USE_RES bool NodeFeatures_requires_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_requires_payment_secret(long this_arg); - // MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - public static native boolean Bolt11InvoiceFeatures_requires_payment_secret(long this_arg); - // void InitFeatures_set_basic_mpp_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_basic_mpp_optional(long this_arg); - // void InitFeatures_set_basic_mpp_required(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_basic_mpp_required(long this_arg); - // MUST_USE_RES bool InitFeatures_supports_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_supports_basic_mpp(long this_arg); - // void NodeFeatures_set_basic_mpp_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_basic_mpp_optional(long this_arg); - // void NodeFeatures_set_basic_mpp_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_basic_mpp_required(long this_arg); - // MUST_USE_RES bool NodeFeatures_supports_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_supports_basic_mpp(long this_arg); - // void Bolt11InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - public static native void Bolt11InvoiceFeatures_set_basic_mpp_optional(long this_arg); - // void Bolt11InvoiceFeatures_set_basic_mpp_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - public static native void Bolt11InvoiceFeatures_set_basic_mpp_required(long this_arg); - // MUST_USE_RES bool Bolt11InvoiceFeatures_supports_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - public static native boolean Bolt11InvoiceFeatures_supports_basic_mpp(long this_arg); - // void Bolt12InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg); - public static native void Bolt12InvoiceFeatures_set_basic_mpp_optional(long this_arg); - // void Bolt12InvoiceFeatures_set_basic_mpp_required(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg); - public static native void Bolt12InvoiceFeatures_set_basic_mpp_required(long this_arg); - // MUST_USE_RES bool Bolt12InvoiceFeatures_supports_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg); - public static native boolean Bolt12InvoiceFeatures_supports_basic_mpp(long this_arg); - // MUST_USE_RES bool InitFeatures_requires_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_requires_basic_mpp(long this_arg); - // MUST_USE_RES bool NodeFeatures_requires_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_requires_basic_mpp(long this_arg); - // MUST_USE_RES bool Bolt11InvoiceFeatures_requires_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - public static native boolean Bolt11InvoiceFeatures_requires_basic_mpp(long this_arg); - // MUST_USE_RES bool Bolt12InvoiceFeatures_requires_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg); - public static native boolean Bolt12InvoiceFeatures_requires_basic_mpp(long this_arg); - // void InitFeatures_set_wumbo_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_wumbo_optional(long this_arg); - // void InitFeatures_set_wumbo_required(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_wumbo_required(long this_arg); - // MUST_USE_RES bool InitFeatures_supports_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_supports_wumbo(long this_arg); - // void NodeFeatures_set_wumbo_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_wumbo_optional(long this_arg); - // void NodeFeatures_set_wumbo_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_wumbo_required(long this_arg); - // MUST_USE_RES bool NodeFeatures_supports_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_supports_wumbo(long this_arg); - // MUST_USE_RES bool InitFeatures_requires_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_requires_wumbo(long this_arg); - // MUST_USE_RES bool NodeFeatures_requires_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_requires_wumbo(long this_arg); - // void InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(long this_arg); - // void InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(long this_arg); - // MUST_USE_RES bool InitFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_supports_anchors_nonzero_fee_htlc_tx(long this_arg); - // void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(long this_arg); - // void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(long this_arg); - // MUST_USE_RES bool NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(long this_arg); - // void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - public static native void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(long this_arg); - // void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - public static native void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(long this_arg); - // MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - public static native boolean ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(long this_arg); - // MUST_USE_RES bool InitFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_requires_anchors_nonzero_fee_htlc_tx(long this_arg); - // MUST_USE_RES bool NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(long this_arg); - // MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - public static native boolean ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(long this_arg); - // void InitFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_anchors_zero_fee_htlc_tx_optional(long this_arg); - // void InitFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_anchors_zero_fee_htlc_tx_required(long this_arg); - // MUST_USE_RES bool InitFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_supports_anchors_zero_fee_htlc_tx(long this_arg); - // void NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(long this_arg); - // void NodeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_anchors_zero_fee_htlc_tx_required(long this_arg); - // MUST_USE_RES bool NodeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_supports_anchors_zero_fee_htlc_tx(long this_arg); - // void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - public static native void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(long this_arg); - // void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - public static native void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(long this_arg); - // MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - public static native boolean ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(long this_arg); - // MUST_USE_RES bool InitFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_requires_anchors_zero_fee_htlc_tx(long this_arg); - // MUST_USE_RES bool NodeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_requires_anchors_zero_fee_htlc_tx(long this_arg); - // MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - public static native boolean ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(long this_arg); - // void InitFeatures_set_route_blinding_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_route_blinding_optional(long this_arg); - // void InitFeatures_set_route_blinding_required(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_route_blinding_required(long this_arg); - // MUST_USE_RES bool InitFeatures_supports_route_blinding(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_supports_route_blinding(long this_arg); - // void NodeFeatures_set_route_blinding_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_route_blinding_optional(long this_arg); - // void NodeFeatures_set_route_blinding_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_route_blinding_required(long this_arg); - // MUST_USE_RES bool NodeFeatures_supports_route_blinding(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_supports_route_blinding(long this_arg); - // MUST_USE_RES bool InitFeatures_requires_route_blinding(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_requires_route_blinding(long this_arg); - // MUST_USE_RES bool NodeFeatures_requires_route_blinding(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_requires_route_blinding(long this_arg); - // void InitFeatures_set_shutdown_any_segwit_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_shutdown_any_segwit_optional(long this_arg); - // void InitFeatures_set_shutdown_any_segwit_required(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_shutdown_any_segwit_required(long this_arg); - // MUST_USE_RES bool InitFeatures_supports_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_supports_shutdown_anysegwit(long this_arg); - // void NodeFeatures_set_shutdown_any_segwit_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_shutdown_any_segwit_optional(long this_arg); - // void NodeFeatures_set_shutdown_any_segwit_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_shutdown_any_segwit_required(long this_arg); - // MUST_USE_RES bool NodeFeatures_supports_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_supports_shutdown_anysegwit(long this_arg); - // MUST_USE_RES bool InitFeatures_requires_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_requires_shutdown_anysegwit(long this_arg); - // MUST_USE_RES bool NodeFeatures_requires_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_requires_shutdown_anysegwit(long this_arg); - // void InitFeatures_set_taproot_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_taproot_optional(long this_arg); - // void InitFeatures_set_taproot_required(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_taproot_required(long this_arg); - // MUST_USE_RES bool InitFeatures_supports_taproot(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_supports_taproot(long this_arg); - // void NodeFeatures_set_taproot_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_taproot_optional(long this_arg); - // void NodeFeatures_set_taproot_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_taproot_required(long this_arg); - // MUST_USE_RES bool NodeFeatures_supports_taproot(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_supports_taproot(long this_arg); - // void ChannelTypeFeatures_set_taproot_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - public static native void ChannelTypeFeatures_set_taproot_optional(long this_arg); - // void ChannelTypeFeatures_set_taproot_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - public static native void ChannelTypeFeatures_set_taproot_required(long this_arg); - // MUST_USE_RES bool ChannelTypeFeatures_supports_taproot(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - public static native boolean ChannelTypeFeatures_supports_taproot(long this_arg); - // MUST_USE_RES bool InitFeatures_requires_taproot(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_requires_taproot(long this_arg); - // MUST_USE_RES bool NodeFeatures_requires_taproot(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_requires_taproot(long this_arg); - // MUST_USE_RES bool ChannelTypeFeatures_requires_taproot(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - public static native boolean ChannelTypeFeatures_requires_taproot(long this_arg); - // void InitFeatures_set_onion_messages_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_onion_messages_optional(long this_arg); - // void InitFeatures_set_onion_messages_required(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_onion_messages_required(long this_arg); - // MUST_USE_RES bool InitFeatures_supports_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_supports_onion_messages(long this_arg); - // void NodeFeatures_set_onion_messages_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_onion_messages_optional(long this_arg); - // void NodeFeatures_set_onion_messages_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_onion_messages_required(long this_arg); - // MUST_USE_RES bool NodeFeatures_supports_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_supports_onion_messages(long this_arg); - // MUST_USE_RES bool InitFeatures_requires_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_requires_onion_messages(long this_arg); - // MUST_USE_RES bool NodeFeatures_requires_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_requires_onion_messages(long this_arg); - // void InitFeatures_set_channel_type_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_channel_type_optional(long this_arg); - // void InitFeatures_set_channel_type_required(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_channel_type_required(long this_arg); - // MUST_USE_RES bool InitFeatures_supports_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_supports_channel_type(long this_arg); - // void NodeFeatures_set_channel_type_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_channel_type_optional(long this_arg); - // void NodeFeatures_set_channel_type_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_channel_type_required(long this_arg); - // MUST_USE_RES bool NodeFeatures_supports_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_supports_channel_type(long this_arg); - // MUST_USE_RES bool InitFeatures_requires_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_requires_channel_type(long this_arg); - // MUST_USE_RES bool NodeFeatures_requires_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_requires_channel_type(long this_arg); - // void InitFeatures_set_scid_privacy_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_scid_privacy_optional(long this_arg); - // void InitFeatures_set_scid_privacy_required(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_scid_privacy_required(long this_arg); - // MUST_USE_RES bool InitFeatures_supports_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_supports_scid_privacy(long this_arg); - // void NodeFeatures_set_scid_privacy_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_scid_privacy_optional(long this_arg); - // void NodeFeatures_set_scid_privacy_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_scid_privacy_required(long this_arg); - // MUST_USE_RES bool NodeFeatures_supports_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_supports_scid_privacy(long this_arg); - // void ChannelTypeFeatures_set_scid_privacy_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - public static native void ChannelTypeFeatures_set_scid_privacy_optional(long this_arg); - // void ChannelTypeFeatures_set_scid_privacy_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - public static native void ChannelTypeFeatures_set_scid_privacy_required(long this_arg); - // MUST_USE_RES bool ChannelTypeFeatures_supports_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - public static native boolean ChannelTypeFeatures_supports_scid_privacy(long this_arg); - // MUST_USE_RES bool InitFeatures_requires_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_requires_scid_privacy(long this_arg); - // MUST_USE_RES bool NodeFeatures_requires_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_requires_scid_privacy(long this_arg); - // MUST_USE_RES bool ChannelTypeFeatures_requires_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - public static native boolean ChannelTypeFeatures_requires_scid_privacy(long this_arg); - // void Bolt11InvoiceFeatures_set_payment_metadata_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - public static native void Bolt11InvoiceFeatures_set_payment_metadata_optional(long this_arg); - // void Bolt11InvoiceFeatures_set_payment_metadata_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - public static native void Bolt11InvoiceFeatures_set_payment_metadata_required(long this_arg); - // MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - public static native boolean Bolt11InvoiceFeatures_supports_payment_metadata(long this_arg); - // MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - public static native boolean Bolt11InvoiceFeatures_requires_payment_metadata(long this_arg); - // void InitFeatures_set_zero_conf_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_zero_conf_optional(long this_arg); - // void InitFeatures_set_zero_conf_required(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_zero_conf_required(long this_arg); - // MUST_USE_RES bool InitFeatures_supports_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_supports_zero_conf(long this_arg); - // void NodeFeatures_set_zero_conf_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_zero_conf_optional(long this_arg); - // void NodeFeatures_set_zero_conf_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_zero_conf_required(long this_arg); - // MUST_USE_RES bool NodeFeatures_supports_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_supports_zero_conf(long this_arg); - // void ChannelTypeFeatures_set_zero_conf_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - public static native void ChannelTypeFeatures_set_zero_conf_optional(long this_arg); - // void ChannelTypeFeatures_set_zero_conf_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - public static native void ChannelTypeFeatures_set_zero_conf_required(long this_arg); - // MUST_USE_RES bool ChannelTypeFeatures_supports_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - public static native boolean ChannelTypeFeatures_supports_zero_conf(long this_arg); - // MUST_USE_RES bool InitFeatures_requires_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_requires_zero_conf(long this_arg); - // MUST_USE_RES bool NodeFeatures_requires_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_requires_zero_conf(long this_arg); - // MUST_USE_RES bool ChannelTypeFeatures_requires_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - public static native boolean ChannelTypeFeatures_requires_zero_conf(long this_arg); - // void NodeFeatures_set_keysend_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_keysend_optional(long this_arg); - // void NodeFeatures_set_keysend_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_keysend_required(long this_arg); - // MUST_USE_RES bool NodeFeatures_supports_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_supports_keysend(long this_arg); - // MUST_USE_RES bool NodeFeatures_requires_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_requires_keysend(long this_arg); - // void InitFeatures_set_trampoline_routing_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_trampoline_routing_optional(long this_arg); - // void InitFeatures_set_trampoline_routing_required(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_set_trampoline_routing_required(long this_arg); - // MUST_USE_RES bool InitFeatures_supports_trampoline_routing(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_supports_trampoline_routing(long this_arg); - // void NodeFeatures_set_trampoline_routing_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_trampoline_routing_optional(long this_arg); - // void NodeFeatures_set_trampoline_routing_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_set_trampoline_routing_required(long this_arg); - // MUST_USE_RES bool NodeFeatures_supports_trampoline_routing(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_supports_trampoline_routing(long this_arg); - // void Bolt11InvoiceFeatures_set_trampoline_routing_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - public static native void Bolt11InvoiceFeatures_set_trampoline_routing_optional(long this_arg); - // void Bolt11InvoiceFeatures_set_trampoline_routing_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - public static native void Bolt11InvoiceFeatures_set_trampoline_routing_required(long this_arg); - // MUST_USE_RES bool Bolt11InvoiceFeatures_supports_trampoline_routing(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - public static native boolean Bolt11InvoiceFeatures_supports_trampoline_routing(long this_arg); - // MUST_USE_RES bool InitFeatures_requires_trampoline_routing(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_requires_trampoline_routing(long this_arg); - // MUST_USE_RES bool NodeFeatures_requires_trampoline_routing(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_requires_trampoline_routing(long this_arg); - // MUST_USE_RES bool Bolt11InvoiceFeatures_requires_trampoline_routing(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); - public static native boolean Bolt11InvoiceFeatures_requires_trampoline_routing(long this_arg); // void ShutdownScript_free(struct LDKShutdownScript this_obj); public static native void ShutdownScript_free(long this_obj); // uint64_t ShutdownScript_clone_ptr(LDKShutdownScript *NONNULL_PTR arg); @@ -12175,6 +12132,24 @@ public class bindings { public static native long ChannelId_read(byte[] ser); // struct LDKStr ChannelId_to_str(const struct LDKChannelId *NONNULL_PTR o); public static native String ChannelId_to_str(long o); + // 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); + public static native long create_phantom_invoice(long amt_msat, long payment_hash, String description, int invoice_expiry_delta_secs, long[] phantom_route_hints, long entropy_source, long node_signer, long logger, Currency network, long min_final_cltv_expiry_delta, long duration_since_epoch); + // 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); + public static native long create_phantom_invoice_with_description_hash(long amt_msat, long payment_hash, int invoice_expiry_delta_secs, long description_hash, long[] phantom_route_hints, long entropy_source, long node_signer, long logger, Currency network, long min_final_cltv_expiry_delta, long duration_since_epoch); + // 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); + public static native long create_invoice_from_channelmanager(long channelmanager, long node_signer, long logger, Currency network, long amt_msat, String description, int invoice_expiry_delta_secs, long min_final_cltv_expiry_delta); + // 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); + public static native long create_invoice_from_channelmanager_with_description_hash(long channelmanager, long node_signer, long logger, Currency network, long amt_msat, long description_hash, int invoice_expiry_delta_secs, long min_final_cltv_expiry_delta); + // 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); + public static native long create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(long channelmanager, long node_signer, long logger, Currency network, long amt_msat, long description_hash, long duration_since_epoch, int invoice_expiry_delta_secs, long min_final_cltv_expiry_delta); + // 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); + public static native long create_invoice_from_channelmanager_and_duration_since_epoch(long channelmanager, long node_signer, long logger, Currency network, long amt_msat, String description, long duration_since_epoch, int invoice_expiry_delta_secs, long min_final_cltv_expiry_delta); + // 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); + public static native long create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(long channelmanager, long node_signer, long logger, Currency network, long amt_msat, String description, long duration_since_epoch, int invoice_expiry_delta_secs, byte[] payment_hash, long min_final_cltv_expiry_delta); + // struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ payment_parameters_from_zero_amount_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice, uint64_t amount_msat); + public static native long payment_parameters_from_zero_amount_invoice(long invoice, long amount_msat); + // struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ payment_parameters_from_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice); + public static native long payment_parameters_from_invoice(long invoice); // void Retry_free(struct LDKRetry this_ptr); public static native void Retry_free(long this_ptr); // uint64_t Retry_clone_ptr(LDKRetry *NONNULL_PTR arg); @@ -12201,6 +12176,8 @@ public class bindings { public static native RetryableSendFailure RetryableSendFailure_route_not_found(); // enum LDKRetryableSendFailure RetryableSendFailure_duplicate_payment(void); public static native RetryableSendFailure RetryableSendFailure_duplicate_payment(); + // enum LDKRetryableSendFailure RetryableSendFailure_onion_packet_size_exceeded(void); + public static native RetryableSendFailure RetryableSendFailure_onion_packet_size_exceeded(); // bool RetryableSendFailure_eq(const enum LDKRetryableSendFailure *NONNULL_PTR a, const enum LDKRetryableSendFailure *NONNULL_PTR b); public static native boolean RetryableSendFailure_eq(long a, long b); // void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr); @@ -12221,6 +12198,22 @@ public class bindings { public static native long PaymentSendFailure_partial_failure(long[] results, long failed_paths_retry, byte[] payment_id); // bool PaymentSendFailure_eq(const struct LDKPaymentSendFailure *NONNULL_PTR a, const struct LDKPaymentSendFailure *NONNULL_PTR b); public static native boolean PaymentSendFailure_eq(long a, long b); + // void Bolt12PaymentError_free(struct LDKBolt12PaymentError this_ptr); + public static native void Bolt12PaymentError_free(long this_ptr); + // uint64_t Bolt12PaymentError_clone_ptr(LDKBolt12PaymentError *NONNULL_PTR arg); + public static native long Bolt12PaymentError_clone_ptr(long arg); + // struct LDKBolt12PaymentError Bolt12PaymentError_clone(const struct LDKBolt12PaymentError *NONNULL_PTR orig); + public static native long Bolt12PaymentError_clone(long orig); + // struct LDKBolt12PaymentError Bolt12PaymentError_unexpected_invoice(void); + public static native long Bolt12PaymentError_unexpected_invoice(); + // struct LDKBolt12PaymentError Bolt12PaymentError_duplicate_invoice(void); + public static native long Bolt12PaymentError_duplicate_invoice(); + // struct LDKBolt12PaymentError Bolt12PaymentError_unknown_required_features(void); + public static native long Bolt12PaymentError_unknown_required_features(); + // struct LDKBolt12PaymentError Bolt12PaymentError_sending_failed(enum LDKRetryableSendFailure a); + public static native long Bolt12PaymentError_sending_failed(RetryableSendFailure a); + // bool Bolt12PaymentError_eq(const struct LDKBolt12PaymentError *NONNULL_PTR a, const struct LDKBolt12PaymentError *NONNULL_PTR b); + public static native boolean Bolt12PaymentError_eq(long a, long b); // void ProbeSendFailure_free(struct LDKProbeSendFailure this_ptr); public static native void ProbeSendFailure_free(long this_ptr); // uint64_t ProbeSendFailure_clone_ptr(LDKProbeSendFailure *NONNULL_PTR arg); @@ -12313,14 +12306,14 @@ public class bindings { public static native void OfferWithExplicitMetadataBuilder_description(long this_arg, String description); // MUST_USE_RES void OfferWithExplicitMetadataBuilder_issuer(struct LDKOfferWithExplicitMetadataBuilder this_arg, struct LDKStr issuer); public static native void OfferWithExplicitMetadataBuilder_issuer(long this_arg, String issuer); - // MUST_USE_RES void OfferWithExplicitMetadataBuilder_path(struct LDKOfferWithExplicitMetadataBuilder this_arg, struct LDKBlindedPath path); + // MUST_USE_RES void OfferWithExplicitMetadataBuilder_path(struct LDKOfferWithExplicitMetadataBuilder this_arg, struct LDKBlindedMessagePath path); public static native void OfferWithExplicitMetadataBuilder_path(long this_arg, long path); // MUST_USE_RES void OfferWithExplicitMetadataBuilder_supported_quantity(struct LDKOfferWithExplicitMetadataBuilder this_arg, struct LDKQuantity quantity); public static native void OfferWithExplicitMetadataBuilder_supported_quantity(long this_arg, long quantity); // MUST_USE_RES struct LDKCResult_OfferBolt12SemanticErrorZ OfferWithExplicitMetadataBuilder_build(struct LDKOfferWithExplicitMetadataBuilder this_arg); public static native long OfferWithExplicitMetadataBuilder_build(long this_arg); - // MUST_USE_RES struct LDKOfferWithDerivedMetadataBuilder OfferWithDerivedMetadataBuilder_deriving_signing_pubkey(struct LDKPublicKey node_id, const struct LDKExpandedKey *NONNULL_PTR expanded_key, struct LDKEntropySource entropy_source); - public static native long OfferWithDerivedMetadataBuilder_deriving_signing_pubkey(byte[] node_id, long expanded_key, long entropy_source); + // MUST_USE_RES struct LDKOfferWithDerivedMetadataBuilder OfferWithDerivedMetadataBuilder_deriving_signing_pubkey(struct LDKPublicKey node_id, const struct LDKExpandedKey *NONNULL_PTR expanded_key, struct LDKNonce nonce); + public static native long OfferWithDerivedMetadataBuilder_deriving_signing_pubkey(byte[] node_id, long expanded_key, long nonce); // MUST_USE_RES void OfferWithDerivedMetadataBuilder_chain(struct LDKOfferWithDerivedMetadataBuilder this_arg, enum LDKNetwork network); public static native void OfferWithDerivedMetadataBuilder_chain(long this_arg, Network network); // MUST_USE_RES void OfferWithDerivedMetadataBuilder_amount_msats(struct LDKOfferWithDerivedMetadataBuilder this_arg, uint64_t amount_msats); @@ -12331,7 +12324,7 @@ public class bindings { public static native void OfferWithDerivedMetadataBuilder_description(long this_arg, String description); // MUST_USE_RES void OfferWithDerivedMetadataBuilder_issuer(struct LDKOfferWithDerivedMetadataBuilder this_arg, struct LDKStr issuer); public static native void OfferWithDerivedMetadataBuilder_issuer(long this_arg, String issuer); - // MUST_USE_RES void OfferWithDerivedMetadataBuilder_path(struct LDKOfferWithDerivedMetadataBuilder this_arg, struct LDKBlindedPath path); + // MUST_USE_RES void OfferWithDerivedMetadataBuilder_path(struct LDKOfferWithDerivedMetadataBuilder this_arg, struct LDKBlindedMessagePath path); public static native void OfferWithDerivedMetadataBuilder_path(long this_arg, long path); // MUST_USE_RES void OfferWithDerivedMetadataBuilder_supported_quantity(struct LDKOfferWithDerivedMetadataBuilder this_arg, struct LDKQuantity quantity); public static native void OfferWithDerivedMetadataBuilder_supported_quantity(long this_arg, long quantity); @@ -12357,7 +12350,7 @@ public class bindings { public static native long Offer_absolute_expiry(long this_arg); // MUST_USE_RES struct LDKPrintableString Offer_issuer(const struct LDKOffer *NONNULL_PTR this_arg); public static native long Offer_issuer(long this_arg); - // MUST_USE_RES struct LDKCVec_BlindedPathZ Offer_paths(const struct LDKOffer *NONNULL_PTR this_arg); + // MUST_USE_RES struct LDKCVec_BlindedMessagePathZ Offer_paths(const struct LDKOffer *NONNULL_PTR this_arg); public static native long[] Offer_paths(long this_arg); // MUST_USE_RES struct LDKQuantity Offer_supported_quantity(const struct LDKOffer *NONNULL_PTR this_arg); public static native long Offer_supported_quantity(long this_arg); @@ -12375,14 +12368,16 @@ public class bindings { public static native boolean Offer_is_valid_quantity(long this_arg, long quantity); // MUST_USE_RES bool Offer_expects_quantity(const struct LDKOffer *NONNULL_PTR this_arg); public static native boolean Offer_expects_quantity(long this_arg); - // 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); - public static native long Offer_request_invoice_deriving_payer_id(long this_arg, long expanded_key, long entropy_source, byte[] payment_id); - // 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); - public static native long Offer_request_invoice_deriving_metadata(long this_arg, byte[] payer_id, long expanded_key, long entropy_source, byte[] payment_id); + // 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 LDKNonce nonce, struct LDKThirtyTwoBytes payment_id); + public static native long Offer_request_invoice_deriving_payer_id(long this_arg, long expanded_key, long nonce, byte[] payment_id); + // 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 LDKNonce nonce, struct LDKThirtyTwoBytes payment_id); + public static native long Offer_request_invoice_deriving_metadata(long this_arg, byte[] payer_id, long expanded_key, long nonce, byte[] payment_id); // MUST_USE_RES struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ Offer_request_invoice(const struct LDKOffer *NONNULL_PTR this_arg, struct LDKCVec_u8Z metadata, struct LDKPublicKey payer_id); public static native long Offer_request_invoice(long this_arg, byte[] metadata, byte[] payer_id); // uint64_t Offer_hash(const struct LDKOffer *NONNULL_PTR o); public static native long Offer_hash(long o); + // struct LDKCResult_OfferDecodeErrorZ Offer_read(struct LDKu8slice ser); + public static native long Offer_read(byte[] ser); // struct LDKCVec_u8Z Offer_write(const struct LDKOffer *NONNULL_PTR obj); public static native byte[] Offer_write(long obj); // void Amount_free(struct LDKAmount this_ptr); @@ -12455,6 +12450,18 @@ public class bindings { public static native long Bolt12Invoice_clone_ptr(long arg); // struct LDKBolt12Invoice Bolt12Invoice_clone(const struct LDKBolt12Invoice *NONNULL_PTR orig); public static native long Bolt12Invoice_clone(long orig); + // MUST_USE_RES uint64_t UnsignedBolt12Invoice_created_at(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); + public static native long UnsignedBolt12Invoice_created_at(long this_arg); + // MUST_USE_RES uint64_t UnsignedBolt12Invoice_relative_expiry(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); + public static native long UnsignedBolt12Invoice_relative_expiry(long this_arg); + // MUST_USE_RES bool UnsignedBolt12Invoice_is_expired(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); + public static native boolean UnsignedBolt12Invoice_is_expired(long this_arg); + // MUST_USE_RES struct LDKCVec_StrZ UnsignedBolt12Invoice_fallbacks(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); + public static native String[] UnsignedBolt12Invoice_fallbacks(long this_arg); + // MUST_USE_RES struct LDKBolt12InvoiceFeatures UnsignedBolt12Invoice_invoice_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); + public static native long UnsignedBolt12Invoice_invoice_features(long this_arg); + // MUST_USE_RES struct LDKPublicKey UnsignedBolt12Invoice_signing_pubkey(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); + public static native byte[] UnsignedBolt12Invoice_signing_pubkey(long this_arg); // MUST_USE_RES struct LDKCOption_CVec_ThirtyTwoBytesZZ UnsignedBolt12Invoice_offer_chains(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); public static native long UnsignedBolt12Invoice_offer_chains(long this_arg); // MUST_USE_RES struct LDKThirtyTwoBytes UnsignedBolt12Invoice_chain(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); @@ -12471,7 +12478,7 @@ public class bindings { public static native long UnsignedBolt12Invoice_absolute_expiry(long this_arg); // MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_issuer(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); public static native long UnsignedBolt12Invoice_issuer(long this_arg); - // MUST_USE_RES struct LDKCVec_BlindedPathZ UnsignedBolt12Invoice_message_paths(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); + // MUST_USE_RES struct LDKCVec_BlindedMessagePathZ UnsignedBolt12Invoice_message_paths(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); public static native long[] UnsignedBolt12Invoice_message_paths(long this_arg); // MUST_USE_RES struct LDKCOption_QuantityZ UnsignedBolt12Invoice_supported_quantity(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); public static native long UnsignedBolt12Invoice_supported_quantity(long this_arg); @@ -12485,20 +12492,22 @@ public class bindings { public static native byte[] UnsignedBolt12Invoice_payer_id(long this_arg); // MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_payer_note(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); public static native long UnsignedBolt12Invoice_payer_note(long this_arg); - // MUST_USE_RES uint64_t UnsignedBolt12Invoice_created_at(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); - public static native long UnsignedBolt12Invoice_created_at(long this_arg); - // MUST_USE_RES uint64_t UnsignedBolt12Invoice_relative_expiry(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); - public static native long UnsignedBolt12Invoice_relative_expiry(long this_arg); - // MUST_USE_RES bool UnsignedBolt12Invoice_is_expired(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); - public static native boolean UnsignedBolt12Invoice_is_expired(long this_arg); // MUST_USE_RES struct LDKThirtyTwoBytes UnsignedBolt12Invoice_payment_hash(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); public static native byte[] UnsignedBolt12Invoice_payment_hash(long this_arg); // MUST_USE_RES uint64_t UnsignedBolt12Invoice_amount_msats(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); public static native long UnsignedBolt12Invoice_amount_msats(long this_arg); - // MUST_USE_RES struct LDKBolt12InvoiceFeatures UnsignedBolt12Invoice_invoice_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); - public static native long UnsignedBolt12Invoice_invoice_features(long this_arg); - // MUST_USE_RES struct LDKPublicKey UnsignedBolt12Invoice_signing_pubkey(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); - public static native byte[] UnsignedBolt12Invoice_signing_pubkey(long this_arg); + // MUST_USE_RES uint64_t Bolt12Invoice_created_at(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); + public static native long Bolt12Invoice_created_at(long this_arg); + // MUST_USE_RES uint64_t Bolt12Invoice_relative_expiry(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); + public static native long Bolt12Invoice_relative_expiry(long this_arg); + // MUST_USE_RES bool Bolt12Invoice_is_expired(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); + public static native boolean Bolt12Invoice_is_expired(long this_arg); + // MUST_USE_RES struct LDKCVec_StrZ Bolt12Invoice_fallbacks(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); + public static native String[] Bolt12Invoice_fallbacks(long this_arg); + // MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12Invoice_invoice_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); + public static native long Bolt12Invoice_invoice_features(long this_arg); + // MUST_USE_RES struct LDKPublicKey Bolt12Invoice_signing_pubkey(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); + public static native byte[] Bolt12Invoice_signing_pubkey(long this_arg); // MUST_USE_RES struct LDKCOption_CVec_ThirtyTwoBytesZZ Bolt12Invoice_offer_chains(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); public static native long Bolt12Invoice_offer_chains(long this_arg); // MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_chain(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); @@ -12515,7 +12524,7 @@ public class bindings { public static native long Bolt12Invoice_absolute_expiry(long this_arg); // MUST_USE_RES struct LDKPrintableString Bolt12Invoice_issuer(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); public static native long Bolt12Invoice_issuer(long this_arg); - // MUST_USE_RES struct LDKCVec_BlindedPathZ Bolt12Invoice_message_paths(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); + // MUST_USE_RES struct LDKCVec_BlindedMessagePathZ Bolt12Invoice_message_paths(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); public static native long[] Bolt12Invoice_message_paths(long this_arg); // MUST_USE_RES struct LDKCOption_QuantityZ Bolt12Invoice_supported_quantity(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); public static native long Bolt12Invoice_supported_quantity(long this_arg); @@ -12529,72 +12538,26 @@ public class bindings { public static native byte[] Bolt12Invoice_payer_id(long this_arg); // MUST_USE_RES struct LDKPrintableString Bolt12Invoice_payer_note(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); public static native long Bolt12Invoice_payer_note(long this_arg); - // MUST_USE_RES uint64_t Bolt12Invoice_created_at(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); - public static native long Bolt12Invoice_created_at(long this_arg); - // MUST_USE_RES uint64_t Bolt12Invoice_relative_expiry(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); - public static native long Bolt12Invoice_relative_expiry(long this_arg); - // MUST_USE_RES bool Bolt12Invoice_is_expired(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); - public static native boolean Bolt12Invoice_is_expired(long this_arg); // MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_payment_hash(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); public static native byte[] Bolt12Invoice_payment_hash(long this_arg); // MUST_USE_RES uint64_t Bolt12Invoice_amount_msats(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); public static native long Bolt12Invoice_amount_msats(long this_arg); - // MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12Invoice_invoice_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); - public static native long Bolt12Invoice_invoice_features(long this_arg); - // MUST_USE_RES struct LDKPublicKey Bolt12Invoice_signing_pubkey(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); - public static native byte[] Bolt12Invoice_signing_pubkey(long this_arg); // MUST_USE_RES struct LDKSchnorrSignature Bolt12Invoice_signature(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); public static native byte[] Bolt12Invoice_signature(long this_arg); // MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_signable_hash(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); public static native byte[] Bolt12Invoice_signable_hash(long this_arg); - // MUST_USE_RES struct LDKCResult_ThirtyTwoBytesNoneZ Bolt12Invoice_verify(const struct LDKBolt12Invoice *NONNULL_PTR this_arg, const struct LDKExpandedKey *NONNULL_PTR key); - public static native long Bolt12Invoice_verify(long this_arg, long key); + // MUST_USE_RES struct LDKCResult_ThirtyTwoBytesNoneZ Bolt12Invoice_verify_using_metadata(const struct LDKBolt12Invoice *NONNULL_PTR this_arg, const struct LDKExpandedKey *NONNULL_PTR key); + public static native long Bolt12Invoice_verify_using_metadata(long this_arg, long key); + // MUST_USE_RES struct LDKCResult_ThirtyTwoBytesNoneZ Bolt12Invoice_verify_using_payer_data(const struct LDKBolt12Invoice *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id, struct LDKNonce nonce, const struct LDKExpandedKey *NONNULL_PTR key); + public static native long Bolt12Invoice_verify_using_payer_data(long this_arg, byte[] payment_id, long nonce, long key); // uint64_t Bolt12Invoice_hash(const struct LDKBolt12Invoice *NONNULL_PTR o); public static native long Bolt12Invoice_hash(long o); // struct LDKCVec_u8Z UnsignedBolt12Invoice_write(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR obj); public static native byte[] UnsignedBolt12Invoice_write(long obj); // struct LDKCVec_u8Z Bolt12Invoice_write(const struct LDKBolt12Invoice *NONNULL_PTR obj); public static native byte[] Bolt12Invoice_write(long obj); - // void BlindedPayInfo_free(struct LDKBlindedPayInfo this_obj); - public static native void BlindedPayInfo_free(long this_obj); - // uint32_t BlindedPayInfo_get_fee_base_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr); - public static native int BlindedPayInfo_get_fee_base_msat(long this_ptr); - // void BlindedPayInfo_set_fee_base_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val); - public static native void BlindedPayInfo_set_fee_base_msat(long this_ptr, int val); - // uint32_t BlindedPayInfo_get_fee_proportional_millionths(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr); - public static native int BlindedPayInfo_get_fee_proportional_millionths(long this_ptr); - // void BlindedPayInfo_set_fee_proportional_millionths(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val); - public static native void BlindedPayInfo_set_fee_proportional_millionths(long this_ptr, int val); - // uint16_t BlindedPayInfo_get_cltv_expiry_delta(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr); - public static native short BlindedPayInfo_get_cltv_expiry_delta(long this_ptr); - // void BlindedPayInfo_set_cltv_expiry_delta(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint16_t val); - public static native void BlindedPayInfo_set_cltv_expiry_delta(long this_ptr, short val); - // uint64_t BlindedPayInfo_get_htlc_minimum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr); - public static native long BlindedPayInfo_get_htlc_minimum_msat(long this_ptr); - // void BlindedPayInfo_set_htlc_minimum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val); - public static native void BlindedPayInfo_set_htlc_minimum_msat(long this_ptr, long val); - // uint64_t BlindedPayInfo_get_htlc_maximum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr); - public static native long BlindedPayInfo_get_htlc_maximum_msat(long this_ptr); - // void BlindedPayInfo_set_htlc_maximum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val); - public static native void BlindedPayInfo_set_htlc_maximum_msat(long this_ptr, long val); - // struct LDKBlindedHopFeatures BlindedPayInfo_get_features(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr); - public static native long BlindedPayInfo_get_features(long this_ptr); - // void BlindedPayInfo_set_features(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, struct LDKBlindedHopFeatures val); - public static native void BlindedPayInfo_set_features(long this_ptr, long val); - // 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); - public static native long BlindedPayInfo_new(int fee_base_msat_arg, int fee_proportional_millionths_arg, short cltv_expiry_delta_arg, long htlc_minimum_msat_arg, long htlc_maximum_msat_arg, long features_arg); - // uint64_t BlindedPayInfo_clone_ptr(LDKBlindedPayInfo *NONNULL_PTR arg); - public static native long BlindedPayInfo_clone_ptr(long arg); - // struct LDKBlindedPayInfo BlindedPayInfo_clone(const struct LDKBlindedPayInfo *NONNULL_PTR orig); - public static native long BlindedPayInfo_clone(long orig); - // uint64_t BlindedPayInfo_hash(const struct LDKBlindedPayInfo *NONNULL_PTR o); - public static native long BlindedPayInfo_hash(long o); - // bool BlindedPayInfo_eq(const struct LDKBlindedPayInfo *NONNULL_PTR a, const struct LDKBlindedPayInfo *NONNULL_PTR b); - public static native boolean BlindedPayInfo_eq(long a, long b); - // struct LDKCVec_u8Z BlindedPayInfo_write(const struct LDKBlindedPayInfo *NONNULL_PTR obj); - public static native byte[] BlindedPayInfo_write(long obj); - // struct LDKCResult_BlindedPayInfoDecodeErrorZ BlindedPayInfo_read(struct LDKu8slice ser); - public static native long BlindedPayInfo_read(byte[] ser); + // struct LDKCResult_Bolt12InvoiceDecodeErrorZ Bolt12Invoice_read(struct LDKu8slice ser); + public static native long Bolt12Invoice_read(byte[] ser); // void InvoiceError_free(struct LDKInvoiceError this_obj); public static native void InvoiceError_free(long this_obj); // struct LDKErroneousField InvoiceError_get_erroneous_field(const struct LDKInvoiceError *NONNULL_PTR this_ptr); @@ -12681,10 +12644,6 @@ public class bindings { public static native long VerifiedInvoiceRequest_get_offer_id(long this_ptr); // void VerifiedInvoiceRequest_set_offer_id(struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr, struct LDKOfferId val); public static native void VerifiedInvoiceRequest_set_offer_id(long this_ptr, long val); - // struct LDKCOption_SecretKeyZ VerifiedInvoiceRequest_get_keys(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr); - public static native long VerifiedInvoiceRequest_get_keys(long this_ptr); - // void VerifiedInvoiceRequest_set_keys(struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr, struct LDKCOption_SecretKeyZ val); - public static native void VerifiedInvoiceRequest_set_keys(long this_ptr, long val); // uint64_t VerifiedInvoiceRequest_clone_ptr(LDKVerifiedInvoiceRequest *NONNULL_PTR arg); public static native long VerifiedInvoiceRequest_clone_ptr(long arg); // struct LDKVerifiedInvoiceRequest VerifiedInvoiceRequest_clone(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR orig); @@ -12703,7 +12662,7 @@ public class bindings { public static native long UnsignedInvoiceRequest_absolute_expiry(long this_arg); // MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_issuer(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg); public static native long UnsignedInvoiceRequest_issuer(long this_arg); - // MUST_USE_RES struct LDKCVec_BlindedPathZ UnsignedInvoiceRequest_paths(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg); + // MUST_USE_RES struct LDKCVec_BlindedMessagePathZ UnsignedInvoiceRequest_paths(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg); public static native long[] UnsignedInvoiceRequest_paths(long this_arg); // MUST_USE_RES struct LDKQuantity UnsignedInvoiceRequest_supported_quantity(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg); public static native long UnsignedInvoiceRequest_supported_quantity(long this_arg); @@ -12737,7 +12696,7 @@ public class bindings { public static native long InvoiceRequest_absolute_expiry(long this_arg); // MUST_USE_RES struct LDKPrintableString InvoiceRequest_issuer(const struct LDKInvoiceRequest *NONNULL_PTR this_arg); public static native long InvoiceRequest_issuer(long this_arg); - // MUST_USE_RES struct LDKCVec_BlindedPathZ InvoiceRequest_paths(const struct LDKInvoiceRequest *NONNULL_PTR this_arg); + // MUST_USE_RES struct LDKCVec_BlindedMessagePathZ InvoiceRequest_paths(const struct LDKInvoiceRequest *NONNULL_PTR this_arg); public static native long[] InvoiceRequest_paths(long this_arg); // MUST_USE_RES struct LDKQuantity InvoiceRequest_supported_quantity(const struct LDKInvoiceRequest *NONNULL_PTR this_arg); public static native long InvoiceRequest_supported_quantity(long this_arg); @@ -12757,12 +12716,14 @@ public class bindings { public static native byte[] InvoiceRequest_payer_id(long this_arg); // MUST_USE_RES struct LDKPrintableString InvoiceRequest_payer_note(const struct LDKInvoiceRequest *NONNULL_PTR this_arg); public static native long InvoiceRequest_payer_note(long this_arg); - // 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); + // MUST_USE_RES struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ InvoiceRequest_respond_with(const struct LDKInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_BlindedPaymentPathZ payment_paths, struct LDKThirtyTwoBytes payment_hash); public static native long InvoiceRequest_respond_with(long this_arg, long[] payment_paths, byte[] payment_hash); - // 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); + // MUST_USE_RES struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ InvoiceRequest_respond_with_no_std(const struct LDKInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_BlindedPaymentPathZ payment_paths, struct LDKThirtyTwoBytes payment_hash, uint64_t created_at); public static native long InvoiceRequest_respond_with_no_std(long this_arg, long[] payment_paths, byte[] payment_hash, long created_at); - // MUST_USE_RES struct LDKCResult_VerifiedInvoiceRequestNoneZ InvoiceRequest_verify(struct LDKInvoiceRequest this_arg, const struct LDKExpandedKey *NONNULL_PTR key); - public static native long InvoiceRequest_verify(long this_arg, long key); + // MUST_USE_RES struct LDKCResult_VerifiedInvoiceRequestNoneZ InvoiceRequest_verify_using_metadata(struct LDKInvoiceRequest this_arg, const struct LDKExpandedKey *NONNULL_PTR key); + public static native long InvoiceRequest_verify_using_metadata(long this_arg, long key); + // MUST_USE_RES struct LDKCResult_VerifiedInvoiceRequestNoneZ InvoiceRequest_verify_using_recipient_data(struct LDKInvoiceRequest this_arg, struct LDKNonce nonce, const struct LDKExpandedKey *NONNULL_PTR key); + public static native long InvoiceRequest_verify_using_recipient_data(long this_arg, long nonce, long key); // MUST_USE_RES struct LDKSchnorrSignature InvoiceRequest_signature(const struct LDKInvoiceRequest *NONNULL_PTR this_arg); public static native byte[] InvoiceRequest_signature(long this_arg); // MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ VerifiedInvoiceRequest_chains(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg); @@ -12779,7 +12740,7 @@ public class bindings { public static native long VerifiedInvoiceRequest_absolute_expiry(long this_arg); // MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_issuer(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg); public static native long VerifiedInvoiceRequest_issuer(long this_arg); - // MUST_USE_RES struct LDKCVec_BlindedPathZ VerifiedInvoiceRequest_paths(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg); + // MUST_USE_RES struct LDKCVec_BlindedMessagePathZ VerifiedInvoiceRequest_paths(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg); public static native long[] VerifiedInvoiceRequest_paths(long this_arg); // MUST_USE_RES struct LDKQuantity VerifiedInvoiceRequest_supported_quantity(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg); public static native long VerifiedInvoiceRequest_supported_quantity(long this_arg); @@ -12799,13 +12760,13 @@ public class bindings { public static native byte[] VerifiedInvoiceRequest_payer_id(long this_arg); // MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_payer_note(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg); public static native long VerifiedInvoiceRequest_payer_note(long this_arg); - // 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); + // MUST_USE_RES struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ VerifiedInvoiceRequest_respond_with(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_BlindedPaymentPathZ payment_paths, struct LDKThirtyTwoBytes payment_hash); public static native long VerifiedInvoiceRequest_respond_with(long this_arg, long[] payment_paths, byte[] payment_hash); - // 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); + // MUST_USE_RES struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ VerifiedInvoiceRequest_respond_with_no_std(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_BlindedPaymentPathZ payment_paths, struct LDKThirtyTwoBytes payment_hash, uint64_t created_at); public static native long VerifiedInvoiceRequest_respond_with_no_std(long this_arg, long[] payment_paths, byte[] payment_hash, long created_at); - // 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); + // MUST_USE_RES struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ VerifiedInvoiceRequest_respond_using_derived_keys(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_BlindedPaymentPathZ payment_paths, struct LDKThirtyTwoBytes payment_hash); public static native long VerifiedInvoiceRequest_respond_using_derived_keys(long this_arg, long[] payment_paths, byte[] payment_hash); - // 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); + // MUST_USE_RES struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ VerifiedInvoiceRequest_respond_using_derived_keys_no_std(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_BlindedPaymentPathZ payment_paths, struct LDKThirtyTwoBytes payment_hash, uint64_t created_at); public static native long VerifiedInvoiceRequest_respond_using_derived_keys_no_std(long this_arg, long[] payment_paths, byte[] payment_hash, long created_at); // struct LDKCVec_u8Z UnsignedInvoiceRequest_write(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR obj); public static native byte[] UnsignedInvoiceRequest_write(long obj); @@ -12859,6 +12820,22 @@ public class bindings { public static native long SignError_signing(); // struct LDKSignError SignError_verification(enum LDKSecp256k1Error a); public static native long SignError_verification(Secp256k1Error a); + // void Nonce_free(struct LDKNonce this_obj); + public static native void Nonce_free(long this_obj); + // uint64_t Nonce_clone_ptr(LDKNonce *NONNULL_PTR arg); + public static native long Nonce_clone_ptr(long arg); + // struct LDKNonce Nonce_clone(const struct LDKNonce *NONNULL_PTR orig); + public static native long Nonce_clone(long orig); + // bool Nonce_eq(const struct LDKNonce *NONNULL_PTR a, const struct LDKNonce *NONNULL_PTR b); + public static native boolean Nonce_eq(long a, long b); + // MUST_USE_RES struct LDKNonce Nonce_from_entropy_source(struct LDKEntropySource entropy_source); + public static native long Nonce_from_entropy_source(long entropy_source); + // MUST_USE_RES struct LDKu8slice Nonce_as_slice(const struct LDKNonce *NONNULL_PTR this_arg); + public static native byte[] Nonce_as_slice(long this_arg); + // struct LDKCVec_u8Z Nonce_write(const struct LDKNonce *NONNULL_PTR obj); + public static native byte[] Nonce_write(long obj); + // struct LDKCResult_NonceDecodeErrorZ Nonce_read(struct LDKu8slice ser); + public static native long Nonce_read(byte[] ser); // void Bolt12ParseError_free(struct LDKBolt12ParseError this_obj); public static native void Bolt12ParseError_free(long this_obj); // uint64_t Bolt12ParseError_clone_ptr(LDKBolt12ParseError *NONNULL_PTR arg); @@ -12921,6 +12898,8 @@ public class bindings { public static native Bolt12SemanticError Bolt12SemanticError_missing_creation_time(); // enum LDKBolt12SemanticError Bolt12SemanticError_missing_payment_hash(void); public static native Bolt12SemanticError Bolt12SemanticError_missing_payment_hash(); + // enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_payment_hash(void); + public static native Bolt12SemanticError Bolt12SemanticError_unexpected_payment_hash(); // enum LDKBolt12SemanticError Bolt12SemanticError_missing_signature(void); public static native Bolt12SemanticError Bolt12SemanticError_missing_signature(); // void RefundMaybeWithDerivedMetadataBuilder_free(struct LDKRefundMaybeWithDerivedMetadataBuilder this_obj); @@ -12931,15 +12910,15 @@ public class bindings { public static native long RefundMaybeWithDerivedMetadataBuilder_clone(long orig); // MUST_USE_RES struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ RefundMaybeWithDerivedMetadataBuilder_new(struct LDKCVec_u8Z metadata, struct LDKPublicKey payer_id, uint64_t amount_msats); public static native long RefundMaybeWithDerivedMetadataBuilder_new(byte[] metadata, byte[] payer_id, long amount_msats); - // 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); - public static native long RefundMaybeWithDerivedMetadataBuilder_deriving_payer_id(byte[] node_id, long expanded_key, long entropy_source, long amount_msats, byte[] payment_id); + // MUST_USE_RES struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ RefundMaybeWithDerivedMetadataBuilder_deriving_payer_id(struct LDKPublicKey node_id, const struct LDKExpandedKey *NONNULL_PTR expanded_key, struct LDKNonce nonce, uint64_t amount_msats, struct LDKThirtyTwoBytes payment_id); + public static native long RefundMaybeWithDerivedMetadataBuilder_deriving_payer_id(byte[] node_id, long expanded_key, long nonce, long amount_msats, byte[] payment_id); // MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_description(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, struct LDKStr description); public static native void RefundMaybeWithDerivedMetadataBuilder_description(long this_arg, String description); // MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_absolute_expiry(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, uint64_t absolute_expiry); public static native void RefundMaybeWithDerivedMetadataBuilder_absolute_expiry(long this_arg, long absolute_expiry); // MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_issuer(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, struct LDKStr issuer); public static native void RefundMaybeWithDerivedMetadataBuilder_issuer(long this_arg, String issuer); - // MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_path(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, struct LDKBlindedPath path); + // MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_path(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, struct LDKBlindedMessagePath path); public static native void RefundMaybeWithDerivedMetadataBuilder_path(long this_arg, long path); // MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_chain(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, enum LDKNetwork network); public static native void RefundMaybeWithDerivedMetadataBuilder_chain(long this_arg, Network network); @@ -12965,7 +12944,7 @@ public class bindings { public static native boolean Refund_is_expired_no_std(long this_arg, long duration_since_epoch); // MUST_USE_RES struct LDKPrintableString Refund_issuer(const struct LDKRefund *NONNULL_PTR this_arg); public static native long Refund_issuer(long this_arg); - // MUST_USE_RES struct LDKCVec_BlindedPathZ Refund_paths(const struct LDKRefund *NONNULL_PTR this_arg); + // MUST_USE_RES struct LDKCVec_BlindedMessagePathZ Refund_paths(const struct LDKRefund *NONNULL_PTR this_arg); public static native long[] Refund_paths(long this_arg); // MUST_USE_RES struct LDKu8slice Refund_payer_metadata(const struct LDKRefund *NONNULL_PTR this_arg); public static native byte[] Refund_payer_metadata(long this_arg); @@ -12983,6 +12962,8 @@ public class bindings { public static native long Refund_payer_note(long this_arg); // uint64_t Refund_hash(const struct LDKRefund *NONNULL_PTR o); public static native long Refund_hash(long o); + // struct LDKCResult_RefundDecodeErrorZ Refund_read(struct LDKu8slice ser); + public static native long Refund_read(byte[] ser); // struct LDKCVec_u8Z Refund_write(const struct LDKRefund *NONNULL_PTR obj); public static native byte[] Refund_write(long obj); // struct LDKCResult_RefundBolt12ParseErrorZ Refund_from_str(struct LDKStr s); @@ -13025,6 +13006,8 @@ public class bindings { public static native long NodeId_clone_ptr(long arg); // struct LDKNodeId NodeId_clone(const struct LDKNodeId *NONNULL_PTR orig); public static native long NodeId_clone(long orig); + // bool NodeId_eq(const struct LDKNodeId *NONNULL_PTR a, const struct LDKNodeId *NONNULL_PTR b); + public static native boolean NodeId_eq(long a, long b); // MUST_USE_RES struct LDKNodeId NodeId_from_pubkey(struct LDKPublicKey pubkey); public static native long NodeId_from_pubkey(byte[] pubkey); // MUST_USE_RES struct LDKCResult_NodeIdDecodeErrorZ NodeId_from_slice(struct LDKu8slice bytes); @@ -13053,8 +13036,6 @@ public class bindings { public static native long NetworkUpdate_clone_ptr(long arg); // struct LDKNetworkUpdate NetworkUpdate_clone(const struct LDKNetworkUpdate *NONNULL_PTR orig); public static native long NetworkUpdate_clone(long orig); - // struct LDKNetworkUpdate NetworkUpdate_channel_update_message(struct LDKChannelUpdate msg); - public static native long NetworkUpdate_channel_update_message(long msg); // struct LDKNetworkUpdate NetworkUpdate_channel_failure(uint64_t short_channel_id, bool is_permanent); public static native long NetworkUpdate_channel_failure(long short_channel_id, boolean is_permanent); // struct LDKNetworkUpdate NetworkUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent); @@ -13085,18 +13066,6 @@ public class bindings { public static native long P2PGossipSync_as_MessageSendEventsProvider(long this_arg); // void ChannelUpdateInfo_free(struct LDKChannelUpdateInfo this_obj); public static native void ChannelUpdateInfo_free(long this_obj); - // uint32_t ChannelUpdateInfo_get_last_update(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr); - public static native int ChannelUpdateInfo_get_last_update(long this_ptr); - // void ChannelUpdateInfo_set_last_update(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint32_t val); - public static native void ChannelUpdateInfo_set_last_update(long this_ptr, int val); - // bool ChannelUpdateInfo_get_enabled(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr); - public static native boolean ChannelUpdateInfo_get_enabled(long this_ptr); - // void ChannelUpdateInfo_set_enabled(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, bool val); - public static native void ChannelUpdateInfo_set_enabled(long this_ptr, boolean val); - // uint16_t ChannelUpdateInfo_get_cltv_expiry_delta(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr); - public static native short ChannelUpdateInfo_get_cltv_expiry_delta(long this_ptr); - // void ChannelUpdateInfo_set_cltv_expiry_delta(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint16_t val); - public static native void ChannelUpdateInfo_set_cltv_expiry_delta(long this_ptr, short val); // uint64_t ChannelUpdateInfo_get_htlc_minimum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr); public static native long ChannelUpdateInfo_get_htlc_minimum_msat(long this_ptr); // void ChannelUpdateInfo_set_htlc_minimum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val); @@ -13109,12 +13078,24 @@ public class bindings { public static native long ChannelUpdateInfo_get_fees(long this_ptr); // void ChannelUpdateInfo_set_fees(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val); public static native void ChannelUpdateInfo_set_fees(long this_ptr, long val); + // uint32_t ChannelUpdateInfo_get_last_update(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr); + public static native int ChannelUpdateInfo_get_last_update(long this_ptr); + // void ChannelUpdateInfo_set_last_update(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint32_t val); + public static native void ChannelUpdateInfo_set_last_update(long this_ptr, int val); + // uint16_t ChannelUpdateInfo_get_cltv_expiry_delta(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr); + public static native short ChannelUpdateInfo_get_cltv_expiry_delta(long this_ptr); + // void ChannelUpdateInfo_set_cltv_expiry_delta(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint16_t val); + public static native void ChannelUpdateInfo_set_cltv_expiry_delta(long this_ptr, short val); + // bool ChannelUpdateInfo_get_enabled(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr); + public static native boolean ChannelUpdateInfo_get_enabled(long this_ptr); + // void ChannelUpdateInfo_set_enabled(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, bool val); + public static native void ChannelUpdateInfo_set_enabled(long this_ptr, boolean val); // struct LDKChannelUpdate ChannelUpdateInfo_get_last_update_message(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr); public static native long ChannelUpdateInfo_get_last_update_message(long this_ptr); // void ChannelUpdateInfo_set_last_update_message(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val); public static native void ChannelUpdateInfo_set_last_update_message(long this_ptr, long val); - // 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); - public static native long ChannelUpdateInfo_new(int last_update_arg, boolean enabled_arg, short cltv_expiry_delta_arg, long htlc_minimum_msat_arg, long htlc_maximum_msat_arg, long fees_arg, long last_update_message_arg); + // MUST_USE_RES struct LDKChannelUpdateInfo ChannelUpdateInfo_new(uint64_t htlc_minimum_msat_arg, uint64_t htlc_maximum_msat_arg, struct LDKRoutingFees fees_arg, uint32_t last_update_arg, uint16_t cltv_expiry_delta_arg, bool enabled_arg, struct LDKChannelUpdate last_update_message_arg); + public static native long ChannelUpdateInfo_new(long htlc_minimum_msat_arg, long htlc_maximum_msat_arg, long fees_arg, int last_update_arg, short cltv_expiry_delta_arg, boolean enabled_arg, long last_update_message_arg); // uint64_t ChannelUpdateInfo_clone_ptr(LDKChannelUpdateInfo *NONNULL_PTR arg); public static native long ChannelUpdateInfo_clone_ptr(long arg); // struct LDKChannelUpdateInfo ChannelUpdateInfo_clone(const struct LDKChannelUpdateInfo *NONNULL_PTR orig); @@ -13137,22 +13118,22 @@ public class bindings { public static native long ChannelInfo_get_node_one(long this_ptr); // void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val); public static native void ChannelInfo_set_node_one(long this_ptr, long val); - // struct LDKChannelUpdateInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr); - public static native long ChannelInfo_get_one_to_two(long this_ptr); - // void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val); - public static native void ChannelInfo_set_one_to_two(long this_ptr, long val); // struct LDKNodeId ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr); public static native long ChannelInfo_get_node_two(long this_ptr); // void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val); public static native void ChannelInfo_set_node_two(long this_ptr, long val); - // struct LDKChannelUpdateInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr); - public static native long ChannelInfo_get_two_to_one(long this_ptr); - // void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val); - public static native void ChannelInfo_set_two_to_one(long this_ptr, long val); // struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr); public static native long ChannelInfo_get_capacity_sats(long this_ptr); // void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); public static native void ChannelInfo_set_capacity_sats(long this_ptr, long val); + // struct LDKChannelUpdateInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr); + public static native long ChannelInfo_get_one_to_two(long this_ptr); + // void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val); + public static native void ChannelInfo_set_one_to_two(long this_ptr, long val); + // struct LDKChannelUpdateInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr); + public static native long ChannelInfo_get_two_to_one(long this_ptr); + // void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val); + public static native void ChannelInfo_set_two_to_one(long this_ptr, long val); // struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr); public static native long ChannelInfo_get_announcement_message(long this_ptr); // void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val); @@ -13205,62 +13186,64 @@ public class bindings { public static native long EffectiveCapacity_unknown(); // MUST_USE_RES uint64_t EffectiveCapacity_as_msat(const struct LDKEffectiveCapacity *NONNULL_PTR this_arg); public static native long EffectiveCapacity_as_msat(long this_arg); - // void RoutingFees_free(struct LDKRoutingFees this_obj); - public static native void RoutingFees_free(long this_obj); - // uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr); - public static native int RoutingFees_get_base_msat(long this_ptr); - // void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val); - public static native void RoutingFees_set_base_msat(long this_ptr, int val); - // uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr); - public static native int RoutingFees_get_proportional_millionths(long this_ptr); - // void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val); - public static native void RoutingFees_set_proportional_millionths(long this_ptr, int val); - // MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg); - public static native long RoutingFees_new(int base_msat_arg, int proportional_millionths_arg); - // bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b); - public static native boolean RoutingFees_eq(long a, long b); - // uint64_t RoutingFees_clone_ptr(LDKRoutingFees *NONNULL_PTR arg); - public static native long RoutingFees_clone_ptr(long arg); - // struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig); - public static native long RoutingFees_clone(long orig); - // uint64_t RoutingFees_hash(const struct LDKRoutingFees *NONNULL_PTR o); - public static native long RoutingFees_hash(long o); // struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj); public static native byte[] RoutingFees_write(long obj); // struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser); public static native long RoutingFees_read(byte[] ser); - // void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj); - public static native void NodeAnnouncementInfo_free(long this_obj); - // struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr); - public static native long NodeAnnouncementInfo_get_features(long this_ptr); - // void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val); - public static native void NodeAnnouncementInfo_set_features(long this_ptr, long val); - // uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr); - public static native int NodeAnnouncementInfo_get_last_update(long this_ptr); - // void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val); - public static native void NodeAnnouncementInfo_set_last_update(long this_ptr, int val); - // const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3]; - public static native byte[] NodeAnnouncementInfo_get_rgb(long this_ptr); - // void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val); - public static native void NodeAnnouncementInfo_set_rgb(long this_ptr, byte[] val); - // struct LDKNodeAlias NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr); - public static native long NodeAnnouncementInfo_get_alias(long this_ptr); - // void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAlias val); - public static native void NodeAnnouncementInfo_set_alias(long this_ptr, long val); - // struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr); - public static native long NodeAnnouncementInfo_get_announcement_message(long this_ptr); - // void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val); - public static native void NodeAnnouncementInfo_set_announcement_message(long this_ptr, long val); - // 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); - public static native long NodeAnnouncementInfo_new(long features_arg, int last_update_arg, byte[] rgb_arg, long alias_arg, long announcement_message_arg); + // void NodeAnnouncementDetails_free(struct LDKNodeAnnouncementDetails this_obj); + public static native void NodeAnnouncementDetails_free(long this_obj); + // struct LDKNodeFeatures NodeAnnouncementDetails_get_features(const struct LDKNodeAnnouncementDetails *NONNULL_PTR this_ptr); + public static native long NodeAnnouncementDetails_get_features(long this_ptr); + // void NodeAnnouncementDetails_set_features(struct LDKNodeAnnouncementDetails *NONNULL_PTR this_ptr, struct LDKNodeFeatures val); + public static native void NodeAnnouncementDetails_set_features(long this_ptr, long val); + // uint32_t NodeAnnouncementDetails_get_last_update(const struct LDKNodeAnnouncementDetails *NONNULL_PTR this_ptr); + public static native int NodeAnnouncementDetails_get_last_update(long this_ptr); + // void NodeAnnouncementDetails_set_last_update(struct LDKNodeAnnouncementDetails *NONNULL_PTR this_ptr, uint32_t val); + public static native void NodeAnnouncementDetails_set_last_update(long this_ptr, int val); + // const uint8_t (*NodeAnnouncementDetails_get_rgb(const struct LDKNodeAnnouncementDetails *NONNULL_PTR this_ptr))[3]; + public static native byte[] NodeAnnouncementDetails_get_rgb(long this_ptr); + // void NodeAnnouncementDetails_set_rgb(struct LDKNodeAnnouncementDetails *NONNULL_PTR this_ptr, struct LDKThreeBytes val); + public static native void NodeAnnouncementDetails_set_rgb(long this_ptr, byte[] val); + // struct LDKNodeAlias NodeAnnouncementDetails_get_alias(const struct LDKNodeAnnouncementDetails *NONNULL_PTR this_ptr); + public static native long NodeAnnouncementDetails_get_alias(long this_ptr); + // void NodeAnnouncementDetails_set_alias(struct LDKNodeAnnouncementDetails *NONNULL_PTR this_ptr, struct LDKNodeAlias val); + public static native void NodeAnnouncementDetails_set_alias(long this_ptr, long val); + // struct LDKCVec_SocketAddressZ NodeAnnouncementDetails_get_addresses(const struct LDKNodeAnnouncementDetails *NONNULL_PTR this_ptr); + public static native long[] NodeAnnouncementDetails_get_addresses(long this_ptr); + // void NodeAnnouncementDetails_set_addresses(struct LDKNodeAnnouncementDetails *NONNULL_PTR this_ptr, struct LDKCVec_SocketAddressZ val); + public static native void NodeAnnouncementDetails_set_addresses(long this_ptr, long[] val); + // MUST_USE_RES struct LDKNodeAnnouncementDetails NodeAnnouncementDetails_new(struct LDKNodeFeatures features_arg, uint32_t last_update_arg, struct LDKThreeBytes rgb_arg, struct LDKNodeAlias alias_arg, struct LDKCVec_SocketAddressZ addresses_arg); + public static native long NodeAnnouncementDetails_new(long features_arg, int last_update_arg, byte[] rgb_arg, long alias_arg, long[] addresses_arg); + // uint64_t NodeAnnouncementDetails_clone_ptr(LDKNodeAnnouncementDetails *NONNULL_PTR arg); + public static native long NodeAnnouncementDetails_clone_ptr(long arg); + // struct LDKNodeAnnouncementDetails NodeAnnouncementDetails_clone(const struct LDKNodeAnnouncementDetails *NONNULL_PTR orig); + public static native long NodeAnnouncementDetails_clone(long orig); + // bool NodeAnnouncementDetails_eq(const struct LDKNodeAnnouncementDetails *NONNULL_PTR a, const struct LDKNodeAnnouncementDetails *NONNULL_PTR b); + public static native boolean NodeAnnouncementDetails_eq(long a, long b); + // void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_ptr); + public static native void NodeAnnouncementInfo_free(long this_ptr); // uint64_t NodeAnnouncementInfo_clone_ptr(LDKNodeAnnouncementInfo *NONNULL_PTR arg); public static native long NodeAnnouncementInfo_clone_ptr(long arg); // struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig); public static native long NodeAnnouncementInfo_clone(long orig); + // struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_relayed(struct LDKNodeAnnouncement a); + public static native long NodeAnnouncementInfo_relayed(long a); + // struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_local(struct LDKNodeAnnouncementDetails a); + public static native long NodeAnnouncementInfo_local(long a); // bool NodeAnnouncementInfo_eq(const struct LDKNodeAnnouncementInfo *NONNULL_PTR a, const struct LDKNodeAnnouncementInfo *NONNULL_PTR b); public static native boolean NodeAnnouncementInfo_eq(long a, long b); + // MUST_USE_RES struct LDKNodeFeatures NodeAnnouncementInfo_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_arg); + public static native long NodeAnnouncementInfo_features(long this_arg); + // MUST_USE_RES uint32_t NodeAnnouncementInfo_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_arg); + public static native int NodeAnnouncementInfo_last_update(long this_arg); + // MUST_USE_RES struct LDKThreeBytes NodeAnnouncementInfo_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_arg); + public static native byte[] NodeAnnouncementInfo_rgb(long this_arg); + // MUST_USE_RES struct LDKNodeAlias NodeAnnouncementInfo_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_arg); + public static native long NodeAnnouncementInfo_alias(long this_arg); // MUST_USE_RES struct LDKCVec_SocketAddressZ NodeAnnouncementInfo_addresses(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_arg); public static native long[] NodeAnnouncementInfo_addresses(long this_arg); + // MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncementInfo_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_arg); + public static native long NodeAnnouncementInfo_announcement_message(long this_arg); // struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj); public static native byte[] NodeAnnouncementInfo_write(long obj); // struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser); @@ -13293,12 +13276,10 @@ public class bindings { public static native long[] NodeInfo_get_channels(long this_ptr); // void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val); public static native void NodeInfo_set_channels(long this_ptr, long[] val); - // struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr); + // struct LDKCOption_NodeAnnouncementInfoZ NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr); public static native long NodeInfo_get_announcement_info(long this_ptr); - // void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val); + // void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCOption_NodeAnnouncementInfoZ val); public static native void NodeInfo_set_announcement_info(long this_ptr, long val); - // MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKNodeAnnouncementInfo announcement_info_arg); - public static native long NodeInfo_new(long[] channels_arg, long announcement_info_arg); // uint64_t NodeInfo_clone_ptr(LDKNodeInfo *NONNULL_PTR arg); public static native long NodeInfo_clone_ptr(long arg); // struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig); @@ -13555,6 +13536,8 @@ public class bindings { public static native boolean RouteParameters_eq(long a, long b); // MUST_USE_RES struct LDKRouteParameters RouteParameters_from_payment_params_and_value(struct LDKPaymentParameters payment_params, uint64_t final_value_msat); public static native long RouteParameters_from_payment_params_and_value(long payment_params, long final_value_msat); + // MUST_USE_RES struct LDKCResult_NoneNoneZ RouteParameters_set_max_path_length(struct LDKRouteParameters *NONNULL_PTR this_arg, const struct LDKRecipientOnionFields *NONNULL_PTR recipient_onion, bool is_keysend, uint32_t best_block_height); + public static native long RouteParameters_set_max_path_length(long this_arg, long recipient_onion, boolean is_keysend, int best_block_height); // struct LDKCVec_u8Z RouteParameters_write(const struct LDKRouteParameters *NONNULL_PTR obj); public static native byte[] RouteParameters_write(long obj); // struct LDKCResult_RouteParametersDecodeErrorZ RouteParameters_read(struct LDKu8slice ser); @@ -13577,6 +13560,10 @@ public class bindings { public static native byte PaymentParameters_get_max_path_count(long this_ptr); // void PaymentParameters_set_max_path_count(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val); public static native void PaymentParameters_set_max_path_count(long this_ptr, byte val); + // uint8_t PaymentParameters_get_max_path_length(const struct LDKPaymentParameters *NONNULL_PTR this_ptr); + public static native byte PaymentParameters_get_max_path_length(long this_ptr); + // void PaymentParameters_set_max_path_length(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val); + public static native void PaymentParameters_set_max_path_length(long this_ptr, byte val); // uint8_t PaymentParameters_get_max_channel_saturation_power_of_half(const struct LDKPaymentParameters *NONNULL_PTR this_ptr); public static native byte PaymentParameters_get_max_channel_saturation_power_of_half(long this_ptr); // void PaymentParameters_set_max_channel_saturation_power_of_half(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val); @@ -13589,8 +13576,8 @@ public class bindings { public static native long[] PaymentParameters_get_previously_failed_blinded_path_idxs(long this_ptr); // void PaymentParameters_set_previously_failed_blinded_path_idxs(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val); public static native void PaymentParameters_set_previously_failed_blinded_path_idxs(long this_ptr, long[] val); - // 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); - public static native long PaymentParameters_new(long payee_arg, long expiry_time_arg, int max_total_cltv_expiry_delta_arg, byte max_path_count_arg, byte max_channel_saturation_power_of_half_arg, long[] previously_failed_channels_arg, long[] previously_failed_blinded_path_idxs_arg); + // 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_path_length_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); + public static native long PaymentParameters_new(long payee_arg, long expiry_time_arg, int max_total_cltv_expiry_delta_arg, byte max_path_count_arg, byte max_path_length_arg, byte max_channel_saturation_power_of_half_arg, long[] previously_failed_channels_arg, long[] previously_failed_blinded_path_idxs_arg); // uint64_t PaymentParameters_clone_ptr(LDKPaymentParameters *NONNULL_PTR arg); public static native long PaymentParameters_clone_ptr(long arg); // struct LDKPaymentParameters PaymentParameters_clone(const struct LDKPaymentParameters *NONNULL_PTR orig); @@ -13609,7 +13596,7 @@ public class bindings { public static native long PaymentParameters_for_keysend(byte[] payee_pubkey, int final_cltv_expiry_delta, boolean allow_mpp); // MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_bolt12_invoice(const struct LDKBolt12Invoice *NONNULL_PTR invoice); public static native long PaymentParameters_from_bolt12_invoice(long invoice); - // MUST_USE_RES struct LDKPaymentParameters PaymentParameters_blinded(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ blinded_route_hints); + // MUST_USE_RES struct LDKPaymentParameters PaymentParameters_blinded(struct LDKCVec_BlindedPaymentPathZ blinded_route_hints); public static native long PaymentParameters_blinded(long[] blinded_route_hints); // void Payee_free(struct LDKPayee this_ptr); public static native void Payee_free(long this_ptr); @@ -13617,7 +13604,7 @@ public class bindings { public static native long Payee_clone_ptr(long arg); // struct LDKPayee Payee_clone(const struct LDKPayee *NONNULL_PTR orig); public static native long Payee_clone(long orig); - // struct LDKPayee Payee_blinded(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ route_hints, struct LDKBolt12InvoiceFeatures features); + // struct LDKPayee Payee_blinded(struct LDKCVec_BlindedPaymentPathZ route_hints, struct LDKBolt12InvoiceFeatures features); public static native long Payee_blinded(long[] route_hints, long features); // struct LDKPayee Payee_clear(struct LDKPublicKey node_id, struct LDKCVec_RouteHintZ route_hints, struct LDKBolt11InvoiceFeatures features, uint32_t final_cltv_expiry_delta); public static native long Payee_clear(byte[] node_id, long[] route_hints, long features, int final_cltv_expiry_delta); @@ -13625,62 +13612,10 @@ public class bindings { public static native long Payee_hash(long o); // bool Payee_eq(const struct LDKPayee *NONNULL_PTR a, const struct LDKPayee *NONNULL_PTR b); public static native boolean Payee_eq(long a, long b); - // void RouteHint_free(struct LDKRouteHint this_obj); - public static native void RouteHint_free(long this_obj); - // struct LDKCVec_RouteHintHopZ RouteHint_get_a(const struct LDKRouteHint *NONNULL_PTR this_ptr); - public static native long[] RouteHint_get_a(long this_ptr); - // void RouteHint_set_a(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintHopZ val); - public static native void RouteHint_set_a(long this_ptr, long[] val); - // MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg); - public static native long RouteHint_new(long[] a_arg); - // uint64_t RouteHint_clone_ptr(LDKRouteHint *NONNULL_PTR arg); - public static native long RouteHint_clone_ptr(long arg); - // struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig); - public static native long RouteHint_clone(long orig); - // uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o); - public static native long RouteHint_hash(long o); - // bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b); - public static native boolean RouteHint_eq(long a, long b); // struct LDKCVec_u8Z RouteHint_write(const struct LDKRouteHint *NONNULL_PTR obj); public static native byte[] RouteHint_write(long obj); // struct LDKCResult_RouteHintDecodeErrorZ RouteHint_read(struct LDKu8slice ser); public static native long RouteHint_read(byte[] ser); - // void RouteHintHop_free(struct LDKRouteHintHop this_obj); - public static native void RouteHintHop_free(long this_obj); - // struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); - public static native byte[] RouteHintHop_get_src_node_id(long this_ptr); - // void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void RouteHintHop_set_src_node_id(long this_ptr, byte[] val); - // uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); - public static native long RouteHintHop_get_short_channel_id(long this_ptr); - // void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val); - public static native void RouteHintHop_set_short_channel_id(long this_ptr, long val); - // struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); - public static native long RouteHintHop_get_fees(long this_ptr); - // void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val); - public static native void RouteHintHop_set_fees(long this_ptr, long val); - // uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); - public static native short RouteHintHop_get_cltv_expiry_delta(long this_ptr); - // void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val); - public static native void RouteHintHop_set_cltv_expiry_delta(long this_ptr, short val); - // struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); - public static native long RouteHintHop_get_htlc_minimum_msat(long this_ptr); - // void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); - public static native void RouteHintHop_set_htlc_minimum_msat(long this_ptr, long val); - // struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); - public static native long RouteHintHop_get_htlc_maximum_msat(long this_ptr); - // void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); - public static native void RouteHintHop_set_htlc_maximum_msat(long this_ptr, long val); - // 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); - public static native long RouteHintHop_new(byte[] src_node_id_arg, long short_channel_id_arg, long fees_arg, short cltv_expiry_delta_arg, long htlc_minimum_msat_arg, long htlc_maximum_msat_arg); - // uint64_t RouteHintHop_clone_ptr(LDKRouteHintHop *NONNULL_PTR arg); - public static native long RouteHintHop_clone_ptr(long arg); - // struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig); - public static native long RouteHintHop_clone(long orig); - // uint64_t RouteHintHop_hash(const struct LDKRouteHintHop *NONNULL_PTR o); - public static native long RouteHintHop_hash(long o); - // bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b); - public static native boolean RouteHintHop_eq(long a, long b); // struct LDKCVec_u8Z RouteHintHop_write(const struct LDKRouteHintHop *NONNULL_PTR obj); public static native byte[] RouteHintHop_write(long obj); // struct LDKCResult_RouteHintHopDecodeErrorZ RouteHintHop_read(struct LDKu8slice ser); @@ -14107,7 +14042,7 @@ public class bindings { public static native byte[] HTLCDescriptor_witness_script(long this_arg); // MUST_USE_RES struct LDKWitness HTLCDescriptor_tx_input_witness(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg, struct LDKECDSASignature signature, struct LDKu8slice witness_script); public static native byte[] HTLCDescriptor_tx_input_witness(long this_arg, byte[] signature, byte[] witness_script); - // MUST_USE_RES struct LDKWriteableEcdsaChannelSigner HTLCDescriptor_derive_channel_signer(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider); + // MUST_USE_RES struct LDKEcdsaChannelSigner HTLCDescriptor_derive_channel_signer(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider); public static native long HTLCDescriptor_derive_channel_signer(long this_arg, long signer_provider); // void ChannelSigner_free(struct LDKChannelSigner this_ptr); public static native void ChannelSigner_free(long this_ptr); @@ -14183,8 +14118,6 @@ public class bindings { public static native long InMemorySigner_as_ChannelSigner(long this_arg); // struct LDKEcdsaChannelSigner InMemorySigner_as_EcdsaChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg); public static native long InMemorySigner_as_EcdsaChannelSigner(long this_arg); - // struct LDKWriteableEcdsaChannelSigner InMemorySigner_as_WriteableEcdsaChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg); - public static native long InMemorySigner_as_WriteableEcdsaChannelSigner(long this_arg); // struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj); public static native byte[] InMemorySigner_write(long obj); // struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser, struct LDKEntropySource arg); @@ -14231,16 +14164,104 @@ public class bindings { public static native long RandomBytes_new(byte[] seed); // struct LDKEntropySource RandomBytes_as_EntropySource(const struct LDKRandomBytes *NONNULL_PTR this_arg); public static native long RandomBytes_as_EntropySource(long this_arg); + // uint64_t EcdsaChannelSigner_clone_ptr(LDKEcdsaChannelSigner *NONNULL_PTR arg); + public static native long EcdsaChannelSigner_clone_ptr(long arg); + // struct LDKEcdsaChannelSigner EcdsaChannelSigner_clone(const struct LDKEcdsaChannelSigner *NONNULL_PTR orig); + public static native long EcdsaChannelSigner_clone(long orig); // void EcdsaChannelSigner_free(struct LDKEcdsaChannelSigner this_ptr); public static native void EcdsaChannelSigner_free(long this_ptr); - // uint64_t WriteableEcdsaChannelSigner_clone_ptr(LDKWriteableEcdsaChannelSigner *NONNULL_PTR arg); - public static native long WriteableEcdsaChannelSigner_clone_ptr(long arg); - // struct LDKWriteableEcdsaChannelSigner WriteableEcdsaChannelSigner_clone(const struct LDKWriteableEcdsaChannelSigner *NONNULL_PTR orig); - public static native long WriteableEcdsaChannelSigner_clone(long orig); - // void WriteableEcdsaChannelSigner_free(struct LDKWriteableEcdsaChannelSigner this_ptr); - public static native void WriteableEcdsaChannelSigner_free(long this_ptr); + // void AsyncPaymentsMessageHandler_free(struct LDKAsyncPaymentsMessageHandler this_ptr); + public static native void AsyncPaymentsMessageHandler_free(long this_ptr); + // void AsyncPaymentsMessage_free(struct LDKAsyncPaymentsMessage this_ptr); + public static native void AsyncPaymentsMessage_free(long this_ptr); + // uint64_t AsyncPaymentsMessage_clone_ptr(LDKAsyncPaymentsMessage *NONNULL_PTR arg); + public static native long AsyncPaymentsMessage_clone_ptr(long arg); + // struct LDKAsyncPaymentsMessage AsyncPaymentsMessage_clone(const struct LDKAsyncPaymentsMessage *NONNULL_PTR orig); + public static native long AsyncPaymentsMessage_clone(long orig); + // struct LDKAsyncPaymentsMessage AsyncPaymentsMessage_held_htlc_available(struct LDKHeldHtlcAvailable a); + public static native long AsyncPaymentsMessage_held_htlc_available(long a); + // struct LDKAsyncPaymentsMessage AsyncPaymentsMessage_release_held_htlc(struct LDKReleaseHeldHtlc a); + public static native long AsyncPaymentsMessage_release_held_htlc(long a); + // void HeldHtlcAvailable_free(struct LDKHeldHtlcAvailable this_obj); + public static native void HeldHtlcAvailable_free(long this_obj); + // const uint8_t (*HeldHtlcAvailable_get_payment_release_secret(const struct LDKHeldHtlcAvailable *NONNULL_PTR this_ptr))[32]; + public static native byte[] HeldHtlcAvailable_get_payment_release_secret(long this_ptr); + // void HeldHtlcAvailable_set_payment_release_secret(struct LDKHeldHtlcAvailable *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + public static native void HeldHtlcAvailable_set_payment_release_secret(long this_ptr, byte[] val); + // MUST_USE_RES struct LDKHeldHtlcAvailable HeldHtlcAvailable_new(struct LDKThirtyTwoBytes payment_release_secret_arg); + public static native long HeldHtlcAvailable_new(byte[] payment_release_secret_arg); + // uint64_t HeldHtlcAvailable_clone_ptr(LDKHeldHtlcAvailable *NONNULL_PTR arg); + public static native long HeldHtlcAvailable_clone_ptr(long arg); + // struct LDKHeldHtlcAvailable HeldHtlcAvailable_clone(const struct LDKHeldHtlcAvailable *NONNULL_PTR orig); + public static native long HeldHtlcAvailable_clone(long orig); + // void ReleaseHeldHtlc_free(struct LDKReleaseHeldHtlc this_obj); + public static native void ReleaseHeldHtlc_free(long this_obj); + // const uint8_t (*ReleaseHeldHtlc_get_payment_release_secret(const struct LDKReleaseHeldHtlc *NONNULL_PTR this_ptr))[32]; + public static native byte[] ReleaseHeldHtlc_get_payment_release_secret(long this_ptr); + // void ReleaseHeldHtlc_set_payment_release_secret(struct LDKReleaseHeldHtlc *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + public static native void ReleaseHeldHtlc_set_payment_release_secret(long this_ptr, byte[] val); + // MUST_USE_RES struct LDKReleaseHeldHtlc ReleaseHeldHtlc_new(struct LDKThirtyTwoBytes payment_release_secret_arg); + public static native long ReleaseHeldHtlc_new(byte[] payment_release_secret_arg); + // uint64_t ReleaseHeldHtlc_clone_ptr(LDKReleaseHeldHtlc *NONNULL_PTR arg); + public static native long ReleaseHeldHtlc_clone_ptr(long arg); + // struct LDKReleaseHeldHtlc ReleaseHeldHtlc_clone(const struct LDKReleaseHeldHtlc *NONNULL_PTR orig); + public static native long ReleaseHeldHtlc_clone(long orig); + // struct LDKOnionMessageContents ReleaseHeldHtlc_as_OnionMessageContents(const struct LDKReleaseHeldHtlc *NONNULL_PTR this_arg); + public static native long ReleaseHeldHtlc_as_OnionMessageContents(long this_arg); + // struct LDKCVec_u8Z HeldHtlcAvailable_write(const struct LDKHeldHtlcAvailable *NONNULL_PTR obj); + public static native byte[] HeldHtlcAvailable_write(long obj); + // struct LDKCResult_HeldHtlcAvailableDecodeErrorZ HeldHtlcAvailable_read(struct LDKu8slice ser); + public static native long HeldHtlcAvailable_read(byte[] ser); + // struct LDKCVec_u8Z ReleaseHeldHtlc_write(const struct LDKReleaseHeldHtlc *NONNULL_PTR obj); + public static native byte[] ReleaseHeldHtlc_write(long obj); + // struct LDKCResult_ReleaseHeldHtlcDecodeErrorZ ReleaseHeldHtlc_read(struct LDKu8slice ser); + public static native long ReleaseHeldHtlc_read(byte[] ser); + // MUST_USE_RES bool AsyncPaymentsMessage_is_known_type(uint64_t tlv_type); + public static native boolean AsyncPaymentsMessage_is_known_type(long tlv_type); + // struct LDKOnionMessageContents AsyncPaymentsMessage_as_OnionMessageContents(const struct LDKAsyncPaymentsMessage *NONNULL_PTR this_arg); + public static native long AsyncPaymentsMessage_as_OnionMessageContents(long this_arg); + // struct LDKCVec_u8Z AsyncPaymentsMessage_write(const struct LDKAsyncPaymentsMessage *NONNULL_PTR obj); + public static native byte[] AsyncPaymentsMessage_write(long obj); + // struct LDKCResult_AsyncPaymentsMessageDecodeErrorZ AsyncPaymentsMessage_read(struct LDKu8slice ser, uint64_t arg); + public static native long AsyncPaymentsMessage_read(byte[] ser, long arg); // void OnionMessenger_free(struct LDKOnionMessenger this_obj); public static native void OnionMessenger_free(long this_obj); + // void Responder_free(struct LDKResponder this_obj); + public static native void Responder_free(long this_obj); + // uint64_t Responder_clone_ptr(LDKResponder *NONNULL_PTR arg); + public static native long Responder_clone_ptr(long arg); + // struct LDKResponder Responder_clone(const struct LDKResponder *NONNULL_PTR orig); + public static native long Responder_clone(long orig); + // bool Responder_eq(const struct LDKResponder *NONNULL_PTR a, const struct LDKResponder *NONNULL_PTR b); + public static native boolean Responder_eq(long a, long b); + // struct LDKCVec_u8Z Responder_write(const struct LDKResponder *NONNULL_PTR obj); + public static native byte[] Responder_write(long obj); + // struct LDKCResult_ResponderDecodeErrorZ Responder_read(struct LDKu8slice ser); + public static native long Responder_read(byte[] ser); + // MUST_USE_RES struct LDKResponseInstruction Responder_respond(struct LDKResponder this_arg); + public static native long Responder_respond(long this_arg); + // MUST_USE_RES struct LDKResponseInstruction Responder_respond_with_reply_path(struct LDKResponder this_arg, struct LDKMessageContext context); + public static native long Responder_respond_with_reply_path(long this_arg, long context); + // void ResponseInstruction_free(struct LDKResponseInstruction this_obj); + public static native void ResponseInstruction_free(long this_obj); + // uint64_t ResponseInstruction_clone_ptr(LDKResponseInstruction *NONNULL_PTR arg); + public static native long ResponseInstruction_clone_ptr(long arg); + // struct LDKResponseInstruction ResponseInstruction_clone(const struct LDKResponseInstruction *NONNULL_PTR orig); + public static native long ResponseInstruction_clone(long orig); + // void MessageSendInstructions_free(struct LDKMessageSendInstructions this_ptr); + public static native void MessageSendInstructions_free(long this_ptr); + // uint64_t MessageSendInstructions_clone_ptr(LDKMessageSendInstructions *NONNULL_PTR arg); + public static native long MessageSendInstructions_clone_ptr(long arg); + // struct LDKMessageSendInstructions MessageSendInstructions_clone(const struct LDKMessageSendInstructions *NONNULL_PTR orig); + public static native long MessageSendInstructions_clone(long orig); + // struct LDKMessageSendInstructions MessageSendInstructions_with_specified_reply_path(struct LDKDestination destination, struct LDKBlindedMessagePath reply_path); + public static native long MessageSendInstructions_with_specified_reply_path(long destination, long reply_path); + // struct LDKMessageSendInstructions MessageSendInstructions_with_reply_path(struct LDKDestination destination, struct LDKMessageContext context); + public static native long MessageSendInstructions_with_reply_path(long destination, long context); + // struct LDKMessageSendInstructions MessageSendInstructions_without_reply_path(struct LDKDestination destination); + public static native long MessageSendInstructions_without_reply_path(long destination); + // struct LDKMessageSendInstructions MessageSendInstructions_for_reply(struct LDKResponseInstruction instructions); + public static native long MessageSendInstructions_for_reply(long instructions); // void MessageRouter_free(struct LDKMessageRouter this_ptr); public static native void MessageRouter_free(long this_ptr); // void DefaultMessageRouter_free(struct LDKDefaultMessageRouter this_obj); @@ -14279,7 +14300,7 @@ public class bindings { public static native long Destination_clone(long orig); // struct LDKDestination Destination_node(struct LDKPublicKey a); public static native long Destination_node(byte[] a); - // struct LDKDestination Destination_blinded_path(struct LDKBlindedPath a); + // struct LDKDestination Destination_blinded_path(struct LDKBlindedMessagePath a); public static native long Destination_blinded_path(long a); // uint64_t Destination_hash(const struct LDKDestination *NONNULL_PTR o); public static native long Destination_hash(long o); @@ -14341,18 +14362,28 @@ public class bindings { public static native long PeeledOnion_clone(long orig); // struct LDKPeeledOnion PeeledOnion_forward(struct LDKNextMessageHop a, struct LDKOnionMessage b); public static native long PeeledOnion_forward(long a, long b); - // struct LDKPeeledOnion PeeledOnion_receive(struct LDKParsedOnionMessageContents a, struct LDKThirtyTwoBytes b, struct LDKBlindedPath c); - public static native long PeeledOnion_receive(long a, byte[] b, long c); - // 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); + // struct LDKPeeledOnion PeeledOnion_receive(struct LDKParsedOnionMessageContents a, struct LDKCOption_MessageContextZ b, struct LDKBlindedMessagePath c); + public static native long PeeledOnion_receive(long a, long b, long c); + // 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 LDKBlindedMessagePath reply_path); public static native long create_onion_message_resolving_destination(long entropy_source, long node_signer, long node_id_lookup, long network_graph, long path, long contents, long reply_path); - // 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); + // 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 LDKBlindedMessagePath reply_path); public static native long create_onion_message(long entropy_source, long node_signer, long node_id_lookup, long path, long contents, long reply_path); // struct LDKCResult_PeeledOnionNoneZ peel_onion_message(const struct LDKOnionMessage *NONNULL_PTR msg, struct LDKNodeSigner node_signer, struct LDKLogger logger, struct LDKCustomOnionMessageHandler custom_handler); public static native long peel_onion_message(long msg, long node_signer, long logger, long custom_handler); - // 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); - public static native long OnionMessenger_new(long entropy_source, long node_signer, long logger, long node_id_lookup, long message_router, long offers_handler, long custom_handler); - // 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); - public static native long OnionMessenger_send_onion_message(long this_arg, long contents, long destination, long reply_path); + // 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 LDKAsyncPaymentsMessageHandler async_payments_handler, struct LDKCustomOnionMessageHandler custom_handler); + public static native long OnionMessenger_new(long entropy_source, long node_signer, long logger, long node_id_lookup, long message_router, long offers_handler, long async_payments_handler, long custom_handler); + // MUST_USE_RES struct LDKOnionMessenger OnionMessenger_new_with_offline_peer_interception(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 LDKAsyncPaymentsMessageHandler async_payments_handler, struct LDKCustomOnionMessageHandler custom_handler); + public static native long OnionMessenger_new_with_offline_peer_interception(long entropy_source, long node_signer, long logger, long node_id_lookup, long message_router, long offers_handler, long async_payments_handler, long custom_handler); + // MUST_USE_RES struct LDKCResult_SendSuccessSendErrorZ OnionMessenger_send_onion_message(const struct LDKOnionMessenger *NONNULL_PTR this_arg, struct LDKOnionMessageContents contents, struct LDKMessageSendInstructions instructions); + public static native long OnionMessenger_send_onion_message(long this_arg, long contents, long instructions); + // MUST_USE_RES struct LDKCResult_NoneSendErrorZ OnionMessenger_forward_onion_message(const struct LDKOnionMessenger *NONNULL_PTR this_arg, struct LDKOnionMessage message, struct LDKPublicKey peer_node_id); + public static native long OnionMessenger_forward_onion_message(long this_arg, long message, byte[] peer_node_id); + // MUST_USE_RES struct LDKCResult_SendSuccessSendErrorZ OnionMessenger_handle_onion_message_response(const struct LDKOnionMessenger *NONNULL_PTR this_arg, struct LDKOnionMessageContents response, struct LDKResponseInstruction instructions); + public static native long OnionMessenger_handle_onion_message_response(long this_arg, long response, long instructions); + // MUST_USE_RES struct LDKFuture OnionMessenger_get_update_future(const struct LDKOnionMessenger *NONNULL_PTR this_arg); + public static native long OnionMessenger_get_update_future(long this_arg); + // struct LDKEventsProvider OnionMessenger_as_EventsProvider(const struct LDKOnionMessenger *NONNULL_PTR this_arg); + public static native long OnionMessenger_as_EventsProvider(long this_arg); // struct LDKOnionMessageHandler OnionMessenger_as_OnionMessageHandler(const struct LDKOnionMessenger *NONNULL_PTR this_arg); public static native long OnionMessenger_as_OnionMessageHandler(long this_arg); // void OffersMessageHandler_free(struct LDKOffersMessageHandler this_ptr); @@ -14427,44 +14458,6 @@ public class bindings { public static native long OnionMessageContents_clone(long orig); // void OnionMessageContents_free(struct LDKOnionMessageContents this_ptr); public static native void OnionMessageContents_free(long this_ptr); - // void NextMessageHop_free(struct LDKNextMessageHop this_ptr); - public static native void NextMessageHop_free(long this_ptr); - // uint64_t NextMessageHop_clone_ptr(LDKNextMessageHop *NONNULL_PTR arg); - public static native long NextMessageHop_clone_ptr(long arg); - // struct LDKNextMessageHop NextMessageHop_clone(const struct LDKNextMessageHop *NONNULL_PTR orig); - public static native long NextMessageHop_clone(long orig); - // struct LDKNextMessageHop NextMessageHop_node_id(struct LDKPublicKey a); - public static native long NextMessageHop_node_id(byte[] a); - // struct LDKNextMessageHop NextMessageHop_short_channel_id(uint64_t a); - public static native long NextMessageHop_short_channel_id(long a); - // uint64_t NextMessageHop_hash(const struct LDKNextMessageHop *NONNULL_PTR o); - public static native long NextMessageHop_hash(long o); - // bool NextMessageHop_eq(const struct LDKNextMessageHop *NONNULL_PTR a, const struct LDKNextMessageHop *NONNULL_PTR b); - public static native boolean NextMessageHop_eq(long a, long b); - // void BlindedPath_free(struct LDKBlindedPath this_obj); - public static native void BlindedPath_free(long this_obj); - // struct LDKIntroductionNode BlindedPath_get_introduction_node(const struct LDKBlindedPath *NONNULL_PTR this_ptr); - public static native long BlindedPath_get_introduction_node(long this_ptr); - // void BlindedPath_set_introduction_node(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKIntroductionNode val); - public static native void BlindedPath_set_introduction_node(long this_ptr, long val); - // struct LDKPublicKey BlindedPath_get_blinding_point(const struct LDKBlindedPath *NONNULL_PTR this_ptr); - public static native byte[] BlindedPath_get_blinding_point(long this_ptr); - // void BlindedPath_set_blinding_point(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void BlindedPath_set_blinding_point(long this_ptr, byte[] val); - // struct LDKCVec_BlindedHopZ BlindedPath_get_blinded_hops(const struct LDKBlindedPath *NONNULL_PTR this_ptr); - public static native long[] BlindedPath_get_blinded_hops(long this_ptr); - // void BlindedPath_set_blinded_hops(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKCVec_BlindedHopZ val); - public static native void BlindedPath_set_blinded_hops(long this_ptr, long[] val); - // MUST_USE_RES struct LDKBlindedPath BlindedPath_new(struct LDKIntroductionNode introduction_node_arg, struct LDKPublicKey blinding_point_arg, struct LDKCVec_BlindedHopZ blinded_hops_arg); - public static native long BlindedPath_new(long introduction_node_arg, byte[] blinding_point_arg, long[] blinded_hops_arg); - // uint64_t BlindedPath_clone_ptr(LDKBlindedPath *NONNULL_PTR arg); - public static native long BlindedPath_clone_ptr(long arg); - // struct LDKBlindedPath BlindedPath_clone(const struct LDKBlindedPath *NONNULL_PTR orig); - public static native long BlindedPath_clone(long orig); - // uint64_t BlindedPath_hash(const struct LDKBlindedPath *NONNULL_PTR o); - public static native long BlindedPath_hash(long o); - // bool BlindedPath_eq(const struct LDKBlindedPath *NONNULL_PTR a, const struct LDKBlindedPath *NONNULL_PTR b); - public static native boolean BlindedPath_eq(long a, long b); // void IntroductionNode_free(struct LDKIntroductionNode this_ptr); public static native void IntroductionNode_free(long this_ptr); // uint64_t IntroductionNode_clone_ptr(LDKIntroductionNode *NONNULL_PTR arg); @@ -14517,44 +14510,98 @@ public class bindings { public static native long BlindedHop_hash(long o); // bool BlindedHop_eq(const struct LDKBlindedHop *NONNULL_PTR a, const struct LDKBlindedHop *NONNULL_PTR b); public static native boolean BlindedHop_eq(long a, long b); - // MUST_USE_RES struct LDKCResult_BlindedPathNoneZ BlindedPath_one_hop_for_message(struct LDKPublicKey recipient_node_id, struct LDKEntropySource entropy_source); - public static native long BlindedPath_one_hop_for_message(byte[] recipient_node_id, long entropy_source); - // MUST_USE_RES struct LDKCResult_BlindedPathNoneZ BlindedPath_new_for_message(struct LDKCVec_PublicKeyZ node_pks, struct LDKEntropySource entropy_source); - public static native long BlindedPath_new_for_message(byte[][] node_pks, long entropy_source); - // 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); - public static native long BlindedPath_one_hop_for_payment(byte[] payee_node_id, long payee_tlvs, short min_final_cltv_expiry_delta, long entropy_source); - // 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); - public static native long BlindedPath_new_for_payment(long[] intermediate_nodes, byte[] payee_node_id, long payee_tlvs, long htlc_maximum_msat, short min_final_cltv_expiry_delta, long entropy_source); - // MUST_USE_RES struct LDKNodeId BlindedPath_public_introduction_node_id(const struct LDKBlindedPath *NONNULL_PTR this_arg, const struct LDKReadOnlyNetworkGraph *NONNULL_PTR network_graph); - public static native long BlindedPath_public_introduction_node_id(long this_arg, long network_graph); - // struct LDKCVec_u8Z BlindedPath_write(const struct LDKBlindedPath *NONNULL_PTR obj); - public static native byte[] BlindedPath_write(long obj); - // struct LDKCResult_BlindedPathDecodeErrorZ BlindedPath_read(struct LDKu8slice ser); - public static native long BlindedPath_read(byte[] ser); // struct LDKCVec_u8Z BlindedHop_write(const struct LDKBlindedHop *NONNULL_PTR obj); public static native byte[] BlindedHop_write(long obj); // struct LDKCResult_BlindedHopDecodeErrorZ BlindedHop_read(struct LDKu8slice ser); public static native long BlindedHop_read(byte[] ser); - // void ForwardNode_free(struct LDKForwardNode this_obj); - public static native void ForwardNode_free(long this_obj); - // struct LDKForwardTlvs ForwardNode_get_tlvs(const struct LDKForwardNode *NONNULL_PTR this_ptr); - public static native long ForwardNode_get_tlvs(long this_ptr); - // void ForwardNode_set_tlvs(struct LDKForwardNode *NONNULL_PTR this_ptr, struct LDKForwardTlvs val); - public static native void ForwardNode_set_tlvs(long this_ptr, long val); - // struct LDKPublicKey ForwardNode_get_node_id(const struct LDKForwardNode *NONNULL_PTR this_ptr); - public static native byte[] ForwardNode_get_node_id(long this_ptr); - // void ForwardNode_set_node_id(struct LDKForwardNode *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void ForwardNode_set_node_id(long this_ptr, byte[] val); - // uint64_t ForwardNode_get_htlc_maximum_msat(const struct LDKForwardNode *NONNULL_PTR this_ptr); - public static native long ForwardNode_get_htlc_maximum_msat(long this_ptr); - // void ForwardNode_set_htlc_maximum_msat(struct LDKForwardNode *NONNULL_PTR this_ptr, uint64_t val); - public static native void ForwardNode_set_htlc_maximum_msat(long this_ptr, long val); - // MUST_USE_RES struct LDKForwardNode ForwardNode_new(struct LDKForwardTlvs tlvs_arg, struct LDKPublicKey node_id_arg, uint64_t htlc_maximum_msat_arg); - public static native long ForwardNode_new(long tlvs_arg, byte[] node_id_arg, long htlc_maximum_msat_arg); - // uint64_t ForwardNode_clone_ptr(LDKForwardNode *NONNULL_PTR arg); - public static native long ForwardNode_clone_ptr(long arg); - // struct LDKForwardNode ForwardNode_clone(const struct LDKForwardNode *NONNULL_PTR orig); - public static native long ForwardNode_clone(long orig); + // void BlindedPayInfo_free(struct LDKBlindedPayInfo this_obj); + public static native void BlindedPayInfo_free(long this_obj); + // uint32_t BlindedPayInfo_get_fee_base_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr); + public static native int BlindedPayInfo_get_fee_base_msat(long this_ptr); + // void BlindedPayInfo_set_fee_base_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val); + public static native void BlindedPayInfo_set_fee_base_msat(long this_ptr, int val); + // uint32_t BlindedPayInfo_get_fee_proportional_millionths(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr); + public static native int BlindedPayInfo_get_fee_proportional_millionths(long this_ptr); + // void BlindedPayInfo_set_fee_proportional_millionths(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val); + public static native void BlindedPayInfo_set_fee_proportional_millionths(long this_ptr, int val); + // uint16_t BlindedPayInfo_get_cltv_expiry_delta(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr); + public static native short BlindedPayInfo_get_cltv_expiry_delta(long this_ptr); + // void BlindedPayInfo_set_cltv_expiry_delta(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint16_t val); + public static native void BlindedPayInfo_set_cltv_expiry_delta(long this_ptr, short val); + // uint64_t BlindedPayInfo_get_htlc_minimum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr); + public static native long BlindedPayInfo_get_htlc_minimum_msat(long this_ptr); + // void BlindedPayInfo_set_htlc_minimum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val); + public static native void BlindedPayInfo_set_htlc_minimum_msat(long this_ptr, long val); + // uint64_t BlindedPayInfo_get_htlc_maximum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr); + public static native long BlindedPayInfo_get_htlc_maximum_msat(long this_ptr); + // void BlindedPayInfo_set_htlc_maximum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val); + public static native void BlindedPayInfo_set_htlc_maximum_msat(long this_ptr, long val); + // struct LDKBlindedHopFeatures BlindedPayInfo_get_features(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr); + public static native long BlindedPayInfo_get_features(long this_ptr); + // void BlindedPayInfo_set_features(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, struct LDKBlindedHopFeatures val); + public static native void BlindedPayInfo_set_features(long this_ptr, long val); + // 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); + public static native long BlindedPayInfo_new(int fee_base_msat_arg, int fee_proportional_millionths_arg, short cltv_expiry_delta_arg, long htlc_minimum_msat_arg, long htlc_maximum_msat_arg, long features_arg); + // uint64_t BlindedPayInfo_clone_ptr(LDKBlindedPayInfo *NONNULL_PTR arg); + public static native long BlindedPayInfo_clone_ptr(long arg); + // struct LDKBlindedPayInfo BlindedPayInfo_clone(const struct LDKBlindedPayInfo *NONNULL_PTR orig); + public static native long BlindedPayInfo_clone(long orig); + // uint64_t BlindedPayInfo_hash(const struct LDKBlindedPayInfo *NONNULL_PTR o); + public static native long BlindedPayInfo_hash(long o); + // bool BlindedPayInfo_eq(const struct LDKBlindedPayInfo *NONNULL_PTR a, const struct LDKBlindedPayInfo *NONNULL_PTR b); + public static native boolean BlindedPayInfo_eq(long a, long b); + // struct LDKCVec_u8Z BlindedPayInfo_write(const struct LDKBlindedPayInfo *NONNULL_PTR obj); + public static native byte[] BlindedPayInfo_write(long obj); + // struct LDKCResult_BlindedPayInfoDecodeErrorZ BlindedPayInfo_read(struct LDKu8slice ser); + public static native long BlindedPayInfo_read(byte[] ser); + // void BlindedPaymentPath_free(struct LDKBlindedPaymentPath this_obj); + public static native void BlindedPaymentPath_free(long this_obj); + // struct LDKBlindedPayInfo BlindedPaymentPath_get_payinfo(const struct LDKBlindedPaymentPath *NONNULL_PTR this_ptr); + public static native long BlindedPaymentPath_get_payinfo(long this_ptr); + // void BlindedPaymentPath_set_payinfo(struct LDKBlindedPaymentPath *NONNULL_PTR this_ptr, struct LDKBlindedPayInfo val); + public static native void BlindedPaymentPath_set_payinfo(long this_ptr, long val); + // uint64_t BlindedPaymentPath_clone_ptr(LDKBlindedPaymentPath *NONNULL_PTR arg); + public static native long BlindedPaymentPath_clone_ptr(long arg); + // struct LDKBlindedPaymentPath BlindedPaymentPath_clone(const struct LDKBlindedPaymentPath *NONNULL_PTR orig); + public static native long BlindedPaymentPath_clone(long orig); + // uint64_t BlindedPaymentPath_hash(const struct LDKBlindedPaymentPath *NONNULL_PTR o); + public static native long BlindedPaymentPath_hash(long o); + // bool BlindedPaymentPath_eq(const struct LDKBlindedPaymentPath *NONNULL_PTR a, const struct LDKBlindedPaymentPath *NONNULL_PTR b); + public static native boolean BlindedPaymentPath_eq(long a, long b); + // MUST_USE_RES struct LDKCResult_BlindedPaymentPathNoneZ BlindedPaymentPath_one_hop(struct LDKPublicKey payee_node_id, struct LDKReceiveTlvs payee_tlvs, uint16_t min_final_cltv_expiry_delta, struct LDKEntropySource entropy_source); + public static native long BlindedPaymentPath_one_hop(byte[] payee_node_id, long payee_tlvs, short min_final_cltv_expiry_delta, long entropy_source); + // MUST_USE_RES struct LDKCResult_BlindedPaymentPathNoneZ BlindedPaymentPath_new(struct LDKCVec_PaymentForwardNodeZ 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); + public static native long BlindedPaymentPath_new(long[] intermediate_nodes, byte[] payee_node_id, long payee_tlvs, long htlc_maximum_msat, short min_final_cltv_expiry_delta, long entropy_source); + // MUST_USE_RES struct LDKNodeId BlindedPaymentPath_public_introduction_node_id(const struct LDKBlindedPaymentPath *NONNULL_PTR this_arg, const struct LDKReadOnlyNetworkGraph *NONNULL_PTR network_graph); + public static native long BlindedPaymentPath_public_introduction_node_id(long this_arg, long network_graph); + // MUST_USE_RES struct LDKIntroductionNode BlindedPaymentPath_introduction_node(const struct LDKBlindedPaymentPath *NONNULL_PTR this_arg); + public static native long BlindedPaymentPath_introduction_node(long this_arg); + // MUST_USE_RES struct LDKPublicKey BlindedPaymentPath_blinding_point(const struct LDKBlindedPaymentPath *NONNULL_PTR this_arg); + public static native byte[] BlindedPaymentPath_blinding_point(long this_arg); + // MUST_USE_RES struct LDKCVec_BlindedHopZ BlindedPaymentPath_blinded_hops(const struct LDKBlindedPaymentPath *NONNULL_PTR this_arg); + public static native long[] BlindedPaymentPath_blinded_hops(long this_arg); + // MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedPaymentPath_advance_path_by_one(struct LDKBlindedPaymentPath *NONNULL_PTR this_arg, const struct LDKNodeSigner *NONNULL_PTR node_signer, const struct LDKNodeIdLookUp *NONNULL_PTR node_id_lookup); + public static native long BlindedPaymentPath_advance_path_by_one(long this_arg, long node_signer, long node_id_lookup); + // void PaymentForwardNode_free(struct LDKPaymentForwardNode this_obj); + public static native void PaymentForwardNode_free(long this_obj); + // struct LDKForwardTlvs PaymentForwardNode_get_tlvs(const struct LDKPaymentForwardNode *NONNULL_PTR this_ptr); + public static native long PaymentForwardNode_get_tlvs(long this_ptr); + // void PaymentForwardNode_set_tlvs(struct LDKPaymentForwardNode *NONNULL_PTR this_ptr, struct LDKForwardTlvs val); + public static native void PaymentForwardNode_set_tlvs(long this_ptr, long val); + // struct LDKPublicKey PaymentForwardNode_get_node_id(const struct LDKPaymentForwardNode *NONNULL_PTR this_ptr); + public static native byte[] PaymentForwardNode_get_node_id(long this_ptr); + // void PaymentForwardNode_set_node_id(struct LDKPaymentForwardNode *NONNULL_PTR this_ptr, struct LDKPublicKey val); + public static native void PaymentForwardNode_set_node_id(long this_ptr, byte[] val); + // uint64_t PaymentForwardNode_get_htlc_maximum_msat(const struct LDKPaymentForwardNode *NONNULL_PTR this_ptr); + public static native long PaymentForwardNode_get_htlc_maximum_msat(long this_ptr); + // void PaymentForwardNode_set_htlc_maximum_msat(struct LDKPaymentForwardNode *NONNULL_PTR this_ptr, uint64_t val); + public static native void PaymentForwardNode_set_htlc_maximum_msat(long this_ptr, long val); + // MUST_USE_RES struct LDKPaymentForwardNode PaymentForwardNode_new(struct LDKForwardTlvs tlvs_arg, struct LDKPublicKey node_id_arg, uint64_t htlc_maximum_msat_arg); + public static native long PaymentForwardNode_new(long tlvs_arg, byte[] node_id_arg, long htlc_maximum_msat_arg); + // uint64_t PaymentForwardNode_clone_ptr(LDKPaymentForwardNode *NONNULL_PTR arg); + public static native long PaymentForwardNode_clone_ptr(long arg); + // struct LDKPaymentForwardNode PaymentForwardNode_clone(const struct LDKPaymentForwardNode *NONNULL_PTR orig); + public static native long PaymentForwardNode_clone(long orig); // void ForwardTlvs_free(struct LDKForwardTlvs this_obj); public static native void ForwardTlvs_free(long this_obj); // uint64_t ForwardTlvs_get_short_channel_id(const struct LDKForwardTlvs *NONNULL_PTR this_ptr); @@ -14573,8 +14620,12 @@ public class bindings { public static native long ForwardTlvs_get_features(long this_ptr); // void ForwardTlvs_set_features(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKBlindedHopFeatures val); public static native void ForwardTlvs_set_features(long this_ptr, long val); - // 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); - public static native long ForwardTlvs_new(long short_channel_id_arg, long payment_relay_arg, long payment_constraints_arg, long features_arg); + // struct LDKPublicKey ForwardTlvs_get_next_blinding_override(const struct LDKForwardTlvs *NONNULL_PTR this_ptr); + public static native byte[] ForwardTlvs_get_next_blinding_override(long this_ptr); + // void ForwardTlvs_set_next_blinding_override(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKPublicKey val); + public static native void ForwardTlvs_set_next_blinding_override(long this_ptr, byte[] val); + // 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, struct LDKPublicKey next_blinding_override_arg); + public static native long ForwardTlvs_new(long short_channel_id_arg, long payment_relay_arg, long payment_constraints_arg, long features_arg, byte[] next_blinding_override_arg); // uint64_t ForwardTlvs_clone_ptr(LDKForwardTlvs *NONNULL_PTR arg); public static native long ForwardTlvs_clone_ptr(long arg); // struct LDKForwardTlvs ForwardTlvs_clone(const struct LDKForwardTlvs *NONNULL_PTR orig); @@ -14713,6 +14764,118 @@ public class bindings { public static native byte[] Bolt12RefundContext_write(long obj); // struct LDKCResult_Bolt12RefundContextDecodeErrorZ Bolt12RefundContext_read(struct LDKu8slice ser); public static native long Bolt12RefundContext_read(byte[] ser); + // void BlindedMessagePath_free(struct LDKBlindedMessagePath this_obj); + public static native void BlindedMessagePath_free(long this_obj); + // uint64_t BlindedMessagePath_clone_ptr(LDKBlindedMessagePath *NONNULL_PTR arg); + public static native long BlindedMessagePath_clone_ptr(long arg); + // struct LDKBlindedMessagePath BlindedMessagePath_clone(const struct LDKBlindedMessagePath *NONNULL_PTR orig); + public static native long BlindedMessagePath_clone(long orig); + // uint64_t BlindedMessagePath_hash(const struct LDKBlindedMessagePath *NONNULL_PTR o); + public static native long BlindedMessagePath_hash(long o); + // bool BlindedMessagePath_eq(const struct LDKBlindedMessagePath *NONNULL_PTR a, const struct LDKBlindedMessagePath *NONNULL_PTR b); + public static native boolean BlindedMessagePath_eq(long a, long b); + // struct LDKCVec_u8Z BlindedMessagePath_write(const struct LDKBlindedMessagePath *NONNULL_PTR obj); + public static native byte[] BlindedMessagePath_write(long obj); + // struct LDKCResult_BlindedMessagePathDecodeErrorZ BlindedMessagePath_read(struct LDKu8slice ser); + public static native long BlindedMessagePath_read(byte[] ser); + // MUST_USE_RES struct LDKCResult_BlindedMessagePathNoneZ BlindedMessagePath_one_hop(struct LDKPublicKey recipient_node_id, struct LDKMessageContext context, struct LDKEntropySource entropy_source); + public static native long BlindedMessagePath_one_hop(byte[] recipient_node_id, long context, long entropy_source); + // MUST_USE_RES struct LDKCResult_BlindedMessagePathNoneZ BlindedMessagePath_new(struct LDKCVec_MessageForwardNodeZ intermediate_nodes, struct LDKPublicKey recipient_node_id, struct LDKMessageContext context, struct LDKEntropySource entropy_source); + public static native long BlindedMessagePath_new(long[] intermediate_nodes, byte[] recipient_node_id, long context, long entropy_source); + // void BlindedMessagePath_use_compact_introduction_node(struct LDKBlindedMessagePath *NONNULL_PTR this_arg, const struct LDKReadOnlyNetworkGraph *NONNULL_PTR network_graph); + public static native void BlindedMessagePath_use_compact_introduction_node(long this_arg, long network_graph); + // MUST_USE_RES struct LDKNodeId BlindedMessagePath_public_introduction_node_id(const struct LDKBlindedMessagePath *NONNULL_PTR this_arg, const struct LDKReadOnlyNetworkGraph *NONNULL_PTR network_graph); + public static native long BlindedMessagePath_public_introduction_node_id(long this_arg, long network_graph); + // MUST_USE_RES struct LDKIntroductionNode BlindedMessagePath_introduction_node(const struct LDKBlindedMessagePath *NONNULL_PTR this_arg); + public static native long BlindedMessagePath_introduction_node(long this_arg); + // MUST_USE_RES struct LDKPublicKey BlindedMessagePath_blinding_point(const struct LDKBlindedMessagePath *NONNULL_PTR this_arg); + public static native byte[] BlindedMessagePath_blinding_point(long this_arg); + // MUST_USE_RES struct LDKCVec_BlindedHopZ BlindedMessagePath_blinded_hops(const struct LDKBlindedMessagePath *NONNULL_PTR this_arg); + public static native long[] BlindedMessagePath_blinded_hops(long this_arg); + // MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedMessagePath_advance_path_by_one(struct LDKBlindedMessagePath *NONNULL_PTR this_arg, const struct LDKNodeSigner *NONNULL_PTR node_signer, const struct LDKNodeIdLookUp *NONNULL_PTR node_id_lookup); + public static native long BlindedMessagePath_advance_path_by_one(long this_arg, long node_signer, long node_id_lookup); + // void NextMessageHop_free(struct LDKNextMessageHop this_ptr); + public static native void NextMessageHop_free(long this_ptr); + // uint64_t NextMessageHop_clone_ptr(LDKNextMessageHop *NONNULL_PTR arg); + public static native long NextMessageHop_clone_ptr(long arg); + // struct LDKNextMessageHop NextMessageHop_clone(const struct LDKNextMessageHop *NONNULL_PTR orig); + public static native long NextMessageHop_clone(long orig); + // struct LDKNextMessageHop NextMessageHop_node_id(struct LDKPublicKey a); + public static native long NextMessageHop_node_id(byte[] a); + // struct LDKNextMessageHop NextMessageHop_short_channel_id(uint64_t a); + public static native long NextMessageHop_short_channel_id(long a); + // uint64_t NextMessageHop_hash(const struct LDKNextMessageHop *NONNULL_PTR o); + public static native long NextMessageHop_hash(long o); + // bool NextMessageHop_eq(const struct LDKNextMessageHop *NONNULL_PTR a, const struct LDKNextMessageHop *NONNULL_PTR b); + public static native boolean NextMessageHop_eq(long a, long b); + // void MessageForwardNode_free(struct LDKMessageForwardNode this_obj); + public static native void MessageForwardNode_free(long this_obj); + // struct LDKPublicKey MessageForwardNode_get_node_id(const struct LDKMessageForwardNode *NONNULL_PTR this_ptr); + public static native byte[] MessageForwardNode_get_node_id(long this_ptr); + // void MessageForwardNode_set_node_id(struct LDKMessageForwardNode *NONNULL_PTR this_ptr, struct LDKPublicKey val); + public static native void MessageForwardNode_set_node_id(long this_ptr, byte[] val); + // struct LDKCOption_u64Z MessageForwardNode_get_short_channel_id(const struct LDKMessageForwardNode *NONNULL_PTR this_ptr); + public static native long MessageForwardNode_get_short_channel_id(long this_ptr); + // void MessageForwardNode_set_short_channel_id(struct LDKMessageForwardNode *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + public static native void MessageForwardNode_set_short_channel_id(long this_ptr, long val); + // MUST_USE_RES struct LDKMessageForwardNode MessageForwardNode_new(struct LDKPublicKey node_id_arg, struct LDKCOption_u64Z short_channel_id_arg); + public static native long MessageForwardNode_new(byte[] node_id_arg, long short_channel_id_arg); + // uint64_t MessageForwardNode_clone_ptr(LDKMessageForwardNode *NONNULL_PTR arg); + public static native long MessageForwardNode_clone_ptr(long arg); + // struct LDKMessageForwardNode MessageForwardNode_clone(const struct LDKMessageForwardNode *NONNULL_PTR orig); + public static native long MessageForwardNode_clone(long orig); + // uint64_t MessageForwardNode_hash(const struct LDKMessageForwardNode *NONNULL_PTR o); + public static native long MessageForwardNode_hash(long o); + // bool MessageForwardNode_eq(const struct LDKMessageForwardNode *NONNULL_PTR a, const struct LDKMessageForwardNode *NONNULL_PTR b); + public static native boolean MessageForwardNode_eq(long a, long b); + // void MessageContext_free(struct LDKMessageContext this_ptr); + public static native void MessageContext_free(long this_ptr); + // uint64_t MessageContext_clone_ptr(LDKMessageContext *NONNULL_PTR arg); + public static native long MessageContext_clone_ptr(long arg); + // struct LDKMessageContext MessageContext_clone(const struct LDKMessageContext *NONNULL_PTR orig); + public static native long MessageContext_clone(long orig); + // struct LDKMessageContext MessageContext_offers(struct LDKOffersContext a); + public static native long MessageContext_offers(long a); + // struct LDKMessageContext MessageContext_custom(struct LDKCVec_u8Z a); + public static native long MessageContext_custom(byte[] a); + // void OffersContext_free(struct LDKOffersContext this_ptr); + public static native void OffersContext_free(long this_ptr); + // uint64_t OffersContext_clone_ptr(LDKOffersContext *NONNULL_PTR arg); + public static native long OffersContext_clone_ptr(long arg); + // struct LDKOffersContext OffersContext_clone(const struct LDKOffersContext *NONNULL_PTR orig); + public static native long OffersContext_clone(long orig); + // struct LDKOffersContext OffersContext_invoice_request(struct LDKNonce nonce); + public static native long OffersContext_invoice_request(long nonce); + // struct LDKOffersContext OffersContext_outbound_payment(struct LDKThirtyTwoBytes payment_id, struct LDKNonce nonce, struct LDKThirtyTwoBytes hmac); + public static native long OffersContext_outbound_payment(byte[] payment_id, long nonce, byte[] hmac); + // struct LDKOffersContext OffersContext_inbound_payment(struct LDKThirtyTwoBytes payment_hash); + public static native long OffersContext_inbound_payment(byte[] payment_hash); + // bool OffersContext_eq(const struct LDKOffersContext *NONNULL_PTR a, const struct LDKOffersContext *NONNULL_PTR b); + public static native boolean OffersContext_eq(long a, long b); + // struct LDKCVec_u8Z MessageContext_write(const struct LDKMessageContext *NONNULL_PTR obj); + public static native byte[] MessageContext_write(long obj); + // struct LDKCResult_MessageContextDecodeErrorZ MessageContext_read(struct LDKu8slice ser); + public static native long MessageContext_read(byte[] ser); + // struct LDKCVec_u8Z OffersContext_write(const struct LDKOffersContext *NONNULL_PTR obj); + public static native byte[] OffersContext_write(long obj); + // struct LDKCResult_OffersContextDecodeErrorZ OffersContext_read(struct LDKu8slice ser); + public static native long OffersContext_read(byte[] ser); + // void FundingInfo_free(struct LDKFundingInfo this_ptr); + public static native void FundingInfo_free(long this_ptr); + // uint64_t FundingInfo_clone_ptr(LDKFundingInfo *NONNULL_PTR arg); + public static native long FundingInfo_clone_ptr(long arg); + // struct LDKFundingInfo FundingInfo_clone(const struct LDKFundingInfo *NONNULL_PTR orig); + public static native long FundingInfo_clone(long orig); + // struct LDKFundingInfo FundingInfo_tx(struct LDKTransaction transaction); + public static native long FundingInfo_tx(byte[] transaction); + // struct LDKFundingInfo FundingInfo_out_point(struct LDKOutPoint outpoint); + public static native long FundingInfo_out_point(long outpoint); + // bool FundingInfo_eq(const struct LDKFundingInfo *NONNULL_PTR a, const struct LDKFundingInfo *NONNULL_PTR b); + public static native boolean FundingInfo_eq(long a, long b); + // struct LDKCVec_u8Z FundingInfo_write(const struct LDKFundingInfo *NONNULL_PTR obj); + public static native byte[] FundingInfo_write(long obj); + // struct LDKCResult_FundingInfoDecodeErrorZ FundingInfo_read(struct LDKu8slice ser); + public static native long FundingInfo_read(byte[] ser); // void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr); public static native void PaymentPurpose_free(long this_ptr); // uint64_t PaymentPurpose_clone_ptr(LDKPaymentPurpose *NONNULL_PTR arg); @@ -14793,8 +14956,8 @@ public class bindings { public static native long ClosureReason_clone(long orig); // struct LDKClosureReason ClosureReason_counterparty_force_closed(struct LDKUntrustedString peer_msg); public static native long ClosureReason_counterparty_force_closed(long peer_msg); - // struct LDKClosureReason ClosureReason_holder_force_closed(void); - public static native long ClosureReason_holder_force_closed(); + // struct LDKClosureReason ClosureReason_holder_force_closed(struct LDKCOption_boolZ broadcasted_latest_txn); + public static native long ClosureReason_holder_force_closed(long broadcasted_latest_txn); // struct LDKClosureReason ClosureReason_legacy_cooperative_closure(void); public static native long ClosureReason_legacy_cooperative_closure(); // struct LDKClosureReason ClosureReason_counterparty_initiated_cooperative_closure(void); @@ -14817,6 +14980,8 @@ public class bindings { public static native long ClosureReason_funding_batch_closure(); // struct LDKClosureReason ClosureReason_htlcs_timed_out(void); public static native long ClosureReason_htlcs_timed_out(); + // struct LDKClosureReason ClosureReason_peer_feerate_too_low(uint32_t peer_feerate_sat_per_kw, uint32_t required_feerate_sat_per_kw); + public static native long ClosureReason_peer_feerate_too_low(int peer_feerate_sat_per_kw, int required_feerate_sat_per_kw); // bool ClosureReason_eq(const struct LDKClosureReason *NONNULL_PTR a, const struct LDKClosureReason *NONNULL_PTR b); public static native boolean ClosureReason_eq(long a, long b); // struct LDKStr ClosureReason_to_str(const struct LDKClosureReason *NONNULL_PTR o); @@ -14861,11 +15026,17 @@ public class bindings { public static native PaymentFailureReason PaymentFailureReason_route_not_found(); // enum LDKPaymentFailureReason PaymentFailureReason_unexpected_error(void); public static native PaymentFailureReason PaymentFailureReason_unexpected_error(); + // enum LDKPaymentFailureReason PaymentFailureReason_unknown_required_features(void); + public static native PaymentFailureReason PaymentFailureReason_unknown_required_features(); + // enum LDKPaymentFailureReason PaymentFailureReason_invoice_request_expired(void); + public static native PaymentFailureReason PaymentFailureReason_invoice_request_expired(); + // enum LDKPaymentFailureReason PaymentFailureReason_invoice_request_rejected(void); + public static native PaymentFailureReason PaymentFailureReason_invoice_request_rejected(); // bool PaymentFailureReason_eq(const enum LDKPaymentFailureReason *NONNULL_PTR a, const enum LDKPaymentFailureReason *NONNULL_PTR b); public static native boolean PaymentFailureReason_eq(long a, long b); // struct LDKCVec_u8Z PaymentFailureReason_write(const enum LDKPaymentFailureReason *NONNULL_PTR obj); public static native byte[] PaymentFailureReason_write(long obj); - // struct LDKCResult_PaymentFailureReasonDecodeErrorZ PaymentFailureReason_read(struct LDKu8slice ser); + // struct LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ PaymentFailureReason_read(struct LDKu8slice ser); public static native long PaymentFailureReason_read(byte[] ser); // void Event_free(struct LDKEvent this_ptr); public static native void Event_free(long this_ptr); @@ -14875,18 +15046,20 @@ public class bindings { public static native long Event_clone(long orig); // 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); public static native long Event_funding_generation_ready(long temporary_channel_id, byte[] counterparty_node_id, long channel_value_satoshis, byte[] output_script, byte[] user_channel_id); + // struct LDKEvent Event_funding_tx_broadcast_safe(struct LDKChannelId channel_id, struct LDKU128 user_channel_id, struct LDKOutPoint funding_txo, struct LDKPublicKey counterparty_node_id, struct LDKChannelId former_temporary_channel_id); + public static native long Event_funding_tx_broadcast_safe(long channel_id, byte[] user_channel_id, long funding_txo, byte[] counterparty_node_id, long former_temporary_channel_id); // 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); public static native long Event_payment_claimable(byte[] receiver_node_id, byte[] payment_hash, long onion_fields, long amount_msat, long counterparty_skimmed_fee_msat, long purpose, long via_channel_id, long via_user_channel_id, long claim_deadline); - // 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); - public static native long Event_payment_claimed(byte[] receiver_node_id, byte[] payment_hash, long amount_msat, long purpose, long[] htlcs, long sender_intended_total_msat); + // 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, struct LDKRecipientOnionFields onion_fields); + public static native long Event_payment_claimed(byte[] receiver_node_id, byte[] payment_hash, long amount_msat, long purpose, long[] htlcs, long sender_intended_total_msat, long onion_fields); // struct LDKEvent Event_connection_needed(struct LDKPublicKey node_id, struct LDKCVec_SocketAddressZ addresses); public static native long Event_connection_needed(byte[] node_id, long[] addresses); - // struct LDKEvent Event_invoice_request_failed(struct LDKThirtyTwoBytes payment_id); - public static native long Event_invoice_request_failed(byte[] payment_id); + // struct LDKEvent Event_invoice_received(struct LDKThirtyTwoBytes payment_id, struct LDKBolt12Invoice invoice, struct LDKCOption_OffersContextZ context, struct LDKResponder responder); + public static native long Event_invoice_received(byte[] payment_id, long invoice, long context, long responder); // struct LDKEvent Event_payment_sent(struct LDKCOption_ThirtyTwoBytesZ payment_id, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z fee_paid_msat); public static native long Event_payment_sent(long payment_id, byte[] payment_preimage, byte[] payment_hash, long fee_paid_msat); - // struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_PaymentFailureReasonZ reason); - public static native long Event_payment_failed(byte[] payment_id, byte[] payment_hash, long reason); + // struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKCOption_ThirtyTwoBytesZ payment_hash, struct LDKCOption_PaymentFailureReasonZ reason); + public static native long Event_payment_failed(byte[] payment_id, long payment_hash, long reason); // struct LDKEvent Event_payment_path_successful(struct LDKThirtyTwoBytes payment_id, struct LDKCOption_ThirtyTwoBytesZ payment_hash, struct LDKPath path); public static native long Event_payment_path_successful(byte[] payment_id, long payment_hash, long path); // 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); @@ -14909,14 +15082,18 @@ public class bindings { public static native long Event_channel_ready(long channel_id, byte[] user_channel_id, byte[] counterparty_node_id, long channel_type); // 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); public static native long Event_channel_closed(long channel_id, byte[] user_channel_id, long reason, byte[] counterparty_node_id, long channel_capacity_sats, long channel_funding_txo); - // struct LDKEvent Event_discard_funding(struct LDKChannelId channel_id, struct LDKTransaction transaction); - public static native long Event_discard_funding(long channel_id, byte[] transaction); - // 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); - public static native long Event_open_channel_request(long temporary_channel_id, byte[] counterparty_node_id, long funding_satoshis, long push_msat, long channel_type); + // struct LDKEvent Event_discard_funding(struct LDKChannelId channel_id, struct LDKFundingInfo funding_info); + public static native long Event_discard_funding(long channel_id, long funding_info); + // 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, bool is_announced, struct LDKChannelParameters params); + public static native long Event_open_channel_request(long temporary_channel_id, byte[] counterparty_node_id, long funding_satoshis, long push_msat, long channel_type, boolean is_announced, long params); // struct LDKEvent Event_htlchandling_failed(struct LDKChannelId prev_channel_id, struct LDKHTLCDestination failed_next_destination); public static native long Event_htlchandling_failed(long prev_channel_id, long failed_next_destination); // struct LDKEvent Event_bump_transaction(struct LDKBumpTransactionEvent a); public static native long Event_bump_transaction(long a); + // struct LDKEvent Event_onion_message_intercepted(struct LDKPublicKey peer_node_id, struct LDKOnionMessage message); + public static native long Event_onion_message_intercepted(byte[] peer_node_id, long message); + // struct LDKEvent Event_onion_message_peer_connected(struct LDKPublicKey peer_node_id); + public static native long Event_onion_message_peer_connected(byte[] peer_node_id); // bool Event_eq(const struct LDKEvent *NONNULL_PTR a, const struct LDKEvent *NONNULL_PTR b); public static native boolean Event_eq(long a, long b); // struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj); @@ -14943,8 +15120,8 @@ public class bindings { public static native long MessageSendEvent_send_funding_signed(byte[] node_id, long msg); // struct LDKMessageSendEvent MessageSendEvent_send_stfu(struct LDKPublicKey node_id, struct LDKStfu msg); public static native long MessageSendEvent_send_stfu(byte[] node_id, long msg); - // struct LDKMessageSendEvent MessageSendEvent_send_splice(struct LDKPublicKey node_id, struct LDKSplice msg); - public static native long MessageSendEvent_send_splice(byte[] node_id, long msg); + // struct LDKMessageSendEvent MessageSendEvent_send_splice_init(struct LDKPublicKey node_id, struct LDKSpliceInit msg); + public static native long MessageSendEvent_send_splice_init(byte[] node_id, long msg); // struct LDKMessageSendEvent MessageSendEvent_send_splice_ack(struct LDKPublicKey node_id, struct LDKSpliceAck msg); public static native long MessageSendEvent_send_splice_ack(byte[] node_id, long msg); // struct LDKMessageSendEvent MessageSendEvent_send_splice_locked(struct LDKPublicKey node_id, struct LDKSpliceLocked msg); @@ -15005,6 +15182,14 @@ public class bindings { public static native void MessageSendEventsProvider_free(long this_ptr); // void EventsProvider_free(struct LDKEventsProvider this_ptr); public static native void EventsProvider_free(long this_ptr); + // void ReplayEvent_free(struct LDKReplayEvent this_obj); + public static native void ReplayEvent_free(long this_obj); + // MUST_USE_RES struct LDKReplayEvent ReplayEvent_new(void); + public static native long ReplayEvent_new(); + // uint64_t ReplayEvent_clone_ptr(LDKReplayEvent *NONNULL_PTR arg); + public static native long ReplayEvent_clone_ptr(long arg); + // struct LDKReplayEvent ReplayEvent_clone(const struct LDKReplayEvent *NONNULL_PTR orig); + public static native long ReplayEvent_clone(long orig); // void EventHandler_free(struct LDKEventHandler this_ptr); public static native void EventHandler_free(long this_ptr); // void AnchorDescriptor_free(struct LDKAnchorDescriptor this_obj); @@ -15033,7 +15218,7 @@ public class bindings { public static native byte[] AnchorDescriptor_witness_script(long this_arg); // MUST_USE_RES struct LDKWitness AnchorDescriptor_tx_input_witness(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg, struct LDKECDSASignature signature); public static native byte[] AnchorDescriptor_tx_input_witness(long this_arg, byte[] signature); - // MUST_USE_RES struct LDKWriteableEcdsaChannelSigner AnchorDescriptor_derive_channel_signer(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider); + // MUST_USE_RES struct LDKEcdsaChannelSigner AnchorDescriptor_derive_channel_signer(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider); public static native long AnchorDescriptor_derive_channel_signer(long this_arg, long signer_provider); // void BumpTransactionEvent_free(struct LDKBumpTransactionEvent this_ptr); public static native void BumpTransactionEvent_free(long this_ptr); @@ -15129,6 +15314,826 @@ public class bindings { public static native long BumpTransactionEventHandler_new(long broadcaster, long utxo_source, long signer_provider, long logger); // void BumpTransactionEventHandler_handle_event(const struct LDKBumpTransactionEventHandler *NONNULL_PTR this_arg, const struct LDKBumpTransactionEvent *NONNULL_PTR event); public static native void BumpTransactionEventHandler_handle_event(long this_arg, long event); + // bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b); + public static native boolean InitFeatures_eq(long a, long b); + // bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b); + public static native boolean NodeFeatures_eq(long a, long b); + // bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b); + public static native boolean ChannelFeatures_eq(long a, long b); + // bool Bolt11InvoiceFeatures_eq(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR b); + public static native boolean Bolt11InvoiceFeatures_eq(long a, long b); + // bool OfferFeatures_eq(const struct LDKOfferFeatures *NONNULL_PTR a, const struct LDKOfferFeatures *NONNULL_PTR b); + public static native boolean OfferFeatures_eq(long a, long b); + // bool InvoiceRequestFeatures_eq(const struct LDKInvoiceRequestFeatures *NONNULL_PTR a, const struct LDKInvoiceRequestFeatures *NONNULL_PTR b); + public static native boolean InvoiceRequestFeatures_eq(long a, long b); + // bool Bolt12InvoiceFeatures_eq(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR b); + public static native boolean Bolt12InvoiceFeatures_eq(long a, long b); + // bool BlindedHopFeatures_eq(const struct LDKBlindedHopFeatures *NONNULL_PTR a, const struct LDKBlindedHopFeatures *NONNULL_PTR b); + public static native boolean BlindedHopFeatures_eq(long a, long b); + // bool ChannelTypeFeatures_eq(const struct LDKChannelTypeFeatures *NONNULL_PTR a, const struct LDKChannelTypeFeatures *NONNULL_PTR b); + public static native boolean ChannelTypeFeatures_eq(long a, long b); + // uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg); + public static native long InitFeatures_clone_ptr(long arg); + // struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig); + public static native long InitFeatures_clone(long orig); + // uint64_t NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg); + public static native long NodeFeatures_clone_ptr(long arg); + // struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig); + public static native long NodeFeatures_clone(long orig); + // uint64_t ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg); + public static native long ChannelFeatures_clone_ptr(long arg); + // struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig); + public static native long ChannelFeatures_clone(long orig); + // uint64_t Bolt11InvoiceFeatures_clone_ptr(LDKBolt11InvoiceFeatures *NONNULL_PTR arg); + public static native long Bolt11InvoiceFeatures_clone_ptr(long arg); + // struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_clone(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR orig); + public static native long Bolt11InvoiceFeatures_clone(long orig); + // uint64_t OfferFeatures_clone_ptr(LDKOfferFeatures *NONNULL_PTR arg); + public static native long OfferFeatures_clone_ptr(long arg); + // struct LDKOfferFeatures OfferFeatures_clone(const struct LDKOfferFeatures *NONNULL_PTR orig); + public static native long OfferFeatures_clone(long orig); + // uint64_t InvoiceRequestFeatures_clone_ptr(LDKInvoiceRequestFeatures *NONNULL_PTR arg); + public static native long InvoiceRequestFeatures_clone_ptr(long arg); + // struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_clone(const struct LDKInvoiceRequestFeatures *NONNULL_PTR orig); + public static native long InvoiceRequestFeatures_clone(long orig); + // uint64_t Bolt12InvoiceFeatures_clone_ptr(LDKBolt12InvoiceFeatures *NONNULL_PTR arg); + public static native long Bolt12InvoiceFeatures_clone_ptr(long arg); + // struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_clone(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR orig); + public static native long Bolt12InvoiceFeatures_clone(long orig); + // uint64_t BlindedHopFeatures_clone_ptr(LDKBlindedHopFeatures *NONNULL_PTR arg); + public static native long BlindedHopFeatures_clone_ptr(long arg); + // struct LDKBlindedHopFeatures BlindedHopFeatures_clone(const struct LDKBlindedHopFeatures *NONNULL_PTR orig); + public static native long BlindedHopFeatures_clone(long orig); + // uint64_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg); + public static native long ChannelTypeFeatures_clone_ptr(long arg); + // struct LDKChannelTypeFeatures ChannelTypeFeatures_clone(const struct LDKChannelTypeFeatures *NONNULL_PTR orig); + public static native long ChannelTypeFeatures_clone(long orig); + // uint64_t InitFeatures_hash(const struct LDKInitFeatures *NONNULL_PTR o); + public static native long InitFeatures_hash(long o); + // uint64_t NodeFeatures_hash(const struct LDKNodeFeatures *NONNULL_PTR o); + public static native long NodeFeatures_hash(long o); + // uint64_t ChannelFeatures_hash(const struct LDKChannelFeatures *NONNULL_PTR o); + public static native long ChannelFeatures_hash(long o); + // uint64_t Bolt11InvoiceFeatures_hash(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR o); + public static native long Bolt11InvoiceFeatures_hash(long o); + // uint64_t OfferFeatures_hash(const struct LDKOfferFeatures *NONNULL_PTR o); + public static native long OfferFeatures_hash(long o); + // uint64_t InvoiceRequestFeatures_hash(const struct LDKInvoiceRequestFeatures *NONNULL_PTR o); + public static native long InvoiceRequestFeatures_hash(long o); + // uint64_t Bolt12InvoiceFeatures_hash(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR o); + public static native long Bolt12InvoiceFeatures_hash(long o); + // uint64_t BlindedHopFeatures_hash(const struct LDKBlindedHopFeatures *NONNULL_PTR o); + public static native long BlindedHopFeatures_hash(long o); + // uint64_t ChannelTypeFeatures_hash(const struct LDKChannelTypeFeatures *NONNULL_PTR o); + public static native long ChannelTypeFeatures_hash(long o); + // void InitFeatures_free(struct LDKInitFeatures this_obj); + public static native void InitFeatures_free(long this_obj); + // void NodeFeatures_free(struct LDKNodeFeatures this_obj); + public static native void NodeFeatures_free(long this_obj); + // void ChannelFeatures_free(struct LDKChannelFeatures this_obj); + public static native void ChannelFeatures_free(long this_obj); + // void Bolt11InvoiceFeatures_free(struct LDKBolt11InvoiceFeatures this_obj); + public static native void Bolt11InvoiceFeatures_free(long this_obj); + // void OfferFeatures_free(struct LDKOfferFeatures this_obj); + public static native void OfferFeatures_free(long this_obj); + // void InvoiceRequestFeatures_free(struct LDKInvoiceRequestFeatures this_obj); + public static native void InvoiceRequestFeatures_free(long this_obj); + // void Bolt12InvoiceFeatures_free(struct LDKBolt12InvoiceFeatures this_obj); + public static native void Bolt12InvoiceFeatures_free(long this_obj); + // void BlindedHopFeatures_free(struct LDKBlindedHopFeatures this_obj); + public static native void BlindedHopFeatures_free(long this_obj); + // void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj); + public static native void ChannelTypeFeatures_free(long this_obj); + // MUST_USE_RES struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_for_keysend(bool allow_mpp); + public static native long Bolt11InvoiceFeatures_for_keysend(boolean allow_mpp); + // MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_only_static_remote_key(void); + public static native long ChannelTypeFeatures_only_static_remote_key(); + // MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_anchors_zero_htlc_fee_and_dependencies(void); + public static native long ChannelTypeFeatures_anchors_zero_htlc_fee_and_dependencies(); + // MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void); + public static native long InitFeatures_empty(); + // MUST_USE_RES struct LDKu8slice InitFeatures_le_flags(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native byte[] InitFeatures_le_flags(long this_arg); + // MUST_USE_RES bool InitFeatures_supports_any_optional_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_supports_any_optional_bits(long this_arg); + // MUST_USE_RES bool InitFeatures_requires_unknown_bits_from(const struct LDKInitFeatures *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR other); + public static native boolean InitFeatures_requires_unknown_bits_from(long this_arg, long other); + // MUST_USE_RES struct LDKCVec_u64Z InitFeatures_required_unknown_bits_from(const struct LDKInitFeatures *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR other); + public static native long[] InitFeatures_required_unknown_bits_from(long this_arg, long other); + // MUST_USE_RES bool InitFeatures_requires_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_requires_unknown_bits(long this_arg); + // MUST_USE_RES bool InitFeatures_supports_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_supports_unknown_bits(long this_arg); + // MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_required_feature_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit); + public static native long InitFeatures_set_required_feature_bit(long this_arg, long bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_optional_feature_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit); + public static native long InitFeatures_set_optional_feature_bit(long this_arg, long bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_required_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit); + public static native long InitFeatures_set_required_custom_bit(long this_arg, long bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_optional_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit); + public static native long InitFeatures_set_optional_custom_bit(long this_arg, long bit); + // MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void); + public static native long NodeFeatures_empty(); + // MUST_USE_RES struct LDKu8slice NodeFeatures_le_flags(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native byte[] NodeFeatures_le_flags(long this_arg); + // MUST_USE_RES bool NodeFeatures_supports_any_optional_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_supports_any_optional_bits(long this_arg); + // MUST_USE_RES bool NodeFeatures_requires_unknown_bits_from(const struct LDKNodeFeatures *NONNULL_PTR this_arg, const struct LDKNodeFeatures *NONNULL_PTR other); + public static native boolean NodeFeatures_requires_unknown_bits_from(long this_arg, long other); + // MUST_USE_RES struct LDKCVec_u64Z NodeFeatures_required_unknown_bits_from(const struct LDKNodeFeatures *NONNULL_PTR this_arg, const struct LDKNodeFeatures *NONNULL_PTR other); + public static native long[] NodeFeatures_required_unknown_bits_from(long this_arg, long other); + // MUST_USE_RES bool NodeFeatures_requires_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_requires_unknown_bits(long this_arg); + // MUST_USE_RES bool NodeFeatures_supports_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_supports_unknown_bits(long this_arg); + // MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_required_feature_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit); + public static native long NodeFeatures_set_required_feature_bit(long this_arg, long bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_optional_feature_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit); + public static native long NodeFeatures_set_optional_feature_bit(long this_arg, long bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_required_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit); + public static native long NodeFeatures_set_required_custom_bit(long this_arg, long bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_optional_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit); + public static native long NodeFeatures_set_optional_custom_bit(long this_arg, long bit); + // MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void); + public static native long ChannelFeatures_empty(); + // MUST_USE_RES struct LDKu8slice ChannelFeatures_le_flags(const struct LDKChannelFeatures *NONNULL_PTR this_arg); + public static native byte[] ChannelFeatures_le_flags(long this_arg); + // MUST_USE_RES bool ChannelFeatures_supports_any_optional_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg); + public static native boolean ChannelFeatures_supports_any_optional_bits(long this_arg); + // MUST_USE_RES bool ChannelFeatures_requires_unknown_bits_from(const struct LDKChannelFeatures *NONNULL_PTR this_arg, const struct LDKChannelFeatures *NONNULL_PTR other); + public static native boolean ChannelFeatures_requires_unknown_bits_from(long this_arg, long other); + // MUST_USE_RES struct LDKCVec_u64Z ChannelFeatures_required_unknown_bits_from(const struct LDKChannelFeatures *NONNULL_PTR this_arg, const struct LDKChannelFeatures *NONNULL_PTR other); + public static native long[] ChannelFeatures_required_unknown_bits_from(long this_arg, long other); + // MUST_USE_RES bool ChannelFeatures_requires_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg); + public static native boolean ChannelFeatures_requires_unknown_bits(long this_arg); + // MUST_USE_RES bool ChannelFeatures_supports_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg); + public static native boolean ChannelFeatures_supports_unknown_bits(long this_arg); + // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_required_feature_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit); + public static native long ChannelFeatures_set_required_feature_bit(long this_arg, long bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_optional_feature_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit); + public static native long ChannelFeatures_set_optional_feature_bit(long this_arg, long bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_required_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit); + public static native long ChannelFeatures_set_required_custom_bit(long this_arg, long bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_optional_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit); + public static native long ChannelFeatures_set_optional_custom_bit(long this_arg, long bit); + // MUST_USE_RES struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_empty(void); + public static native long Bolt11InvoiceFeatures_empty(); + // MUST_USE_RES struct LDKu8slice Bolt11InvoiceFeatures_le_flags(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + public static native byte[] Bolt11InvoiceFeatures_le_flags(long this_arg); + // MUST_USE_RES bool Bolt11InvoiceFeatures_supports_any_optional_bits(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + public static native boolean Bolt11InvoiceFeatures_supports_any_optional_bits(long this_arg); + // MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR other); + public static native boolean Bolt11InvoiceFeatures_requires_unknown_bits_from(long this_arg, long other); + // MUST_USE_RES struct LDKCVec_u64Z Bolt11InvoiceFeatures_required_unknown_bits_from(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR other); + public static native long[] Bolt11InvoiceFeatures_required_unknown_bits_from(long this_arg, long other); + // MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + public static native boolean Bolt11InvoiceFeatures_requires_unknown_bits(long this_arg); + // MUST_USE_RES bool Bolt11InvoiceFeatures_supports_unknown_bits(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + public static native boolean Bolt11InvoiceFeatures_supports_unknown_bits(long this_arg); + // MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_required_feature_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit); + public static native long Bolt11InvoiceFeatures_set_required_feature_bit(long this_arg, long bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_optional_feature_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit); + public static native long Bolt11InvoiceFeatures_set_optional_feature_bit(long this_arg, long bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_required_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit); + public static native long Bolt11InvoiceFeatures_set_required_custom_bit(long this_arg, long bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_optional_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit); + public static native long Bolt11InvoiceFeatures_set_optional_custom_bit(long this_arg, long bit); + // MUST_USE_RES struct LDKOfferFeatures OfferFeatures_empty(void); + public static native long OfferFeatures_empty(); + // MUST_USE_RES struct LDKu8slice OfferFeatures_le_flags(const struct LDKOfferFeatures *NONNULL_PTR this_arg); + public static native byte[] OfferFeatures_le_flags(long this_arg); + // MUST_USE_RES bool OfferFeatures_supports_any_optional_bits(const struct LDKOfferFeatures *NONNULL_PTR this_arg); + public static native boolean OfferFeatures_supports_any_optional_bits(long this_arg); + // MUST_USE_RES bool OfferFeatures_requires_unknown_bits_from(const struct LDKOfferFeatures *NONNULL_PTR this_arg, const struct LDKOfferFeatures *NONNULL_PTR other); + public static native boolean OfferFeatures_requires_unknown_bits_from(long this_arg, long other); + // MUST_USE_RES struct LDKCVec_u64Z OfferFeatures_required_unknown_bits_from(const struct LDKOfferFeatures *NONNULL_PTR this_arg, const struct LDKOfferFeatures *NONNULL_PTR other); + public static native long[] OfferFeatures_required_unknown_bits_from(long this_arg, long other); + // MUST_USE_RES bool OfferFeatures_requires_unknown_bits(const struct LDKOfferFeatures *NONNULL_PTR this_arg); + public static native boolean OfferFeatures_requires_unknown_bits(long this_arg); + // MUST_USE_RES bool OfferFeatures_supports_unknown_bits(const struct LDKOfferFeatures *NONNULL_PTR this_arg); + public static native boolean OfferFeatures_supports_unknown_bits(long this_arg); + // MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_required_feature_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit); + public static native long OfferFeatures_set_required_feature_bit(long this_arg, long bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_optional_feature_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit); + public static native long OfferFeatures_set_optional_feature_bit(long this_arg, long bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_required_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit); + public static native long OfferFeatures_set_required_custom_bit(long this_arg, long bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_optional_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit); + public static native long OfferFeatures_set_optional_custom_bit(long this_arg, long bit); + // MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_empty(void); + public static native long InvoiceRequestFeatures_empty(); + // MUST_USE_RES struct LDKu8slice InvoiceRequestFeatures_le_flags(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg); + public static native byte[] InvoiceRequestFeatures_le_flags(long this_arg); + // MUST_USE_RES bool InvoiceRequestFeatures_supports_any_optional_bits(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg); + public static native boolean InvoiceRequestFeatures_supports_any_optional_bits(long this_arg); + // MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits_from(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, const struct LDKInvoiceRequestFeatures *NONNULL_PTR other); + public static native boolean InvoiceRequestFeatures_requires_unknown_bits_from(long this_arg, long other); + // MUST_USE_RES struct LDKCVec_u64Z InvoiceRequestFeatures_required_unknown_bits_from(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, const struct LDKInvoiceRequestFeatures *NONNULL_PTR other); + public static native long[] InvoiceRequestFeatures_required_unknown_bits_from(long this_arg, long other); + // MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg); + public static native boolean InvoiceRequestFeatures_requires_unknown_bits(long this_arg); + // MUST_USE_RES bool InvoiceRequestFeatures_supports_unknown_bits(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg); + public static native boolean InvoiceRequestFeatures_supports_unknown_bits(long this_arg); + // MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_required_feature_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit); + public static native long InvoiceRequestFeatures_set_required_feature_bit(long this_arg, long bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_optional_feature_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit); + public static native long InvoiceRequestFeatures_set_optional_feature_bit(long this_arg, long bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_required_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit); + public static native long InvoiceRequestFeatures_set_required_custom_bit(long this_arg, long bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_optional_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit); + public static native long InvoiceRequestFeatures_set_optional_custom_bit(long this_arg, long bit); + // MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_empty(void); + public static native long Bolt12InvoiceFeatures_empty(); + // MUST_USE_RES struct LDKu8slice Bolt12InvoiceFeatures_le_flags(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg); + public static native byte[] Bolt12InvoiceFeatures_le_flags(long this_arg); + // MUST_USE_RES bool Bolt12InvoiceFeatures_supports_any_optional_bits(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg); + public static native boolean Bolt12InvoiceFeatures_supports_any_optional_bits(long this_arg); + // MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR other); + public static native boolean Bolt12InvoiceFeatures_requires_unknown_bits_from(long this_arg, long other); + // MUST_USE_RES struct LDKCVec_u64Z Bolt12InvoiceFeatures_required_unknown_bits_from(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR other); + public static native long[] Bolt12InvoiceFeatures_required_unknown_bits_from(long this_arg, long other); + // MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg); + public static native boolean Bolt12InvoiceFeatures_requires_unknown_bits(long this_arg); + // MUST_USE_RES bool Bolt12InvoiceFeatures_supports_unknown_bits(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg); + public static native boolean Bolt12InvoiceFeatures_supports_unknown_bits(long this_arg); + // MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_required_feature_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit); + public static native long Bolt12InvoiceFeatures_set_required_feature_bit(long this_arg, long bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_optional_feature_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit); + public static native long Bolt12InvoiceFeatures_set_optional_feature_bit(long this_arg, long bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_required_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit); + public static native long Bolt12InvoiceFeatures_set_required_custom_bit(long this_arg, long bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_optional_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit); + public static native long Bolt12InvoiceFeatures_set_optional_custom_bit(long this_arg, long bit); + // MUST_USE_RES struct LDKBlindedHopFeatures BlindedHopFeatures_empty(void); + public static native long BlindedHopFeatures_empty(); + // MUST_USE_RES struct LDKu8slice BlindedHopFeatures_le_flags(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg); + public static native byte[] BlindedHopFeatures_le_flags(long this_arg); + // MUST_USE_RES bool BlindedHopFeatures_supports_any_optional_bits(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg); + public static native boolean BlindedHopFeatures_supports_any_optional_bits(long this_arg); + // MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits_from(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, const struct LDKBlindedHopFeatures *NONNULL_PTR other); + public static native boolean BlindedHopFeatures_requires_unknown_bits_from(long this_arg, long other); + // MUST_USE_RES struct LDKCVec_u64Z BlindedHopFeatures_required_unknown_bits_from(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, const struct LDKBlindedHopFeatures *NONNULL_PTR other); + public static native long[] BlindedHopFeatures_required_unknown_bits_from(long this_arg, long other); + // MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg); + public static native boolean BlindedHopFeatures_requires_unknown_bits(long this_arg); + // MUST_USE_RES bool BlindedHopFeatures_supports_unknown_bits(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg); + public static native boolean BlindedHopFeatures_supports_unknown_bits(long this_arg); + // MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_required_feature_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit); + public static native long BlindedHopFeatures_set_required_feature_bit(long this_arg, long bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_optional_feature_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit); + public static native long BlindedHopFeatures_set_optional_feature_bit(long this_arg, long bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_required_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit); + public static native long BlindedHopFeatures_set_required_custom_bit(long this_arg, long bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_optional_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit); + public static native long BlindedHopFeatures_set_optional_custom_bit(long this_arg, long bit); + // MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void); + public static native long ChannelTypeFeatures_empty(); + // MUST_USE_RES struct LDKu8slice ChannelTypeFeatures_le_flags(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native byte[] ChannelTypeFeatures_le_flags(long this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_supports_any_optional_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native boolean ChannelTypeFeatures_supports_any_optional_bits(long this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits_from(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, const struct LDKChannelTypeFeatures *NONNULL_PTR other); + public static native boolean ChannelTypeFeatures_requires_unknown_bits_from(long this_arg, long other); + // MUST_USE_RES struct LDKCVec_u64Z ChannelTypeFeatures_required_unknown_bits_from(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, const struct LDKChannelTypeFeatures *NONNULL_PTR other); + public static native long[] ChannelTypeFeatures_required_unknown_bits_from(long this_arg, long other); + // MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native boolean ChannelTypeFeatures_requires_unknown_bits(long this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_supports_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native boolean ChannelTypeFeatures_supports_unknown_bits(long this_arg); + // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_required_feature_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit); + public static native long ChannelTypeFeatures_set_required_feature_bit(long this_arg, long bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_optional_feature_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit); + public static native long ChannelTypeFeatures_set_optional_feature_bit(long this_arg, long bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_required_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit); + public static native long ChannelTypeFeatures_set_required_custom_bit(long this_arg, long bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_optional_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit); + public static native long ChannelTypeFeatures_set_optional_custom_bit(long this_arg, long bit); + // MUST_USE_RES struct LDKInitFeatures InitFeatures_clear_upfront_shutdown_script(struct LDKInitFeatures this_arg); + public static native long InitFeatures_clear_upfront_shutdown_script(long this_arg); + // MUST_USE_RES struct LDKNodeFeatures NodeFeatures_clear_upfront_shutdown_script(struct LDKNodeFeatures this_arg); + public static native long NodeFeatures_clear_upfront_shutdown_script(long this_arg); + // MUST_USE_RES struct LDKInitFeatures InitFeatures_clear_shutdown_anysegwit(struct LDKInitFeatures this_arg); + public static native long InitFeatures_clear_shutdown_anysegwit(long this_arg); + // MUST_USE_RES struct LDKNodeFeatures NodeFeatures_clear_shutdown_anysegwit(struct LDKNodeFeatures this_arg); + public static native long NodeFeatures_clear_shutdown_anysegwit(long this_arg); + // MUST_USE_RES struct LDKInitFeatures InitFeatures_clear_wumbo(struct LDKInitFeatures this_arg); + public static native long InitFeatures_clear_wumbo(long this_arg); + // MUST_USE_RES struct LDKNodeFeatures NodeFeatures_clear_wumbo(struct LDKNodeFeatures this_arg); + public static native long NodeFeatures_clear_wumbo(long this_arg); + // void InitFeatures_clear_scid_privacy(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_clear_scid_privacy(long this_arg); + // void NodeFeatures_clear_scid_privacy(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_clear_scid_privacy(long this_arg); + // void ChannelTypeFeatures_clear_scid_privacy(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native void ChannelTypeFeatures_clear_scid_privacy(long this_arg); + // void InitFeatures_clear_anchors_zero_fee_htlc_tx(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_clear_anchors_zero_fee_htlc_tx(long this_arg); + // void NodeFeatures_clear_anchors_zero_fee_htlc_tx(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_clear_anchors_zero_fee_htlc_tx(long this_arg); + // void ChannelTypeFeatures_clear_anchors_zero_fee_htlc_tx(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native void ChannelTypeFeatures_clear_anchors_zero_fee_htlc_tx(long this_arg); + // void InitFeatures_clear_route_blinding(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_clear_route_blinding(long this_arg); + // void NodeFeatures_clear_route_blinding(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_clear_route_blinding(long this_arg); + // void InitFeatures_set_data_loss_protect_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_data_loss_protect_optional(long this_arg); + // void InitFeatures_set_data_loss_protect_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_data_loss_protect_required(long this_arg); + // MUST_USE_RES bool InitFeatures_supports_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_supports_data_loss_protect(long this_arg); + // void NodeFeatures_set_data_loss_protect_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_data_loss_protect_optional(long this_arg); + // void NodeFeatures_set_data_loss_protect_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_data_loss_protect_required(long this_arg); + // MUST_USE_RES bool NodeFeatures_supports_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_supports_data_loss_protect(long this_arg); + // MUST_USE_RES bool InitFeatures_requires_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_requires_data_loss_protect(long this_arg); + // MUST_USE_RES bool NodeFeatures_requires_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_requires_data_loss_protect(long this_arg); + // void InitFeatures_set_initial_routing_sync_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_initial_routing_sync_optional(long this_arg); + // void InitFeatures_set_initial_routing_sync_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_initial_routing_sync_required(long this_arg); + // MUST_USE_RES bool InitFeatures_initial_routing_sync(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_initial_routing_sync(long this_arg); + // void InitFeatures_set_upfront_shutdown_script_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_upfront_shutdown_script_optional(long this_arg); + // void InitFeatures_set_upfront_shutdown_script_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_upfront_shutdown_script_required(long this_arg); + // MUST_USE_RES bool InitFeatures_supports_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_supports_upfront_shutdown_script(long this_arg); + // void NodeFeatures_set_upfront_shutdown_script_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_upfront_shutdown_script_optional(long this_arg); + // void NodeFeatures_set_upfront_shutdown_script_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_upfront_shutdown_script_required(long this_arg); + // MUST_USE_RES bool NodeFeatures_supports_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_supports_upfront_shutdown_script(long this_arg); + // MUST_USE_RES bool InitFeatures_requires_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_requires_upfront_shutdown_script(long this_arg); + // MUST_USE_RES bool NodeFeatures_requires_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_requires_upfront_shutdown_script(long this_arg); + // void InitFeatures_set_gossip_queries_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_gossip_queries_optional(long this_arg); + // void InitFeatures_set_gossip_queries_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_gossip_queries_required(long this_arg); + // MUST_USE_RES bool InitFeatures_supports_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_supports_gossip_queries(long this_arg); + // void NodeFeatures_set_gossip_queries_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_gossip_queries_optional(long this_arg); + // void NodeFeatures_set_gossip_queries_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_gossip_queries_required(long this_arg); + // MUST_USE_RES bool NodeFeatures_supports_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_supports_gossip_queries(long this_arg); + // MUST_USE_RES bool InitFeatures_requires_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_requires_gossip_queries(long this_arg); + // MUST_USE_RES bool NodeFeatures_requires_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_requires_gossip_queries(long this_arg); + // void InitFeatures_set_variable_length_onion_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_variable_length_onion_optional(long this_arg); + // void InitFeatures_set_variable_length_onion_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_variable_length_onion_required(long this_arg); + // MUST_USE_RES bool InitFeatures_supports_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_supports_variable_length_onion(long this_arg); + // void NodeFeatures_set_variable_length_onion_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_variable_length_onion_optional(long this_arg); + // void NodeFeatures_set_variable_length_onion_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_variable_length_onion_required(long this_arg); + // MUST_USE_RES bool NodeFeatures_supports_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_supports_variable_length_onion(long this_arg); + // void Bolt11InvoiceFeatures_set_variable_length_onion_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + public static native void Bolt11InvoiceFeatures_set_variable_length_onion_optional(long this_arg); + // void Bolt11InvoiceFeatures_set_variable_length_onion_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + public static native void Bolt11InvoiceFeatures_set_variable_length_onion_required(long this_arg); + // MUST_USE_RES bool Bolt11InvoiceFeatures_supports_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + public static native boolean Bolt11InvoiceFeatures_supports_variable_length_onion(long this_arg); + // MUST_USE_RES bool InitFeatures_requires_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_requires_variable_length_onion(long this_arg); + // MUST_USE_RES bool NodeFeatures_requires_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_requires_variable_length_onion(long this_arg); + // MUST_USE_RES bool Bolt11InvoiceFeatures_requires_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + public static native boolean Bolt11InvoiceFeatures_requires_variable_length_onion(long this_arg); + // void InitFeatures_set_static_remote_key_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_static_remote_key_optional(long this_arg); + // void InitFeatures_set_static_remote_key_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_static_remote_key_required(long this_arg); + // MUST_USE_RES bool InitFeatures_supports_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_supports_static_remote_key(long this_arg); + // void NodeFeatures_set_static_remote_key_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_static_remote_key_optional(long this_arg); + // void NodeFeatures_set_static_remote_key_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_static_remote_key_required(long this_arg); + // MUST_USE_RES bool NodeFeatures_supports_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_supports_static_remote_key(long this_arg); + // void ChannelTypeFeatures_set_static_remote_key_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native void ChannelTypeFeatures_set_static_remote_key_optional(long this_arg); + // void ChannelTypeFeatures_set_static_remote_key_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native void ChannelTypeFeatures_set_static_remote_key_required(long this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_supports_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native boolean ChannelTypeFeatures_supports_static_remote_key(long this_arg); + // MUST_USE_RES bool InitFeatures_requires_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_requires_static_remote_key(long this_arg); + // MUST_USE_RES bool NodeFeatures_requires_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_requires_static_remote_key(long this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_requires_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native boolean ChannelTypeFeatures_requires_static_remote_key(long this_arg); + // void InitFeatures_set_payment_secret_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_payment_secret_optional(long this_arg); + // void InitFeatures_set_payment_secret_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_payment_secret_required(long this_arg); + // MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_supports_payment_secret(long this_arg); + // void NodeFeatures_set_payment_secret_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_payment_secret_optional(long this_arg); + // void NodeFeatures_set_payment_secret_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_payment_secret_required(long this_arg); + // MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_supports_payment_secret(long this_arg); + // void Bolt11InvoiceFeatures_set_payment_secret_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + public static native void Bolt11InvoiceFeatures_set_payment_secret_optional(long this_arg); + // void Bolt11InvoiceFeatures_set_payment_secret_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + public static native void Bolt11InvoiceFeatures_set_payment_secret_required(long this_arg); + // MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + public static native boolean Bolt11InvoiceFeatures_supports_payment_secret(long this_arg); + // MUST_USE_RES bool InitFeatures_requires_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_requires_payment_secret(long this_arg); + // MUST_USE_RES bool NodeFeatures_requires_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_requires_payment_secret(long this_arg); + // MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + public static native boolean Bolt11InvoiceFeatures_requires_payment_secret(long this_arg); + // void InitFeatures_set_basic_mpp_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_basic_mpp_optional(long this_arg); + // void InitFeatures_set_basic_mpp_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_basic_mpp_required(long this_arg); + // MUST_USE_RES bool InitFeatures_supports_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_supports_basic_mpp(long this_arg); + // void NodeFeatures_set_basic_mpp_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_basic_mpp_optional(long this_arg); + // void NodeFeatures_set_basic_mpp_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_basic_mpp_required(long this_arg); + // MUST_USE_RES bool NodeFeatures_supports_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_supports_basic_mpp(long this_arg); + // void Bolt11InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + public static native void Bolt11InvoiceFeatures_set_basic_mpp_optional(long this_arg); + // void Bolt11InvoiceFeatures_set_basic_mpp_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + public static native void Bolt11InvoiceFeatures_set_basic_mpp_required(long this_arg); + // MUST_USE_RES bool Bolt11InvoiceFeatures_supports_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + public static native boolean Bolt11InvoiceFeatures_supports_basic_mpp(long this_arg); + // void Bolt12InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg); + public static native void Bolt12InvoiceFeatures_set_basic_mpp_optional(long this_arg); + // void Bolt12InvoiceFeatures_set_basic_mpp_required(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg); + public static native void Bolt12InvoiceFeatures_set_basic_mpp_required(long this_arg); + // MUST_USE_RES bool Bolt12InvoiceFeatures_supports_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg); + public static native boolean Bolt12InvoiceFeatures_supports_basic_mpp(long this_arg); + // MUST_USE_RES bool InitFeatures_requires_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_requires_basic_mpp(long this_arg); + // MUST_USE_RES bool NodeFeatures_requires_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_requires_basic_mpp(long this_arg); + // MUST_USE_RES bool Bolt11InvoiceFeatures_requires_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + public static native boolean Bolt11InvoiceFeatures_requires_basic_mpp(long this_arg); + // MUST_USE_RES bool Bolt12InvoiceFeatures_requires_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg); + public static native boolean Bolt12InvoiceFeatures_requires_basic_mpp(long this_arg); + // void InitFeatures_set_wumbo_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_wumbo_optional(long this_arg); + // void InitFeatures_set_wumbo_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_wumbo_required(long this_arg); + // MUST_USE_RES bool InitFeatures_supports_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_supports_wumbo(long this_arg); + // void NodeFeatures_set_wumbo_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_wumbo_optional(long this_arg); + // void NodeFeatures_set_wumbo_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_wumbo_required(long this_arg); + // MUST_USE_RES bool NodeFeatures_supports_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_supports_wumbo(long this_arg); + // MUST_USE_RES bool InitFeatures_requires_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_requires_wumbo(long this_arg); + // MUST_USE_RES bool NodeFeatures_requires_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_requires_wumbo(long this_arg); + // void InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(long this_arg); + // void InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(long this_arg); + // MUST_USE_RES bool InitFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_supports_anchors_nonzero_fee_htlc_tx(long this_arg); + // void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(long this_arg); + // void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(long this_arg); + // MUST_USE_RES bool NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(long this_arg); + // void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(long this_arg); + // void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(long this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native boolean ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(long this_arg); + // MUST_USE_RES bool InitFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_requires_anchors_nonzero_fee_htlc_tx(long this_arg); + // MUST_USE_RES bool NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(long this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native boolean ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(long this_arg); + // void InitFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_anchors_zero_fee_htlc_tx_optional(long this_arg); + // void InitFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_anchors_zero_fee_htlc_tx_required(long this_arg); + // MUST_USE_RES bool InitFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_supports_anchors_zero_fee_htlc_tx(long this_arg); + // void NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(long this_arg); + // void NodeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_anchors_zero_fee_htlc_tx_required(long this_arg); + // MUST_USE_RES bool NodeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_supports_anchors_zero_fee_htlc_tx(long this_arg); + // void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(long this_arg); + // void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(long this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native boolean ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(long this_arg); + // MUST_USE_RES bool InitFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_requires_anchors_zero_fee_htlc_tx(long this_arg); + // MUST_USE_RES bool NodeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_requires_anchors_zero_fee_htlc_tx(long this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native boolean ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(long this_arg); + // void InitFeatures_set_route_blinding_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_route_blinding_optional(long this_arg); + // void InitFeatures_set_route_blinding_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_route_blinding_required(long this_arg); + // MUST_USE_RES bool InitFeatures_supports_route_blinding(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_supports_route_blinding(long this_arg); + // void NodeFeatures_set_route_blinding_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_route_blinding_optional(long this_arg); + // void NodeFeatures_set_route_blinding_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_route_blinding_required(long this_arg); + // MUST_USE_RES bool NodeFeatures_supports_route_blinding(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_supports_route_blinding(long this_arg); + // MUST_USE_RES bool InitFeatures_requires_route_blinding(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_requires_route_blinding(long this_arg); + // MUST_USE_RES bool NodeFeatures_requires_route_blinding(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_requires_route_blinding(long this_arg); + // void InitFeatures_set_shutdown_any_segwit_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_shutdown_any_segwit_optional(long this_arg); + // void InitFeatures_set_shutdown_any_segwit_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_shutdown_any_segwit_required(long this_arg); + // MUST_USE_RES bool InitFeatures_supports_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_supports_shutdown_anysegwit(long this_arg); + // void NodeFeatures_set_shutdown_any_segwit_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_shutdown_any_segwit_optional(long this_arg); + // void NodeFeatures_set_shutdown_any_segwit_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_shutdown_any_segwit_required(long this_arg); + // MUST_USE_RES bool NodeFeatures_supports_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_supports_shutdown_anysegwit(long this_arg); + // MUST_USE_RES bool InitFeatures_requires_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_requires_shutdown_anysegwit(long this_arg); + // MUST_USE_RES bool NodeFeatures_requires_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_requires_shutdown_anysegwit(long this_arg); + // void InitFeatures_set_taproot_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_taproot_optional(long this_arg); + // void InitFeatures_set_taproot_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_taproot_required(long this_arg); + // MUST_USE_RES bool InitFeatures_supports_taproot(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_supports_taproot(long this_arg); + // void NodeFeatures_set_taproot_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_taproot_optional(long this_arg); + // void NodeFeatures_set_taproot_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_taproot_required(long this_arg); + // MUST_USE_RES bool NodeFeatures_supports_taproot(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_supports_taproot(long this_arg); + // void ChannelTypeFeatures_set_taproot_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native void ChannelTypeFeatures_set_taproot_optional(long this_arg); + // void ChannelTypeFeatures_set_taproot_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native void ChannelTypeFeatures_set_taproot_required(long this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_supports_taproot(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native boolean ChannelTypeFeatures_supports_taproot(long this_arg); + // MUST_USE_RES bool InitFeatures_requires_taproot(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_requires_taproot(long this_arg); + // MUST_USE_RES bool NodeFeatures_requires_taproot(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_requires_taproot(long this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_requires_taproot(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native boolean ChannelTypeFeatures_requires_taproot(long this_arg); + // void InitFeatures_set_onion_messages_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_onion_messages_optional(long this_arg); + // void InitFeatures_set_onion_messages_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_onion_messages_required(long this_arg); + // MUST_USE_RES bool InitFeatures_supports_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_supports_onion_messages(long this_arg); + // void NodeFeatures_set_onion_messages_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_onion_messages_optional(long this_arg); + // void NodeFeatures_set_onion_messages_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_onion_messages_required(long this_arg); + // MUST_USE_RES bool NodeFeatures_supports_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_supports_onion_messages(long this_arg); + // MUST_USE_RES bool InitFeatures_requires_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_requires_onion_messages(long this_arg); + // MUST_USE_RES bool NodeFeatures_requires_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_requires_onion_messages(long this_arg); + // void InitFeatures_set_channel_type_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_channel_type_optional(long this_arg); + // void InitFeatures_set_channel_type_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_channel_type_required(long this_arg); + // MUST_USE_RES bool InitFeatures_supports_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_supports_channel_type(long this_arg); + // void NodeFeatures_set_channel_type_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_channel_type_optional(long this_arg); + // void NodeFeatures_set_channel_type_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_channel_type_required(long this_arg); + // MUST_USE_RES bool NodeFeatures_supports_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_supports_channel_type(long this_arg); + // MUST_USE_RES bool InitFeatures_requires_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_requires_channel_type(long this_arg); + // MUST_USE_RES bool NodeFeatures_requires_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_requires_channel_type(long this_arg); + // void InitFeatures_set_scid_privacy_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_scid_privacy_optional(long this_arg); + // void InitFeatures_set_scid_privacy_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_scid_privacy_required(long this_arg); + // MUST_USE_RES bool InitFeatures_supports_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_supports_scid_privacy(long this_arg); + // void NodeFeatures_set_scid_privacy_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_scid_privacy_optional(long this_arg); + // void NodeFeatures_set_scid_privacy_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_scid_privacy_required(long this_arg); + // MUST_USE_RES bool NodeFeatures_supports_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_supports_scid_privacy(long this_arg); + // void ChannelTypeFeatures_set_scid_privacy_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native void ChannelTypeFeatures_set_scid_privacy_optional(long this_arg); + // void ChannelTypeFeatures_set_scid_privacy_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native void ChannelTypeFeatures_set_scid_privacy_required(long this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_supports_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native boolean ChannelTypeFeatures_supports_scid_privacy(long this_arg); + // MUST_USE_RES bool InitFeatures_requires_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_requires_scid_privacy(long this_arg); + // MUST_USE_RES bool NodeFeatures_requires_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_requires_scid_privacy(long this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_requires_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native boolean ChannelTypeFeatures_requires_scid_privacy(long this_arg); + // void Bolt11InvoiceFeatures_set_payment_metadata_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + public static native void Bolt11InvoiceFeatures_set_payment_metadata_optional(long this_arg); + // void Bolt11InvoiceFeatures_set_payment_metadata_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + public static native void Bolt11InvoiceFeatures_set_payment_metadata_required(long this_arg); + // MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + public static native boolean Bolt11InvoiceFeatures_supports_payment_metadata(long this_arg); + // MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + public static native boolean Bolt11InvoiceFeatures_requires_payment_metadata(long this_arg); + // void InitFeatures_set_zero_conf_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_zero_conf_optional(long this_arg); + // void InitFeatures_set_zero_conf_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_zero_conf_required(long this_arg); + // MUST_USE_RES bool InitFeatures_supports_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_supports_zero_conf(long this_arg); + // void NodeFeatures_set_zero_conf_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_zero_conf_optional(long this_arg); + // void NodeFeatures_set_zero_conf_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_zero_conf_required(long this_arg); + // MUST_USE_RES bool NodeFeatures_supports_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_supports_zero_conf(long this_arg); + // void ChannelTypeFeatures_set_zero_conf_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native void ChannelTypeFeatures_set_zero_conf_optional(long this_arg); + // void ChannelTypeFeatures_set_zero_conf_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native void ChannelTypeFeatures_set_zero_conf_required(long this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_supports_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native boolean ChannelTypeFeatures_supports_zero_conf(long this_arg); + // MUST_USE_RES bool InitFeatures_requires_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_requires_zero_conf(long this_arg); + // MUST_USE_RES bool NodeFeatures_requires_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_requires_zero_conf(long this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_requires_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native boolean ChannelTypeFeatures_requires_zero_conf(long this_arg); + // void NodeFeatures_set_keysend_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_keysend_optional(long this_arg); + // void NodeFeatures_set_keysend_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_keysend_required(long this_arg); + // MUST_USE_RES bool NodeFeatures_supports_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_supports_keysend(long this_arg); + // MUST_USE_RES bool NodeFeatures_requires_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_requires_keysend(long this_arg); + // void InitFeatures_set_trampoline_routing_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_trampoline_routing_optional(long this_arg); + // void InitFeatures_set_trampoline_routing_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_trampoline_routing_required(long this_arg); + // MUST_USE_RES bool InitFeatures_supports_trampoline_routing(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_supports_trampoline_routing(long this_arg); + // void NodeFeatures_set_trampoline_routing_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_trampoline_routing_optional(long this_arg); + // void NodeFeatures_set_trampoline_routing_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_trampoline_routing_required(long this_arg); + // MUST_USE_RES bool NodeFeatures_supports_trampoline_routing(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_supports_trampoline_routing(long this_arg); + // void Bolt11InvoiceFeatures_set_trampoline_routing_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + public static native void Bolt11InvoiceFeatures_set_trampoline_routing_optional(long this_arg); + // void Bolt11InvoiceFeatures_set_trampoline_routing_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + public static native void Bolt11InvoiceFeatures_set_trampoline_routing_required(long this_arg); + // MUST_USE_RES bool Bolt11InvoiceFeatures_supports_trampoline_routing(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + public static native boolean Bolt11InvoiceFeatures_supports_trampoline_routing(long this_arg); + // MUST_USE_RES bool InitFeatures_requires_trampoline_routing(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_requires_trampoline_routing(long this_arg); + // MUST_USE_RES bool NodeFeatures_requires_trampoline_routing(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_requires_trampoline_routing(long this_arg); + // MUST_USE_RES bool Bolt11InvoiceFeatures_requires_trampoline_routing(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + public static native boolean Bolt11InvoiceFeatures_requires_trampoline_routing(long this_arg); + // void RoutingFees_free(struct LDKRoutingFees this_obj); + public static native void RoutingFees_free(long this_obj); + // uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr); + public static native int RoutingFees_get_base_msat(long this_ptr); + // void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val); + public static native void RoutingFees_set_base_msat(long this_ptr, int val); + // uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr); + public static native int RoutingFees_get_proportional_millionths(long this_ptr); + // void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val); + public static native void RoutingFees_set_proportional_millionths(long this_ptr, int val); + // MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg); + public static native long RoutingFees_new(int base_msat_arg, int proportional_millionths_arg); + // bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b); + public static native boolean RoutingFees_eq(long a, long b); + // uint64_t RoutingFees_clone_ptr(LDKRoutingFees *NONNULL_PTR arg); + public static native long RoutingFees_clone_ptr(long arg); + // struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig); + public static native long RoutingFees_clone(long orig); + // uint64_t RoutingFees_hash(const struct LDKRoutingFees *NONNULL_PTR o); + public static native long RoutingFees_hash(long o); + // void RouteHint_free(struct LDKRouteHint this_obj); + public static native void RouteHint_free(long this_obj); + // struct LDKCVec_RouteHintHopZ RouteHint_get_a(const struct LDKRouteHint *NONNULL_PTR this_ptr); + public static native long[] RouteHint_get_a(long this_ptr); + // void RouteHint_set_a(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintHopZ val); + public static native void RouteHint_set_a(long this_ptr, long[] val); + // MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg); + public static native long RouteHint_new(long[] a_arg); + // uint64_t RouteHint_clone_ptr(LDKRouteHint *NONNULL_PTR arg); + public static native long RouteHint_clone_ptr(long arg); + // struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig); + public static native long RouteHint_clone(long orig); + // uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o); + public static native long RouteHint_hash(long o); + // bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b); + public static native boolean RouteHint_eq(long a, long b); + // void RouteHintHop_free(struct LDKRouteHintHop this_obj); + public static native void RouteHintHop_free(long this_obj); + // struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); + public static native byte[] RouteHintHop_get_src_node_id(long this_ptr); + // void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val); + public static native void RouteHintHop_set_src_node_id(long this_ptr, byte[] val); + // uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); + public static native long RouteHintHop_get_short_channel_id(long this_ptr); + // void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val); + public static native void RouteHintHop_set_short_channel_id(long this_ptr, long val); + // struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); + public static native long RouteHintHop_get_fees(long this_ptr); + // void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val); + public static native void RouteHintHop_set_fees(long this_ptr, long val); + // uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); + public static native short RouteHintHop_get_cltv_expiry_delta(long this_ptr); + // void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val); + public static native void RouteHintHop_set_cltv_expiry_delta(long this_ptr, short val); + // struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); + public static native long RouteHintHop_get_htlc_minimum_msat(long this_ptr); + // void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + public static native void RouteHintHop_set_htlc_minimum_msat(long this_ptr, long val); + // struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); + public static native long RouteHintHop_get_htlc_maximum_msat(long this_ptr); + // void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + public static native void RouteHintHop_set_htlc_maximum_msat(long this_ptr, long val); + // 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); + public static native long RouteHintHop_new(byte[] src_node_id_arg, long short_channel_id_arg, long fees_arg, short cltv_expiry_delta_arg, long htlc_minimum_msat_arg, long htlc_maximum_msat_arg); + // uint64_t RouteHintHop_clone_ptr(LDKRouteHintHop *NONNULL_PTR arg); + public static native long RouteHintHop_clone_ptr(long arg); + // struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig); + public static native long RouteHintHop_clone(long orig); + // uint64_t RouteHintHop_hash(const struct LDKRouteHintHop *NONNULL_PTR o); + public static native long RouteHintHop_hash(long o); + // bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b); + public static native boolean RouteHintHop_eq(long a, long b); + // void UntrustedString_free(struct LDKUntrustedString this_obj); + public static native void UntrustedString_free(long this_obj); + // struct LDKStr UntrustedString_get_a(const struct LDKUntrustedString *NONNULL_PTR this_ptr); + public static native String UntrustedString_get_a(long this_ptr); + // void UntrustedString_set_a(struct LDKUntrustedString *NONNULL_PTR this_ptr, struct LDKStr val); + public static native void UntrustedString_set_a(long this_ptr, String val); + // MUST_USE_RES struct LDKUntrustedString UntrustedString_new(struct LDKStr a_arg); + public static native long UntrustedString_new(String a_arg); + // uint64_t UntrustedString_clone_ptr(LDKUntrustedString *NONNULL_PTR arg); + public static native long UntrustedString_clone_ptr(long arg); + // struct LDKUntrustedString UntrustedString_clone(const struct LDKUntrustedString *NONNULL_PTR orig); + public static native long UntrustedString_clone(long orig); + // bool UntrustedString_eq(const struct LDKUntrustedString *NONNULL_PTR a, const struct LDKUntrustedString *NONNULL_PTR b); + public static native boolean UntrustedString_eq(long a, long b); + // uint64_t UntrustedString_hash(const struct LDKUntrustedString *NONNULL_PTR o); + public static native long UntrustedString_hash(long o); + // struct LDKStr UntrustedString_to_str(const struct LDKUntrustedString *NONNULL_PTR o); + public static native String UntrustedString_to_str(long o); + // void PrintableString_free(struct LDKPrintableString this_obj); + public static native void PrintableString_free(long this_obj); + // struct LDKStr PrintableString_get_a(const struct LDKPrintableString *NONNULL_PTR this_ptr); + public static native String PrintableString_get_a(long this_ptr); + // void PrintableString_set_a(struct LDKPrintableString *NONNULL_PTR this_ptr, struct LDKStr val); + public static native void PrintableString_set_a(long this_ptr, String val); + // MUST_USE_RES struct LDKPrintableString PrintableString_new(struct LDKStr a_arg); + public static native long PrintableString_new(String a_arg); + // struct LDKStr PrintableString_to_str(const struct LDKPrintableString *NONNULL_PTR o); + public static native String PrintableString_to_str(long o); // void FilesystemStore_free(struct LDKFilesystemStore this_obj); public static native void FilesystemStore_free(long this_obj); // MUST_USE_RES struct LDKFilesystemStore FilesystemStore_new(struct LDKStr data_dir); @@ -15147,8 +16152,8 @@ public class bindings { public static native long GossipSync_rapid(long a); // struct LDKGossipSync GossipSync_none(void); public static native long GossipSync_none(); - // 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); - public static native long BackgroundProcessor_start(long persister, long event_handler, long chain_monitor, long channel_manager, long gossip_sync, long peer_manager, long logger, long scorer); + // 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, const struct LDKOnionMessenger *NONNULL_PTR onion_messenger, struct LDKGossipSync gossip_sync, const struct LDKPeerManager *NONNULL_PTR peer_manager, struct LDKLogger logger, struct LDKCOption_WriteableScoreZ scorer); + public static native long BackgroundProcessor_start(long persister, long event_handler, long chain_monitor, long channel_manager, long onion_messenger, long gossip_sync, long peer_manager, long logger, long scorer); // MUST_USE_RES struct LDKCResult_NoneIOErrorZ BackgroundProcessor_join(struct LDKBackgroundProcessor this_arg); public static native long BackgroundProcessor_join(long this_arg); // MUST_USE_RES struct LDKCResult_NoneIOErrorZ BackgroundProcessor_stop(struct LDKBackgroundProcessor this_arg); @@ -15381,6 +16386,12 @@ public class bindings { public static native boolean Fallback_eq(long a, long b); // void Bolt11InvoiceSignature_free(struct LDKBolt11InvoiceSignature this_obj); public static native void Bolt11InvoiceSignature_free(long this_obj); + // struct LDKRecoverableSignature Bolt11InvoiceSignature_get_a(const struct LDKBolt11InvoiceSignature *NONNULL_PTR this_ptr); + public static native byte[] Bolt11InvoiceSignature_get_a(long this_ptr); + // void Bolt11InvoiceSignature_set_a(struct LDKBolt11InvoiceSignature *NONNULL_PTR this_ptr, struct LDKRecoverableSignature val); + public static native void Bolt11InvoiceSignature_set_a(long this_ptr, byte[] val); + // MUST_USE_RES struct LDKBolt11InvoiceSignature Bolt11InvoiceSignature_new(struct LDKRecoverableSignature a_arg); + public static native long Bolt11InvoiceSignature_new(byte[] a_arg); // uint64_t Bolt11InvoiceSignature_clone_ptr(LDKBolt11InvoiceSignature *NONNULL_PTR arg); public static native long Bolt11InvoiceSignature_clone_ptr(long arg); // struct LDKBolt11InvoiceSignature Bolt11InvoiceSignature_clone(const struct LDKBolt11InvoiceSignature *NONNULL_PTR orig); @@ -15503,6 +16514,8 @@ public class bindings { public static native long Description_new(String description); // MUST_USE_RES struct LDKUntrustedString Description_into_inner(struct LDKDescription this_arg); public static native long Description_into_inner(long this_arg); + // MUST_USE_RES struct LDKUntrustedString Description_as_inner(const struct LDKDescription *NONNULL_PTR this_arg); + public static native long Description_as_inner(long this_arg); // struct LDKStr Description_to_str(const struct LDKDescription *NONNULL_PTR o); public static native String Description_to_str(long o); // MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_seconds(uint64_t seconds); @@ -15575,24 +16588,6 @@ public class bindings { public static native boolean SignOrCreationError_eq(long a, long b); // struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o); public static native String SignOrCreationError_to_str(long o); - // struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ payment_parameters_from_zero_amount_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice, uint64_t amount_msat); - public static native long payment_parameters_from_zero_amount_invoice(long invoice, long amount_msat); - // struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ payment_parameters_from_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice); - public static native long payment_parameters_from_invoice(long invoice); - // 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); - public static native long create_phantom_invoice(long amt_msat, long payment_hash, String description, int invoice_expiry_delta_secs, long[] phantom_route_hints, long entropy_source, long node_signer, long logger, Currency network, long min_final_cltv_expiry_delta, long duration_since_epoch); - // 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); - public static native long create_phantom_invoice_with_description_hash(long amt_msat, long payment_hash, int invoice_expiry_delta_secs, long description_hash, long[] phantom_route_hints, long entropy_source, long node_signer, long logger, Currency network, long min_final_cltv_expiry_delta, long duration_since_epoch); - // 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); - public static native long create_invoice_from_channelmanager(long channelmanager, long node_signer, long logger, Currency network, long amt_msat, String description, int invoice_expiry_delta_secs, long min_final_cltv_expiry_delta); - // 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); - public static native long create_invoice_from_channelmanager_with_description_hash(long channelmanager, long node_signer, long logger, Currency network, long amt_msat, long description_hash, int invoice_expiry_delta_secs, long min_final_cltv_expiry_delta); - // 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); - public static native long create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(long channelmanager, long node_signer, long logger, Currency network, long amt_msat, long description_hash, long duration_since_epoch, int invoice_expiry_delta_secs, long min_final_cltv_expiry_delta); - // 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); - public static native long create_invoice_from_channelmanager_and_duration_since_epoch(long channelmanager, long node_signer, long logger, Currency network, long amt_msat, String description, long duration_since_epoch, int invoice_expiry_delta_secs, long min_final_cltv_expiry_delta); - // 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); - public static native long create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(long channelmanager, long node_signer, long logger, Currency network, long amt_msat, String description, long duration_since_epoch, int invoice_expiry_delta_secs, byte[] payment_hash, long min_final_cltv_expiry_delta); // struct LDKCResult_SiPrefixBolt11ParseErrorZ SiPrefix_from_str(struct LDKStr s); public static native long SiPrefix_from_str(String s); // struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ Bolt11Invoice_from_str(struct LDKStr s); diff --git a/src/main/java/org/ldk/structs/APIError.java b/src/main/java/org/ldk/structs/APIError.java index d99e4b9c..d330283f 100644 --- a/src/main/java/org/ldk/structs/APIError.java +++ b/src/main/java/org/ldk/structs/APIError.java @@ -231,7 +231,6 @@ public class APIError extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.APIError ret_hu_conv = org.ldk.structs.APIError.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(script); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/AcceptChannel.java b/src/main/java/org/ldk/structs/AcceptChannel.java index 757328e2..e126df24 100644 --- a/src/main/java/org/ldk/structs/AcceptChannel.java +++ b/src/main/java/org/ldk/structs/AcceptChannel.java @@ -43,7 +43,6 @@ public class AcceptChannel extends CommonBase { bindings.AcceptChannel_set_common_fields(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -74,7 +73,6 @@ public class AcceptChannel extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.AcceptChannel ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.AcceptChannel(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(common_fields_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/AcceptChannelV2.java b/src/main/java/org/ldk/structs/AcceptChannelV2.java index 9327a5ea..a29a788e 100644 --- a/src/main/java/org/ldk/structs/AcceptChannelV2.java +++ b/src/main/java/org/ldk/structs/AcceptChannelV2.java @@ -41,7 +41,6 @@ public class AcceptChannelV2 extends CommonBase { bindings.AcceptChannelV2_set_common_fields(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -110,7 +109,6 @@ public class AcceptChannelV2 extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.AcceptChannelV2 ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.AcceptChannelV2(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(common_fields_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/AnchorDescriptor.java b/src/main/java/org/ldk/structs/AnchorDescriptor.java index f821d707..7930dea8 100644 --- a/src/main/java/org/ldk/structs/AnchorDescriptor.java +++ b/src/main/java/org/ldk/structs/AnchorDescriptor.java @@ -39,7 +39,6 @@ public class AnchorDescriptor extends CommonBase { bindings.AnchorDescriptor_set_channel_derivation_parameters(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -63,7 +62,6 @@ public class AnchorDescriptor extends CommonBase { bindings.AnchorDescriptor_set_outpoint(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -76,8 +74,6 @@ public class AnchorDescriptor extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.AnchorDescriptor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.AnchorDescriptor(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_derivation_parameters_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(outpoint_arg); }; return ret_hu_conv; } @@ -163,12 +159,12 @@ public class AnchorDescriptor extends CommonBase { /** * Derives the channel signer required to sign the anchor input. */ - public WriteableEcdsaChannelSigner derive_channel_signer(org.ldk.structs.SignerProvider signer_provider) { + public EcdsaChannelSigner derive_channel_signer(org.ldk.structs.SignerProvider signer_provider) { long ret = bindings.AnchorDescriptor_derive_channel_signer(this.ptr, signer_provider.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(signer_provider); if (ret >= 0 && ret <= 4096) { return null; } - WriteableEcdsaChannelSigner ret_hu_conv = new WriteableEcdsaChannelSigner(null, ret); + EcdsaChannelSigner ret_hu_conv = new EcdsaChannelSigner(null, ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; if (this != null) { this.ptrs_to.add(signer_provider); }; return ret_hu_conv; diff --git a/src/main/java/org/ldk/structs/AnnouncementSignatures.java b/src/main/java/org/ldk/structs/AnnouncementSignatures.java index a8f0837c..774f94c8 100644 --- a/src/main/java/org/ldk/structs/AnnouncementSignatures.java +++ b/src/main/java/org/ldk/structs/AnnouncementSignatures.java @@ -41,7 +41,6 @@ public class AnnouncementSignatures extends CommonBase { bindings.AnnouncementSignatures_set_channel_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -110,7 +109,6 @@ public class AnnouncementSignatures extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.AnnouncementSignatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.AnnouncementSignatures(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/AsyncPaymentsMessage.java b/src/main/java/org/ldk/structs/AsyncPaymentsMessage.java new file mode 100644 index 00000000..0e45dc00 --- /dev/null +++ b/src/main/java/org/ldk/structs/AsyncPaymentsMessage.java @@ -0,0 +1,138 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * Possible async payment messages sent and received via an [`OnionMessage`]. + * + * [`OnionMessage`]: crate::ln::msgs::OnionMessage + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class AsyncPaymentsMessage extends CommonBase { + private AsyncPaymentsMessage(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.AsyncPaymentsMessage_free(ptr); } + } + static AsyncPaymentsMessage constr_from_ptr(long ptr) { + bindings.LDKAsyncPaymentsMessage raw_val = bindings.LDKAsyncPaymentsMessage_ref_from_ptr(ptr); + if (raw_val.getClass() == bindings.LDKAsyncPaymentsMessage.HeldHtlcAvailable.class) { + return new HeldHtlcAvailable(ptr, (bindings.LDKAsyncPaymentsMessage.HeldHtlcAvailable)raw_val); + } + if (raw_val.getClass() == bindings.LDKAsyncPaymentsMessage.ReleaseHeldHtlc.class) { + return new ReleaseHeldHtlc(ptr, (bindings.LDKAsyncPaymentsMessage.ReleaseHeldHtlc)raw_val); + } + assert false; return null; // Unreachable without extending the (internal) bindings interface + } + + /** + * An HTLC is being held upstream for the often-offline recipient, to be released via + * [`ReleaseHeldHtlc`]. + */ + public final static class HeldHtlcAvailable extends AsyncPaymentsMessage { + public final org.ldk.structs.HeldHtlcAvailable held_htlc_available; + private HeldHtlcAvailable(long ptr, bindings.LDKAsyncPaymentsMessage.HeldHtlcAvailable obj) { + super(null, ptr); + long held_htlc_available = obj.held_htlc_available; + org.ldk.structs.HeldHtlcAvailable held_htlc_available_hu_conv = null; if (held_htlc_available < 0 || held_htlc_available > 4096) { held_htlc_available_hu_conv = new org.ldk.structs.HeldHtlcAvailable(null, held_htlc_available); } + if (held_htlc_available_hu_conv != null) { held_htlc_available_hu_conv.ptrs_to.add(this); }; + this.held_htlc_available = held_htlc_available_hu_conv; + } + } + /** + * Releases the HTLC corresponding to an inbound [`HeldHtlcAvailable`] message. + */ + public final static class ReleaseHeldHtlc extends AsyncPaymentsMessage { + public final org.ldk.structs.ReleaseHeldHtlc release_held_htlc; + private ReleaseHeldHtlc(long ptr, bindings.LDKAsyncPaymentsMessage.ReleaseHeldHtlc obj) { + super(null, ptr); + long release_held_htlc = obj.release_held_htlc; + org.ldk.structs.ReleaseHeldHtlc release_held_htlc_hu_conv = null; if (release_held_htlc < 0 || release_held_htlc > 4096) { release_held_htlc_hu_conv = new org.ldk.structs.ReleaseHeldHtlc(null, release_held_htlc); } + if (release_held_htlc_hu_conv != null) { release_held_htlc_hu_conv.ptrs_to.add(this); }; + this.release_held_htlc = release_held_htlc_hu_conv; + } + } + long clone_ptr() { + long ret = bindings.AsyncPaymentsMessage_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the AsyncPaymentsMessage + */ + public AsyncPaymentsMessage clone() { + long ret = bindings.AsyncPaymentsMessage_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.AsyncPaymentsMessage ret_hu_conv = org.ldk.structs.AsyncPaymentsMessage.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new HeldHtlcAvailable-variant AsyncPaymentsMessage + */ + public static AsyncPaymentsMessage held_htlc_available(org.ldk.structs.HeldHtlcAvailable a) { + long ret = bindings.AsyncPaymentsMessage_held_htlc_available(a.ptr); + Reference.reachabilityFence(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.AsyncPaymentsMessage ret_hu_conv = org.ldk.structs.AsyncPaymentsMessage.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new ReleaseHeldHtlc-variant AsyncPaymentsMessage + */ + public static AsyncPaymentsMessage release_held_htlc(org.ldk.structs.ReleaseHeldHtlc a) { + long ret = bindings.AsyncPaymentsMessage_release_held_htlc(a.ptr); + Reference.reachabilityFence(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.AsyncPaymentsMessage ret_hu_conv = org.ldk.structs.AsyncPaymentsMessage.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Constructs a new OnionMessageContents which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned OnionMessageContents must be freed before this_arg is + */ + public OnionMessageContents as_OnionMessageContents() { + long ret = bindings.AsyncPaymentsMessage_as_OnionMessageContents(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + OnionMessageContents ret_hu_conv = new OnionMessageContents(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Serialize the AsyncPaymentsMessage object into a byte array which can be read by AsyncPaymentsMessage_read + */ + public byte[] write() { + byte[] ret = bindings.AsyncPaymentsMessage_write(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Read a AsyncPaymentsMessage from a byte array, created by AsyncPaymentsMessage_write + */ + public static Result_AsyncPaymentsMessageDecodeErrorZ read(byte[] ser, long arg) { + long ret = bindings.AsyncPaymentsMessage_read(ser, arg); + Reference.reachabilityFence(ser); + Reference.reachabilityFence(arg); + if (ret >= 0 && ret <= 4096) { return null; } + Result_AsyncPaymentsMessageDecodeErrorZ ret_hu_conv = Result_AsyncPaymentsMessageDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/AsyncPaymentsMessageHandler.java b/src/main/java/org/ldk/structs/AsyncPaymentsMessageHandler.java new file mode 100644 index 00000000..d7d04338 --- /dev/null +++ b/src/main/java/org/ldk/structs/AsyncPaymentsMessageHandler.java @@ -0,0 +1,138 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + +/** + * A handler for an [`OnionMessage`] containing an async payments message as its payload. + * + * [`OnionMessage`]: crate::ln::msgs::OnionMessage + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class AsyncPaymentsMessageHandler extends CommonBase { + final bindings.LDKAsyncPaymentsMessageHandler bindings_instance; + AsyncPaymentsMessageHandler(Object _dummy, long ptr) { super(ptr); bindings_instance = null; } + private AsyncPaymentsMessageHandler(bindings.LDKAsyncPaymentsMessageHandler arg) { + super(bindings.LDKAsyncPaymentsMessageHandler_new(arg)); + this.ptrs_to.add(arg); + this.bindings_instance = arg; + } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.AsyncPaymentsMessageHandler_free(ptr); } super.finalize(); + } + /** + * Destroys the object, freeing associated resources. After this call, any access + * to this object may result in a SEGFAULT or worse. + * + * You should generally NEVER call this method. You should let the garbage collector + * do this for you when it finalizes objects. However, it may be useful for types + * which represent locks and should be closed immediately to avoid holding locks + * until the GC runs. + */ + public void destroy() { + if (ptr != 0) { bindings.AsyncPaymentsMessageHandler_free(ptr); } + ptr = 0; + } + public static interface AsyncPaymentsMessageHandlerInterface { + /** + * Handle a [`HeldHtlcAvailable`] message. A [`ReleaseHeldHtlc`] should be returned to release + * the held funds. + * + * Note that responder (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ held_htlc_available(HeldHtlcAvailable message, Responder responder); + /** + * Handle a [`ReleaseHeldHtlc`] message. If authentication of the message succeeds, an HTLC + * should be released to the corresponding payee. + */ + void release_held_htlc(ReleaseHeldHtlc message); + /** + * Release any [`AsyncPaymentsMessage`]s that need to be sent. + * + * Typically, this is used for messages initiating an async payment flow rather than in response + * to another message. + */ + TwoTuple_AsyncPaymentsMessageMessageSendInstructionsZ[] release_pending_messages(); + } + private static class LDKAsyncPaymentsMessageHandlerHolder { AsyncPaymentsMessageHandler held; } + public static AsyncPaymentsMessageHandler new_impl(AsyncPaymentsMessageHandlerInterface arg) { + final LDKAsyncPaymentsMessageHandlerHolder impl_holder = new LDKAsyncPaymentsMessageHandlerHolder(); + impl_holder.held = new AsyncPaymentsMessageHandler(new bindings.LDKAsyncPaymentsMessageHandler() { + @Override public long held_htlc_available(long message, long responder) { + org.ldk.structs.HeldHtlcAvailable message_hu_conv = null; if (message < 0 || message > 4096) { message_hu_conv = new org.ldk.structs.HeldHtlcAvailable(null, message); } + if (message_hu_conv != null) { message_hu_conv.ptrs_to.add(this); }; + org.ldk.structs.Responder responder_hu_conv = null; if (responder < 0 || responder > 4096) { responder_hu_conv = new org.ldk.structs.Responder(null, responder); } + if (responder_hu_conv != null) { responder_hu_conv.ptrs_to.add(this); }; + Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ ret = arg.held_htlc_available(message_hu_conv, responder_hu_conv); + Reference.reachabilityFence(arg); + long result = ret.clone_ptr(); + return result; + } + @Override public void release_held_htlc(long message) { + org.ldk.structs.ReleaseHeldHtlc message_hu_conv = null; if (message < 0 || message > 4096) { message_hu_conv = new org.ldk.structs.ReleaseHeldHtlc(null, message); } + if (message_hu_conv != null) { message_hu_conv.ptrs_to.add(this); }; + arg.release_held_htlc(message_hu_conv); + Reference.reachabilityFence(arg); + } + @Override public long[] release_pending_messages() { + TwoTuple_AsyncPaymentsMessageMessageSendInstructionsZ[] ret = arg.release_pending_messages(); + Reference.reachabilityFence(arg); + long[] result = ret != null ? Arrays.stream(ret).mapToLong(ret_conv_55 -> ret_conv_55.clone_ptr()).toArray() : null; + return result; + } + }); + return impl_holder.held; + } + /** + * Handle a [`HeldHtlcAvailable`] message. A [`ReleaseHeldHtlc`] should be returned to release + * the held funds. + * + * Note that responder (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ held_htlc_available(org.ldk.structs.HeldHtlcAvailable message, @Nullable org.ldk.structs.Responder responder) { + long ret = bindings.AsyncPaymentsMessageHandler_held_htlc_available(this.ptr, message.ptr, responder == null ? 0 : responder.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(message); + Reference.reachabilityFence(responder); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Handle a [`ReleaseHeldHtlc`] message. If authentication of the message succeeds, an HTLC + * should be released to the corresponding payee. + */ + public void release_held_htlc(org.ldk.structs.ReleaseHeldHtlc message) { + bindings.AsyncPaymentsMessageHandler_release_held_htlc(this.ptr, message.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(message); + } + + /** + * Release any [`AsyncPaymentsMessage`]s that need to be sent. + * + * Typically, this is used for messages initiating an async payment flow rather than in response + * to another message. + */ + public TwoTuple_AsyncPaymentsMessageMessageSendInstructionsZ[] release_pending_messages() { + long[] ret = bindings.AsyncPaymentsMessageHandler_release_pending_messages(this.ptr); + Reference.reachabilityFence(this); + int ret_conv_55_len = ret.length; + TwoTuple_AsyncPaymentsMessageMessageSendInstructionsZ[] ret_conv_55_arr = new TwoTuple_AsyncPaymentsMessageMessageSendInstructionsZ[ret_conv_55_len]; + for (int d = 0; d < ret_conv_55_len; d++) { + long ret_conv_55 = ret[d]; + TwoTuple_AsyncPaymentsMessageMessageSendInstructionsZ ret_conv_55_hu_conv = new TwoTuple_AsyncPaymentsMessageMessageSendInstructionsZ(null, ret_conv_55); + if (ret_conv_55_hu_conv != null) { ret_conv_55_hu_conv.ptrs_to.add(this); }; + ret_conv_55_arr[d] = ret_conv_55_hu_conv; + } + return ret_conv_55_arr; + } + +} diff --git a/src/main/java/org/ldk/structs/BackgroundProcessor.java b/src/main/java/org/ldk/structs/BackgroundProcessor.java index a6dac689..a29eb2e9 100644 --- a/src/main/java/org/ldk/structs/BackgroundProcessor.java +++ b/src/main/java/org/ldk/structs/BackgroundProcessor.java @@ -94,12 +94,13 @@ public class BackgroundProcessor extends CommonBase { * [`NetworkGraph`]: lightning::routing::gossip::NetworkGraph * [`NetworkGraph::write`]: lightning::routing::gossip::NetworkGraph#impl-Writeable */ - public static BackgroundProcessor start(org.ldk.structs.Persister persister, org.ldk.structs.EventHandler event_handler, org.ldk.structs.ChainMonitor chain_monitor, org.ldk.structs.ChannelManager channel_manager, org.ldk.structs.GossipSync gossip_sync, org.ldk.structs.PeerManager peer_manager, org.ldk.structs.Logger logger, org.ldk.structs.Option_WriteableScoreZ scorer) { - long ret = bindings.BackgroundProcessor_start(persister.ptr, event_handler.ptr, chain_monitor.ptr, channel_manager.ptr, gossip_sync.ptr, peer_manager.ptr, logger.ptr, scorer.ptr); + public static BackgroundProcessor start(org.ldk.structs.Persister persister, org.ldk.structs.EventHandler event_handler, org.ldk.structs.ChainMonitor chain_monitor, org.ldk.structs.ChannelManager channel_manager, org.ldk.structs.OnionMessenger onion_messenger, org.ldk.structs.GossipSync gossip_sync, org.ldk.structs.PeerManager peer_manager, org.ldk.structs.Logger logger, org.ldk.structs.Option_WriteableScoreZ scorer) { + long ret = bindings.BackgroundProcessor_start(persister.ptr, event_handler.ptr, chain_monitor.ptr, channel_manager.ptr, onion_messenger.ptr, gossip_sync.ptr, peer_manager.ptr, logger.ptr, scorer.ptr); Reference.reachabilityFence(persister); Reference.reachabilityFence(event_handler); Reference.reachabilityFence(chain_monitor); Reference.reachabilityFence(channel_manager); + Reference.reachabilityFence(onion_messenger); Reference.reachabilityFence(gossip_sync); Reference.reachabilityFence(peer_manager); Reference.reachabilityFence(logger); @@ -111,6 +112,7 @@ public class BackgroundProcessor extends CommonBase { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(event_handler); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(chain_monitor); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_manager); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(onion_messenger); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(gossip_sync); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(peer_manager); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(logger); }; diff --git a/src/main/java/org/ldk/structs/Balance.java b/src/main/java/org/ldk/structs/Balance.java index e46e85c4..79fa1557 100644 --- a/src/main/java/org/ldk/structs/Balance.java +++ b/src/main/java/org/ldk/structs/Balance.java @@ -56,9 +56,67 @@ public class Balance extends CommonBase { * required to do so. */ public final long amount_satoshis; + /** + * The transaction fee we pay for the closing commitment transaction. This amount is not + * included in the [`Balance::ClaimableOnChannelClose::amount_satoshis`] value. + * + * Note that if this channel is inbound (and thus our counterparty pays the commitment + * transaction fee) this value will be zero. For [`ChannelMonitor`]s created prior to LDK + * 0.0.124, the channel is always treated as outbound (and thus this value is never zero). + */ + public final long transaction_fee_satoshis; + /** + * The amount of millisatoshis which has been burned to fees from HTLCs which are outbound + * from us and are related to a payment which was sent by us. This is the sum of the + * millisatoshis part of all HTLCs which are otherwise represented by + * [`Balance::MaybeTimeoutClaimableHTLC`] with their + * [`Balance::MaybeTimeoutClaimableHTLC::outbound_payment`] flag set, as well as any dust + * HTLCs which would otherwise be represented the same. + * + * This amount (rounded up to a whole satoshi value) will not be included in `amount_satoshis`. + */ + public final long outbound_payment_htlc_rounded_msat; + /** + * The amount of millisatoshis which has been burned to fees from HTLCs which are outbound + * from us and are related to a forwarded HTLC. This is the sum of the millisatoshis part + * of all HTLCs which are otherwise represented by [`Balance::MaybeTimeoutClaimableHTLC`] + * with their [`Balance::MaybeTimeoutClaimableHTLC::outbound_payment`] flag *not* set, as + * well as any dust HTLCs which would otherwise be represented the same. + * + * This amount (rounded up to a whole satoshi value) will not be included in `amount_satoshis`. + */ + public final long outbound_forwarded_htlc_rounded_msat; + /** + * The amount of millisatoshis which has been burned to fees from HTLCs which are inbound + * to us and for which we know the preimage. This is the sum of the millisatoshis part of + * all HTLCs which would be represented by [`Balance::ContentiousClaimable`] on channel + * close, but whose current value is included in + * [`Balance::ClaimableOnChannelClose::amount_satoshis`], as well as any dust HTLCs which + * would otherwise be represented the same. + * + * This amount (rounded up to a whole satoshi value) will not be included in the counterparty's + * `amount_satoshis`. + */ + public final long inbound_claiming_htlc_rounded_msat; + /** + * The amount of millisatoshis which has been burned to fees from HTLCs which are inbound + * to us and for which we do not know the preimage. This is the sum of the millisatoshis + * part of all HTLCs which would be represented by [`Balance::MaybePreimageClaimableHTLC`] + * on channel close, as well as any dust HTLCs which would otherwise be represented the + * same. + * + * This amount (rounded up to a whole satoshi value) will not be included in the counterparty's + * `amount_satoshis`. + */ + public final long inbound_htlc_rounded_msat; private ClaimableOnChannelClose(long ptr, bindings.LDKBalance.ClaimableOnChannelClose obj) { super(null, ptr); this.amount_satoshis = obj.amount_satoshis; + this.transaction_fee_satoshis = obj.transaction_fee_satoshis; + this.outbound_payment_htlc_rounded_msat = obj.outbound_payment_htlc_rounded_msat; + this.outbound_forwarded_htlc_rounded_msat = obj.outbound_forwarded_htlc_rounded_msat; + this.inbound_claiming_htlc_rounded_msat = obj.inbound_claiming_htlc_rounded_msat; + this.inbound_htlc_rounded_msat = obj.inbound_htlc_rounded_msat; } } /** @@ -76,10 +134,15 @@ public class Balance extends CommonBase { * amount. */ public final int confirmation_height; + /** + * Whether this balance is a result of cooperative close, a force-close, or an HTLC. + */ + public final org.ldk.enums.BalanceSource source; private ClaimableAwaitingConfirmations(long ptr, bindings.LDKBalance.ClaimableAwaitingConfirmations obj) { super(null, ptr); this.amount_satoshis = obj.amount_satoshis; this.confirmation_height = obj.confirmation_height; + this.source = obj.source; } } /** @@ -138,11 +201,18 @@ public class Balance extends CommonBase { * The payment hash whose preimage our counterparty needs to claim this HTLC. */ public final byte[] payment_hash; + /** + * Whether this HTLC represents a payment which was sent outbound from us. Otherwise it + * represents an HTLC which was forwarded (and should, thus, have a corresponding inbound + * edge on another channel). + */ + public final boolean outbound_payment; private MaybeTimeoutClaimableHTLC(long ptr, bindings.LDKBalance.MaybeTimeoutClaimableHTLC obj) { super(null, ptr); this.amount_satoshis = obj.amount_satoshis; this.claimable_height = obj.claimable_height; this.payment_hash = obj.payment_hash; + this.outbound_payment = obj.outbound_payment; } } /** @@ -213,9 +283,14 @@ public class Balance extends CommonBase { /** * Utility method to constructs a new ClaimableOnChannelClose-variant Balance */ - public static Balance claimable_on_channel_close(long amount_satoshis) { - long ret = bindings.Balance_claimable_on_channel_close(amount_satoshis); + public static Balance claimable_on_channel_close(long amount_satoshis, long transaction_fee_satoshis, long outbound_payment_htlc_rounded_msat, long outbound_forwarded_htlc_rounded_msat, long inbound_claiming_htlc_rounded_msat, long inbound_htlc_rounded_msat) { + long ret = bindings.Balance_claimable_on_channel_close(amount_satoshis, transaction_fee_satoshis, outbound_payment_htlc_rounded_msat, outbound_forwarded_htlc_rounded_msat, inbound_claiming_htlc_rounded_msat, inbound_htlc_rounded_msat); Reference.reachabilityFence(amount_satoshis); + Reference.reachabilityFence(transaction_fee_satoshis); + Reference.reachabilityFence(outbound_payment_htlc_rounded_msat); + Reference.reachabilityFence(outbound_forwarded_htlc_rounded_msat); + Reference.reachabilityFence(inbound_claiming_htlc_rounded_msat); + Reference.reachabilityFence(inbound_htlc_rounded_msat); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Balance ret_hu_conv = org.ldk.structs.Balance.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; @@ -225,10 +300,11 @@ public class Balance extends CommonBase { /** * Utility method to constructs a new ClaimableAwaitingConfirmations-variant Balance */ - public static Balance claimable_awaiting_confirmations(long amount_satoshis, int confirmation_height) { - long ret = bindings.Balance_claimable_awaiting_confirmations(amount_satoshis, confirmation_height); + public static Balance claimable_awaiting_confirmations(long amount_satoshis, int confirmation_height, org.ldk.enums.BalanceSource source) { + long ret = bindings.Balance_claimable_awaiting_confirmations(amount_satoshis, confirmation_height, source); Reference.reachabilityFence(amount_satoshis); Reference.reachabilityFence(confirmation_height); + Reference.reachabilityFence(source); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Balance ret_hu_conv = org.ldk.structs.Balance.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; @@ -253,11 +329,12 @@ public class Balance extends CommonBase { /** * Utility method to constructs a new MaybeTimeoutClaimableHTLC-variant Balance */ - public static Balance maybe_timeout_claimable_htlc(long amount_satoshis, int claimable_height, byte[] payment_hash) { - long ret = bindings.Balance_maybe_timeout_claimable_htlc(amount_satoshis, claimable_height, InternalUtils.check_arr_len(payment_hash, 32)); + public static Balance maybe_timeout_claimable_htlc(long amount_satoshis, int claimable_height, byte[] payment_hash, boolean outbound_payment) { + long ret = bindings.Balance_maybe_timeout_claimable_htlc(amount_satoshis, claimable_height, InternalUtils.check_arr_len(payment_hash, 32), outbound_payment); Reference.reachabilityFence(amount_satoshis); Reference.reachabilityFence(claimable_height); Reference.reachabilityFence(payment_hash); + Reference.reachabilityFence(outbound_payment); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Balance ret_hu_conv = org.ldk.structs.Balance.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; @@ -306,9 +383,15 @@ public class Balance extends CommonBase { return this.eq((Balance)o); } /** - * The amount claimable, in satoshis. This excludes balances that we are unsure if we are able - * to claim, this is because we are waiting for a preimage or for a timeout to expire. For more - * information on these balances see [`Balance::MaybeTimeoutClaimableHTLC`] and + * The amount claimable, in satoshis. + * + * For outbound payments, this excludes the balance from the possible HTLC timeout. + * + * For forwarded payments, this includes the balance from the possible HTLC timeout as + * (to be conservative) that balance does not include routing fees we'd earn if we'd claim + * the balance from a preimage in a successful forward. + * + * For more information on these balances see [`Balance::MaybeTimeoutClaimableHTLC`] and * [`Balance::MaybePreimageClaimableHTLC`]. * * On-chain fees required to claim the balance are not included in this amount. diff --git a/src/main/java/org/ldk/structs/BlindedForward.java b/src/main/java/org/ldk/structs/BlindedForward.java index 6172aa20..2cd51b5b 100644 --- a/src/main/java/org/ldk/structs/BlindedForward.java +++ b/src/main/java/org/ldk/structs/BlindedForward.java @@ -62,13 +62,43 @@ public class BlindedForward extends CommonBase { Reference.reachabilityFence(val); } + /** + * Overrides the next hop's [`msgs::UpdateAddHTLC::blinding_point`]. Set if this HTLC is being + * forwarded within a [`BlindedPaymentPath`] that was concatenated to another blinded path that + * starts at the next hop. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + @Nullable + public byte[] get_next_blinding_override() { + byte[] ret = bindings.BlindedForward_get_next_blinding_override(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Overrides the next hop's [`msgs::UpdateAddHTLC::blinding_point`]. Set if this HTLC is being + * forwarded within a [`BlindedPaymentPath`] that was concatenated to another blinded path that + * starts at the next hop. + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public void set_next_blinding_override(@Nullable byte[] val) { + bindings.BlindedForward_set_next_blinding_override(this.ptr, InternalUtils.check_arr_len(val, 33)); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + /** * Constructs a new BlindedForward given each field + * + * Note that next_blinding_override_arg (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public static BlindedForward of(byte[] inbound_blinding_point_arg, org.ldk.enums.BlindedFailure failure_arg) { - long ret = bindings.BlindedForward_new(InternalUtils.check_arr_len(inbound_blinding_point_arg, 33), failure_arg); + public static BlindedForward of(byte[] inbound_blinding_point_arg, org.ldk.enums.BlindedFailure failure_arg, @Nullable byte[] next_blinding_override_arg) { + long ret = bindings.BlindedForward_new(InternalUtils.check_arr_len(inbound_blinding_point_arg, 33), failure_arg, InternalUtils.check_arr_len(next_blinding_override_arg, 33)); Reference.reachabilityFence(inbound_blinding_point_arg); Reference.reachabilityFence(failure_arg); + Reference.reachabilityFence(next_blinding_override_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.BlindedForward ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedForward(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; diff --git a/src/main/java/org/ldk/structs/BlindedHop.java b/src/main/java/org/ldk/structs/BlindedHop.java index 6acd1512..9757eced 100644 --- a/src/main/java/org/ldk/structs/BlindedHop.java +++ b/src/main/java/org/ldk/structs/BlindedHop.java @@ -23,7 +23,7 @@ public class BlindedHop extends CommonBase { } /** - * The blinded node id of this hop in a [`BlindedPath`]. + * The blinded node id of this hop in a blinded path. */ public byte[] get_blinded_node_id() { byte[] ret = bindings.BlindedHop_get_blinded_node_id(this.ptr); @@ -32,7 +32,7 @@ public class BlindedHop extends CommonBase { } /** - * The blinded node id of this hop in a [`BlindedPath`]. + * The blinded node id of this hop in a blinded path. */ public void set_blinded_node_id(byte[] val) { bindings.BlindedHop_set_blinded_node_id(this.ptr, InternalUtils.check_arr_len(val, 33)); @@ -41,7 +41,7 @@ public class BlindedHop extends CommonBase { } /** - * The encrypted payload intended for this hop in a [`BlindedPath`]. + * The encrypted payload intended for this hop in a blinded path. * * Returns a copy of the field. */ @@ -52,7 +52,7 @@ public class BlindedHop extends CommonBase { } /** - * The encrypted payload intended for this hop in a [`BlindedPath`]. + * The encrypted payload intended for this hop in a blinded path. */ public void set_encrypted_payload(byte[] val) { bindings.BlindedHop_set_encrypted_payload(this.ptr, val); diff --git a/src/main/java/org/ldk/structs/BlindedHopFeatures.java b/src/main/java/org/ldk/structs/BlindedHopFeatures.java index 8d13ba0e..35267f0c 100644 --- a/src/main/java/org/ldk/structs/BlindedHopFeatures.java +++ b/src/main/java/org/ldk/structs/BlindedHopFeatures.java @@ -20,6 +20,26 @@ public class BlindedHopFeatures extends CommonBase { if (ptr != 0) { bindings.BlindedHopFeatures_free(ptr); } } + /** + * Serialize the BlindedHopFeatures object into a byte array which can be read by BlindedHopFeatures_read + */ + public byte[] write() { + byte[] ret = bindings.BlindedHopFeatures_write(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Read a BlindedHopFeatures from a byte array, created by BlindedHopFeatures_write + */ + public static Result_BlindedHopFeaturesDecodeErrorZ read(byte[] ser) { + long ret = bindings.BlindedHopFeatures_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedHopFeaturesDecodeErrorZ ret_hu_conv = Result_BlindedHopFeaturesDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + /** * Checks if two BlindedHopFeaturess contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. @@ -78,6 +98,25 @@ public class BlindedHopFeatures extends CommonBase { return ret_hu_conv; } + /** + * Returns the feature set as a list of bytes, in little-endian. This is in reverse byte order + * from most on-the-wire encodings. + */ + public byte[] le_flags() { + byte[] ret = bindings.BlindedHopFeatures_le_flags(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Returns true if this `Features` has any optional flags set + */ + public boolean supports_any_optional_bits() { + boolean ret = bindings.BlindedHopFeatures_supports_any_optional_bits(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * Returns true if this `Features` object contains required features unknown by `other`. */ @@ -89,6 +128,17 @@ public class BlindedHopFeatures extends CommonBase { return ret; } + /** + * Returns the set of required features unknown by `other`, as their bit position. + */ + public long[] required_unknown_bits_from(org.ldk.structs.BlindedHopFeatures other) { + long[] ret = bindings.BlindedHopFeatures_required_unknown_bits_from(this.ptr, other.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(other); + if (this != null) { this.ptrs_to.add(other); }; + return ret; + } + /** * Returns true if this `Features` object contains unknown feature flags which are set as * \"required\". @@ -99,6 +149,15 @@ public class BlindedHopFeatures extends CommonBase { return ret; } + /** + * Returns true if this `Features` supports any bits which we do not know of + */ + public boolean supports_unknown_bits() { + boolean ret = bindings.BlindedHopFeatures_supports_unknown_bits(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * Sets a required feature bit. Errors if `bit` is outside the feature range as defined * by [BOLT 9]. @@ -171,24 +230,4 @@ public class BlindedHopFeatures extends CommonBase { return ret_hu_conv; } - /** - * Serialize the BlindedHopFeatures object into a byte array which can be read by BlindedHopFeatures_read - */ - public byte[] write() { - byte[] ret = bindings.BlindedHopFeatures_write(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Read a BlindedHopFeatures from a byte array, created by BlindedHopFeatures_write - */ - public static Result_BlindedHopFeaturesDecodeErrorZ read(byte[] ser) { - long ret = bindings.BlindedHopFeatures_read(ser); - Reference.reachabilityFence(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_BlindedHopFeaturesDecodeErrorZ ret_hu_conv = Result_BlindedHopFeaturesDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - } diff --git a/src/main/java/org/ldk/structs/BlindedMessagePath.java b/src/main/java/org/ldk/structs/BlindedMessagePath.java new file mode 100644 index 00000000..affcff28 --- /dev/null +++ b/src/main/java/org/ldk/structs/BlindedMessagePath.java @@ -0,0 +1,214 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * A blinded path to be used for sending or receiving a message, hiding the identity of the + * recipient. + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class BlindedMessagePath extends CommonBase { + BlindedMessagePath(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.BlindedMessagePath_free(ptr); } + } + + long clone_ptr() { + long ret = bindings.BlindedMessagePath_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the BlindedMessagePath + */ + public BlindedMessagePath clone() { + long ret = bindings.BlindedMessagePath_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.BlindedMessagePath ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedMessagePath(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Generates a non-cryptographic 64-bit hash of the BlindedMessagePath. + */ + public long hash() { + long ret = bindings.BlindedMessagePath_hash(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + @Override public int hashCode() { + return (int)this.hash(); + } + /** + * Checks if two BlindedMessagePaths contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public boolean eq(org.ldk.structs.BlindedMessagePath b) { + boolean ret = bindings.BlindedMessagePath_eq(this.ptr, b.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(b); + if (this != null) { this.ptrs_to.add(b); }; + return ret; + } + + @Override public boolean equals(Object o) { + if (!(o instanceof BlindedMessagePath)) return false; + return this.eq((BlindedMessagePath)o); + } + /** + * Serialize the BlindedMessagePath object into a byte array which can be read by BlindedMessagePath_read + */ + public byte[] write() { + byte[] ret = bindings.BlindedMessagePath_write(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Read a BlindedMessagePath from a byte array, created by BlindedMessagePath_write + */ + public static Result_BlindedMessagePathDecodeErrorZ read(byte[] ser) { + long ret = bindings.BlindedMessagePath_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedMessagePathDecodeErrorZ ret_hu_conv = Result_BlindedMessagePathDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Create a one-hop blinded path for a message. + */ + public static Result_BlindedMessagePathNoneZ one_hop(byte[] recipient_node_id, org.ldk.structs.MessageContext context, org.ldk.structs.EntropySource entropy_source) { + long ret = bindings.BlindedMessagePath_one_hop(InternalUtils.check_arr_len(recipient_node_id, 33), context.ptr, entropy_source.ptr); + Reference.reachabilityFence(recipient_node_id); + Reference.reachabilityFence(context); + Reference.reachabilityFence(entropy_source); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedMessagePathNoneZ ret_hu_conv = Result_BlindedMessagePathNoneZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(entropy_source); }; + return ret_hu_conv; + } + + /** + * Create a path for an onion message, to be forwarded along `node_pks`. The last node + * pubkey in `node_pks` will be the destination node. + * + * Errors if no hops are provided or if `node_pk`(s) are invalid. + */ + public static Result_BlindedMessagePathNoneZ of(MessageForwardNode[] intermediate_nodes, byte[] recipient_node_id, org.ldk.structs.MessageContext context, org.ldk.structs.EntropySource entropy_source) { + long ret = bindings.BlindedMessagePath_new(intermediate_nodes != null ? Arrays.stream(intermediate_nodes).mapToLong(intermediate_nodes_conv_20 -> intermediate_nodes_conv_20.ptr).toArray() : null, InternalUtils.check_arr_len(recipient_node_id, 33), context.ptr, entropy_source.ptr); + Reference.reachabilityFence(intermediate_nodes); + Reference.reachabilityFence(recipient_node_id); + Reference.reachabilityFence(context); + Reference.reachabilityFence(entropy_source); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedMessagePathNoneZ ret_hu_conv = Result_BlindedMessagePathNoneZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(entropy_source); }; + return ret_hu_conv; + } + + /** + * Attempts to a use a compact representation for the [`IntroductionNode`] by using a directed + * short channel id from a channel in `network_graph` leading to the introduction node. + * + * While this may result in a smaller encoding, there is a trade off in that the path may + * become invalid if the channel is closed or hasn't been propagated via gossip. Therefore, + * calling this may not be suitable for long-lived blinded paths. + */ + public void use_compact_introduction_node(org.ldk.structs.ReadOnlyNetworkGraph network_graph) { + bindings.BlindedMessagePath_use_compact_introduction_node(this.ptr, network_graph.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(network_graph); + if (this != null) { this.ptrs_to.add(network_graph); }; + } + + /** + * Returns the introduction [`NodeId`] of the blinded path, if it is publicly reachable (i.e., + * it is found in the network graph). + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + @Nullable + public NodeId public_introduction_node_id(org.ldk.structs.ReadOnlyNetworkGraph network_graph) { + long ret = bindings.BlindedMessagePath_public_introduction_node_id(this.ptr, network_graph.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(network_graph); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.NodeId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + if (this != null) { this.ptrs_to.add(network_graph); }; + return ret_hu_conv; + } + + /** + * The [`IntroductionNode`] of the blinded path. + */ + public IntroductionNode introduction_node() { + long ret = bindings.BlindedMessagePath_introduction_node(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.IntroductionNode ret_hu_conv = org.ldk.structs.IntroductionNode.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Used by the [`IntroductionNode`] to decrypt its [`encrypted_payload`] to forward the message. + * + * [`encrypted_payload`]: BlindedHop::encrypted_payload + */ + public byte[] blinding_point() { + byte[] ret = bindings.BlindedMessagePath_blinding_point(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * The [`BlindedHop`]s within the blinded path. + */ + public BlindedHop[] blinded_hops() { + long[] ret = bindings.BlindedMessagePath_blinded_hops(this.ptr); + Reference.reachabilityFence(this); + int ret_conv_12_len = ret.length; + BlindedHop[] ret_conv_12_arr = new BlindedHop[ret_conv_12_len]; + for (int m = 0; m < ret_conv_12_len; m++) { + long ret_conv_12 = ret[m]; + org.ldk.structs.BlindedHop ret_conv_12_hu_conv = null; if (ret_conv_12 < 0 || ret_conv_12 > 4096) { ret_conv_12_hu_conv = new org.ldk.structs.BlindedHop(null, ret_conv_12); } + if (ret_conv_12_hu_conv != null) { ret_conv_12_hu_conv.ptrs_to.add(this); }; + ret_conv_12_arr[m] = ret_conv_12_hu_conv; + } + return ret_conv_12_arr; + } + + /** + * Advance the blinded onion message path by one hop, making the second hop into the new + * introduction node. + * + * Will only modify `self` when returning `Ok`. + */ + public Result_NoneNoneZ advance_path_by_one(org.ldk.structs.NodeSigner node_signer, org.ldk.structs.NodeIdLookUp node_id_lookup) { + long ret = bindings.BlindedMessagePath_advance_path_by_one(this.ptr, node_signer.ptr, node_id_lookup.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(node_signer); + Reference.reachabilityFence(node_id_lookup); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.add(node_signer); }; + if (this != null) { this.ptrs_to.add(node_id_lookup); }; + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/BlindedPath.java b/src/main/java/org/ldk/structs/BlindedPath.java deleted file mode 100644 index 5861f015..00000000 --- a/src/main/java/org/ldk/structs/BlindedPath.java +++ /dev/null @@ -1,235 +0,0 @@ -package org.ldk.structs; - -import org.ldk.impl.bindings; -import org.ldk.enums.*; -import org.ldk.util.*; -import java.util.Arrays; -import java.lang.ref.Reference; -import javax.annotation.Nullable; - - -/** - * Onion messages and payments can be sent and received to blinded paths, which serve to hide the - * identity of the recipient. - */ -@SuppressWarnings("unchecked") // We correctly assign various generic arrays -public class BlindedPath extends CommonBase { - BlindedPath(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.BlindedPath_free(ptr); } - } - - /** - * To send to a blinded path, the sender first finds a route to the unblinded - * `introduction_node`, which can unblind its [`encrypted_payload`] to find out the onion - * message or payment's next hop and forward it along. - * - * [`encrypted_payload`]: BlindedHop::encrypted_payload - */ - public IntroductionNode get_introduction_node() { - long ret = bindings.BlindedPath_get_introduction_node(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.IntroductionNode ret_hu_conv = org.ldk.structs.IntroductionNode.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - return ret_hu_conv; - } - - /** - * To send to a blinded path, the sender first finds a route to the unblinded - * `introduction_node`, which can unblind its [`encrypted_payload`] to find out the onion - * message or payment's next hop and forward it along. - * - * [`encrypted_payload`]: BlindedHop::encrypted_payload - */ - public void set_introduction_node(org.ldk.structs.IntroductionNode val) { - bindings.BlindedPath_set_introduction_node(this.ptr, val.ptr); - Reference.reachabilityFence(this); - Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; - } - - /** - * Used by the introduction node to decrypt its [`encrypted_payload`] to forward the onion - * message or payment. - * - * [`encrypted_payload`]: BlindedHop::encrypted_payload - */ - public byte[] get_blinding_point() { - byte[] ret = bindings.BlindedPath_get_blinding_point(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Used by the introduction node to decrypt its [`encrypted_payload`] to forward the onion - * message or payment. - * - * [`encrypted_payload`]: BlindedHop::encrypted_payload - */ - public void set_blinding_point(byte[] val) { - bindings.BlindedPath_set_blinding_point(this.ptr, InternalUtils.check_arr_len(val, 33)); - Reference.reachabilityFence(this); - Reference.reachabilityFence(val); - } - - /** - * The hops composing the blinded path. - */ - public BlindedHop[] get_blinded_hops() { - long[] ret = bindings.BlindedPath_get_blinded_hops(this.ptr); - Reference.reachabilityFence(this); - int ret_conv_12_len = ret.length; - BlindedHop[] ret_conv_12_arr = new BlindedHop[ret_conv_12_len]; - for (int m = 0; m < ret_conv_12_len; m++) { - long ret_conv_12 = ret[m]; - org.ldk.structs.BlindedHop ret_conv_12_hu_conv = null; if (ret_conv_12 < 0 || ret_conv_12 > 4096) { ret_conv_12_hu_conv = new org.ldk.structs.BlindedHop(null, ret_conv_12); } - if (ret_conv_12_hu_conv != null) { ret_conv_12_hu_conv.ptrs_to.add(this); }; - ret_conv_12_arr[m] = ret_conv_12_hu_conv; - } - return ret_conv_12_arr; - } - - /** - * The hops composing the blinded path. - */ - public void set_blinded_hops(BlindedHop[] val) { - bindings.BlindedPath_set_blinded_hops(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_12 -> val_conv_12.ptr).toArray() : null); - Reference.reachabilityFence(this); - Reference.reachabilityFence(val); - for (BlindedHop val_conv_12: val) { if (this != null) { this.ptrs_to.add(val_conv_12); }; }; - } - - /** - * Constructs a new BlindedPath given each field - */ - public static BlindedPath of(org.ldk.structs.IntroductionNode introduction_node_arg, byte[] blinding_point_arg, BlindedHop[] blinded_hops_arg) { - long ret = bindings.BlindedPath_new(introduction_node_arg.ptr, InternalUtils.check_arr_len(blinding_point_arg, 33), blinded_hops_arg != null ? Arrays.stream(blinded_hops_arg).mapToLong(blinded_hops_arg_conv_12 -> blinded_hops_arg_conv_12.ptr).toArray() : null); - Reference.reachabilityFence(introduction_node_arg); - Reference.reachabilityFence(blinding_point_arg); - Reference.reachabilityFence(blinded_hops_arg); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.BlindedPath ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedPath(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(introduction_node_arg); }; - for (BlindedHop blinded_hops_arg_conv_12: blinded_hops_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(blinded_hops_arg_conv_12); }; }; - return ret_hu_conv; - } - - long clone_ptr() { - long ret = bindings.BlindedPath_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Creates a copy of the BlindedPath - */ - public BlindedPath clone() { - long ret = bindings.BlindedPath_clone(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.BlindedPath ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedPath(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - return ret_hu_conv; - } - - /** - * Generates a non-cryptographic 64-bit hash of the BlindedPath. - */ - public long hash() { - long ret = bindings.BlindedPath_hash(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - @Override public int hashCode() { - return (int)this.hash(); - } - /** - * Checks if two BlindedPaths contain equal inner contents. - * This ignores pointers and is_owned flags and looks at the values in fields. - * Two objects with NULL inner values will be considered "equal" here. - */ - public boolean eq(org.ldk.structs.BlindedPath b) { - boolean ret = bindings.BlindedPath_eq(this.ptr, b.ptr); - Reference.reachabilityFence(this); - Reference.reachabilityFence(b); - if (this != null) { this.ptrs_to.add(b); }; - return ret; - } - - @Override public boolean equals(Object o) { - if (!(o instanceof BlindedPath)) return false; - return this.eq((BlindedPath)o); - } - /** - * Create a one-hop blinded path for a message. - */ - public static Result_BlindedPathNoneZ one_hop_for_message(byte[] recipient_node_id, org.ldk.structs.EntropySource entropy_source) { - long ret = bindings.BlindedPath_one_hop_for_message(InternalUtils.check_arr_len(recipient_node_id, 33), entropy_source.ptr); - Reference.reachabilityFence(recipient_node_id); - Reference.reachabilityFence(entropy_source); - if (ret >= 0 && ret <= 4096) { return null; } - Result_BlindedPathNoneZ ret_hu_conv = Result_BlindedPathNoneZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(entropy_source); }; - return ret_hu_conv; - } - - /** - * Create a blinded path for an onion message, to be forwarded along `node_pks`. The last node - * pubkey in `node_pks` will be the destination node. - * - * Errors if no hops are provided or if `node_pk`(s) are invalid. - */ - public static Result_BlindedPathNoneZ new_for_message(byte[][] node_pks, org.ldk.structs.EntropySource entropy_source) { - long ret = bindings.BlindedPath_new_for_message(node_pks != null ? Arrays.stream(node_pks).map(node_pks_conv_8 -> InternalUtils.check_arr_len(node_pks_conv_8, 33)).toArray(byte[][]::new) : null, entropy_source.ptr); - Reference.reachabilityFence(node_pks); - Reference.reachabilityFence(entropy_source); - if (ret >= 0 && ret <= 4096) { return null; } - Result_BlindedPathNoneZ ret_hu_conv = Result_BlindedPathNoneZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(entropy_source); }; - return ret_hu_conv; - } - - /** - * Returns the introduction [`NodeId`] of the blinded path, if it is publicly reachable (i.e., - * it is found in the network graph). - * - * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None - */ - @Nullable - public NodeId public_introduction_node_id(org.ldk.structs.ReadOnlyNetworkGraph network_graph) { - long ret = bindings.BlindedPath_public_introduction_node_id(this.ptr, network_graph.ptr); - Reference.reachabilityFence(this); - Reference.reachabilityFence(network_graph); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.NodeId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeId(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - if (this != null) { this.ptrs_to.add(network_graph); }; - return ret_hu_conv; - } - - /** - * Serialize the BlindedPath object into a byte array which can be read by BlindedPath_read - */ - public byte[] write() { - byte[] ret = bindings.BlindedPath_write(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Read a BlindedPath from a byte array, created by BlindedPath_write - */ - public static Result_BlindedPathDecodeErrorZ read(byte[] ser) { - long ret = bindings.BlindedPath_read(ser); - Reference.reachabilityFence(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_BlindedPathDecodeErrorZ ret_hu_conv = Result_BlindedPathDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} diff --git a/src/main/java/org/ldk/structs/BlindedPayInfo.java b/src/main/java/org/ldk/structs/BlindedPayInfo.java index e575c503..eb244f18 100644 --- a/src/main/java/org/ldk/structs/BlindedPayInfo.java +++ b/src/main/java/org/ldk/structs/BlindedPayInfo.java @@ -9,7 +9,7 @@ import javax.annotation.Nullable; /** - * Information needed to route a payment across a [`BlindedPath`]. + * Information needed to route a payment across a [`BlindedPaymentPath`]. */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class BlindedPayInfo extends CommonBase { @@ -143,7 +143,6 @@ public class BlindedPayInfo extends CommonBase { bindings.BlindedPayInfo_set_features(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -160,7 +159,6 @@ public class BlindedPayInfo extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.BlindedPayInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedPayInfo(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(features_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/BlindedPaymentPath.java b/src/main/java/org/ldk/structs/BlindedPaymentPath.java new file mode 100644 index 00000000..d404f6bf --- /dev/null +++ b/src/main/java/org/ldk/structs/BlindedPaymentPath.java @@ -0,0 +1,205 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * A blinded path to be used for sending or receiving a payment, hiding the identity of the + * recipient. + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class BlindedPaymentPath extends CommonBase { + BlindedPaymentPath(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.BlindedPaymentPath_free(ptr); } + } + + /** + * The [`BlindedPayInfo`] used to pay this blinded path. + */ + public BlindedPayInfo get_payinfo() { + long ret = bindings.BlindedPaymentPath_get_payinfo(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.BlindedPayInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedPayInfo(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * The [`BlindedPayInfo`] used to pay this blinded path. + */ + public void set_payinfo(org.ldk.structs.BlindedPayInfo val) { + bindings.BlindedPaymentPath_set_payinfo(this.ptr, val.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + long clone_ptr() { + long ret = bindings.BlindedPaymentPath_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the BlindedPaymentPath + */ + public BlindedPaymentPath clone() { + long ret = bindings.BlindedPaymentPath_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.BlindedPaymentPath ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedPaymentPath(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Generates a non-cryptographic 64-bit hash of the BlindedPaymentPath. + */ + public long hash() { + long ret = bindings.BlindedPaymentPath_hash(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + @Override public int hashCode() { + return (int)this.hash(); + } + /** + * Checks if two BlindedPaymentPaths contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public boolean eq(org.ldk.structs.BlindedPaymentPath b) { + boolean ret = bindings.BlindedPaymentPath_eq(this.ptr, b.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(b); + if (this != null) { this.ptrs_to.add(b); }; + return ret; + } + + @Override public boolean equals(Object o) { + if (!(o instanceof BlindedPaymentPath)) return false; + return this.eq((BlindedPaymentPath)o); + } + /** + * Create a one-hop blinded path for a payment. + */ + public static Result_BlindedPaymentPathNoneZ one_hop(byte[] payee_node_id, org.ldk.structs.ReceiveTlvs payee_tlvs, short min_final_cltv_expiry_delta, org.ldk.structs.EntropySource entropy_source) { + long ret = bindings.BlindedPaymentPath_one_hop(InternalUtils.check_arr_len(payee_node_id, 33), payee_tlvs.ptr, min_final_cltv_expiry_delta, entropy_source.ptr); + Reference.reachabilityFence(payee_node_id); + Reference.reachabilityFence(payee_tlvs); + Reference.reachabilityFence(min_final_cltv_expiry_delta); + Reference.reachabilityFence(entropy_source); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedPaymentPathNoneZ ret_hu_conv = Result_BlindedPaymentPathNoneZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(entropy_source); }; + return ret_hu_conv; + } + + /** + * Create a blinded path for a payment, to be forwarded along `intermediate_nodes`. + * + * Errors if: + * a provided node id is invalid + * [`BlindedPayInfo`] calculation results in an integer overflow + * any unknown features are required in the provided [`ForwardTlvs`] + */ + public static Result_BlindedPaymentPathNoneZ of(PaymentForwardNode[] intermediate_nodes, byte[] payee_node_id, org.ldk.structs.ReceiveTlvs payee_tlvs, long htlc_maximum_msat, short min_final_cltv_expiry_delta, org.ldk.structs.EntropySource entropy_source) { + long ret = bindings.BlindedPaymentPath_new(intermediate_nodes != null ? Arrays.stream(intermediate_nodes).mapToLong(intermediate_nodes_conv_20 -> intermediate_nodes_conv_20.ptr).toArray() : null, InternalUtils.check_arr_len(payee_node_id, 33), payee_tlvs.ptr, htlc_maximum_msat, min_final_cltv_expiry_delta, entropy_source.ptr); + Reference.reachabilityFence(intermediate_nodes); + Reference.reachabilityFence(payee_node_id); + Reference.reachabilityFence(payee_tlvs); + Reference.reachabilityFence(htlc_maximum_msat); + Reference.reachabilityFence(min_final_cltv_expiry_delta); + Reference.reachabilityFence(entropy_source); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedPaymentPathNoneZ ret_hu_conv = Result_BlindedPaymentPathNoneZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(entropy_source); }; + return ret_hu_conv; + } + + /** + * Returns the introduction [`NodeId`] of the blinded path, if it is publicly reachable (i.e., + * it is found in the network graph). + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + @Nullable + public NodeId public_introduction_node_id(org.ldk.structs.ReadOnlyNetworkGraph network_graph) { + long ret = bindings.BlindedPaymentPath_public_introduction_node_id(this.ptr, network_graph.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(network_graph); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.NodeId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + if (this != null) { this.ptrs_to.add(network_graph); }; + return ret_hu_conv; + } + + /** + * The [`IntroductionNode`] of the blinded path. + */ + public IntroductionNode introduction_node() { + long ret = bindings.BlindedPaymentPath_introduction_node(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.IntroductionNode ret_hu_conv = org.ldk.structs.IntroductionNode.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Used by the [`IntroductionNode`] to decrypt its [`encrypted_payload`] to forward the payment. + * + * [`encrypted_payload`]: BlindedHop::encrypted_payload + */ + public byte[] blinding_point() { + byte[] ret = bindings.BlindedPaymentPath_blinding_point(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * The [`BlindedHop`]s within the blinded path. + */ + public BlindedHop[] blinded_hops() { + long[] ret = bindings.BlindedPaymentPath_blinded_hops(this.ptr); + Reference.reachabilityFence(this); + int ret_conv_12_len = ret.length; + BlindedHop[] ret_conv_12_arr = new BlindedHop[ret_conv_12_len]; + for (int m = 0; m < ret_conv_12_len; m++) { + long ret_conv_12 = ret[m]; + org.ldk.structs.BlindedHop ret_conv_12_hu_conv = null; if (ret_conv_12 < 0 || ret_conv_12 > 4096) { ret_conv_12_hu_conv = new org.ldk.structs.BlindedHop(null, ret_conv_12); } + if (ret_conv_12_hu_conv != null) { ret_conv_12_hu_conv.ptrs_to.add(this); }; + ret_conv_12_arr[m] = ret_conv_12_hu_conv; + } + return ret_conv_12_arr; + } + + /** + * Advance the blinded onion payment path by one hop, making the second hop into the new + * introduction node. + * + * Will only modify `self` when returning `Ok`. + */ + public Result_NoneNoneZ advance_path_by_one(org.ldk.structs.NodeSigner node_signer, org.ldk.structs.NodeIdLookUp node_id_lookup) { + long ret = bindings.BlindedPaymentPath_advance_path_by_one(this.ptr, node_signer.ptr, node_id_lookup.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(node_signer); + Reference.reachabilityFence(node_id_lookup); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.add(node_signer); }; + if (this != null) { this.ptrs_to.add(node_id_lookup); }; + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/BlindedTail.java b/src/main/java/org/ldk/structs/BlindedTail.java index c9e59fc8..7d4ec18d 100644 --- a/src/main/java/org/ldk/structs/BlindedTail.java +++ b/src/main/java/org/ldk/structs/BlindedTail.java @@ -24,9 +24,7 @@ public class BlindedTail extends CommonBase { } /** - * The hops of the [`BlindedPath`] provided by the recipient. - * - * [`BlindedPath`]: crate::blinded_path::BlindedPath + * The hops of the [`BlindedPaymentPath`] provided by the recipient. */ public BlindedHop[] get_hops() { long[] ret = bindings.BlindedTail_get_hops(this.ptr); @@ -43,21 +41,16 @@ public class BlindedTail extends CommonBase { } /** - * The hops of the [`BlindedPath`] provided by the recipient. - * - * [`BlindedPath`]: crate::blinded_path::BlindedPath + * The hops of the [`BlindedPaymentPath`] provided by the recipient. */ public void set_hops(BlindedHop[] val) { bindings.BlindedTail_set_hops(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_12 -> val_conv_12.ptr).toArray() : null); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - for (BlindedHop val_conv_12: val) { if (this != null) { this.ptrs_to.add(val_conv_12); }; }; } /** - * The blinding point of the [`BlindedPath`] provided by the recipient. - * - * [`BlindedPath`]: crate::blinded_path::BlindedPath + * The blinding point of the [`BlindedPaymentPath`] provided by the recipient. */ public byte[] get_blinding_point() { byte[] ret = bindings.BlindedTail_get_blinding_point(this.ptr); @@ -66,9 +59,7 @@ public class BlindedTail extends CommonBase { } /** - * The blinding point of the [`BlindedPath`] provided by the recipient. - * - * [`BlindedPath`]: crate::blinded_path::BlindedPath + * The blinding point of the [`BlindedPaymentPath`] provided by the recipient. */ public void set_blinding_point(byte[] val) { bindings.BlindedTail_set_blinding_point(this.ptr, InternalUtils.check_arr_len(val, 33)); @@ -126,7 +117,6 @@ public class BlindedTail extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.BlindedTail ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedTail(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - for (BlindedHop hops_arg_conv_12: hops_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(hops_arg_conv_12); }; }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Bolt11Invoice.java b/src/main/java/org/ldk/structs/Bolt11Invoice.java index 67e9f44b..f296502c 100644 --- a/src/main/java/org/ldk/structs/Bolt11Invoice.java +++ b/src/main/java/org/ldk/structs/Bolt11Invoice.java @@ -92,7 +92,7 @@ public class Bolt11Invoice extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.SignedRawBolt11Invoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.SignedRawBolt11Invoice(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - if (this != null) { this.ptrs_to.add(this); }; + ; return ret_hu_conv; } @@ -134,7 +134,6 @@ public class Bolt11Invoice extends CommonBase { Reference.reachabilityFence(signed_invoice); if (ret >= 0 && ret <= 4096) { return null; } Result_Bolt11InvoiceBolt11SemanticErrorZ ret_hu_conv = Result_Bolt11InvoiceBolt11SemanticErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(signed_invoice); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Bolt11InvoiceFeatures.java b/src/main/java/org/ldk/structs/Bolt11InvoiceFeatures.java index cc4e156d..94ff1715 100644 --- a/src/main/java/org/ldk/structs/Bolt11InvoiceFeatures.java +++ b/src/main/java/org/ldk/structs/Bolt11InvoiceFeatures.java @@ -20,6 +20,26 @@ public class Bolt11InvoiceFeatures extends CommonBase { if (ptr != 0) { bindings.Bolt11InvoiceFeatures_free(ptr); } } + /** + * Serialize the Bolt11InvoiceFeatures object into a byte array which can be read by Bolt11InvoiceFeatures_read + */ + public byte[] write() { + byte[] ret = bindings.Bolt11InvoiceFeatures_write(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Read a Bolt11InvoiceFeatures from a byte array, created by Bolt11InvoiceFeatures_write + */ + public static Result_Bolt11InvoiceFeaturesDecodeErrorZ read(byte[] ser) { + long ret = bindings.Bolt11InvoiceFeatures_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt11InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_Bolt11InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + /** * Checks if two Bolt11InvoiceFeaturess contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. @@ -67,6 +87,24 @@ public class Bolt11InvoiceFeatures extends CommonBase { @Override public int hashCode() { return (int)this.hash(); } + /** + * Getting a route for a keysend payment to a private node requires providing the payee's + * features (since they were not announced in a node announcement). However, keysend payments + * don't have an invoice to pull the payee's features from, so this method is provided for use + * when a [`Bolt11InvoiceFeatures`] is required in a route. + * + * MPP keysend is not widely supported yet, so we parameterize support to allow the user to + * choose whether their router should find multi-part routes. + */ + public static Bolt11InvoiceFeatures for_keysend(boolean allow_mpp) { + long ret = bindings.Bolt11InvoiceFeatures_for_keysend(allow_mpp); + Reference.reachabilityFence(allow_mpp); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt11InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Bolt11InvoiceFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + /** * Create a blank Features with no features set */ @@ -78,6 +116,25 @@ public class Bolt11InvoiceFeatures extends CommonBase { return ret_hu_conv; } + /** + * Returns the feature set as a list of bytes, in little-endian. This is in reverse byte order + * from most on-the-wire encodings. + */ + public byte[] le_flags() { + byte[] ret = bindings.Bolt11InvoiceFeatures_le_flags(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Returns true if this `Features` has any optional flags set + */ + public boolean supports_any_optional_bits() { + boolean ret = bindings.Bolt11InvoiceFeatures_supports_any_optional_bits(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * Returns true if this `Features` object contains required features unknown by `other`. */ @@ -89,6 +146,17 @@ public class Bolt11InvoiceFeatures extends CommonBase { return ret; } + /** + * Returns the set of required features unknown by `other`, as their bit position. + */ + public long[] required_unknown_bits_from(org.ldk.structs.Bolt11InvoiceFeatures other) { + long[] ret = bindings.Bolt11InvoiceFeatures_required_unknown_bits_from(this.ptr, other.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(other); + if (this != null) { this.ptrs_to.add(other); }; + return ret; + } + /** * Returns true if this `Features` object contains unknown feature flags which are set as * \"required\". @@ -99,6 +167,15 @@ public class Bolt11InvoiceFeatures extends CommonBase { return ret; } + /** + * Returns true if this `Features` supports any bits which we do not know of + */ + public boolean supports_unknown_bits() { + boolean ret = bindings.Bolt11InvoiceFeatures_supports_unknown_bits(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * Sets a required feature bit. Errors if `bit` is outside the feature range as defined * by [BOLT 9]. @@ -171,26 +248,6 @@ public class Bolt11InvoiceFeatures extends CommonBase { return ret_hu_conv; } - /** - * Serialize the Bolt11InvoiceFeatures object into a byte array which can be read by Bolt11InvoiceFeatures_read - */ - public byte[] write() { - byte[] ret = bindings.Bolt11InvoiceFeatures_write(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Read a Bolt11InvoiceFeatures from a byte array, created by Bolt11InvoiceFeatures_write - */ - public static Result_Bolt11InvoiceFeaturesDecodeErrorZ read(byte[] ser) { - long ret = bindings.Bolt11InvoiceFeatures_read(ser); - Reference.reachabilityFence(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_Bolt11InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_Bolt11InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - /** * Set this feature as optional. */ diff --git a/src/main/java/org/ldk/structs/Bolt11InvoiceSignature.java b/src/main/java/org/ldk/structs/Bolt11InvoiceSignature.java index 7ea69a15..03e63504 100644 --- a/src/main/java/org/ldk/structs/Bolt11InvoiceSignature.java +++ b/src/main/java/org/ldk/structs/Bolt11InvoiceSignature.java @@ -20,6 +20,30 @@ public class Bolt11InvoiceSignature extends CommonBase { if (ptr != 0) { bindings.Bolt11InvoiceSignature_free(ptr); } } + public byte[] get_a() { + byte[] ret = bindings.Bolt11InvoiceSignature_get_a(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + public void set_a(byte[] val) { + bindings.Bolt11InvoiceSignature_set_a(this.ptr, InternalUtils.check_arr_len(val, 68)); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * Constructs a new Bolt11InvoiceSignature given each field + */ + public static Bolt11InvoiceSignature of(byte[] a_arg) { + long ret = bindings.Bolt11InvoiceSignature_new(InternalUtils.check_arr_len(a_arg, 68)); + Reference.reachabilityFence(a_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt11InvoiceSignature ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Bolt11InvoiceSignature(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + long clone_ptr() { long ret = bindings.Bolt11InvoiceSignature_clone_ptr(this.ptr); Reference.reachabilityFence(this); diff --git a/src/main/java/org/ldk/structs/Bolt11ParseError.java b/src/main/java/org/ldk/structs/Bolt11ParseError.java index 61124831..f7266c64 100644 --- a/src/main/java/org/ldk/structs/Bolt11ParseError.java +++ b/src/main/java/org/ldk/structs/Bolt11ParseError.java @@ -217,7 +217,6 @@ public class Bolt11ParseError extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Bolt11ParseError ret_hu_conv = org.ldk.structs.Bolt11ParseError.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Bolt12Invoice.java b/src/main/java/org/ldk/structs/Bolt12Invoice.java index 77ad79fd..c2843288 100644 --- a/src/main/java/org/ldk/structs/Bolt12Invoice.java +++ b/src/main/java/org/ldk/structs/Bolt12Invoice.java @@ -45,6 +45,66 @@ public class Bolt12Invoice extends CommonBase { return ret_hu_conv; } + /** + * Duration since the Unix epoch when the invoice was created. + */ + public long created_at() { + long ret = bindings.Bolt12Invoice_created_at(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Duration since + * [`Bolt12Invoice::created_at`] + * when the invoice has expired and therefore should no longer be paid. + */ + public long relative_expiry() { + long ret = bindings.Bolt12Invoice_relative_expiry(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Whether the invoice has expired. + */ + public boolean is_expired() { + boolean ret = bindings.Bolt12Invoice_is_expired(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Fallback addresses for paying the invoice on-chain, in order of most-preferred to + * least-preferred. + */ + public String[] fallbacks() { + String[] ret = bindings.Bolt12Invoice_fallbacks(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Features pertaining to paying an invoice. + */ + public Bolt12InvoiceFeatures invoice_features() { + long ret = bindings.Bolt12Invoice_invoice_features(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt12InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Bolt12InvoiceFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * The public key corresponding to the key used to sign the invoice. + */ + public byte[] signing_pubkey() { + byte[] ret = bindings.Bolt12Invoice_signing_pubkey(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * The chains that may be used when paying a requested invoice. * @@ -194,18 +254,18 @@ public class Bolt12Invoice extends CommonBase { * * [`Offer::paths`]: crate::offers::offer::Offer::paths */ - public BlindedPath[] message_paths() { + public BlindedMessagePath[] message_paths() { long[] ret = bindings.Bolt12Invoice_message_paths(this.ptr); Reference.reachabilityFence(this); - int ret_conv_13_len = ret.length; - BlindedPath[] ret_conv_13_arr = new BlindedPath[ret_conv_13_len]; - for (int n = 0; n < ret_conv_13_len; n++) { - long ret_conv_13 = ret[n]; - org.ldk.structs.BlindedPath ret_conv_13_hu_conv = null; if (ret_conv_13 < 0 || ret_conv_13 > 4096) { ret_conv_13_hu_conv = new org.ldk.structs.BlindedPath(null, ret_conv_13); } - if (ret_conv_13_hu_conv != null) { ret_conv_13_hu_conv.ptrs_to.add(this); }; - ret_conv_13_arr[n] = ret_conv_13_hu_conv; + int ret_conv_20_len = ret.length; + BlindedMessagePath[] ret_conv_20_arr = new BlindedMessagePath[ret_conv_20_len]; + for (int u = 0; u < ret_conv_20_len; u++) { + long ret_conv_20 = ret[u]; + org.ldk.structs.BlindedMessagePath ret_conv_20_hu_conv = null; if (ret_conv_20 < 0 || ret_conv_20 > 4096) { ret_conv_20_hu_conv = new org.ldk.structs.BlindedMessagePath(null, ret_conv_20); } + if (ret_conv_20_hu_conv != null) { ret_conv_20_hu_conv.ptrs_to.add(this); }; + ret_conv_20_arr[u] = ret_conv_20_hu_conv; } - return ret_conv_13_arr; + return ret_conv_20_arr; } /** @@ -293,34 +353,6 @@ public class Bolt12Invoice extends CommonBase { return ret_hu_conv; } - /** - * Duration since the Unix epoch when the invoice was created. - */ - public long created_at() { - long ret = bindings.Bolt12Invoice_created_at(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Duration since [`Bolt12Invoice::created_at`] when the invoice has expired and therefore - * should no longer be paid. - */ - public long relative_expiry() { - long ret = bindings.Bolt12Invoice_relative_expiry(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Whether the invoice has expired. - */ - public boolean is_expired() { - boolean ret = bindings.Bolt12Invoice_is_expired(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - /** * SHA256 hash of the payment preimage that will be given in return for paying the invoice. */ @@ -339,27 +371,6 @@ public class Bolt12Invoice extends CommonBase { return ret; } - /** - * Features pertaining to paying an invoice. - */ - public Bolt12InvoiceFeatures invoice_features() { - long ret = bindings.Bolt12Invoice_invoice_features(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Bolt12InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Bolt12InvoiceFeatures(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - return ret_hu_conv; - } - - /** - * The public key corresponding to the key used to sign the invoice. - */ - public byte[] signing_pubkey() { - byte[] ret = bindings.Bolt12Invoice_signing_pubkey(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - /** * Signature of the invoice verified using [`Bolt12Invoice::signing_pubkey`]. */ @@ -379,11 +390,13 @@ public class Bolt12Invoice extends CommonBase { } /** - * Verifies that the invoice was for a request or refund created using the given key. Returns - * the associated [`PaymentId`] to use when sending the payment. + * Verifies that the invoice was for a request or refund created using the given key by + * checking the payer metadata from the invoice request. + * + * Returns the associated [`PaymentId`] to use when sending the payment. */ - public Result_ThirtyTwoBytesNoneZ verify(org.ldk.structs.ExpandedKey key) { - long ret = bindings.Bolt12Invoice_verify(this.ptr, key.ptr); + public Result_ThirtyTwoBytesNoneZ verify_using_metadata(org.ldk.structs.ExpandedKey key) { + long ret = bindings.Bolt12Invoice_verify_using_metadata(this.ptr, key.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(key); if (ret >= 0 && ret <= 4096) { return null; } @@ -392,6 +405,23 @@ public class Bolt12Invoice extends CommonBase { return ret_hu_conv; } + /** + * Verifies that the invoice was for a request or refund created using the given key by + * checking a payment id and nonce included with the [`BlindedMessagePath`] for which the invoice was + * sent through. + */ + public Result_ThirtyTwoBytesNoneZ verify_using_payer_data(byte[] payment_id, org.ldk.structs.Nonce nonce, org.ldk.structs.ExpandedKey key) { + long ret = bindings.Bolt12Invoice_verify_using_payer_data(this.ptr, InternalUtils.check_arr_len(payment_id, 32), nonce.ptr, key.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(payment_id); + Reference.reachabilityFence(nonce); + Reference.reachabilityFence(key); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ThirtyTwoBytesNoneZ ret_hu_conv = Result_ThirtyTwoBytesNoneZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.add(key); }; + return ret_hu_conv; + } + /** * Generates a non-cryptographic 64-bit hash of the Bolt12Invoice. */ @@ -413,4 +443,15 @@ public class Bolt12Invoice extends CommonBase { return ret; } + /** + * Read a Bolt12Invoice from a byte array, created by Bolt12Invoice_write + */ + public static Result_Bolt12InvoiceDecodeErrorZ read(byte[] ser) { + long ret = bindings.Bolt12Invoice_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt12InvoiceDecodeErrorZ ret_hu_conv = Result_Bolt12InvoiceDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Bolt12InvoiceFeatures.java b/src/main/java/org/ldk/structs/Bolt12InvoiceFeatures.java index 6dbd72cc..1d2a5597 100644 --- a/src/main/java/org/ldk/structs/Bolt12InvoiceFeatures.java +++ b/src/main/java/org/ldk/structs/Bolt12InvoiceFeatures.java @@ -20,6 +20,26 @@ public class Bolt12InvoiceFeatures extends CommonBase { if (ptr != 0) { bindings.Bolt12InvoiceFeatures_free(ptr); } } + /** + * Serialize the Bolt12InvoiceFeatures object into a byte array which can be read by Bolt12InvoiceFeatures_read + */ + public byte[] write() { + byte[] ret = bindings.Bolt12InvoiceFeatures_write(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Read a Bolt12InvoiceFeatures from a byte array, created by Bolt12InvoiceFeatures_write + */ + public static Result_Bolt12InvoiceFeaturesDecodeErrorZ read(byte[] ser) { + long ret = bindings.Bolt12InvoiceFeatures_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt12InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_Bolt12InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + /** * Checks if two Bolt12InvoiceFeaturess contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. @@ -78,6 +98,25 @@ public class Bolt12InvoiceFeatures extends CommonBase { return ret_hu_conv; } + /** + * Returns the feature set as a list of bytes, in little-endian. This is in reverse byte order + * from most on-the-wire encodings. + */ + public byte[] le_flags() { + byte[] ret = bindings.Bolt12InvoiceFeatures_le_flags(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Returns true if this `Features` has any optional flags set + */ + public boolean supports_any_optional_bits() { + boolean ret = bindings.Bolt12InvoiceFeatures_supports_any_optional_bits(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * Returns true if this `Features` object contains required features unknown by `other`. */ @@ -89,6 +128,17 @@ public class Bolt12InvoiceFeatures extends CommonBase { return ret; } + /** + * Returns the set of required features unknown by `other`, as their bit position. + */ + public long[] required_unknown_bits_from(org.ldk.structs.Bolt12InvoiceFeatures other) { + long[] ret = bindings.Bolt12InvoiceFeatures_required_unknown_bits_from(this.ptr, other.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(other); + if (this != null) { this.ptrs_to.add(other); }; + return ret; + } + /** * Returns true if this `Features` object contains unknown feature flags which are set as * \"required\". @@ -99,6 +149,15 @@ public class Bolt12InvoiceFeatures extends CommonBase { return ret; } + /** + * Returns true if this `Features` supports any bits which we do not know of + */ + public boolean supports_unknown_bits() { + boolean ret = bindings.Bolt12InvoiceFeatures_supports_unknown_bits(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * Sets a required feature bit. Errors if `bit` is outside the feature range as defined * by [BOLT 9]. @@ -171,26 +230,6 @@ public class Bolt12InvoiceFeatures extends CommonBase { return ret_hu_conv; } - /** - * Serialize the Bolt12InvoiceFeatures object into a byte array which can be read by Bolt12InvoiceFeatures_read - */ - public byte[] write() { - byte[] ret = bindings.Bolt12InvoiceFeatures_write(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Read a Bolt12InvoiceFeatures from a byte array, created by Bolt12InvoiceFeatures_write - */ - public static Result_Bolt12InvoiceFeaturesDecodeErrorZ read(byte[] ser) { - long ret = bindings.Bolt12InvoiceFeatures_read(ser); - Reference.reachabilityFence(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_Bolt12InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_Bolt12InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - /** * Set this feature as optional. */ diff --git a/src/main/java/org/ldk/structs/Bolt12OfferContext.java b/src/main/java/org/ldk/structs/Bolt12OfferContext.java index cc84552e..e3f1a69f 100644 --- a/src/main/java/org/ldk/structs/Bolt12OfferContext.java +++ b/src/main/java/org/ldk/structs/Bolt12OfferContext.java @@ -45,7 +45,6 @@ public class Bolt12OfferContext extends CommonBase { bindings.Bolt12OfferContext_set_offer_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -73,7 +72,6 @@ public class Bolt12OfferContext extends CommonBase { bindings.Bolt12OfferContext_set_invoice_request(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -86,8 +84,6 @@ public class Bolt12OfferContext extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Bolt12OfferContext ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Bolt12OfferContext(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(offer_id_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(invoice_request_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Bolt12PaymentError.java b/src/main/java/org/ldk/structs/Bolt12PaymentError.java new file mode 100644 index 00000000..b12509ac --- /dev/null +++ b/src/main/java/org/ldk/structs/Bolt12PaymentError.java @@ -0,0 +1,151 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * An error when attempting to pay a [`Bolt12Invoice`]. + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Bolt12PaymentError extends CommonBase { + private Bolt12PaymentError(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.Bolt12PaymentError_free(ptr); } + } + static Bolt12PaymentError constr_from_ptr(long ptr) { + bindings.LDKBolt12PaymentError raw_val = bindings.LDKBolt12PaymentError_ref_from_ptr(ptr); + if (raw_val.getClass() == bindings.LDKBolt12PaymentError.UnexpectedInvoice.class) { + return new UnexpectedInvoice(ptr, (bindings.LDKBolt12PaymentError.UnexpectedInvoice)raw_val); + } + if (raw_val.getClass() == bindings.LDKBolt12PaymentError.DuplicateInvoice.class) { + return new DuplicateInvoice(ptr, (bindings.LDKBolt12PaymentError.DuplicateInvoice)raw_val); + } + if (raw_val.getClass() == bindings.LDKBolt12PaymentError.UnknownRequiredFeatures.class) { + return new UnknownRequiredFeatures(ptr, (bindings.LDKBolt12PaymentError.UnknownRequiredFeatures)raw_val); + } + if (raw_val.getClass() == bindings.LDKBolt12PaymentError.SendingFailed.class) { + return new SendingFailed(ptr, (bindings.LDKBolt12PaymentError.SendingFailed)raw_val); + } + assert false; return null; // Unreachable without extending the (internal) bindings interface + } + + /** + * The invoice was not requested. + */ + public final static class UnexpectedInvoice extends Bolt12PaymentError { + private UnexpectedInvoice(long ptr, bindings.LDKBolt12PaymentError.UnexpectedInvoice obj) { + super(null, ptr); + } + } + /** + * Payment for an invoice with the corresponding [`PaymentId`] was already initiated. + */ + public final static class DuplicateInvoice extends Bolt12PaymentError { + private DuplicateInvoice(long ptr, bindings.LDKBolt12PaymentError.DuplicateInvoice obj) { + super(null, ptr); + } + } + /** + * The invoice was valid for the corresponding [`PaymentId`], but required unknown features. + */ + public final static class UnknownRequiredFeatures extends Bolt12PaymentError { + private UnknownRequiredFeatures(long ptr, bindings.LDKBolt12PaymentError.UnknownRequiredFeatures obj) { + super(null, ptr); + } + } + /** + * The invoice was valid for the corresponding [`PaymentId`], but sending the payment failed. + */ + public final static class SendingFailed extends Bolt12PaymentError { + public final org.ldk.enums.RetryableSendFailure sending_failed; + private SendingFailed(long ptr, bindings.LDKBolt12PaymentError.SendingFailed obj) { + super(null, ptr); + this.sending_failed = obj.sending_failed; + } + } + long clone_ptr() { + long ret = bindings.Bolt12PaymentError_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the Bolt12PaymentError + */ + public Bolt12PaymentError clone() { + long ret = bindings.Bolt12PaymentError_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt12PaymentError ret_hu_conv = org.ldk.structs.Bolt12PaymentError.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new UnexpectedInvoice-variant Bolt12PaymentError + */ + public static Bolt12PaymentError unexpected_invoice() { + long ret = bindings.Bolt12PaymentError_unexpected_invoice(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt12PaymentError ret_hu_conv = org.ldk.structs.Bolt12PaymentError.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new DuplicateInvoice-variant Bolt12PaymentError + */ + public static Bolt12PaymentError duplicate_invoice() { + long ret = bindings.Bolt12PaymentError_duplicate_invoice(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt12PaymentError ret_hu_conv = org.ldk.structs.Bolt12PaymentError.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new UnknownRequiredFeatures-variant Bolt12PaymentError + */ + public static Bolt12PaymentError unknown_required_features() { + long ret = bindings.Bolt12PaymentError_unknown_required_features(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt12PaymentError ret_hu_conv = org.ldk.structs.Bolt12PaymentError.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new SendingFailed-variant Bolt12PaymentError + */ + public static Bolt12PaymentError sending_failed(org.ldk.enums.RetryableSendFailure a) { + long ret = bindings.Bolt12PaymentError_sending_failed(a); + Reference.reachabilityFence(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt12PaymentError ret_hu_conv = org.ldk.structs.Bolt12PaymentError.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Checks if two Bolt12PaymentErrors contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + */ + public boolean eq(org.ldk.structs.Bolt12PaymentError b) { + boolean ret = bindings.Bolt12PaymentError_eq(this.ptr, b.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(b); + return ret; + } + + @Override public boolean equals(Object o) { + if (!(o instanceof Bolt12PaymentError)) return false; + return this.eq((Bolt12PaymentError)o); + } +} diff --git a/src/main/java/org/ldk/structs/BumpTransactionEvent.java b/src/main/java/org/ldk/structs/BumpTransactionEvent.java index 455fb188..c60644e6 100644 --- a/src/main/java/org/ldk/structs/BumpTransactionEvent.java +++ b/src/main/java/org/ldk/structs/BumpTransactionEvent.java @@ -259,9 +259,6 @@ public class BumpTransactionEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.BumpTransactionEvent ret_hu_conv = org.ldk.structs.BumpTransactionEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(anchor_descriptor); }; - for (HTLCOutputInCommitment pending_htlcs_conv_24: pending_htlcs) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(pending_htlcs_conv_24); }; }; return ret_hu_conv; } @@ -279,8 +276,6 @@ public class BumpTransactionEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.BumpTransactionEvent ret_hu_conv = org.ldk.structs.BumpTransactionEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id); }; - for (HTLCDescriptor htlc_descriptors_conv_16: htlc_descriptors) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(htlc_descriptors_conv_16); }; }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/CandidateRouteHop.java b/src/main/java/org/ldk/structs/CandidateRouteHop.java index 60b88565..f3450de2 100644 --- a/src/main/java/org/ldk/structs/CandidateRouteHop.java +++ b/src/main/java/org/ldk/structs/CandidateRouteHop.java @@ -116,6 +116,8 @@ public class CandidateRouteHop extends CommonBase { * * This primarily exists to track that we need to included a blinded path at the end of our * [`Route`], even though it doesn't actually add an additional hop in the payment. + * + * [`BlindedPayInfo`]: crate::blinded_path::payment::BlindedPayInfo */ public final static class OneHopBlinded extends CandidateRouteHop { public final org.ldk.structs.OneHopBlindedPathCandidate one_hop_blinded; @@ -154,7 +156,6 @@ public class CandidateRouteHop extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.CandidateRouteHop ret_hu_conv = org.ldk.structs.CandidateRouteHop.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; return ret_hu_conv; } @@ -167,7 +168,6 @@ public class CandidateRouteHop extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.CandidateRouteHop ret_hu_conv = org.ldk.structs.CandidateRouteHop.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; return ret_hu_conv; } @@ -180,7 +180,6 @@ public class CandidateRouteHop extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.CandidateRouteHop ret_hu_conv = org.ldk.structs.CandidateRouteHop.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; return ret_hu_conv; } @@ -193,7 +192,6 @@ public class CandidateRouteHop extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.CandidateRouteHop ret_hu_conv = org.ldk.structs.CandidateRouteHop.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; return ret_hu_conv; } @@ -206,7 +204,6 @@ public class CandidateRouteHop extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.CandidateRouteHop ret_hu_conv = org.ldk.structs.CandidateRouteHop.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChainMonitor.java b/src/main/java/org/ldk/structs/ChainMonitor.java index 8d68f8f1..cd172fa7 100644 --- a/src/main/java/org/ldk/structs/ChainMonitor.java +++ b/src/main/java/org/ldk/structs/ChainMonitor.java @@ -67,8 +67,7 @@ public class ChainMonitor extends CommonBase { * claims which are awaiting confirmation. * * Includes the balances from each [`ChannelMonitor`] *except* those included in - * `ignored_channels`, allowing you to filter out balances from channels which are still open - * (and whose balance should likely be pulled from the [`ChannelDetails`]). + * `ignored_channels`. * * See [`ChannelMonitor::get_claimable_balances`] for more details on the exact criteria for * inclusion in the return value. @@ -85,7 +84,6 @@ public class ChainMonitor extends CommonBase { if (ret_conv_9_hu_conv != null) { ret_conv_9_hu_conv.ptrs_to.add(this); }; ret_conv_9_arr[j] = ret_conv_9_hu_conv; } - for (ChannelDetails ignored_channels_conv_16: ignored_channels) { if (this != null) { this.ptrs_to.add(ignored_channels_conv_16); }; }; return ret_conv_9_arr; } @@ -102,7 +100,6 @@ public class ChainMonitor extends CommonBase { Reference.reachabilityFence(funding_txo); if (ret >= 0 && ret <= 4096) { return null; } Result_LockedChannelMonitorNoneZ ret_hu_conv = Result_LockedChannelMonitorNoneZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.add(funding_txo); }; return ret_hu_conv; } @@ -128,19 +125,22 @@ public class ChainMonitor extends CommonBase { /** * Lists the pending updates for each [`ChannelMonitor`] (by `OutPoint` being monitored). + * Each `Vec` contains `update_id`s from [`ChannelMonitor::get_latest_update_id`] for updates + * that have not yet been fully persisted. Note that if a full monitor is persisted all the pending + * monitor updates must be individually marked completed by calling [`ChainMonitor::channel_monitor_updated`]. */ - public TwoTuple_OutPointCVec_MonitorUpdateIdZZ[] list_pending_monitor_updates() { + public TwoTuple_OutPointCVec_u64ZZ[] list_pending_monitor_updates() { long[] ret = bindings.ChainMonitor_list_pending_monitor_updates(this.ptr); Reference.reachabilityFence(this); - int ret_conv_41_len = ret.length; - TwoTuple_OutPointCVec_MonitorUpdateIdZZ[] ret_conv_41_arr = new TwoTuple_OutPointCVec_MonitorUpdateIdZZ[ret_conv_41_len]; - for (int p = 0; p < ret_conv_41_len; p++) { - long ret_conv_41 = ret[p]; - TwoTuple_OutPointCVec_MonitorUpdateIdZZ ret_conv_41_hu_conv = new TwoTuple_OutPointCVec_MonitorUpdateIdZZ(null, ret_conv_41); - if (ret_conv_41_hu_conv != null) { ret_conv_41_hu_conv.ptrs_to.add(this); }; - ret_conv_41_arr[p] = ret_conv_41_hu_conv; + int ret_conv_29_len = ret.length; + TwoTuple_OutPointCVec_u64ZZ[] ret_conv_29_arr = new TwoTuple_OutPointCVec_u64ZZ[ret_conv_29_len]; + for (int d = 0; d < ret_conv_29_len; d++) { + long ret_conv_29 = ret[d]; + TwoTuple_OutPointCVec_u64ZZ ret_conv_29_hu_conv = new TwoTuple_OutPointCVec_u64ZZ(null, ret_conv_29); + if (ret_conv_29_hu_conv != null) { ret_conv_29_hu_conv.ptrs_to.add(this); }; + ret_conv_29_arr[d] = ret_conv_29_hu_conv; } - return ret_conv_41_arr; + return ret_conv_29_arr; } /** @@ -151,22 +151,27 @@ public class ChainMonitor extends CommonBase { * 1) This [`ChainMonitor`] calls [`Persist::update_persisted_channel`] which stores the * update to disk and begins updating any remote (e.g. watchtower/backup) copies, * returning [`ChannelMonitorUpdateStatus::InProgress`], - * 2) once all remote copies are updated, you call this function with the - * `completed_update_id` that completed, and once all pending updates have completed the - * channel will be re-enabled. + * 2) once all remote copies are updated, you call this function with [`ChannelMonitor::get_latest_update_id`] + * or [`ChannelMonitorUpdate::update_id`] as the `completed_update_id`, and once all pending + * updates have completed the channel will be re-enabled. + * + * It is only necessary to call [`ChainMonitor::channel_monitor_updated`] when you return [`ChannelMonitorUpdateStatus::InProgress`] + * from [`Persist`] and either: + * 1. A new [`ChannelMonitor`] was added in [`Persist::persist_new_channel`], or + * 2. A [`ChannelMonitorUpdate`] was provided as part of [`Persist::update_persisted_channel`]. + * Note that we don't care about calls to [`Persist::update_persisted_channel`] where no + * [`ChannelMonitorUpdate`] was provided. * * Returns an [`APIError::APIMisuseError`] if `funding_txo` does not match any currently * registered [`ChannelMonitor`]s. */ - public Result_NoneAPIErrorZ channel_monitor_updated(org.ldk.structs.OutPoint funding_txo, org.ldk.structs.MonitorUpdateId completed_update_id) { - long ret = bindings.ChainMonitor_channel_monitor_updated(this.ptr, funding_txo.ptr, completed_update_id.ptr); + public Result_NoneAPIErrorZ channel_monitor_updated(org.ldk.structs.OutPoint funding_txo, long completed_update_id) { + long ret = bindings.ChainMonitor_channel_monitor_updated(this.ptr, funding_txo.ptr, completed_update_id); Reference.reachabilityFence(this); Reference.reachabilityFence(funding_txo); Reference.reachabilityFence(completed_update_id); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.add(funding_txo); }; - if (this != null) { this.ptrs_to.add(completed_update_id); }; return ret_hu_conv; } @@ -213,7 +218,6 @@ public class ChainMonitor extends CommonBase { bindings.ChainMonitor_signer_unblocked(this.ptr, monitor_opt == null ? 0 : monitor_opt.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(monitor_opt); - if (this != null) { this.ptrs_to.add(monitor_opt); }; } /** diff --git a/src/main/java/org/ldk/structs/ChainParameters.java b/src/main/java/org/ldk/structs/ChainParameters.java index 2518986d..c7535249 100644 --- a/src/main/java/org/ldk/structs/ChainParameters.java +++ b/src/main/java/org/ldk/structs/ChainParameters.java @@ -65,7 +65,6 @@ public class ChainParameters extends CommonBase { bindings.ChainParameters_set_best_block(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -78,7 +77,6 @@ public class ChainParameters extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChainParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChainParameters(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(best_block_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChannelAnnouncement.java b/src/main/java/org/ldk/structs/ChannelAnnouncement.java index b766ee90..a9e8cea2 100644 --- a/src/main/java/org/ldk/structs/ChannelAnnouncement.java +++ b/src/main/java/org/ldk/structs/ChannelAnnouncement.java @@ -113,7 +113,6 @@ public class ChannelAnnouncement extends CommonBase { bindings.ChannelAnnouncement_set_contents(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -129,7 +128,6 @@ public class ChannelAnnouncement extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelAnnouncement(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(contents_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChannelConfig.java b/src/main/java/org/ldk/structs/ChannelConfig.java index 3ec121ff..ac3c6c44 100644 --- a/src/main/java/org/ldk/structs/ChannelConfig.java +++ b/src/main/java/org/ldk/structs/ChannelConfig.java @@ -27,7 +27,7 @@ public class ChannelConfig extends CommonBase { * This may be allowed to change at runtime in a later update, however doing so must result in * update messages sent to notify all nodes of our updated relay fee. * - * Default value: 0. + * Default value: `0` */ public int get_forwarding_fee_proportional_millionths() { int ret = bindings.ChannelConfig_get_forwarding_fee_proportional_millionths(this.ptr); @@ -41,7 +41,7 @@ public class ChannelConfig extends CommonBase { * This may be allowed to change at runtime in a later update, however doing so must result in * update messages sent to notify all nodes of our updated relay fee. * - * Default value: 0. + * Default value: `0` */ public void set_forwarding_fee_proportional_millionths(int val) { bindings.ChannelConfig_set_forwarding_fee_proportional_millionths(this.ptr, val); @@ -59,7 +59,7 @@ public class ChannelConfig extends CommonBase { * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through * this node. * - * Default value: 1000. + * Default value: `1000` * * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths */ @@ -79,7 +79,7 @@ public class ChannelConfig extends CommonBase { * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through * this node. * - * Default value: 1000. + * Default value: `1000` * * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths */ @@ -104,9 +104,10 @@ public class ChannelConfig extends CommonBase { * enough time to broadcast and confirm a transaction, possibly with time in between to RBF * the spending transaction). * - * Default value: 72 (12 hours at an average of 6 blocks/hour). - * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as - * [`MIN_CLTV_EXPIRY_DELTA`] instead. + * Default value: `72` (12 hours at an average of 6 blocks/hour) + * + * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`] (Any values less than this will be treated as + * [`MIN_CLTV_EXPIRY_DELTA`] instead.) * * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA */ @@ -131,9 +132,10 @@ public class ChannelConfig extends CommonBase { * enough time to broadcast and confirm a transaction, possibly with time in between to RBF * the spending transaction). * - * Default value: 72 (12 hours at an average of 6 blocks/hour). - * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as - * [`MIN_CLTV_EXPIRY_DELTA`] instead. + * Default value: `72` (12 hours at an average of 6 blocks/hour) + * + * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`] (Any values less than this will be treated as + * [`MIN_CLTV_EXPIRY_DELTA`] instead.) * * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA */ @@ -192,12 +194,12 @@ public class ChannelConfig extends CommonBase { * Note that when using [`MaxDustHTLCExposure::FeeRateMultiplier`] this maximum disagreement * will scale linearly with increases (or decreases) in the our feerate estimates. Further, * for anchor channels we expect our counterparty to use a relatively low feerate estimate - * while we use [`ConfirmationTarget::OnChainSweep`] (which should be relatively high) and - * feerate disagreement force-closures should only occur when theirs is higher than ours. + * while we use [`ConfirmationTarget::MaximumFeeEstimate`] (which should be relatively high) + * and feerate disagreement force-closures should only occur when theirs is higher than ours. * - * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of 10_000. + * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of `10_000` * - * [`ConfirmationTarget::OnChainSweep`]: crate::chain::chaininterface::ConfirmationTarget::OnChainSweep + * [`ConfirmationTarget::MaximumFeeEstimate`]: crate::chain::chaininterface::ConfirmationTarget::MaximumFeeEstimate */ public MaxDustHTLCExposure get_max_dust_htlc_exposure() { long ret = bindings.ChannelConfig_get_max_dust_htlc_exposure(this.ptr); @@ -257,18 +259,17 @@ public class ChannelConfig extends CommonBase { * Note that when using [`MaxDustHTLCExposure::FeeRateMultiplier`] this maximum disagreement * will scale linearly with increases (or decreases) in the our feerate estimates. Further, * for anchor channels we expect our counterparty to use a relatively low feerate estimate - * while we use [`ConfirmationTarget::OnChainSweep`] (which should be relatively high) and - * feerate disagreement force-closures should only occur when theirs is higher than ours. + * while we use [`ConfirmationTarget::MaximumFeeEstimate`] (which should be relatively high) + * and feerate disagreement force-closures should only occur when theirs is higher than ours. * - * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of 10_000. + * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of `10_000` * - * [`ConfirmationTarget::OnChainSweep`]: crate::chain::chaininterface::ConfirmationTarget::OnChainSweep + * [`ConfirmationTarget::MaximumFeeEstimate`]: crate::chain::chaininterface::ConfirmationTarget::MaximumFeeEstimate */ public void set_max_dust_htlc_exposure(org.ldk.structs.MaxDustHTLCExposure val) { bindings.ChannelConfig_set_max_dust_htlc_exposure(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -290,7 +291,7 @@ public class ChannelConfig extends CommonBase { * [`ChannelCloseMinimum`] fee estimate, but allow our counterparty to pay as much fee as they like. * Thus, this value is ignored when we are not the funder. * - * Default value: 1000 satoshis. + * Default value: `1000` * * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum @@ -320,7 +321,7 @@ public class ChannelConfig extends CommonBase { * [`ChannelCloseMinimum`] fee estimate, but allow our counterparty to pay as much fee as they like. * Thus, this value is ignored when we are not the funder. * - * Default value: 1000 satoshis. + * Default value: `1000` * * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum @@ -355,7 +356,7 @@ public class ChannelConfig extends CommonBase { * Switching this config flag on may break compatibility with versions of LDK prior to 0.0.116. * Unsetting this flag between restarts may lead to payment receive failures. * - * Default value: false. + * Default value: `false` * * [intercept scids]: crate::ln::channelmanager::ChannelManager::get_intercept_scid * [`forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc @@ -394,7 +395,7 @@ public class ChannelConfig extends CommonBase { * Switching this config flag on may break compatibility with versions of LDK prior to 0.0.116. * Unsetting this flag between restarts may lead to payment receive failures. * - * Default value: false. + * Default value: `false` * * [intercept scids]: crate::ln::channelmanager::ChannelManager::get_intercept_scid * [`forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc @@ -423,7 +424,6 @@ public class ChannelConfig extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelConfig(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(max_dust_htlc_exposure_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChannelConfigUpdate.java b/src/main/java/org/ldk/structs/ChannelConfigUpdate.java index e824532a..f29d51f0 100644 --- a/src/main/java/org/ldk/structs/ChannelConfigUpdate.java +++ b/src/main/java/org/ldk/structs/ChannelConfigUpdate.java @@ -33,7 +33,6 @@ public class ChannelConfigUpdate extends CommonBase { bindings.ChannelConfigUpdate_set_forwarding_fee_proportional_millionths(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } public Option_u32Z get_forwarding_fee_base_msat() { @@ -49,7 +48,6 @@ public class ChannelConfigUpdate extends CommonBase { bindings.ChannelConfigUpdate_set_forwarding_fee_base_msat(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } public Option_u16Z get_cltv_expiry_delta() { @@ -65,7 +63,6 @@ public class ChannelConfigUpdate extends CommonBase { bindings.ChannelConfigUpdate_set_cltv_expiry_delta(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -84,7 +81,6 @@ public class ChannelConfigUpdate extends CommonBase { bindings.ChannelConfigUpdate_set_max_dust_htlc_exposure_msat(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } public Option_u64Z get_force_close_avoidance_max_fee_satoshis() { @@ -100,7 +96,6 @@ public class ChannelConfigUpdate extends CommonBase { bindings.ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -116,22 +111,6 @@ public class ChannelConfigUpdate extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelConfigUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelConfigUpdate(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(forwarding_fee_proportional_millionths_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(forwarding_fee_base_msat_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(cltv_expiry_delta_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(max_dust_htlc_exposure_msat_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(force_close_avoidance_max_fee_satoshis_arg); }; - return ret_hu_conv; - } - - /** - * Creates a "default" ChannelConfigUpdate. See struct and individual field documentaiton for details on which values are used. - */ - public static ChannelConfigUpdate with_default() { - long ret = bindings.ChannelConfigUpdate_default(); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ChannelConfigUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelConfigUpdate(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChannelCounterparty.java b/src/main/java/org/ldk/structs/ChannelCounterparty.java index 7c006220..b0d2f1c6 100644 --- a/src/main/java/org/ldk/structs/ChannelCounterparty.java +++ b/src/main/java/org/ldk/structs/ChannelCounterparty.java @@ -62,7 +62,6 @@ public class ChannelCounterparty extends CommonBase { bindings.ChannelCounterparty_set_features(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -121,7 +120,6 @@ public class ChannelCounterparty extends CommonBase { bindings.ChannelCounterparty_set_forwarding_info(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -147,7 +145,6 @@ public class ChannelCounterparty extends CommonBase { bindings.ChannelCounterparty_set_outbound_htlc_minimum_msat(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -169,7 +166,6 @@ public class ChannelCounterparty extends CommonBase { bindings.ChannelCounterparty_set_outbound_htlc_maximum_msat(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -188,10 +184,6 @@ public class ChannelCounterparty extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelCounterparty ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelCounterparty(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(features_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(forwarding_info_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(outbound_htlc_minimum_msat_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(outbound_htlc_maximum_msat_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChannelDerivationParameters.java b/src/main/java/org/ldk/structs/ChannelDerivationParameters.java index 93c7a875..f94037ec 100644 --- a/src/main/java/org/ldk/structs/ChannelDerivationParameters.java +++ b/src/main/java/org/ldk/structs/ChannelDerivationParameters.java @@ -77,7 +77,6 @@ public class ChannelDerivationParameters extends CommonBase { bindings.ChannelDerivationParameters_set_transaction_parameters(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -91,7 +90,6 @@ public class ChannelDerivationParameters extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelDerivationParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelDerivationParameters(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(transaction_parameters_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChannelDetails.java b/src/main/java/org/ldk/structs/ChannelDetails.java index 84f4ac7c..f6d60c03 100644 --- a/src/main/java/org/ldk/structs/ChannelDetails.java +++ b/src/main/java/org/ldk/structs/ChannelDetails.java @@ -11,8 +11,14 @@ import javax.annotation.Nullable; /** * Details of a channel, as returned by [`ChannelManager::list_channels`] and [`ChannelManager::list_usable_channels`] * + * Balances of a channel are available through [`ChainMonitor::get_claimable_balances`] and + * [`ChannelMonitor::get_claimable_balances`], calculated with respect to the corresponding on-chain + * transactions. + * * [`ChannelManager::list_channels`]: crate::ln::channelmanager::ChannelManager::list_channels * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels + * [`ChainMonitor::get_claimable_balances`]: crate::chain::chainmonitor::ChainMonitor::get_claimable_balances + * [`ChannelMonitor::get_claimable_balances`]: crate::chain::channelmonitor::ChannelMonitor::get_claimable_balances */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class ChannelDetails extends CommonBase { @@ -48,7 +54,6 @@ public class ChannelDetails extends CommonBase { bindings.ChannelDetails_set_channel_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -70,7 +75,6 @@ public class ChannelDetails extends CommonBase { bindings.ChannelDetails_set_counterparty(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -99,7 +103,6 @@ public class ChannelDetails extends CommonBase { bindings.ChannelDetails_set_funding_txo(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -130,7 +133,6 @@ public class ChannelDetails extends CommonBase { bindings.ChannelDetails_set_channel_type(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -178,7 +180,6 @@ public class ChannelDetails extends CommonBase { bindings.ChannelDetails_set_short_channel_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -216,7 +217,6 @@ public class ChannelDetails extends CommonBase { bindings.ChannelDetails_set_outbound_scid_alias(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -254,7 +254,6 @@ public class ChannelDetails extends CommonBase { bindings.ChannelDetails_set_inbound_scid_alias(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -310,7 +309,6 @@ public class ChannelDetails extends CommonBase { bindings.ChannelDetails_set_unspendable_punishment_reserve(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -373,7 +371,6 @@ public class ChannelDetails extends CommonBase { bindings.ChannelDetails_set_feerate_sat_per_1000_weight(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -575,7 +572,6 @@ public class ChannelDetails extends CommonBase { bindings.ChannelDetails_set_confirmations_required(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -601,7 +597,6 @@ public class ChannelDetails extends CommonBase { bindings.ChannelDetails_set_confirmations(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -635,7 +630,6 @@ public class ChannelDetails extends CommonBase { bindings.ChannelDetails_set_force_close_spend_delay(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -709,7 +703,6 @@ public class ChannelDetails extends CommonBase { bindings.ChannelDetails_set_channel_shutdown_state(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -739,8 +732,8 @@ public class ChannelDetails extends CommonBase { /** * True if this channel is (or will be) publicly-announced. */ - public boolean get_is_public() { - boolean ret = bindings.ChannelDetails_get_is_public(this.ptr); + public boolean get_is_announced() { + boolean ret = bindings.ChannelDetails_get_is_announced(this.ptr); Reference.reachabilityFence(this); return ret; } @@ -748,8 +741,8 @@ public class ChannelDetails extends CommonBase { /** * True if this channel is (or will be) publicly-announced. */ - public void set_is_public(boolean val) { - bindings.ChannelDetails_set_is_public(this.ptr, val); + public void set_is_announced(boolean val) { + bindings.ChannelDetails_set_is_announced(this.ptr, val); Reference.reachabilityFence(this); Reference.reachabilityFence(val); } @@ -775,7 +768,6 @@ public class ChannelDetails extends CommonBase { bindings.ChannelDetails_set_inbound_htlc_minimum_msat(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -797,7 +789,6 @@ public class ChannelDetails extends CommonBase { bindings.ChannelDetails_set_inbound_htlc_maximum_msat(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -828,7 +819,6 @@ public class ChannelDetails extends CommonBase { bindings.ChannelDetails_set_config(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -859,7 +849,6 @@ public class ChannelDetails extends CommonBase { bindings.ChannelDetails_set_pending_inbound_htlcs(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_20 -> val_conv_20.ptr).toArray() : null); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - for (InboundHTLCDetails val_conv_20: val) { if (this != null) { this.ptrs_to.add(val_conv_20); }; }; } /** @@ -890,7 +879,6 @@ public class ChannelDetails extends CommonBase { bindings.ChannelDetails_set_pending_outbound_htlcs(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_21 -> val_conv_21.ptr).toArray() : null); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - for (OutboundHTLCDetails val_conv_21: val) { if (this != null) { this.ptrs_to.add(val_conv_21); }; }; } /** @@ -900,8 +888,8 @@ public class ChannelDetails extends CommonBase { * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None * Note that config_arg (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public static ChannelDetails of(org.ldk.structs.ChannelId channel_id_arg, org.ldk.structs.ChannelCounterparty counterparty_arg, @Nullable org.ldk.structs.OutPoint funding_txo_arg, @Nullable org.ldk.structs.ChannelTypeFeatures channel_type_arg, org.ldk.structs.Option_u64Z short_channel_id_arg, org.ldk.structs.Option_u64Z outbound_scid_alias_arg, org.ldk.structs.Option_u64Z inbound_scid_alias_arg, long channel_value_satoshis_arg, org.ldk.structs.Option_u64Z unspendable_punishment_reserve_arg, org.ldk.util.UInt128 user_channel_id_arg, org.ldk.structs.Option_u32Z feerate_sat_per_1000_weight_arg, long balance_msat_arg, long outbound_capacity_msat_arg, long next_outbound_htlc_limit_msat_arg, long next_outbound_htlc_minimum_msat_arg, long inbound_capacity_msat_arg, org.ldk.structs.Option_u32Z confirmations_required_arg, org.ldk.structs.Option_u32Z confirmations_arg, org.ldk.structs.Option_u16Z force_close_spend_delay_arg, boolean is_outbound_arg, boolean is_channel_ready_arg, org.ldk.structs.Option_ChannelShutdownStateZ channel_shutdown_state_arg, boolean is_usable_arg, boolean is_public_arg, org.ldk.structs.Option_u64Z inbound_htlc_minimum_msat_arg, org.ldk.structs.Option_u64Z inbound_htlc_maximum_msat_arg, @Nullable org.ldk.structs.ChannelConfig config_arg, InboundHTLCDetails[] pending_inbound_htlcs_arg, OutboundHTLCDetails[] pending_outbound_htlcs_arg) { - long ret = bindings.ChannelDetails_new(channel_id_arg.ptr, counterparty_arg.ptr, funding_txo_arg == null ? 0 : funding_txo_arg.ptr, channel_type_arg == null ? 0 : channel_type_arg.ptr, short_channel_id_arg.ptr, outbound_scid_alias_arg.ptr, inbound_scid_alias_arg.ptr, channel_value_satoshis_arg, unspendable_punishment_reserve_arg.ptr, user_channel_id_arg.getLEBytes(), feerate_sat_per_1000_weight_arg.ptr, balance_msat_arg, outbound_capacity_msat_arg, next_outbound_htlc_limit_msat_arg, next_outbound_htlc_minimum_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg.ptr, confirmations_arg.ptr, force_close_spend_delay_arg.ptr, is_outbound_arg, is_channel_ready_arg, channel_shutdown_state_arg.ptr, is_usable_arg, is_public_arg, inbound_htlc_minimum_msat_arg.ptr, inbound_htlc_maximum_msat_arg.ptr, config_arg == null ? 0 : config_arg.ptr, pending_inbound_htlcs_arg != null ? Arrays.stream(pending_inbound_htlcs_arg).mapToLong(pending_inbound_htlcs_arg_conv_20 -> pending_inbound_htlcs_arg_conv_20.ptr).toArray() : null, pending_outbound_htlcs_arg != null ? Arrays.stream(pending_outbound_htlcs_arg).mapToLong(pending_outbound_htlcs_arg_conv_21 -> pending_outbound_htlcs_arg_conv_21.ptr).toArray() : null); + public static ChannelDetails of(org.ldk.structs.ChannelId channel_id_arg, org.ldk.structs.ChannelCounterparty counterparty_arg, @Nullable org.ldk.structs.OutPoint funding_txo_arg, @Nullable org.ldk.structs.ChannelTypeFeatures channel_type_arg, org.ldk.structs.Option_u64Z short_channel_id_arg, org.ldk.structs.Option_u64Z outbound_scid_alias_arg, org.ldk.structs.Option_u64Z inbound_scid_alias_arg, long channel_value_satoshis_arg, org.ldk.structs.Option_u64Z unspendable_punishment_reserve_arg, org.ldk.util.UInt128 user_channel_id_arg, org.ldk.structs.Option_u32Z feerate_sat_per_1000_weight_arg, long balance_msat_arg, long outbound_capacity_msat_arg, long next_outbound_htlc_limit_msat_arg, long next_outbound_htlc_minimum_msat_arg, long inbound_capacity_msat_arg, org.ldk.structs.Option_u32Z confirmations_required_arg, org.ldk.structs.Option_u32Z confirmations_arg, org.ldk.structs.Option_u16Z force_close_spend_delay_arg, boolean is_outbound_arg, boolean is_channel_ready_arg, org.ldk.structs.Option_ChannelShutdownStateZ channel_shutdown_state_arg, boolean is_usable_arg, boolean is_announced_arg, org.ldk.structs.Option_u64Z inbound_htlc_minimum_msat_arg, org.ldk.structs.Option_u64Z inbound_htlc_maximum_msat_arg, @Nullable org.ldk.structs.ChannelConfig config_arg, InboundHTLCDetails[] pending_inbound_htlcs_arg, OutboundHTLCDetails[] pending_outbound_htlcs_arg) { + long ret = bindings.ChannelDetails_new(channel_id_arg.ptr, counterparty_arg.ptr, funding_txo_arg == null ? 0 : funding_txo_arg.ptr, channel_type_arg == null ? 0 : channel_type_arg.ptr, short_channel_id_arg.ptr, outbound_scid_alias_arg.ptr, inbound_scid_alias_arg.ptr, channel_value_satoshis_arg, unspendable_punishment_reserve_arg.ptr, user_channel_id_arg.getLEBytes(), feerate_sat_per_1000_weight_arg.ptr, balance_msat_arg, outbound_capacity_msat_arg, next_outbound_htlc_limit_msat_arg, next_outbound_htlc_minimum_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg.ptr, confirmations_arg.ptr, force_close_spend_delay_arg.ptr, is_outbound_arg, is_channel_ready_arg, channel_shutdown_state_arg.ptr, is_usable_arg, is_announced_arg, inbound_htlc_minimum_msat_arg.ptr, inbound_htlc_maximum_msat_arg.ptr, config_arg == null ? 0 : config_arg.ptr, pending_inbound_htlcs_arg != null ? Arrays.stream(pending_inbound_htlcs_arg).mapToLong(pending_inbound_htlcs_arg_conv_20 -> pending_inbound_htlcs_arg_conv_20.ptr).toArray() : null, pending_outbound_htlcs_arg != null ? Arrays.stream(pending_outbound_htlcs_arg).mapToLong(pending_outbound_htlcs_arg_conv_21 -> pending_outbound_htlcs_arg_conv_21.ptr).toArray() : null); Reference.reachabilityFence(channel_id_arg); Reference.reachabilityFence(counterparty_arg); Reference.reachabilityFence(funding_txo_arg); @@ -925,7 +913,7 @@ public class ChannelDetails extends CommonBase { Reference.reachabilityFence(is_channel_ready_arg); Reference.reachabilityFence(channel_shutdown_state_arg); Reference.reachabilityFence(is_usable_arg); - Reference.reachabilityFence(is_public_arg); + Reference.reachabilityFence(is_announced_arg); Reference.reachabilityFence(inbound_htlc_minimum_msat_arg); Reference.reachabilityFence(inbound_htlc_maximum_msat_arg); Reference.reachabilityFence(config_arg); @@ -934,24 +922,6 @@ public class ChannelDetails extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelDetails ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelDetails(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(counterparty_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(funding_txo_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_type_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(short_channel_id_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(outbound_scid_alias_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(inbound_scid_alias_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(unspendable_punishment_reserve_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(feerate_sat_per_1000_weight_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(confirmations_required_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(confirmations_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(force_close_spend_delay_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_shutdown_state_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(inbound_htlc_minimum_msat_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(inbound_htlc_maximum_msat_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(config_arg); }; - for (InboundHTLCDetails pending_inbound_htlcs_arg_conv_20: pending_inbound_htlcs_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(pending_inbound_htlcs_arg_conv_20); }; }; - for (OutboundHTLCDetails pending_outbound_htlcs_arg_conv_21: pending_outbound_htlcs_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(pending_outbound_htlcs_arg_conv_21); }; }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChannelFeatures.java b/src/main/java/org/ldk/structs/ChannelFeatures.java index 2f05763f..1b213f81 100644 --- a/src/main/java/org/ldk/structs/ChannelFeatures.java +++ b/src/main/java/org/ldk/structs/ChannelFeatures.java @@ -20,6 +20,26 @@ public class ChannelFeatures extends CommonBase { if (ptr != 0) { bindings.ChannelFeatures_free(ptr); } } + /** + * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read + */ + public byte[] write() { + byte[] ret = bindings.ChannelFeatures_write(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write + */ + public static Result_ChannelFeaturesDecodeErrorZ read(byte[] ser) { + long ret = bindings.ChannelFeatures_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ChannelFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelFeaturesDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + /** * Checks if two ChannelFeaturess contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. @@ -78,6 +98,25 @@ public class ChannelFeatures extends CommonBase { return ret_hu_conv; } + /** + * Returns the feature set as a list of bytes, in little-endian. This is in reverse byte order + * from most on-the-wire encodings. + */ + public byte[] le_flags() { + byte[] ret = bindings.ChannelFeatures_le_flags(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Returns true if this `Features` has any optional flags set + */ + public boolean supports_any_optional_bits() { + boolean ret = bindings.ChannelFeatures_supports_any_optional_bits(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * Returns true if this `Features` object contains required features unknown by `other`. */ @@ -89,6 +128,17 @@ public class ChannelFeatures extends CommonBase { return ret; } + /** + * Returns the set of required features unknown by `other`, as their bit position. + */ + public long[] required_unknown_bits_from(org.ldk.structs.ChannelFeatures other) { + long[] ret = bindings.ChannelFeatures_required_unknown_bits_from(this.ptr, other.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(other); + if (this != null) { this.ptrs_to.add(other); }; + return ret; + } + /** * Returns true if this `Features` object contains unknown feature flags which are set as * \"required\". @@ -99,6 +149,15 @@ public class ChannelFeatures extends CommonBase { return ret; } + /** + * Returns true if this `Features` supports any bits which we do not know of + */ + public boolean supports_unknown_bits() { + boolean ret = bindings.ChannelFeatures_supports_unknown_bits(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * Sets a required feature bit. Errors if `bit` is outside the feature range as defined * by [BOLT 9]. @@ -171,24 +230,4 @@ public class ChannelFeatures extends CommonBase { return ret_hu_conv; } - /** - * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read - */ - public byte[] write() { - byte[] ret = bindings.ChannelFeatures_write(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write - */ - public static Result_ChannelFeaturesDecodeErrorZ read(byte[] ser) { - long ret = bindings.ChannelFeatures_read(ser); - Reference.reachabilityFence(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_ChannelFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelFeaturesDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - } diff --git a/src/main/java/org/ldk/structs/ChannelHandshakeConfig.java b/src/main/java/org/ldk/structs/ChannelHandshakeConfig.java index 9162f1c1..6226e23d 100644 --- a/src/main/java/org/ldk/structs/ChannelHandshakeConfig.java +++ b/src/main/java/org/ldk/structs/ChannelHandshakeConfig.java @@ -11,7 +11,7 @@ import javax.annotation.Nullable; /** * Configuration we set when applicable. * - * Default::default() provides sane defaults. + * `Default::default()` provides sane defaults. */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class ChannelHandshakeConfig extends CommonBase { @@ -24,15 +24,15 @@ public class ChannelHandshakeConfig extends CommonBase { /** * Confirmations we will wait for before considering the channel locked in. - * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the + * Applied only for inbound channels (see [`ChannelHandshakeLimits::max_minimum_depth`] for the * equivalent limit applied to outbound channels). * - * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment + * A lower-bound of `1` is applied, requiring all channels to have a confirmed commitment * transaction before operation. If you wish to accept channels with zero confirmations, see * [`UserConfig::manually_accept_inbound_channels`] and * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]. * - * Default value: 6. + * Default value: `6` * * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf @@ -45,15 +45,15 @@ public class ChannelHandshakeConfig extends CommonBase { /** * Confirmations we will wait for before considering the channel locked in. - * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the + * Applied only for inbound channels (see [`ChannelHandshakeLimits::max_minimum_depth`] for the * equivalent limit applied to outbound channels). * - * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment + * A lower-bound of `1` is applied, requiring all channels to have a confirmed commitment * transaction before operation. If you wish to accept channels with zero confirmations, see * [`UserConfig::manually_accept_inbound_channels`] and * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]. * - * Default value: 6. + * Default value: `6` * * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf @@ -78,8 +78,8 @@ public class ChannelHandshakeConfig extends CommonBase { * case of an honest unilateral channel close, which implicitly decrease the economic value of * our channel. * - * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you - * can tweak config to ask for more security, not less. + * Default value: [`BREAKDOWN_TIMEOUT`] (We enforce it as a minimum at channel opening so you + * can tweak config to ask for more security, not less.) */ public short get_our_to_self_delay() { short ret = bindings.ChannelHandshakeConfig_get_our_to_self_delay(this.ptr); @@ -101,8 +101,8 @@ public class ChannelHandshakeConfig extends CommonBase { * case of an honest unilateral channel close, which implicitly decrease the economic value of * our channel. * - * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you - * can tweak config to ask for more security, not less. + * Default value: [`BREAKDOWN_TIMEOUT`] (We enforce it as a minimum at channel opening so you + * can tweak config to ask for more security, not less.) */ public void set_our_to_self_delay(short val) { bindings.ChannelHandshakeConfig_set_our_to_self_delay(this.ptr, val); @@ -116,8 +116,8 @@ public class ChannelHandshakeConfig extends CommonBase { * This value is sent to our counterparty on channel-open and we close the channel any time * our counterparty misbehaves by sending us an HTLC with a value smaller than this. * - * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required - * by the protocol. + * Default value: `1` (If the value is less than `1`, it is ignored and set to `1`, as is + * required by the protocol. */ public long get_our_htlc_minimum_msat() { long ret = bindings.ChannelHandshakeConfig_get_our_htlc_minimum_msat(this.ptr); @@ -131,8 +131,8 @@ public class ChannelHandshakeConfig extends CommonBase { * This value is sent to our counterparty on channel-open and we close the channel any time * our counterparty misbehaves by sending us an HTLC with a value smaller than this. * - * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required - * by the protocol. + * Default value: `1` (If the value is less than `1`, it is ignored and set to `1`, as is + * required by the protocol. */ public void set_our_htlc_minimum_msat(long val) { bindings.ChannelHandshakeConfig_set_our_htlc_minimum_msat(this.ptr, val); @@ -148,7 +148,7 @@ public class ChannelHandshakeConfig extends CommonBase { * channel value in whole percentages. * * Note that: - * If configured to another value than the default value 10, any new channels created with + * If configured to another value than the default value `10`, any new channels created with * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the * `ChannelManager`. * @@ -161,9 +161,11 @@ public class ChannelHandshakeConfig extends CommonBase { * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`] * for more information. * - * Default value: 10. - * Minimum value: 1, any values less than 1 will be treated as 1 instead. - * Maximum value: 100, any values larger than 100 will be treated as 100 instead. + * Default value: `10` + * + * Minimum value: `1` (Any values less will be treated as `1` instead.) + * + * Maximum value: `100` (Any values larger will be treated as `100` instead.) */ public byte get_max_inbound_htlc_value_in_flight_percent_of_channel() { byte ret = bindings.ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(this.ptr); @@ -179,7 +181,7 @@ public class ChannelHandshakeConfig extends CommonBase { * channel value in whole percentages. * * Note that: - * If configured to another value than the default value 10, any new channels created with + * If configured to another value than the default value `10`, any new channels created with * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the * `ChannelManager`. * @@ -192,9 +194,11 @@ public class ChannelHandshakeConfig extends CommonBase { * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`] * for more information. * - * Default value: 10. - * Minimum value: 1, any values less than 1 will be treated as 1 instead. - * Maximum value: 100, any values larger than 100 will be treated as 100 instead. + * Default value: `10` + * + * Minimum value: `1` (Any values less will be treated as `1` instead.) + * + * Maximum value: `100` (Any values larger will be treated as `100` instead.) */ public void set_max_inbound_htlc_value_in_flight_percent_of_channel(byte val) { bindings.ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(this.ptr, val); @@ -217,10 +221,10 @@ public class ChannelHandshakeConfig extends CommonBase { * private channel without that option. * * Ignored if the channel is negotiated to be announced, see - * [`ChannelHandshakeConfig::announced_channel`] and + * [`ChannelHandshakeConfig::announce_for_forwarding`] and * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more. * - * Default value: false. This value is likely to change to true in the future. + * Default value: `false` (This value is likely to change to `true` in the future.) * * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue @@ -246,10 +250,10 @@ public class ChannelHandshakeConfig extends CommonBase { * private channel without that option. * * Ignored if the channel is negotiated to be announced, see - * [`ChannelHandshakeConfig::announced_channel`] and + * [`ChannelHandshakeConfig::announce_for_forwarding`] and * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more. * - * Default value: false. This value is likely to change to true in the future. + * Default value: `false` (This value is likely to change to `true` in the future.) * * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue @@ -269,10 +273,10 @@ public class ChannelHandshakeConfig extends CommonBase { * As the node which funds a channel picks this value this will only apply for new outbound * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set. * - * Default value: false. + * Default value: `false` */ - public boolean get_announced_channel() { - boolean ret = bindings.ChannelHandshakeConfig_get_announced_channel(this.ptr); + public boolean get_announce_for_forwarding() { + boolean ret = bindings.ChannelHandshakeConfig_get_announce_for_forwarding(this.ptr); Reference.reachabilityFence(this); return ret; } @@ -286,10 +290,10 @@ public class ChannelHandshakeConfig extends CommonBase { * As the node which funds a channel picks this value this will only apply for new outbound * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set. * - * Default value: false. + * Default value: `false` */ - public void set_announced_channel(boolean val) { - bindings.ChannelHandshakeConfig_set_announced_channel(this.ptr, val); + public void set_announce_for_forwarding(boolean val) { + bindings.ChannelHandshakeConfig_set_announce_for_forwarding(this.ptr, val); Reference.reachabilityFence(this); Reference.reachabilityFence(val); } @@ -305,7 +309,7 @@ public class ChannelHandshakeConfig extends CommonBase { * * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`]. * - * Default value: true. + * Default value: `true` * * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey */ @@ -326,7 +330,7 @@ public class ChannelHandshakeConfig extends CommonBase { * * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`]. * - * Default value: true. + * Default value: `true` * * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey */ @@ -354,11 +358,15 @@ public class ChannelHandshakeConfig extends CommonBase { * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve * other than the default value. * - * Default value: 1% of channel value, i.e., configured as 10,000 millionths. - * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated - * as 1000 sats instead, which is a safe implementation-specific lower bound. - * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%) - * instead, although channel negotiations will fail in that case. + * Default value: `10_000` millionths (i.e., 1% of channel value) + * + * Minimum value: If the calculated proportional value is less than `1000` sats, it will be + * treated as `1000` sats instead, which is a safe implementation-specific lower + * bound. + * + * Maximum value: `1_000_000` (i.e., 100% of channel value. Any values larger than one million + * will be treated as one million instead, although channel negotiations will + * fail in that case.) */ public int get_their_channel_reserve_proportional_millionths() { int ret = bindings.ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(this.ptr); @@ -384,11 +392,15 @@ public class ChannelHandshakeConfig extends CommonBase { * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve * other than the default value. * - * Default value: 1% of channel value, i.e., configured as 10,000 millionths. - * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated - * as 1000 sats instead, which is a safe implementation-specific lower bound. - * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%) - * instead, although channel negotiations will fail in that case. + * Default value: `10_000` millionths (i.e., 1% of channel value) + * + * Minimum value: If the calculated proportional value is less than `1000` sats, it will be + * treated as `1000` sats instead, which is a safe implementation-specific lower + * bound. + * + * Maximum value: `1_000_000` (i.e., 100% of channel value. Any values larger than one million + * will be treated as one million instead, although channel negotiations will + * fail in that case.) */ public void set_their_channel_reserve_proportional_millionths(int val) { bindings.ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(this.ptr, val); @@ -419,7 +431,7 @@ public class ChannelHandshakeConfig extends CommonBase { * vulnerability after its deployment. For more context, see the [`SIGHASH_SINGLE + update_fee * Considered Harmful`] mailing list post. * - * Default value: false. This value is likely to change to true in the future. + * Default value: `false` (This value is likely to change to `true` in the future.) * * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel @@ -455,7 +467,7 @@ public class ChannelHandshakeConfig extends CommonBase { * vulnerability after its deployment. For more context, see the [`SIGHASH_SINGLE + update_fee * Considered Harmful`] mailing list post. * - * Default value: false. This value is likely to change to true in the future. + * Default value: `false` (This value is likely to change to `true` in the future.) * * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel @@ -477,9 +489,10 @@ public class ChannelHandshakeConfig extends CommonBase { * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration * other than the default value. * - * Default value: 50 - * Maximum value: 483, any values larger will be treated as 483. - * This is the BOLT #2 spec limit on `max_accepted_htlcs`. + * Default value: `50` + * + * Maximum value: `483` (Any values larger will be treated as `483`. This is the BOLT #2 spec + * limit on `max_accepted_htlcs`.) */ public short get_our_max_accepted_htlcs() { short ret = bindings.ChannelHandshakeConfig_get_our_max_accepted_htlcs(this.ptr); @@ -496,9 +509,10 @@ public class ChannelHandshakeConfig extends CommonBase { * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration * other than the default value. * - * Default value: 50 - * Maximum value: 483, any values larger will be treated as 483. - * This is the BOLT #2 spec limit on `max_accepted_htlcs`. + * Default value: `50` + * + * Maximum value: `483` (Any values larger will be treated as `483`. This is the BOLT #2 spec + * limit on `max_accepted_htlcs`.) */ public void set_our_max_accepted_htlcs(short val) { bindings.ChannelHandshakeConfig_set_our_max_accepted_htlcs(this.ptr, val); @@ -509,14 +523,14 @@ public class ChannelHandshakeConfig extends CommonBase { /** * Constructs a new ChannelHandshakeConfig given each field */ - public static ChannelHandshakeConfig of(int minimum_depth_arg, short our_to_self_delay_arg, long our_htlc_minimum_msat_arg, byte max_inbound_htlc_value_in_flight_percent_of_channel_arg, boolean negotiate_scid_privacy_arg, boolean announced_channel_arg, boolean commit_upfront_shutdown_pubkey_arg, int their_channel_reserve_proportional_millionths_arg, boolean negotiate_anchors_zero_fee_htlc_tx_arg, short our_max_accepted_htlcs_arg) { - long ret = bindings.ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg, max_inbound_htlc_value_in_flight_percent_of_channel_arg, negotiate_scid_privacy_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg, their_channel_reserve_proportional_millionths_arg, negotiate_anchors_zero_fee_htlc_tx_arg, our_max_accepted_htlcs_arg); + public static ChannelHandshakeConfig of(int minimum_depth_arg, short our_to_self_delay_arg, long our_htlc_minimum_msat_arg, byte max_inbound_htlc_value_in_flight_percent_of_channel_arg, boolean negotiate_scid_privacy_arg, boolean announce_for_forwarding_arg, boolean commit_upfront_shutdown_pubkey_arg, int their_channel_reserve_proportional_millionths_arg, boolean negotiate_anchors_zero_fee_htlc_tx_arg, short our_max_accepted_htlcs_arg) { + long ret = bindings.ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg, max_inbound_htlc_value_in_flight_percent_of_channel_arg, negotiate_scid_privacy_arg, announce_for_forwarding_arg, commit_upfront_shutdown_pubkey_arg, their_channel_reserve_proportional_millionths_arg, negotiate_anchors_zero_fee_htlc_tx_arg, our_max_accepted_htlcs_arg); Reference.reachabilityFence(minimum_depth_arg); Reference.reachabilityFence(our_to_self_delay_arg); Reference.reachabilityFence(our_htlc_minimum_msat_arg); Reference.reachabilityFence(max_inbound_htlc_value_in_flight_percent_of_channel_arg); Reference.reachabilityFence(negotiate_scid_privacy_arg); - Reference.reachabilityFence(announced_channel_arg); + Reference.reachabilityFence(announce_for_forwarding_arg); Reference.reachabilityFence(commit_upfront_shutdown_pubkey_arg); Reference.reachabilityFence(their_channel_reserve_proportional_millionths_arg); Reference.reachabilityFence(negotiate_anchors_zero_fee_htlc_tx_arg); diff --git a/src/main/java/org/ldk/structs/ChannelHandshakeLimits.java b/src/main/java/org/ldk/structs/ChannelHandshakeLimits.java index 6f9f5443..fbfd5e14 100644 --- a/src/main/java/org/ldk/structs/ChannelHandshakeLimits.java +++ b/src/main/java/org/ldk/structs/ChannelHandshakeLimits.java @@ -13,7 +13,7 @@ import javax.annotation.Nullable; * * These limits are only applied to our counterparty's limits, not our own. * - * Use 0/`::max_value()` as appropriate to skip checking. + * Use `0` or `::max_value()` as appropriate to skip checking. * * Provides sane defaults for most configurations. * @@ -34,7 +34,8 @@ public class ChannelHandshakeLimits extends CommonBase { * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so * only applies to inbound channels. * - * Default value: 0. + * Default value: `1000` + * (Minimum of [`ChannelHandshakeConfig::their_channel_reserve_proportional_millionths`]) */ public long get_min_funding_satoshis() { long ret = bindings.ChannelHandshakeLimits_get_min_funding_satoshis(this.ptr); @@ -46,7 +47,8 @@ public class ChannelHandshakeLimits extends CommonBase { * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so * only applies to inbound channels. * - * Default value: 0. + * Default value: `1000` + * (Minimum of [`ChannelHandshakeConfig::their_channel_reserve_proportional_millionths`]) */ public void set_min_funding_satoshis(long val) { bindings.ChannelHandshakeLimits_set_min_funding_satoshis(this.ptr, val); @@ -58,7 +60,7 @@ public class ChannelHandshakeLimits extends CommonBase { * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so * only applies to inbound channels. * - * Default value: 2^24 - 1. + * Default value: `2^24 - 1` */ public long get_max_funding_satoshis() { long ret = bindings.ChannelHandshakeLimits_get_max_funding_satoshis(this.ptr); @@ -70,7 +72,7 @@ public class ChannelHandshakeLimits extends CommonBase { * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so * only applies to inbound channels. * - * Default value: 2^24 - 1. + * Default value: `2^24 - 1` */ public void set_max_funding_satoshis(long val) { bindings.ChannelHandshakeLimits_set_max_funding_satoshis(this.ptr, val); @@ -82,7 +84,7 @@ public class ChannelHandshakeLimits extends CommonBase { * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows * you to limit the maximum minimum-size they can require. * - * Default value: u64::max_value. + * Default value: `u64::max_value` */ public long get_max_htlc_minimum_msat() { long ret = bindings.ChannelHandshakeLimits_get_max_htlc_minimum_msat(this.ptr); @@ -94,7 +96,7 @@ public class ChannelHandshakeLimits extends CommonBase { * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows * you to limit the maximum minimum-size they can require. * - * Default value: u64::max_value. + * Default value: `u64::max_value` */ public void set_max_htlc_minimum_msat(long val) { bindings.ChannelHandshakeLimits_set_max_htlc_minimum_msat(this.ptr, val); @@ -106,7 +108,7 @@ public class ChannelHandshakeLimits extends CommonBase { * The remote node sets a limit on the maximum value of pending HTLCs to them at any given * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value. * - * Default value: 0. + * Default value: `0` */ public long get_min_max_htlc_value_in_flight_msat() { long ret = bindings.ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(this.ptr); @@ -118,7 +120,7 @@ public class ChannelHandshakeLimits extends CommonBase { * The remote node sets a limit on the maximum value of pending HTLCs to them at any given * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value. * - * Default value: 0. + * Default value: `0` */ public void set_min_max_htlc_value_in_flight_msat(long val) { bindings.ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(this.ptr, val); @@ -131,7 +133,7 @@ public class ChannelHandshakeLimits extends CommonBase { * time, ensuring that we are able to be punished if we broadcast an old state. This allows to * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs). * - * Default value: u64::max_value. + * Default value: `u64::max_value`. */ public long get_max_channel_reserve_satoshis() { long ret = bindings.ChannelHandshakeLimits_get_max_channel_reserve_satoshis(this.ptr); @@ -144,7 +146,7 @@ public class ChannelHandshakeLimits extends CommonBase { * time, ensuring that we are able to be punished if we broadcast an old state. This allows to * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs). * - * Default value: u64::max_value. + * Default value: `u64::max_value`. */ public void set_max_channel_reserve_satoshis(long val) { bindings.ChannelHandshakeLimits_set_max_channel_reserve_satoshis(this.ptr, val); @@ -156,7 +158,7 @@ public class ChannelHandshakeLimits extends CommonBase { * The remote node sets a limit on the maximum number of pending HTLCs to them at any given * time. This allows you to set a minimum such value. * - * Default value: 0. + * Default value: `0` */ public short get_min_max_accepted_htlcs() { short ret = bindings.ChannelHandshakeLimits_get_min_max_accepted_htlcs(this.ptr); @@ -168,7 +170,7 @@ public class ChannelHandshakeLimits extends CommonBase { * The remote node sets a limit on the maximum number of pending HTLCs to them at any given * time. This allows you to set a minimum such value. * - * Default value: 0. + * Default value: `0` */ public void set_min_max_accepted_htlcs(short val) { bindings.ChannelHandshakeLimits_set_min_max_accepted_htlcs(this.ptr, val); @@ -182,7 +184,7 @@ public class ChannelHandshakeLimits extends CommonBase { * assume they aren't going to double-spend themselves). * This config allows you to set a limit on the maximum amount of time to wait. * - * Default value: 144, or roughly one day and only applies to outbound channels. + * Default value: `144`, or roughly one day and only applies to outbound channels */ public int get_max_minimum_depth() { int ret = bindings.ChannelHandshakeLimits_get_max_minimum_depth(this.ptr); @@ -196,7 +198,7 @@ public class ChannelHandshakeLimits extends CommonBase { * assume they aren't going to double-spend themselves). * This config allows you to set a limit on the maximum amount of time to wait. * - * Default value: 144, or roughly one day and only applies to outbound channels. + * Default value: `144`, or roughly one day and only applies to outbound channels */ public void set_max_minimum_depth(int val) { bindings.ChannelHandshakeLimits_set_max_minimum_depth(this.ptr, val); @@ -216,12 +218,12 @@ public class ChannelHandshakeLimits extends CommonBase { * You may wish to un-set this if you allow the user to (or do in an automated fashion) * double-spend the funding transaction to RBF with an alternative channel open. * - * This only applies if our counterparty set their confirmations-required value to 0, and we - * always trust our own funding transaction at 1 confirmation irrespective of this value. + * This only applies if our counterparty set their confirmations-required value to `0`, and we + * always trust our own funding transaction at `1` confirmation irrespective of this value. * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being - * `true` (0) and `false` (1). + * `true` (`0`) and `false` (`1`). * - * Default value: true + * Default value: `true` */ public boolean get_trust_own_funding_0conf() { boolean ret = bindings.ChannelHandshakeLimits_get_trust_own_funding_0conf(this.ptr); @@ -241,12 +243,12 @@ public class ChannelHandshakeLimits extends CommonBase { * You may wish to un-set this if you allow the user to (or do in an automated fashion) * double-spend the funding transaction to RBF with an alternative channel open. * - * This only applies if our counterparty set their confirmations-required value to 0, and we - * always trust our own funding transaction at 1 confirmation irrespective of this value. + * This only applies if our counterparty set their confirmations-required value to `0`, and we + * always trust our own funding transaction at `1` confirmation irrespective of this value. * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being - * `true` (0) and `false` (1). + * `true` (`0`) and `false` (`1`). * - * Default value: true + * Default value: `true` */ public void set_trust_own_funding_0conf(boolean val) { bindings.ChannelHandshakeLimits_set_trust_own_funding_0conf(this.ptr, val); @@ -256,13 +258,13 @@ public class ChannelHandshakeLimits extends CommonBase { /** * Set to force an incoming channel to match our announced channel preference in - * [`ChannelHandshakeConfig::announced_channel`]. + * [`ChannelHandshakeConfig::announce_for_forwarding`]. * * For a node which is not online reliably, this should be set to true and - * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public) + * [`ChannelHandshakeConfig::announce_for_forwarding`] set to false, ensuring that no announced (aka public) * channels will ever be opened. * - * Default value: true. + * Default value: `true` */ public boolean get_force_announced_channel_preference() { boolean ret = bindings.ChannelHandshakeLimits_get_force_announced_channel_preference(this.ptr); @@ -272,13 +274,13 @@ public class ChannelHandshakeLimits extends CommonBase { /** * Set to force an incoming channel to match our announced channel preference in - * [`ChannelHandshakeConfig::announced_channel`]. + * [`ChannelHandshakeConfig::announce_for_forwarding`]. * * For a node which is not online reliably, this should be set to true and - * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public) + * [`ChannelHandshakeConfig::announce_for_forwarding`] set to false, ensuring that no announced (aka public) * channels will ever be opened. * - * Default value: true. + * Default value: `true` */ public void set_force_announced_channel_preference(boolean val) { bindings.ChannelHandshakeLimits_set_force_announced_channel_preference(this.ptr, val); @@ -292,7 +294,7 @@ public class ChannelHandshakeLimits extends CommonBase { * Not checking this value would be a security issue, as our peer would be able to set it to * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time. * - * Default value: 2016, which we also enforce as a maximum value so you can tweak config to + * Default value: `2016`, which we also enforce as a maximum value so you can tweak config to * reduce the loss of having useless locked funds (if your peer accepts) */ public short get_their_to_self_delay() { @@ -307,7 +309,7 @@ public class ChannelHandshakeLimits extends CommonBase { * Not checking this value would be a security issue, as our peer would be able to set it to * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time. * - * Default value: 2016, which we also enforce as a maximum value so you can tweak config to + * Default value: `2016`, which we also enforce as a maximum value so you can tweak config to * reduce the loss of having useless locked funds (if your peer accepts) */ public void set_their_to_self_delay(short val) { diff --git a/src/main/java/org/ldk/structs/ChannelId.java b/src/main/java/org/ldk/structs/ChannelId.java index 43502cef..1d52d620 100644 --- a/src/main/java/org/ldk/structs/ChannelId.java +++ b/src/main/java/org/ldk/structs/ChannelId.java @@ -120,7 +120,6 @@ public class ChannelId extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(outpoint); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChannelInfo.java b/src/main/java/org/ldk/structs/ChannelInfo.java index 84b22d23..b8fbfc61 100644 --- a/src/main/java/org/ldk/structs/ChannelInfo.java +++ b/src/main/java/org/ldk/structs/ChannelInfo.java @@ -40,7 +40,6 @@ public class ChannelInfo extends CommonBase { bindings.ChannelInfo_set_features(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -62,66 +61,58 @@ public class ChannelInfo extends CommonBase { bindings.ChannelInfo_set_node_one(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** - * Details about the first direction of a channel - * - * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + * Source node of the second direction of a channel */ - @Nullable - public ChannelUpdateInfo get_one_to_two() { - long ret = bindings.ChannelInfo_get_one_to_two(this.ptr); + public NodeId get_node_two() { + long ret = bindings.ChannelInfo_get_node_two(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ChannelUpdateInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUpdateInfo(null, ret); } + org.ldk.structs.NodeId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeId(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; return ret_hu_conv; } /** - * Details about the first direction of a channel - * - * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + * Source node of the second direction of a channel */ - public void set_one_to_two(@Nullable org.ldk.structs.ChannelUpdateInfo val) { - bindings.ChannelInfo_set_one_to_two(this.ptr, val == null ? 0 : val.ptr); + public void set_node_two(org.ldk.structs.NodeId val) { + bindings.ChannelInfo_set_node_two(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** - * Source node of the second direction of a channel + * The channel capacity as seen on-chain, if chain lookup is available. */ - public NodeId get_node_two() { - long ret = bindings.ChannelInfo_get_node_two(this.ptr); + public Option_u64Z get_capacity_sats() { + long ret = bindings.ChannelInfo_get_capacity_sats(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.NodeId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeId(null, ret); } + org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; return ret_hu_conv; } /** - * Source node of the second direction of a channel + * The channel capacity as seen on-chain, if chain lookup is available. */ - public void set_node_two(org.ldk.structs.NodeId val) { - bindings.ChannelInfo_set_node_two(this.ptr, val.ptr); + public void set_capacity_sats(org.ldk.structs.Option_u64Z val) { + bindings.ChannelInfo_set_capacity_sats(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** - * Details about the second direction of a channel + * Details about the first direction of a channel * * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ @Nullable - public ChannelUpdateInfo get_two_to_one() { - long ret = bindings.ChannelInfo_get_two_to_one(this.ptr); + public ChannelUpdateInfo get_one_to_two() { + long ret = bindings.ChannelInfo_get_one_to_two(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelUpdateInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUpdateInfo(null, ret); } @@ -130,37 +121,40 @@ public class ChannelInfo extends CommonBase { } /** - * Details about the second direction of a channel + * Details about the first direction of a channel * * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public void set_two_to_one(@Nullable org.ldk.structs.ChannelUpdateInfo val) { - bindings.ChannelInfo_set_two_to_one(this.ptr, val == null ? 0 : val.ptr); + public void set_one_to_two(@Nullable org.ldk.structs.ChannelUpdateInfo val) { + bindings.ChannelInfo_set_one_to_two(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** - * The channel capacity as seen on-chain, if chain lookup is available. + * Details about the second direction of a channel + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public Option_u64Z get_capacity_sats() { - long ret = bindings.ChannelInfo_get_capacity_sats(this.ptr); + @Nullable + public ChannelUpdateInfo get_two_to_one() { + long ret = bindings.ChannelInfo_get_two_to_one(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret); + org.ldk.structs.ChannelUpdateInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUpdateInfo(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; return ret_hu_conv; } /** - * The channel capacity as seen on-chain, if chain lookup is available. + * Details about the second direction of a channel + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public void set_capacity_sats(org.ldk.structs.Option_u64Z val) { - bindings.ChannelInfo_set_capacity_sats(this.ptr, val.ptr); + public void set_two_to_one(@Nullable org.ldk.structs.ChannelUpdateInfo val) { + bindings.ChannelInfo_set_two_to_one(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -193,7 +187,6 @@ public class ChannelInfo extends CommonBase { bindings.ChannelInfo_set_announcement_message(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } long clone_ptr() { diff --git a/src/main/java/org/ldk/structs/ChannelManager.java b/src/main/java/org/ldk/structs/ChannelManager.java index f462ad52..85751dff 100644 --- a/src/main/java/org/ldk/structs/ChannelManager.java +++ b/src/main/java/org/ldk/structs/ChannelManager.java @@ -61,7 +61,7 @@ import javax.annotation.Nullable; * * ``` * use bitcoin::BlockHash; - * use bitcoin::network::constants::Network; + * use bitcoin::network::Network; * use lightning::chain::BestBlock; * # use lightning::chain::channelmonitor::ChannelMonitor; * use lightning::ln::channelmanager::{ChainParameters, ChannelManager, ChannelManagerReadArgs}; @@ -196,7 +196,8 @@ import javax.annotation.Nullable; * } * * On the event processing thread once the peer has responded - * channel_manager.process_pending_events(&|event| match event { + * channel_manager.process_pending_events(&|event| { + * match event { * Event::FundingGenerationReady { * temporary_channel_id, counterparty_node_id, channel_value_satoshis, output_script, * user_channel_id, .. @@ -206,7 +207,7 @@ import javax.annotation.Nullable; * channel_value_satoshis, output_script * ); * match channel_manager.funding_transaction_generated( - * &temporary_channel_id, &counterparty_node_id, funding_transaction + * temporary_channel_id, counterparty_node_id, funding_transaction * ) { * Ok(()) => println!(\"Funding channel {}\", temporary_channel_id), * Err(e) => println!(\"Error funding channel {}: {:?}\", temporary_channel_id, e), @@ -225,6 +226,8 @@ import javax.annotation.Nullable; * }, * ... * # _ => {}, + * } + * Ok(()) * }); * # } * ``` @@ -247,16 +250,18 @@ import javax.annotation.Nullable; * # * # fn example(channel_manager: T) { * # let channel_manager = channel_manager.get_cm(); - * channel_manager.process_pending_events(&|event| match event { + * # let error_message = \"Channel force-closed\"; + * channel_manager.process_pending_events(&|event| { + * match event { * Event::OpenChannelRequest { temporary_channel_id, counterparty_node_id, .. } => { * if !is_trusted(counterparty_node_id) { * match channel_manager.force_close_without_broadcasting_txn( - * &temporary_channel_id, &counterparty_node_id + * &temporary_channel_id, &counterparty_node_id, error_message.to_string() * ) { * Ok(()) => println!(\"Rejecting channel {}\", temporary_channel_id), * Err(e) => println!(\"Error rejecting channel {}: {:?}\", temporary_channel_id, e), * } - * return; + * return Ok(()); * } * * let user_channel_id = 43; @@ -269,6 +274,8 @@ import javax.annotation.Nullable; * }, * ... * # _ => {}, + * } + * Ok(()) * }); * # } * ``` @@ -297,13 +304,16 @@ import javax.annotation.Nullable; * } * * On the event processing thread - * channel_manager.process_pending_events(&|event| match event { + * channel_manager.process_pending_events(&|event| { + * match event { * Event::ChannelClosed { channel_id, user_channel_id, .. } => { * assert_eq!(user_channel_id, 42); * println!(\"Channel {} closed\", channel_id); * }, * ... * # _ => {}, + * } + * Ok(()) * }); * # } * ``` @@ -353,7 +363,8 @@ import javax.annotation.Nullable; * }; * * On the event processing thread - * channel_manager.process_pending_events(&|event| match event { + * channel_manager.process_pending_events(&|event| { + * match event { * Event::PaymentClaimable { payment_hash, purpose, .. } => match purpose { * PaymentPurpose::Bolt11InvoicePayment { payment_preimage: Some(payment_preimage), .. } => { * assert_eq!(payment_hash, known_payment_hash); @@ -369,14 +380,16 @@ import javax.annotation.Nullable; * channel_manager.claim_funds(payment_preimage); * }, * ... - * # _ => {}, + * # _ => {}, * }, * Event::PaymentClaimed { payment_hash, amount_msat, .. } => { * assert_eq!(payment_hash, known_payment_hash); * println!(\"Claimed {} msats\", amount_msat); * }, * ... - * # _ => {}, + * # _ => {}, + * } + * Ok(()) * }); * # } * ``` @@ -419,11 +432,15 @@ import javax.annotation.Nullable; * ); * * On the event processing thread - * channel_manager.process_pending_events(&|event| match event { + * channel_manager.process_pending_events(&|event| { + * match event { * Event::PaymentSent { payment_hash, .. } => println!(\"Paid {}\", payment_hash), - * Event::PaymentFailed { payment_hash, .. } => println!(\"Failed paying {}\", payment_hash), + * Event::PaymentFailed { payment_hash: Some(payment_hash), .. } => + * println!(\"Failed paying {}\", payment_hash), * ... * # _ => {}, + * } + * Ok(()) * }); * # } * ``` @@ -444,8 +461,9 @@ import javax.annotation.Nullable; * # * # fn example(channel_manager: T) -> Result<(), Bolt12SemanticError> { * # let channel_manager = channel_manager.get_cm(); + * # let absolute_expiry = None; * let offer = channel_manager - * .create_offer_builder()? + * .create_offer_builder(absolute_expiry)? * # ; * # // Needed for compiling for c_bindings * # let builder: lightning::offers::offer::OfferBuilder<_, _> = offer.into(); @@ -456,7 +474,8 @@ import javax.annotation.Nullable; * let bech32_offer = offer.to_string(); * * On the event processing thread - * channel_manager.process_pending_events(&|event| match event { + * channel_manager.process_pending_events(&|event| { + * match event { * Event::PaymentClaimable { payment_hash, purpose, .. } => match purpose { * PaymentPurpose::Bolt12OfferPayment { payment_preimage: Some(payment_preimage), .. } => { * println!(\"Claiming payment {}\", payment_hash); @@ -464,23 +483,23 @@ import javax.annotation.Nullable; * }, * PaymentPurpose::Bolt12OfferPayment { payment_preimage: None, .. } => { * println!(\"Unknown payment hash: {}\", payment_hash); - * }, - * ... - * # _ => {}, + * } + * # _ => {}, * }, * Event::PaymentClaimed { payment_hash, amount_msat, .. } => { * println!(\"Claimed {} msats\", amount_msat); * }, * ... * # _ => {}, + * } + * Ok(()) * }); * # Ok(()) * # } * ``` * * Use [`pay_for_offer`] to initiated payment, which sends an [`InvoiceRequest`] for an [`Offer`] - * and pays the [`Bolt12Invoice`] response. In addition to success and failure events, - * [`ChannelManager`] may also generate an [`Event::InvoiceRequestFailed`]. + * and pays the [`Bolt12Invoice`] response. * * ``` * # use lightning::events::{Event, EventsProvider}; @@ -518,12 +537,14 @@ import javax.annotation.Nullable; * ); * * On the event processing thread - * channel_manager.process_pending_events(&|event| match event { + * channel_manager.process_pending_events(&|event| { + * match event { * Event::PaymentSent { payment_id: Some(payment_id), .. } => println!(\"Paid {}\", payment_id), * Event::PaymentFailed { payment_id, .. } => println!(\"Failed paying {}\", payment_id), - * Event::InvoiceRequestFailed { payment_id, .. } => println!(\"Failed paying {}\", payment_id), * ... * # _ => {}, + * } + * Ok(()) * }); * # } * ``` @@ -578,11 +599,14 @@ import javax.annotation.Nullable; * ); * * On the event processing thread - * channel_manager.process_pending_events(&|event| match event { + * channel_manager.process_pending_events(&|event| { + * match event { * Event::PaymentSent { payment_id: Some(payment_id), .. } => println!(\"Paid {}\", payment_id), * Event::PaymentFailed { payment_id, .. } => println!(\"Failed paying {}\", payment_id), * ... * # _ => {}, + * } + * Ok(()) * }); * # Ok(()) * # } @@ -608,18 +632,19 @@ import javax.annotation.Nullable; * }; * * On the event processing thread - * channel_manager.process_pending_events(&|event| match event { + * channel_manager.process_pending_events(&|event| { + * match event { * Event::PaymentClaimable { payment_hash, purpose, .. } => match purpose { - * \tPaymentPurpose::Bolt12RefundPayment { payment_preimage: Some(payment_preimage), .. } => { + * PaymentPurpose::Bolt12RefundPayment { payment_preimage: Some(payment_preimage), .. } => { * assert_eq!(payment_hash, known_payment_hash); * println!(\"Claiming payment {}\", payment_hash); * channel_manager.claim_funds(payment_preimage); * }, - * \tPaymentPurpose::Bolt12RefundPayment { payment_preimage: None, .. } => { + * PaymentPurpose::Bolt12RefundPayment { payment_preimage: None, .. } => { * println!(\"Unknown payment hash: {}\", payment_hash); - * \t}, + * }, * ... - * # _ => {}, + * # _ => {}, * }, * Event::PaymentClaimed { payment_hash, amount_msat, .. } => { * assert_eq!(payment_hash, known_payment_hash); @@ -627,6 +652,8 @@ import javax.annotation.Nullable; * }, * ... * # _ => {}, + * } + * Ok(()) * }); * # } * ``` @@ -772,8 +799,6 @@ public class ChannelManager extends CommonBase { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(entropy_source); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(node_signer); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(signer_provider); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(config); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(params); }; return ret_hu_conv; } @@ -837,8 +862,6 @@ public class ChannelManager extends CommonBase { Reference.reachabilityFence(override_config); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelIdAPIErrorZ ret_hu_conv = Result_ChannelIdAPIErrorZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.add(temporary_channel_id); }; - if (this != null) { this.ptrs_to.add(override_config); }; return ret_hu_conv; } @@ -1003,22 +1026,25 @@ public class ChannelManager extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.add(channel_id); }; - if (this != null) { this.ptrs_to.add(target_feerate_sats_per_1000_weight); }; - if (this != null) { this.ptrs_to.add(shutdown_script); }; return ret_hu_conv; } /** - * Force closes a channel, immediately broadcasting the latest local transaction(s) and - * rejecting new HTLCs on the given channel. Fails if `channel_id` is unknown to - * the manager, or if the `counterparty_node_id` isn't the counterparty of the corresponding - * channel. + * Force closes a channel, immediately broadcasting the latest local transaction(s), + * rejecting new HTLCs. + * + * The provided `error_message` is sent to connected peers for closing + * channels and should be a human-readable description of what went wrong. + * + * Fails if `channel_id` is unknown to the manager, or if the `counterparty_node_id` + * isn't the counterparty of the corresponding channel. */ - public Result_NoneAPIErrorZ force_close_broadcasting_latest_txn(org.ldk.structs.ChannelId channel_id, byte[] counterparty_node_id) { - long ret = bindings.ChannelManager_force_close_broadcasting_latest_txn(this.ptr, channel_id.ptr, InternalUtils.check_arr_len(counterparty_node_id, 33)); + public Result_NoneAPIErrorZ force_close_broadcasting_latest_txn(org.ldk.structs.ChannelId channel_id, byte[] counterparty_node_id, java.lang.String error_message) { + long ret = bindings.ChannelManager_force_close_broadcasting_latest_txn(this.ptr, channel_id.ptr, InternalUtils.check_arr_len(counterparty_node_id, 33), error_message); Reference.reachabilityFence(this); Reference.reachabilityFence(channel_id); Reference.reachabilityFence(counterparty_node_id); + Reference.reachabilityFence(error_message); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.add(channel_id); }; @@ -1027,17 +1053,22 @@ public class ChannelManager extends CommonBase { /** * Force closes a channel, rejecting new HTLCs on the given channel but skips broadcasting - * the latest local transaction(s). Fails if `channel_id` is unknown to the manager, or if the - * `counterparty_node_id` isn't the counterparty of the corresponding channel. + * the latest local transaction(s). * + * The provided `error_message` is sent to connected peers for closing channels and should + * be a human-readable description of what went wrong. + * + * Fails if `channel_id` is unknown to the manager, or if the + * `counterparty_node_id` isn't the counterparty of the corresponding channel. * You can always broadcast the latest local transaction(s) via * [`ChannelMonitor::broadcast_latest_holder_commitment_txn`]. */ - public Result_NoneAPIErrorZ force_close_without_broadcasting_txn(org.ldk.structs.ChannelId channel_id, byte[] counterparty_node_id) { - long ret = bindings.ChannelManager_force_close_without_broadcasting_txn(this.ptr, channel_id.ptr, InternalUtils.check_arr_len(counterparty_node_id, 33)); + public Result_NoneAPIErrorZ force_close_without_broadcasting_txn(org.ldk.structs.ChannelId channel_id, byte[] counterparty_node_id, java.lang.String error_message) { + long ret = bindings.ChannelManager_force_close_without_broadcasting_txn(this.ptr, channel_id.ptr, InternalUtils.check_arr_len(counterparty_node_id, 33), error_message); Reference.reachabilityFence(this); Reference.reachabilityFence(channel_id); Reference.reachabilityFence(counterparty_node_id); + Reference.reachabilityFence(error_message); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.add(channel_id); }; @@ -1047,24 +1078,36 @@ public class ChannelManager extends CommonBase { /** * Force close all channels, immediately broadcasting the latest local commitment transaction * for each to the chain and rejecting new HTLCs on each. + * + * The provided `error_message` is sent to connected peers for closing channels and should + * be a human-readable description of what went wrong. */ - public void force_close_all_channels_broadcasting_latest_txn() { - bindings.ChannelManager_force_close_all_channels_broadcasting_latest_txn(this.ptr); + public void force_close_all_channels_broadcasting_latest_txn(java.lang.String error_message) { + bindings.ChannelManager_force_close_all_channels_broadcasting_latest_txn(this.ptr, error_message); Reference.reachabilityFence(this); + Reference.reachabilityFence(error_message); } /** * Force close all channels rejecting new HTLCs on each but without broadcasting the latest * local transaction(s). + * + * The provided `error_message` is sent to connected peers for closing channels and + * should be a human-readable description of what went wrong. */ - public void force_close_all_channels_without_broadcasting_txn() { - bindings.ChannelManager_force_close_all_channels_without_broadcasting_txn(this.ptr); + public void force_close_all_channels_without_broadcasting_txn(java.lang.String error_message) { + bindings.ChannelManager_force_close_all_channels_without_broadcasting_txn(this.ptr, error_message); Reference.reachabilityFence(this); + Reference.reachabilityFence(error_message); } /** * Sends a payment along a given route. * + * This method is *DEPRECATED*, use [`Self::send_payment`] instead. If you wish to fix the + * route for a payment, do so by matching the [`PaymentId`] passed to + * [`Router::find_route_with_id`]. + * * Value parameters are provided via the last hop in route, see documentation for [`RouteHop`] * fields for more info. * @@ -1124,8 +1167,6 @@ public class ChannelManager extends CommonBase { Reference.reachabilityFence(payment_id); if (ret >= 0 && ret <= 4096) { return null; } Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.add(route); }; - if (this != null) { this.ptrs_to.add(recipient_onion); }; return ret_hu_conv; } @@ -1143,9 +1184,6 @@ public class ChannelManager extends CommonBase { Reference.reachabilityFence(retry_strategy); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneRetryableSendFailureZ ret_hu_conv = Result_NoneRetryableSendFailureZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.add(recipient_onion); }; - if (this != null) { this.ptrs_to.add(route_params); }; - if (this != null) { this.ptrs_to.add(retry_strategy); }; return ret_hu_conv; } @@ -1166,15 +1204,13 @@ public class ChannelManager extends CommonBase { * # Requested Invoices * * In the case of paying a [`Bolt12Invoice`] via [`ChannelManager::pay_for_offer`], abandoning - * the payment prior to receiving the invoice will result in an [`Event::InvoiceRequestFailed`] - * and prevent any attempts at paying it once received. The other events may only be generated - * once the invoice has been received. + * the payment prior to receiving the invoice will result in an [`Event::PaymentFailed`] and + * prevent any attempts at paying it once received. * * # Restart Behavior * * If an [`Event::PaymentFailed`] is generated and we restart without first persisting the - * [`ChannelManager`], another [`Event::PaymentFailed`] may be generated; likewise for - * [`Event::InvoiceRequestFailed`]. + * [`ChannelManager`], another [`Event::PaymentFailed`] may be generated. * * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice */ @@ -1209,8 +1245,6 @@ public class ChannelManager extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } Result_ThirtyTwoBytesPaymentSendFailureZ ret_hu_conv = Result_ThirtyTwoBytesPaymentSendFailureZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.add(route); }; - if (this != null) { this.ptrs_to.add(payment_preimage); }; - if (this != null) { this.ptrs_to.add(recipient_onion); }; return ret_hu_conv; } @@ -1233,10 +1267,6 @@ public class ChannelManager extends CommonBase { Reference.reachabilityFence(retry_strategy); if (ret >= 0 && ret <= 4096) { return null; } Result_ThirtyTwoBytesRetryableSendFailureZ ret_hu_conv = Result_ThirtyTwoBytesRetryableSendFailureZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.add(payment_preimage); }; - if (this != null) { this.ptrs_to.add(recipient_onion); }; - if (this != null) { this.ptrs_to.add(route_params); }; - if (this != null) { this.ptrs_to.add(retry_strategy); }; return ret_hu_conv; } @@ -1251,7 +1281,6 @@ public class ChannelManager extends CommonBase { Reference.reachabilityFence(path); if (ret >= 0 && ret <= 4096) { return null; } Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ ret_hu_conv = Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.add(path); }; return ret_hu_conv; } @@ -1270,7 +1299,6 @@ public class ChannelManager extends CommonBase { Reference.reachabilityFence(liquidity_limit_multiplier); if (ret >= 0 && ret <= 4096) { return null; } Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ ret_hu_conv = Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.add(liquidity_limit_multiplier); }; return ret_hu_conv; } @@ -1297,8 +1325,6 @@ public class ChannelManager extends CommonBase { Reference.reachabilityFence(liquidity_limit_multiplier); if (ret >= 0 && ret <= 4096) { return null; } Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ ret_hu_conv = Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.add(route_params); }; - if (this != null) { this.ptrs_to.add(liquidity_limit_multiplier); }; return ret_hu_conv; } @@ -1342,7 +1368,46 @@ public class ChannelManager extends CommonBase { Reference.reachabilityFence(funding_transaction); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.add(temporary_channel_id); }; + return ret_hu_conv; + } + + /** + * Unsafe**: This method does not validate the spent output. It is the caller's + * responsibility to ensure the spent outputs are SegWit, as well as making sure the funding + * transaction has a final absolute locktime, i.e., its locktime is lower than the next block height. + * + * For a safer method, please refer to [`ChannelManager::funding_transaction_generated`]. + * + * Call this in response to a [`Event::FundingGenerationReady`] event. + * + * Note that if this method is called successfully, the funding transaction won't be + * broadcasted and you are expected to broadcast it manually when receiving the + * [`Event::FundingTxBroadcastSafe`] event. + * + * Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided + * for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`]. + * + * May panic if the funding output is duplicative with some other channel (note that this + * should be trivially prevented by using unique funding transaction keys per-channel). + * + * Note to keep the miner incentives aligned in moving the blockchain forward, we recommend + * the wallet software generating the funding transaction to apply anti-fee sniping as + * implemented by Bitcoin Core wallet. See for + * more details. + * + * [`Event::FundingGenerationReady`]: crate::events::Event::FundingGenerationReady + * [`Event::FundingTxBroadcastSafe`]: crate::events::Event::FundingTxBroadcastSafe + * [`Event::ChannelClosed`]: crate::events::Event::ChannelClosed + * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated + */ + public Result_NoneAPIErrorZ unsafe_manual_funding_transaction_generated(org.ldk.structs.ChannelId temporary_channel_id, byte[] counterparty_node_id, org.ldk.structs.OutPoint funding) { + long ret = bindings.ChannelManager_unsafe_manual_funding_transaction_generated(this.ptr, temporary_channel_id.ptr, InternalUtils.check_arr_len(counterparty_node_id, 33), funding.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(temporary_channel_id); + Reference.reachabilityFence(counterparty_node_id); + Reference.reachabilityFence(funding); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); return ret_hu_conv; } @@ -1400,7 +1465,6 @@ public class ChannelManager extends CommonBase { Reference.reachabilityFence(config_update); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); - for (ChannelId channel_ids_conv_11: channel_ids) { if (this != null) { this.ptrs_to.add(channel_ids_conv_11); }; }; if (this != null) { this.ptrs_to.add(config_update); }; return ret_hu_conv; } @@ -1437,7 +1501,6 @@ public class ChannelManager extends CommonBase { Reference.reachabilityFence(config); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); - for (ChannelId channel_ids_conv_11: channel_ids) { if (this != null) { this.ptrs_to.add(channel_ids_conv_11); }; }; if (this != null) { this.ptrs_to.add(config); }; return ret_hu_conv; } @@ -1569,7 +1632,6 @@ public class ChannelManager extends CommonBase { Reference.reachabilityFence(this); Reference.reachabilityFence(payment_hash); Reference.reachabilityFence(failure_code); - if (this != null) { this.ptrs_to.add(failure_code); }; } /** @@ -1694,16 +1756,15 @@ public class ChannelManager extends CommonBase { /** * Creates an [`OfferBuilder`] such that the [`Offer`] it builds is recognized by the - * [`ChannelManager`] when handling [`InvoiceRequest`] messages for the offer. The offer will - * not have an expiration unless otherwise set on the builder. + * [`ChannelManager`] when handling [`InvoiceRequest`] messages for the offer. The offer's + * expiration will be `absolute_expiry` if `Some`, otherwise it will not expire. * * # Privacy * - * Uses [`MessageRouter::create_blinded_paths`] to construct a [`BlindedPath`] for the offer. - * However, if one is not found, uses a one-hop [`BlindedPath`] with - * [`ChannelManager::get_our_node_id`] as the introduction node instead. In the latter case, - * the node must be announced, otherwise, there is no way to find a path to the introduction in - * order to send the [`InvoiceRequest`]. + * Uses [`MessageRouter`] to construct a [`BlindedMessagePath`] for the offer based on the given + * `absolute_expiry` according to [`MAX_SHORT_LIVED_RELATIVE_EXPIRY`]. See those docs for + * privacy implications as well as those of the parameterized [`Router`], which implements + * [`MessageRouter`]. * * Also, uses a derived signing pubkey in the offer for recipient privacy. * @@ -1719,9 +1780,10 @@ public class ChannelManager extends CommonBase { * [`Offer`]: crate::offers::offer::Offer * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest */ - public Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ create_offer_builder() { - long ret = bindings.ChannelManager_create_offer_builder(this.ptr); + public Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ create_offer_builder(org.ldk.structs.Option_u64Z absolute_expiry) { + long ret = bindings.ChannelManager_create_offer_builder(this.ptr, absolute_expiry.ptr); Reference.reachabilityFence(this); + Reference.reachabilityFence(absolute_expiry); if (ret >= 0 && ret <= 4096) { return null; } Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ ret_hu_conv = Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); return ret_hu_conv; @@ -1743,18 +1805,17 @@ public class ChannelManager extends CommonBase { * * To revoke the refund, use [`ChannelManager::abandon_payment`] prior to receiving the * invoice. If abandoned, or an invoice isn't received before expiration, the payment will fail - * with an [`Event::InvoiceRequestFailed`]. + * with an [`Event::PaymentFailed`]. * * If `max_total_routing_fee_msat` is not specified, The default from * [`RouteParameters::from_payment_params_and_value`] is applied. * * # Privacy * - * Uses [`MessageRouter::create_blinded_paths`] to construct a [`BlindedPath`] for the refund. - * However, if one is not found, uses a one-hop [`BlindedPath`] with - * [`ChannelManager::get_our_node_id`] as the introduction node instead. In the latter case, - * the node must be announced, otherwise, there is no way to find a path to the introduction in - * order to send the [`Bolt12Invoice`]. + * Uses [`MessageRouter`] to construct a [`BlindedMessagePath`] for the refund based on the given + * `absolute_expiry` according to [`MAX_SHORT_LIVED_RELATIVE_EXPIRY`]. See those docs for + * privacy implications as well as those of the parameterized [`Router`], which implements + * [`MessageRouter`]. * * Also, uses a derived payer id in the refund for payer privacy. * @@ -1785,8 +1846,6 @@ public class ChannelManager extends CommonBase { Reference.reachabilityFence(max_total_routing_fee_msat); if (ret >= 0 && ret <= 4096) { return null; } Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ ret_hu_conv = Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.add(retry_strategy); }; - if (this != null) { this.ptrs_to.add(max_total_routing_fee_msat); }; return ret_hu_conv; } @@ -1814,14 +1873,13 @@ public class ChannelManager extends CommonBase { * * To revoke the request, use [`ChannelManager::abandon_payment`] prior to receiving the * invoice. If abandoned, or an invoice isn't received in a reasonable amount of time, the - * payment will fail with an [`Event::InvoiceRequestFailed`]. + * payment will fail with an [`Event::PaymentFailed`]. * * # Privacy * - * Uses a one-hop [`BlindedPath`] for the reply path with [`ChannelManager::get_our_node_id`] - * as the introduction node and a derived payer id for payer privacy. As such, currently, the - * node must be announced. Otherwise, there is no way to find a path to the introduction node - * in order to send the [`Bolt12Invoice`]. + * For payer privacy, uses a derived payer id and uses [`MessageRouter::create_blinded_paths`] + * to construct a [`BlindedMessagePath`] for the reply path. For further privacy implications, see the + * docs of the parameterized [`Router`], which implements [`MessageRouter`]. * * # Limitations * @@ -1859,11 +1917,6 @@ public class ChannelManager extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } Result_NoneBolt12SemanticErrorZ ret_hu_conv = Result_NoneBolt12SemanticErrorZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.add(offer); }; - if (this != null) { this.ptrs_to.add(quantity); }; - if (this != null) { this.ptrs_to.add(amount_msats); }; - if (this != null) { this.ptrs_to.add(payer_note); }; - if (this != null) { this.ptrs_to.add(retry_strategy); }; - if (this != null) { this.ptrs_to.add(max_total_routing_fee_msat); }; return ret_hu_conv; } @@ -1872,8 +1925,8 @@ public class ChannelManager extends CommonBase { * message. * * The resulting invoice uses a [`PaymentHash`] recognized by the [`ChannelManager`] and a - * [`BlindedPath`] containing the [`PaymentSecret`] needed to reconstruct the corresponding - * [`PaymentPreimage`]. It is returned purely for informational purposes. + * [`BlindedPaymentPath`] containing the [`PaymentSecret`] needed to reconstruct the + * corresponding [`PaymentPreimage`]. It is returned purely for informational purposes. * * # Limitations * @@ -1941,8 +1994,6 @@ public class ChannelManager extends CommonBase { Reference.reachabilityFence(min_final_cltv_expiry_delta); if (ret >= 0 && ret <= 4096) { return null; } Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ ret_hu_conv = Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.add(min_value_msat); }; - if (this != null) { this.ptrs_to.add(min_final_cltv_expiry_delta); }; return ret_hu_conv; } @@ -2003,8 +2054,6 @@ public class ChannelManager extends CommonBase { Reference.reachabilityFence(min_final_cltv_expiry); if (ret >= 0 && ret <= 4096) { return null; } Result_ThirtyTwoBytesNoneZ ret_hu_conv = Result_ThirtyTwoBytesNoneZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.add(min_value_msat); }; - if (this != null) { this.ptrs_to.add(min_final_cltv_expiry); }; return ret_hu_conv; } @@ -2251,6 +2300,19 @@ public class ChannelManager extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new AsyncPaymentsMessageHandler which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned AsyncPaymentsMessageHandler must be freed before this_arg is + */ + public AsyncPaymentsMessageHandler as_AsyncPaymentsMessageHandler() { + long ret = bindings.ChannelManager_as_AsyncPaymentsMessageHandler(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + AsyncPaymentsMessageHandler ret_hu_conv = new AsyncPaymentsMessageHandler(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + /** * Constructs a new NodeIdLookUp which calls the relevant methods on this_arg. * This copies the `inner` pointer in this_arg and thus the returned NodeIdLookUp must be freed before this_arg is diff --git a/src/main/java/org/ldk/structs/ChannelManagerReadArgs.java b/src/main/java/org/ldk/structs/ChannelManagerReadArgs.java index 614f0825..b0988395 100644 --- a/src/main/java/org/ldk/structs/ChannelManagerReadArgs.java +++ b/src/main/java/org/ldk/structs/ChannelManagerReadArgs.java @@ -276,7 +276,6 @@ public class ChannelManagerReadArgs extends CommonBase { bindings.ChannelManagerReadArgs_set_default_config(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -307,7 +306,6 @@ public class ChannelManagerReadArgs extends CommonBase { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(tx_broadcaster); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(router); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(logger); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(default_config); }; for (ChannelMonitor channel_monitors_conv_16: channel_monitors) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_monitors_conv_16); }; }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChannelMessageHandler.java b/src/main/java/org/ldk/structs/ChannelMessageHandler.java index 3b16cb18..925bd4b7 100644 --- a/src/main/java/org/ldk/structs/ChannelMessageHandler.java +++ b/src/main/java/org/ldk/structs/ChannelMessageHandler.java @@ -376,7 +376,6 @@ public class ChannelMessageHandler extends CommonBase { Option_CVec_ThirtyTwoBytesZZ ret = arg.get_chain_hashes(); Reference.reachabilityFence(arg); long result = ret.clone_ptr(); - if (impl_holder.held != null) { impl_holder.held.ptrs_to.add(ret); }; return result; } }, MessageSendEventsProvider.new_impl(MessageSendEventsProvider_impl).bindings_instance); diff --git a/src/main/java/org/ldk/structs/ChannelMonitor.java b/src/main/java/org/ldk/structs/ChannelMonitor.java index a255bbcf..2148d7af 100644 --- a/src/main/java/org/ldk/structs/ChannelMonitor.java +++ b/src/main/java/org/ldk/structs/ChannelMonitor.java @@ -175,14 +175,19 @@ public class ChannelMonitor extends CommonBase { * An [`EventHandler`] may safely call back to the provider, though this shouldn't be needed in * order to handle these events. * + * Will return a [`ReplayEvent`] error if event handling failed and should eventually be retried. + * * [`SpendableOutputs`]: crate::events::Event::SpendableOutputs * [`BumpTransaction`]: crate::events::Event::BumpTransaction */ - public void process_pending_events(org.ldk.structs.EventHandler handler) { - bindings.ChannelMonitor_process_pending_events(this.ptr, handler.ptr); + public Result_NoneReplayEventZ process_pending_events(org.ldk.structs.EventHandler handler) { + long ret = bindings.ChannelMonitor_process_pending_events(this.ptr, handler.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(handler); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneReplayEventZ ret_hu_conv = Result_NoneReplayEventZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.add(handler); }; + return ret_hu_conv; } /** @@ -501,6 +506,15 @@ public class ChannelMonitor extends CommonBase { if (this != null) { this.ptrs_to.add(logger); }; } + /** + * Returns true if the monitor has pending claim requests that are not fully confirmed yet. + */ + public boolean has_pending_claims() { + boolean ret = bindings.ChannelMonitor_has_pending_claims(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * Triggers rebroadcasts of pending claims from a force-closed channel after a transaction * signature generation failure. diff --git a/src/main/java/org/ldk/structs/ChannelMonitorUpdate.java b/src/main/java/org/ldk/structs/ChannelMonitorUpdate.java index 5579309f..cacb402b 100644 --- a/src/main/java/org/ldk/structs/ChannelMonitorUpdate.java +++ b/src/main/java/org/ldk/structs/ChannelMonitorUpdate.java @@ -102,7 +102,6 @@ public class ChannelMonitorUpdate extends CommonBase { bindings.ChannelMonitorUpdate_set_channel_id(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } long clone_ptr() { diff --git a/src/main/java/org/ldk/structs/ChannelParameters.java b/src/main/java/org/ldk/structs/ChannelParameters.java new file mode 100644 index 00000000..6ebccf7c --- /dev/null +++ b/src/main/java/org/ldk/structs/ChannelParameters.java @@ -0,0 +1,202 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * A subset of [`CommonOpenChannelFields`], containing various parameters which are set by the + * channel initiator and which are not part of the channel funding transaction. + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class ChannelParameters extends CommonBase { + ChannelParameters(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.ChannelParameters_free(ptr); } + } + + /** + * The threshold below which outputs on transactions broadcast by the channel initiator will be + * omitted. + */ + public long get_dust_limit_satoshis() { + long ret = bindings.ChannelParameters_get_dust_limit_satoshis(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * The threshold below which outputs on transactions broadcast by the channel initiator will be + * omitted. + */ + public void set_dust_limit_satoshis(long val) { + bindings.ChannelParameters_set_dust_limit_satoshis(this.ptr, val); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi + */ + public long get_max_htlc_value_in_flight_msat() { + long ret = bindings.ChannelParameters_get_max_htlc_value_in_flight_msat(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi + */ + public void set_max_htlc_value_in_flight_msat(long val) { + bindings.ChannelParameters_set_max_htlc_value_in_flight_msat(this.ptr, val); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * The minimum HTLC size for HTLCs towards the channel initiator, in milli-satoshi + */ + public long get_htlc_minimum_msat() { + long ret = bindings.ChannelParameters_get_htlc_minimum_msat(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * The minimum HTLC size for HTLCs towards the channel initiator, in milli-satoshi + */ + public void set_htlc_minimum_msat(long val) { + bindings.ChannelParameters_set_htlc_minimum_msat(this.ptr, val); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * The feerate for the commitment transaction set by the channel initiator until updated by + * [`UpdateFee`] + */ + public int get_commitment_feerate_sat_per_1000_weight() { + int ret = bindings.ChannelParameters_get_commitment_feerate_sat_per_1000_weight(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * The feerate for the commitment transaction set by the channel initiator until updated by + * [`UpdateFee`] + */ + public void set_commitment_feerate_sat_per_1000_weight(int val) { + bindings.ChannelParameters_set_commitment_feerate_sat_per_1000_weight(this.ptr, val); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * The number of blocks which the non-channel-initator will have to wait to claim on-chain + * funds if they broadcast a commitment transaction. + */ + public short get_to_self_delay() { + short ret = bindings.ChannelParameters_get_to_self_delay(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * The number of blocks which the non-channel-initator will have to wait to claim on-chain + * funds if they broadcast a commitment transaction. + */ + public void set_to_self_delay(short val) { + bindings.ChannelParameters_set_to_self_delay(this.ptr, val); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * The maximum number of pending HTLCs towards the channel initiator. + */ + public short get_max_accepted_htlcs() { + short ret = bindings.ChannelParameters_get_max_accepted_htlcs(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * The maximum number of pending HTLCs towards the channel initiator. + */ + public void set_max_accepted_htlcs(short val) { + bindings.ChannelParameters_set_max_accepted_htlcs(this.ptr, val); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * Constructs a new ChannelParameters given each field + */ + public static ChannelParameters of(long dust_limit_satoshis_arg, long max_htlc_value_in_flight_msat_arg, long htlc_minimum_msat_arg, int commitment_feerate_sat_per_1000_weight_arg, short to_self_delay_arg, short max_accepted_htlcs_arg) { + long ret = bindings.ChannelParameters_new(dust_limit_satoshis_arg, max_htlc_value_in_flight_msat_arg, htlc_minimum_msat_arg, commitment_feerate_sat_per_1000_weight_arg, to_self_delay_arg, max_accepted_htlcs_arg); + Reference.reachabilityFence(dust_limit_satoshis_arg); + Reference.reachabilityFence(max_htlc_value_in_flight_msat_arg); + Reference.reachabilityFence(htlc_minimum_msat_arg); + Reference.reachabilityFence(commitment_feerate_sat_per_1000_weight_arg); + Reference.reachabilityFence(to_self_delay_arg); + Reference.reachabilityFence(max_accepted_htlcs_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelParameters(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + long clone_ptr() { + long ret = bindings.ChannelParameters_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the ChannelParameters + */ + public ChannelParameters clone() { + long ret = bindings.ChannelParameters_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelParameters(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Generates a non-cryptographic 64-bit hash of the ChannelParameters. + */ + public long hash() { + long ret = bindings.ChannelParameters_hash(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + @Override public int hashCode() { + return (int)this.hash(); + } + /** + * Checks if two ChannelParameterss contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public boolean eq(org.ldk.structs.ChannelParameters b) { + boolean ret = bindings.ChannelParameters_eq(this.ptr, b.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(b); + if (this != null) { this.ptrs_to.add(b); }; + return ret; + } + + @Override public boolean equals(Object o) { + if (!(o instanceof ChannelParameters)) return false; + return this.eq((ChannelParameters)o); + } +} diff --git a/src/main/java/org/ldk/structs/ChannelPublicKeys.java b/src/main/java/org/ldk/structs/ChannelPublicKeys.java index 2bec9de0..8b4adc53 100644 --- a/src/main/java/org/ldk/structs/ChannelPublicKeys.java +++ b/src/main/java/org/ldk/structs/ChannelPublicKeys.java @@ -41,7 +41,7 @@ public class ChannelPublicKeys extends CommonBase { } /** - * The base point which is used (with derive_public_revocation_key) to derive per-commitment + * The base point which is used (with [`RevocationKey::from_basepoint`]) to derive per-commitment * revocation keys. This is combined with the per-commitment-secret generated by the * counterparty to create a secret which the counterparty can reveal to revoke previous * states. @@ -56,7 +56,7 @@ public class ChannelPublicKeys extends CommonBase { } /** - * The base point which is used (with derive_public_revocation_key) to derive per-commitment + * The base point which is used (with [`RevocationKey::from_basepoint`]) to derive per-commitment * revocation keys. This is combined with the per-commitment-secret generated by the * counterparty to create a secret which the counterparty can reveal to revoke previous * states. @@ -65,7 +65,6 @@ public class ChannelPublicKeys extends CommonBase { bindings.ChannelPublicKeys_set_revocation_basepoint(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -113,7 +112,6 @@ public class ChannelPublicKeys extends CommonBase { bindings.ChannelPublicKeys_set_delayed_payment_basepoint(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -137,7 +135,6 @@ public class ChannelPublicKeys extends CommonBase { bindings.ChannelPublicKeys_set_htlc_basepoint(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -153,9 +150,6 @@ public class ChannelPublicKeys extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelPublicKeys(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(revocation_basepoint_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(delayed_payment_basepoint_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(htlc_basepoint_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChannelReady.java b/src/main/java/org/ldk/structs/ChannelReady.java index 95364b2c..466beb2d 100644 --- a/src/main/java/org/ldk/structs/ChannelReady.java +++ b/src/main/java/org/ldk/structs/ChannelReady.java @@ -41,7 +41,6 @@ public class ChannelReady extends CommonBase { bindings.ChannelReady_set_channel_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -87,7 +86,6 @@ public class ChannelReady extends CommonBase { bindings.ChannelReady_set_short_channel_id_alias(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -101,8 +99,6 @@ public class ChannelReady extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelReady ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelReady(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(short_channel_id_alias_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChannelReestablish.java b/src/main/java/org/ldk/structs/ChannelReestablish.java index 42c7696c..bd8198f4 100644 --- a/src/main/java/org/ldk/structs/ChannelReestablish.java +++ b/src/main/java/org/ldk/structs/ChannelReestablish.java @@ -41,7 +41,6 @@ public class ChannelReestablish extends CommonBase { bindings.ChannelReestablish_set_channel_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -137,7 +136,6 @@ public class ChannelReestablish extends CommonBase { bindings.ChannelReestablish_set_next_funding_txid(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -154,8 +152,6 @@ public class ChannelReestablish extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelReestablish ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelReestablish(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(next_funding_txid_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChannelSigner.java b/src/main/java/org/ldk/structs/ChannelSigner.java index b5e02934..6874bdf1 100644 --- a/src/main/java/org/ldk/structs/ChannelSigner.java +++ b/src/main/java/org/ldk/structs/ChannelSigner.java @@ -10,6 +10,10 @@ import javax.annotation.Nullable; /** * A trait to handle Lightning channel key material without concretizing the channel type or * the signature mechanism. + * + * Several methods allow error types to be returned to support async signing. This feature + * is not yet complete, and panics may occur in certain situations when returning errors + * for these methods. */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class ChannelSigner extends CommonBase { @@ -42,8 +46,12 @@ public class ChannelSigner extends CommonBase { * Gets the per-commitment point for a specific commitment number * * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards. + * + * If the signer returns `Err`, then the user is responsible for either force-closing the channel + * or calling `ChannelManager::signer_unblocked` (this method is only available when the + * `async_signing` cfg flag is enabled) once the signature is ready. */ - byte[] get_per_commitment_point(long idx); + Result_PublicKeyNoneZ get_per_commitment_point(long idx); /** * Gets the commitment secret for a specific commitment number as part of the revocation process * @@ -54,7 +62,7 @@ public class ChannelSigner extends CommonBase { * * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards. */ - byte[] release_commitment_secret(long idx); + Result__u832NoneZ release_commitment_secret(long idx); /** * Validate the counterparty's signatures on the holder commitment transaction and HTLCs. * @@ -101,16 +109,16 @@ public class ChannelSigner extends CommonBase { public static ChannelSigner new_impl(ChannelSignerInterface arg, ChannelPublicKeys pubkeys) { final LDKChannelSignerHolder impl_holder = new LDKChannelSignerHolder(); impl_holder.held = new ChannelSigner(new bindings.LDKChannelSigner() { - @Override public byte[] get_per_commitment_point(long idx) { - byte[] ret = arg.get_per_commitment_point(idx); + @Override public long get_per_commitment_point(long idx) { + Result_PublicKeyNoneZ ret = arg.get_per_commitment_point(idx); Reference.reachabilityFence(arg); - byte[] result = InternalUtils.check_arr_len(ret, 33); + long result = ret.clone_ptr(); return result; } - @Override public byte[] release_commitment_secret(long idx) { - byte[] ret = arg.release_commitment_secret(idx); + @Override public long release_commitment_secret(long idx) { + Result__u832NoneZ ret = arg.release_commitment_secret(idx); Reference.reachabilityFence(arg); - byte[] result = InternalUtils.check_arr_len(ret, 32); + long result = ret.clone_ptr(); return result; } @Override public long validate_holder_commitment(long holder_tx, byte[][] outbound_htlc_preimages) { @@ -144,12 +152,18 @@ public class ChannelSigner extends CommonBase { * Gets the per-commitment point for a specific commitment number * * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards. + * + * If the signer returns `Err`, then the user is responsible for either force-closing the channel + * or calling `ChannelManager::signer_unblocked` (this method is only available when the + * `async_signing` cfg flag is enabled) once the signature is ready. */ - public byte[] get_per_commitment_point(long idx) { - byte[] ret = bindings.ChannelSigner_get_per_commitment_point(this.ptr, idx); + public Result_PublicKeyNoneZ get_per_commitment_point(long idx) { + long ret = bindings.ChannelSigner_get_per_commitment_point(this.ptr, idx); Reference.reachabilityFence(this); Reference.reachabilityFence(idx); - return ret; + if (ret >= 0 && ret <= 4096) { return null; } + Result_PublicKeyNoneZ ret_hu_conv = Result_PublicKeyNoneZ.constr_from_ptr(ret); + return ret_hu_conv; } /** @@ -162,11 +176,13 @@ public class ChannelSigner extends CommonBase { * * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards. */ - public byte[] release_commitment_secret(long idx) { - byte[] ret = bindings.ChannelSigner_release_commitment_secret(this.ptr, idx); + public Result__u832NoneZ release_commitment_secret(long idx) { + long ret = bindings.ChannelSigner_release_commitment_secret(this.ptr, idx); Reference.reachabilityFence(this); Reference.reachabilityFence(idx); - return ret; + if (ret >= 0 && ret <= 4096) { return null; } + Result__u832NoneZ ret_hu_conv = Result__u832NoneZ.constr_from_ptr(ret); + return ret_hu_conv; } /** diff --git a/src/main/java/org/ldk/structs/ChannelTransactionParameters.java b/src/main/java/org/ldk/structs/ChannelTransactionParameters.java index 17c6ffed..1a8fdffb 100644 --- a/src/main/java/org/ldk/structs/ChannelTransactionParameters.java +++ b/src/main/java/org/ldk/structs/ChannelTransactionParameters.java @@ -43,7 +43,6 @@ public class ChannelTransactionParameters extends CommonBase { bindings.ChannelTransactionParameters_set_holder_pubkeys(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -110,7 +109,6 @@ public class ChannelTransactionParameters extends CommonBase { bindings.ChannelTransactionParameters_set_counterparty_parameters(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -137,7 +135,6 @@ public class ChannelTransactionParameters extends CommonBase { bindings.ChannelTransactionParameters_set_funding_outpoint(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -161,7 +158,6 @@ public class ChannelTransactionParameters extends CommonBase { bindings.ChannelTransactionParameters_set_channel_type_features(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -181,10 +177,6 @@ public class ChannelTransactionParameters extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelTransactionParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTransactionParameters(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(holder_pubkeys_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(counterparty_parameters_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(funding_outpoint_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_type_features_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChannelTypeFeatures.java b/src/main/java/org/ldk/structs/ChannelTypeFeatures.java index 2ca97505..19ae9ccb 100644 --- a/src/main/java/org/ldk/structs/ChannelTypeFeatures.java +++ b/src/main/java/org/ldk/structs/ChannelTypeFeatures.java @@ -29,6 +29,26 @@ public class ChannelTypeFeatures extends CommonBase { if (ptr != 0) { bindings.ChannelTypeFeatures_free(ptr); } } + /** + * Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read + */ + public byte[] write() { + byte[] ret = bindings.ChannelTypeFeatures_write(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write + */ + public static Result_ChannelTypeFeaturesDecodeErrorZ read(byte[] ser) { + long ret = bindings.ChannelTypeFeatures_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ChannelTypeFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelTypeFeaturesDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + /** * Checks if two ChannelTypeFeaturess contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. @@ -76,6 +96,28 @@ public class ChannelTypeFeatures extends CommonBase { @Override public int hashCode() { return (int)this.hash(); } + /** + * Constructs a ChannelTypeFeatures with only static_remotekey set + */ + public static ChannelTypeFeatures only_static_remote_key() { + long ret = bindings.ChannelTypeFeatures_only_static_remote_key(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Constructs a ChannelTypeFeatures with anchors support + */ + public static ChannelTypeFeatures anchors_zero_htlc_fee_and_dependencies() { + long ret = bindings.ChannelTypeFeatures_anchors_zero_htlc_fee_and_dependencies(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + /** * Create a blank Features with no features set */ @@ -87,6 +129,25 @@ public class ChannelTypeFeatures extends CommonBase { return ret_hu_conv; } + /** + * Returns the feature set as a list of bytes, in little-endian. This is in reverse byte order + * from most on-the-wire encodings. + */ + public byte[] le_flags() { + byte[] ret = bindings.ChannelTypeFeatures_le_flags(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Returns true if this `Features` has any optional flags set + */ + public boolean supports_any_optional_bits() { + boolean ret = bindings.ChannelTypeFeatures_supports_any_optional_bits(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * Returns true if this `Features` object contains required features unknown by `other`. */ @@ -98,6 +159,17 @@ public class ChannelTypeFeatures extends CommonBase { return ret; } + /** + * Returns the set of required features unknown by `other`, as their bit position. + */ + public long[] required_unknown_bits_from(org.ldk.structs.ChannelTypeFeatures other) { + long[] ret = bindings.ChannelTypeFeatures_required_unknown_bits_from(this.ptr, other.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(other); + if (this != null) { this.ptrs_to.add(other); }; + return ret; + } + /** * Returns true if this `Features` object contains unknown feature flags which are set as * \"required\". @@ -108,6 +180,15 @@ public class ChannelTypeFeatures extends CommonBase { return ret; } + /** + * Returns true if this `Features` supports any bits which we do not know of + */ + public boolean supports_unknown_bits() { + boolean ret = bindings.ChannelTypeFeatures_supports_unknown_bits(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * Sets a required feature bit. Errors if `bit` is outside the feature range as defined * by [BOLT 9]. @@ -181,23 +262,19 @@ public class ChannelTypeFeatures extends CommonBase { } /** - * Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read + * Unsets the `scid_privacy` feature */ - public byte[] write() { - byte[] ret = bindings.ChannelTypeFeatures_write(this.ptr); + public void clear_scid_privacy() { + bindings.ChannelTypeFeatures_clear_scid_privacy(this.ptr); Reference.reachabilityFence(this); - return ret; } /** - * Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write + * Unsets the `anchors_zero_fee_htlc_tx` feature */ - public static Result_ChannelTypeFeaturesDecodeErrorZ read(byte[] ser) { - long ret = bindings.ChannelTypeFeatures_read(ser); - Reference.reachabilityFence(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_ChannelTypeFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelTypeFeaturesDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; + public void clear_anchors_zero_fee_htlc_tx() { + bindings.ChannelTypeFeatures_clear_anchors_zero_fee_htlc_tx(this.ptr); + Reference.reachabilityFence(this); } /** diff --git a/src/main/java/org/ldk/structs/ChannelUpdate.java b/src/main/java/org/ldk/structs/ChannelUpdate.java index 93f1cd2c..08515e2d 100644 --- a/src/main/java/org/ldk/structs/ChannelUpdate.java +++ b/src/main/java/org/ldk/structs/ChannelUpdate.java @@ -59,7 +59,6 @@ public class ChannelUpdate extends CommonBase { bindings.ChannelUpdate_set_contents(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -72,7 +71,6 @@ public class ChannelUpdate extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUpdate(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(contents_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChannelUpdateInfo.java b/src/main/java/org/ldk/structs/ChannelUpdateInfo.java index 723b7c89..2df40cf6 100644 --- a/src/main/java/org/ldk/structs/ChannelUpdateInfo.java +++ b/src/main/java/org/ldk/structs/ChannelUpdateInfo.java @@ -21,117 +21,116 @@ public class ChannelUpdateInfo extends CommonBase { } /** - * When the last update to the channel direction was issued. - * Value is opaque, as set in the announcement. + * The minimum value, which must be relayed to the next hop via the channel */ - public int get_last_update() { - int ret = bindings.ChannelUpdateInfo_get_last_update(this.ptr); + public long get_htlc_minimum_msat() { + long ret = bindings.ChannelUpdateInfo_get_htlc_minimum_msat(this.ptr); Reference.reachabilityFence(this); return ret; } /** - * When the last update to the channel direction was issued. - * Value is opaque, as set in the announcement. + * The minimum value, which must be relayed to the next hop via the channel */ - public void set_last_update(int val) { - bindings.ChannelUpdateInfo_set_last_update(this.ptr, val); + public void set_htlc_minimum_msat(long val) { + bindings.ChannelUpdateInfo_set_htlc_minimum_msat(this.ptr, val); Reference.reachabilityFence(this); Reference.reachabilityFence(val); } /** - * Whether the channel can be currently used for payments (in this one direction). + * The maximum value which may be relayed to the next hop via the channel. */ - public boolean get_enabled() { - boolean ret = bindings.ChannelUpdateInfo_get_enabled(this.ptr); + public long get_htlc_maximum_msat() { + long ret = bindings.ChannelUpdateInfo_get_htlc_maximum_msat(this.ptr); Reference.reachabilityFence(this); return ret; } /** - * Whether the channel can be currently used for payments (in this one direction). + * The maximum value which may be relayed to the next hop via the channel. */ - public void set_enabled(boolean val) { - bindings.ChannelUpdateInfo_set_enabled(this.ptr, val); + public void set_htlc_maximum_msat(long val) { + bindings.ChannelUpdateInfo_set_htlc_maximum_msat(this.ptr, val); Reference.reachabilityFence(this); Reference.reachabilityFence(val); } /** - * The difference in CLTV values that you must have when routing through this channel. + * Fees charged when the channel is used for routing */ - public short get_cltv_expiry_delta() { - short ret = bindings.ChannelUpdateInfo_get_cltv_expiry_delta(this.ptr); + public RoutingFees get_fees() { + long ret = bindings.ChannelUpdateInfo_get_fees(this.ptr); Reference.reachabilityFence(this); - return ret; + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.RoutingFees ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RoutingFees(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; } /** - * The difference in CLTV values that you must have when routing through this channel. + * Fees charged when the channel is used for routing */ - public void set_cltv_expiry_delta(short val) { - bindings.ChannelUpdateInfo_set_cltv_expiry_delta(this.ptr, val); + public void set_fees(org.ldk.structs.RoutingFees val) { + bindings.ChannelUpdateInfo_set_fees(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); } /** - * The minimum value, which must be relayed to the next hop via the channel + * When the last update to the channel direction was issued. + * Value is opaque, as set in the announcement. */ - public long get_htlc_minimum_msat() { - long ret = bindings.ChannelUpdateInfo_get_htlc_minimum_msat(this.ptr); + public int get_last_update() { + int ret = bindings.ChannelUpdateInfo_get_last_update(this.ptr); Reference.reachabilityFence(this); return ret; } /** - * The minimum value, which must be relayed to the next hop via the channel + * When the last update to the channel direction was issued. + * Value is opaque, as set in the announcement. */ - public void set_htlc_minimum_msat(long val) { - bindings.ChannelUpdateInfo_set_htlc_minimum_msat(this.ptr, val); + public void set_last_update(int val) { + bindings.ChannelUpdateInfo_set_last_update(this.ptr, val); Reference.reachabilityFence(this); Reference.reachabilityFence(val); } /** - * The maximum value which may be relayed to the next hop via the channel. + * The difference in CLTV values that you must have when routing through this channel. */ - public long get_htlc_maximum_msat() { - long ret = bindings.ChannelUpdateInfo_get_htlc_maximum_msat(this.ptr); + public short get_cltv_expiry_delta() { + short ret = bindings.ChannelUpdateInfo_get_cltv_expiry_delta(this.ptr); Reference.reachabilityFence(this); return ret; } /** - * The maximum value which may be relayed to the next hop via the channel. + * The difference in CLTV values that you must have when routing through this channel. */ - public void set_htlc_maximum_msat(long val) { - bindings.ChannelUpdateInfo_set_htlc_maximum_msat(this.ptr, val); + public void set_cltv_expiry_delta(short val) { + bindings.ChannelUpdateInfo_set_cltv_expiry_delta(this.ptr, val); Reference.reachabilityFence(this); Reference.reachabilityFence(val); } /** - * Fees charged when the channel is used for routing + * Whether the channel can be currently used for payments (in this one direction). */ - public RoutingFees get_fees() { - long ret = bindings.ChannelUpdateInfo_get_fees(this.ptr); + public boolean get_enabled() { + boolean ret = bindings.ChannelUpdateInfo_get_enabled(this.ptr); Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.RoutingFees ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RoutingFees(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - return ret_hu_conv; + return ret; } /** - * Fees charged when the channel is used for routing + * Whether the channel can be currently used for payments (in this one direction). */ - public void set_fees(org.ldk.structs.RoutingFees val) { - bindings.ChannelUpdateInfo_set_fees(this.ptr, val.ptr); + public void set_enabled(boolean val) { + bindings.ChannelUpdateInfo_set_enabled(this.ptr, val); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -164,7 +163,6 @@ public class ChannelUpdateInfo extends CommonBase { bindings.ChannelUpdateInfo_set_last_update_message(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -172,20 +170,18 @@ public class ChannelUpdateInfo extends CommonBase { * * Note that last_update_message_arg (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public static ChannelUpdateInfo of(int last_update_arg, boolean enabled_arg, short cltv_expiry_delta_arg, long htlc_minimum_msat_arg, long htlc_maximum_msat_arg, org.ldk.structs.RoutingFees fees_arg, @Nullable org.ldk.structs.ChannelUpdate last_update_message_arg) { - long ret = bindings.ChannelUpdateInfo_new(last_update_arg, enabled_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, fees_arg.ptr, last_update_message_arg == null ? 0 : last_update_message_arg.ptr); - Reference.reachabilityFence(last_update_arg); - Reference.reachabilityFence(enabled_arg); - Reference.reachabilityFence(cltv_expiry_delta_arg); + public static ChannelUpdateInfo of(long htlc_minimum_msat_arg, long htlc_maximum_msat_arg, org.ldk.structs.RoutingFees fees_arg, int last_update_arg, short cltv_expiry_delta_arg, boolean enabled_arg, @Nullable org.ldk.structs.ChannelUpdate last_update_message_arg) { + long ret = bindings.ChannelUpdateInfo_new(htlc_minimum_msat_arg, htlc_maximum_msat_arg, fees_arg.ptr, last_update_arg, cltv_expiry_delta_arg, enabled_arg, last_update_message_arg == null ? 0 : last_update_message_arg.ptr); Reference.reachabilityFence(htlc_minimum_msat_arg); Reference.reachabilityFence(htlc_maximum_msat_arg); Reference.reachabilityFence(fees_arg); + Reference.reachabilityFence(last_update_arg); + Reference.reachabilityFence(cltv_expiry_delta_arg); + Reference.reachabilityFence(enabled_arg); Reference.reachabilityFence(last_update_message_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelUpdateInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUpdateInfo(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(fees_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(last_update_message_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChannelUsage.java b/src/main/java/org/ldk/structs/ChannelUsage.java index 0aba7c6c..113818d2 100644 --- a/src/main/java/org/ldk/structs/ChannelUsage.java +++ b/src/main/java/org/ldk/structs/ChannelUsage.java @@ -77,7 +77,6 @@ public class ChannelUsage extends CommonBase { bindings.ChannelUsage_set_effective_capacity(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -91,7 +90,6 @@ public class ChannelUsage extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelUsage ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUsage(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(effective_capacity_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ClaimedHTLC.java b/src/main/java/org/ldk/structs/ClaimedHTLC.java index fdb68c06..4677c3de 100644 --- a/src/main/java/org/ldk/structs/ClaimedHTLC.java +++ b/src/main/java/org/ldk/structs/ClaimedHTLC.java @@ -39,7 +39,6 @@ public class ClaimedHTLC extends CommonBase { bindings.ClaimedHTLC_set_channel_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -158,7 +157,6 @@ public class ClaimedHTLC extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ClaimedHTLC ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ClaimedHTLC(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ClosingSigned.java b/src/main/java/org/ldk/structs/ClosingSigned.java index f2bb6b5a..f79fa11c 100644 --- a/src/main/java/org/ldk/structs/ClosingSigned.java +++ b/src/main/java/org/ldk/structs/ClosingSigned.java @@ -41,7 +41,6 @@ public class ClosingSigned extends CommonBase { bindings.ClosingSigned_set_channel_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -106,7 +105,6 @@ public class ClosingSigned extends CommonBase { bindings.ClosingSigned_set_fee_range(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -123,8 +121,6 @@ public class ClosingSigned extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ClosingSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ClosingSigned(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(fee_range_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ClosingTransaction.java b/src/main/java/org/ldk/structs/ClosingTransaction.java index 8dbc3a8e..f2df475a 100644 --- a/src/main/java/org/ldk/structs/ClosingTransaction.java +++ b/src/main/java/org/ldk/structs/ClosingTransaction.java @@ -84,7 +84,6 @@ public class ClosingTransaction extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ClosingTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ClosingTransaction(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(funding_outpoint); }; return ret_hu_conv; } @@ -119,7 +118,6 @@ public class ClosingTransaction extends CommonBase { Reference.reachabilityFence(funding_outpoint); if (ret >= 0 && ret <= 4096) { return null; } Result_TrustedClosingTransactionNoneZ ret_hu_conv = Result_TrustedClosingTransactionNoneZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.add(funding_outpoint); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ClosureReason.java b/src/main/java/org/ldk/structs/ClosureReason.java index 77aec65d..7547bcae 100644 --- a/src/main/java/org/ldk/structs/ClosureReason.java +++ b/src/main/java/org/ldk/structs/ClosureReason.java @@ -60,6 +60,9 @@ public class ClosureReason extends CommonBase { if (raw_val.getClass() == bindings.LDKClosureReason.HTLCsTimedOut.class) { return new HTLCsTimedOut(ptr, (bindings.LDKClosureReason.HTLCsTimedOut)raw_val); } + if (raw_val.getClass() == bindings.LDKClosureReason.PeerFeerateTooLow.class) { + return new PeerFeerateTooLow(ptr, (bindings.LDKClosureReason.PeerFeerateTooLow)raw_val); + } assert false; return null; // Unreachable without extending the (internal) bindings interface } @@ -94,8 +97,27 @@ public class ClosureReason extends CommonBase { * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel. */ public final static class HolderForceClosed extends ClosureReason { + /** + * Whether or not the latest transaction was broadcasted when the channel was force + * closed. + * + * Channels closed using [`ChannelManager::force_close_broadcasting_latest_txn`] will have + * this field set to true, whereas channels closed using [`ChannelManager::force_close_without_broadcasting_txn`] + * or force-closed prior to being funded will have this field set to false. + * + * This will be `None` for objects generated or written by LDK 0.0.123 and + * earlier. + * + * [`ChannelManager::force_close_broadcasting_latest_txn`]: crate::ln::channelmanager::ChannelManager::force_close_broadcasting_latest_txn. + * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn. + */ + public final org.ldk.structs.Option_boolZ broadcasted_latest_txn; private HolderForceClosed(long ptr, bindings.LDKClosureReason.HolderForceClosed obj) { super(null, ptr); + long broadcasted_latest_txn = obj.broadcasted_latest_txn; + org.ldk.structs.Option_boolZ broadcasted_latest_txn_hu_conv = org.ldk.structs.Option_boolZ.constr_from_ptr(broadcasted_latest_txn); + if (broadcasted_latest_txn_hu_conv != null) { broadcasted_latest_txn_hu_conv.ptrs_to.add(this); }; + this.broadcasted_latest_txn = broadcasted_latest_txn_hu_conv; } } /** @@ -217,6 +239,32 @@ public class ClosureReason extends CommonBase { super(null, ptr); } } + /** + * Our peer provided a feerate which violated our required minimum (fetched from our + * [`FeeEstimator`] either as [`ConfirmationTarget::MinAllowedAnchorChannelRemoteFee`] or + * [`ConfirmationTarget::MinAllowedNonAnchorChannelRemoteFee`]). + * + * [`FeeEstimator`]: crate::chain::chaininterface::FeeEstimator + * [`ConfirmationTarget::MinAllowedAnchorChannelRemoteFee`]: crate::chain::chaininterface::ConfirmationTarget::MinAllowedAnchorChannelRemoteFee + * [`ConfirmationTarget::MinAllowedNonAnchorChannelRemoteFee`]: crate::chain::chaininterface::ConfirmationTarget::MinAllowedNonAnchorChannelRemoteFee + */ + public final static class PeerFeerateTooLow extends ClosureReason { + /** + * The feerate on our channel set by our peer. + */ + public final int peer_feerate_sat_per_kw; + /** + * The required feerate we enforce, from our [`FeeEstimator`]. + * + * [`FeeEstimator`]: crate::chain::chaininterface::FeeEstimator + */ + public final int required_feerate_sat_per_kw; + private PeerFeerateTooLow(long ptr, bindings.LDKClosureReason.PeerFeerateTooLow obj) { + super(null, ptr); + this.peer_feerate_sat_per_kw = obj.peer_feerate_sat_per_kw; + this.required_feerate_sat_per_kw = obj.required_feerate_sat_per_kw; + } + } long clone_ptr() { long ret = bindings.ClosureReason_clone_ptr(this.ptr); Reference.reachabilityFence(this); @@ -244,15 +292,15 @@ public class ClosureReason extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ClosureReason ret_hu_conv = org.ldk.structs.ClosureReason.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(peer_msg); }; return ret_hu_conv; } /** * Utility method to constructs a new HolderForceClosed-variant ClosureReason */ - public static ClosureReason holder_force_closed() { - long ret = bindings.ClosureReason_holder_force_closed(); + public static ClosureReason holder_force_closed(org.ldk.structs.Option_boolZ broadcasted_latest_txn) { + long ret = bindings.ClosureReason_holder_force_closed(broadcasted_latest_txn.ptr); + Reference.reachabilityFence(broadcasted_latest_txn); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ClosureReason ret_hu_conv = org.ldk.structs.ClosureReason.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; @@ -381,6 +429,19 @@ public class ClosureReason extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new PeerFeerateTooLow-variant ClosureReason + */ + public static ClosureReason peer_feerate_too_low(int peer_feerate_sat_per_kw, int required_feerate_sat_per_kw) { + long ret = bindings.ClosureReason_peer_feerate_too_low(peer_feerate_sat_per_kw, required_feerate_sat_per_kw); + Reference.reachabilityFence(peer_feerate_sat_per_kw); + Reference.reachabilityFence(required_feerate_sat_per_kw); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ClosureReason ret_hu_conv = org.ldk.structs.ClosureReason.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + /** * Checks if two ClosureReasons contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. diff --git a/src/main/java/org/ldk/structs/CoinSelection.java b/src/main/java/org/ldk/structs/CoinSelection.java index 182ed5ec..e7131a56 100644 --- a/src/main/java/org/ldk/structs/CoinSelection.java +++ b/src/main/java/org/ldk/structs/CoinSelection.java @@ -47,7 +47,6 @@ public class CoinSelection extends CommonBase { bindings.CoinSelection_set_confirmed_utxos(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_6 -> val_conv_6.ptr).toArray() : null); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - for (Utxo val_conv_6: val) { if (this != null) { this.ptrs_to.add(val_conv_6); }; }; } /** @@ -75,7 +74,6 @@ public class CoinSelection extends CommonBase { bindings.CoinSelection_set_change_output(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -88,8 +86,6 @@ public class CoinSelection extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.CoinSelection ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CoinSelection(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - for (Utxo confirmed_utxos_arg_conv_6: confirmed_utxos_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(confirmed_utxos_arg_conv_6); }; }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(change_output_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/CoinSelectionSource.java b/src/main/java/org/ldk/structs/CoinSelectionSource.java index 47b28f5c..fd329760 100644 --- a/src/main/java/org/ldk/structs/CoinSelectionSource.java +++ b/src/main/java/org/ldk/structs/CoinSelectionSource.java @@ -149,7 +149,6 @@ public class CoinSelectionSource extends CommonBase { Reference.reachabilityFence(target_feerate_sat_per_1000_weight); if (ret >= 0 && ret <= 4096) { return null; } Result_CoinSelectionNoneZ ret_hu_conv = Result_CoinSelectionNoneZ.constr_from_ptr(ret); - for (Input must_spend_conv_7: must_spend) { if (this != null) { this.ptrs_to.add(must_spend_conv_7); }; }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/CommitmentSigned.java b/src/main/java/org/ldk/structs/CommitmentSigned.java index d9f6f2df..3dc6de04 100644 --- a/src/main/java/org/ldk/structs/CommitmentSigned.java +++ b/src/main/java/org/ldk/structs/CommitmentSigned.java @@ -41,7 +41,6 @@ public class CommitmentSigned extends CommonBase { bindings.CommitmentSigned_set_channel_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -82,18 +81,46 @@ public class CommitmentSigned extends CommonBase { Reference.reachabilityFence(val); } + /** + * Optional batch size and other parameters + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + @Nullable + public CommitmentSignedBatch get_batch() { + long ret = bindings.CommitmentSigned_get_batch(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.CommitmentSignedBatch ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CommitmentSignedBatch(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Optional batch size and other parameters + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public void set_batch(@Nullable org.ldk.structs.CommitmentSignedBatch val) { + bindings.CommitmentSigned_set_batch(this.ptr, val == null ? 0 : val.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + /** * Constructs a new CommitmentSigned given each field + * + * Note that batch_arg (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public static CommitmentSigned of(org.ldk.structs.ChannelId channel_id_arg, byte[] signature_arg, byte[][] htlc_signatures_arg) { - long ret = bindings.CommitmentSigned_new(channel_id_arg.ptr, InternalUtils.check_arr_len(signature_arg, 64), htlc_signatures_arg != null ? Arrays.stream(htlc_signatures_arg).map(htlc_signatures_arg_conv_8 -> InternalUtils.check_arr_len(htlc_signatures_arg_conv_8, 64)).toArray(byte[][]::new) : null); + public static CommitmentSigned of(org.ldk.structs.ChannelId channel_id_arg, byte[] signature_arg, byte[][] htlc_signatures_arg, @Nullable org.ldk.structs.CommitmentSignedBatch batch_arg) { + long ret = bindings.CommitmentSigned_new(channel_id_arg.ptr, InternalUtils.check_arr_len(signature_arg, 64), htlc_signatures_arg != null ? Arrays.stream(htlc_signatures_arg).map(htlc_signatures_arg_conv_8 -> InternalUtils.check_arr_len(htlc_signatures_arg_conv_8, 64)).toArray(byte[][]::new) : null, batch_arg == null ? 0 : batch_arg.ptr); Reference.reachabilityFence(channel_id_arg); Reference.reachabilityFence(signature_arg); Reference.reachabilityFence(htlc_signatures_arg); + Reference.reachabilityFence(batch_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.CommitmentSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CommitmentSigned(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/CommitmentSignedBatch.java b/src/main/java/org/ldk/structs/CommitmentSignedBatch.java new file mode 100644 index 00000000..a70e771b --- /dev/null +++ b/src/main/java/org/ldk/structs/CommitmentSignedBatch.java @@ -0,0 +1,139 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * Optional batch parameters for `commitment_signed` message. + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class CommitmentSignedBatch extends CommonBase { + CommitmentSignedBatch(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.CommitmentSignedBatch_free(ptr); } + } + + /** + * Batch size N: all N `commitment_signed` messages must be received before being processed + */ + public short get_batch_size() { + short ret = bindings.CommitmentSignedBatch_get_batch_size(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Batch size N: all N `commitment_signed` messages must be received before being processed + */ + public void set_batch_size(short val) { + bindings.CommitmentSignedBatch_set_batch_size(this.ptr, val); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * The funding transaction, to discriminate among multiple pending funding transactions (e.g. in case of splicing) + */ + public byte[] get_funding_txid() { + byte[] ret = bindings.CommitmentSignedBatch_get_funding_txid(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * The funding transaction, to discriminate among multiple pending funding transactions (e.g. in case of splicing) + */ + public void set_funding_txid(byte[] val) { + bindings.CommitmentSignedBatch_set_funding_txid(this.ptr, InternalUtils.check_arr_len(val, 32)); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * Constructs a new CommitmentSignedBatch given each field + */ + public static CommitmentSignedBatch of(short batch_size_arg, byte[] funding_txid_arg) { + long ret = bindings.CommitmentSignedBatch_new(batch_size_arg, InternalUtils.check_arr_len(funding_txid_arg, 32)); + Reference.reachabilityFence(batch_size_arg); + Reference.reachabilityFence(funding_txid_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.CommitmentSignedBatch ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CommitmentSignedBatch(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + long clone_ptr() { + long ret = bindings.CommitmentSignedBatch_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the CommitmentSignedBatch + */ + public CommitmentSignedBatch clone() { + long ret = bindings.CommitmentSignedBatch_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.CommitmentSignedBatch ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CommitmentSignedBatch(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Generates a non-cryptographic 64-bit hash of the CommitmentSignedBatch. + */ + public long hash() { + long ret = bindings.CommitmentSignedBatch_hash(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + @Override public int hashCode() { + return (int)this.hash(); + } + /** + * Checks if two CommitmentSignedBatchs contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public boolean eq(org.ldk.structs.CommitmentSignedBatch b) { + boolean ret = bindings.CommitmentSignedBatch_eq(this.ptr, b.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(b); + if (this != null) { this.ptrs_to.add(b); }; + return ret; + } + + @Override public boolean equals(Object o) { + if (!(o instanceof CommitmentSignedBatch)) return false; + return this.eq((CommitmentSignedBatch)o); + } + /** + * Serialize the CommitmentSignedBatch object into a byte array which can be read by CommitmentSignedBatch_read + */ + public byte[] write() { + byte[] ret = bindings.CommitmentSignedBatch_write(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Read a CommitmentSignedBatch from a byte array, created by CommitmentSignedBatch_write + */ + public static Result_CommitmentSignedBatchDecodeErrorZ read(byte[] ser) { + long ret = bindings.CommitmentSignedBatch_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_CommitmentSignedBatchDecodeErrorZ ret_hu_conv = Result_CommitmentSignedBatchDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/CommitmentUpdate.java b/src/main/java/org/ldk/structs/CommitmentUpdate.java index 7ee8b0b2..e14c7126 100644 --- a/src/main/java/org/ldk/structs/CommitmentUpdate.java +++ b/src/main/java/org/ldk/structs/CommitmentUpdate.java @@ -45,7 +45,6 @@ public class CommitmentUpdate extends CommonBase { bindings.CommitmentUpdate_set_update_add_htlcs(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_15 -> val_conv_15.ptr).toArray() : null); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - for (UpdateAddHTLC val_conv_15: val) { if (this != null) { this.ptrs_to.add(val_conv_15); }; }; } /** @@ -72,7 +71,6 @@ public class CommitmentUpdate extends CommonBase { bindings.CommitmentUpdate_set_update_fulfill_htlcs(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_19 -> val_conv_19.ptr).toArray() : null); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - for (UpdateFulfillHTLC val_conv_19: val) { if (this != null) { this.ptrs_to.add(val_conv_19); }; }; } /** @@ -99,7 +97,6 @@ public class CommitmentUpdate extends CommonBase { bindings.CommitmentUpdate_set_update_fail_htlcs(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_16 -> val_conv_16.ptr).toArray() : null); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - for (UpdateFailHTLC val_conv_16: val) { if (this != null) { this.ptrs_to.add(val_conv_16); }; }; } /** @@ -126,7 +123,6 @@ public class CommitmentUpdate extends CommonBase { bindings.CommitmentUpdate_set_update_fail_malformed_htlcs(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_25 -> val_conv_25.ptr).toArray() : null); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - for (UpdateFailMalformedHTLC val_conv_25: val) { if (this != null) { this.ptrs_to.add(val_conv_25); }; }; } /** @@ -153,7 +149,6 @@ public class CommitmentUpdate extends CommonBase { bindings.CommitmentUpdate_set_update_fee(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -175,7 +170,6 @@ public class CommitmentUpdate extends CommonBase { bindings.CommitmentUpdate_set_commitment_signed(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -194,12 +188,6 @@ public class CommitmentUpdate extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.CommitmentUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CommitmentUpdate(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - for (UpdateAddHTLC update_add_htlcs_arg_conv_15: update_add_htlcs_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(update_add_htlcs_arg_conv_15); }; }; - for (UpdateFulfillHTLC update_fulfill_htlcs_arg_conv_19: update_fulfill_htlcs_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(update_fulfill_htlcs_arg_conv_19); }; }; - for (UpdateFailHTLC update_fail_htlcs_arg_conv_16: update_fail_htlcs_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(update_fail_htlcs_arg_conv_16); }; }; - for (UpdateFailMalformedHTLC update_fail_malformed_htlcs_arg_conv_25: update_fail_malformed_htlcs_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(update_fail_malformed_htlcs_arg_conv_25); }; }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(update_fee_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(commitment_signed_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/CommonAcceptChannelFields.java b/src/main/java/org/ldk/structs/CommonAcceptChannelFields.java index 398ae349..c144f439 100644 --- a/src/main/java/org/ldk/structs/CommonAcceptChannelFields.java +++ b/src/main/java/org/ldk/structs/CommonAcceptChannelFields.java @@ -41,7 +41,6 @@ public class CommonAcceptChannelFields extends CommonBase { bindings.CommonAcceptChannelFields_set_temporary_channel_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -287,7 +286,6 @@ public class CommonAcceptChannelFields extends CommonBase { bindings.CommonAcceptChannelFields_set_shutdown_scriptpubkey(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -324,7 +322,6 @@ public class CommonAcceptChannelFields extends CommonBase { bindings.CommonAcceptChannelFields_set_channel_type(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -352,9 +349,6 @@ public class CommonAcceptChannelFields extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.CommonAcceptChannelFields ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CommonAcceptChannelFields(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(temporary_channel_id_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(shutdown_scriptpubkey_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_type_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/CommonOpenChannelFields.java b/src/main/java/org/ldk/structs/CommonOpenChannelFields.java index 91ef7bf4..6e24ae65 100644 --- a/src/main/java/org/ldk/structs/CommonOpenChannelFields.java +++ b/src/main/java/org/ldk/structs/CommonOpenChannelFields.java @@ -63,7 +63,6 @@ public class CommonOpenChannelFields extends CommonBase { bindings.CommonOpenChannelFields_set_temporary_channel_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -349,7 +348,6 @@ public class CommonOpenChannelFields extends CommonBase { bindings.CommonOpenChannelFields_set_shutdown_scriptpubkey(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -382,7 +380,6 @@ public class CommonOpenChannelFields extends CommonBase { bindings.CommonOpenChannelFields_set_channel_type(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -413,9 +410,6 @@ public class CommonOpenChannelFields extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.CommonOpenChannelFields ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CommonOpenChannelFields(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(temporary_channel_id_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(shutdown_scriptpubkey_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_type_arg); }; return ret_hu_conv; } @@ -466,4 +460,16 @@ public class CommonOpenChannelFields extends CommonBase { if (!(o instanceof CommonOpenChannelFields)) return false; return this.eq((CommonOpenChannelFields)o); } + /** + * The [`ChannelParameters`] for this channel. + */ + public ChannelParameters channel_parameters() { + long ret = bindings.CommonOpenChannelFields_channel_parameters(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelParameters(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/CounterpartyChannelTransactionParameters.java b/src/main/java/org/ldk/structs/CounterpartyChannelTransactionParameters.java index 4d46bb4a..ffd83de4 100644 --- a/src/main/java/org/ldk/structs/CounterpartyChannelTransactionParameters.java +++ b/src/main/java/org/ldk/structs/CounterpartyChannelTransactionParameters.java @@ -39,7 +39,6 @@ public class CounterpartyChannelTransactionParameters extends CommonBase { bindings.CounterpartyChannelTransactionParameters_set_pubkeys(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -70,7 +69,6 @@ public class CounterpartyChannelTransactionParameters extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.CounterpartyChannelTransactionParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CounterpartyChannelTransactionParameters(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(pubkeys_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/CustomMessageHandler.java b/src/main/java/org/ldk/structs/CustomMessageHandler.java index 5ca8853c..1a7cfdd6 100644 --- a/src/main/java/org/ldk/structs/CustomMessageHandler.java +++ b/src/main/java/org/ldk/structs/CustomMessageHandler.java @@ -57,6 +57,18 @@ public class CustomMessageHandler extends CommonBase { * connection to the node exists, then the message is simply not sent. */ TwoTuple_PublicKeyTypeZ[] get_and_clear_pending_msg(); + /** + * Indicates a peer disconnected. + */ + void peer_disconnected(byte[] their_node_id); + /** + * Handle a peer connecting. + * + * May return an `Err(())` if the features the peer supports are not sufficient to communicate + * with us. Implementors should be somewhat conservative about doing so, however, as other + * message handlers may still wish to communicate with this peer. + */ + Result_NoneNoneZ peer_connected(byte[] their_node_id, Init msg, boolean inbound); /** * Gets the node feature flags which this handler itself supports. All available handlers are * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`] @@ -92,6 +104,17 @@ public class CustomMessageHandler extends CommonBase { long[] result = ret != null ? Arrays.stream(ret).mapToLong(ret_conv_25 -> ret_conv_25.clone_ptr()).toArray() : null; return result; } + @Override public void peer_disconnected(byte[] their_node_id) { + arg.peer_disconnected(their_node_id); + Reference.reachabilityFence(arg); + } + @Override public long peer_connected(byte[] their_node_id, long msg, boolean inbound) { + org.ldk.structs.Init msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.Init(null, msg); } + Result_NoneNoneZ ret = arg.peer_connected(their_node_id, msg_hu_conv, inbound); + Reference.reachabilityFence(arg); + long result = ret.clone_ptr(); + return result; + } @Override public long provided_node_features() { NodeFeatures ret = arg.provided_node_features(); Reference.reachabilityFence(arg); @@ -152,6 +175,34 @@ public class CustomMessageHandler extends CommonBase { return ret_conv_25_arr; } + /** + * Indicates a peer disconnected. + */ + public void peer_disconnected(byte[] their_node_id) { + bindings.CustomMessageHandler_peer_disconnected(this.ptr, InternalUtils.check_arr_len(their_node_id, 33)); + Reference.reachabilityFence(this); + Reference.reachabilityFence(their_node_id); + } + + /** + * Handle a peer connecting. + * + * May return an `Err(())` if the features the peer supports are not sufficient to communicate + * with us. Implementors should be somewhat conservative about doing so, however, as other + * message handlers may still wish to communicate with this peer. + */ + public Result_NoneNoneZ peer_connected(byte[] their_node_id, org.ldk.structs.Init msg, boolean inbound) { + long ret = bindings.CustomMessageHandler_peer_connected(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg.ptr, inbound); + Reference.reachabilityFence(this); + Reference.reachabilityFence(their_node_id); + Reference.reachabilityFence(msg); + Reference.reachabilityFence(inbound); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.add(msg); }; + return ret_hu_conv; + } + /** * Gets the node feature flags which this handler itself supports. All available handlers are * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`] diff --git a/src/main/java/org/ldk/structs/CustomOnionMessageHandler.java b/src/main/java/org/ldk/structs/CustomOnionMessageHandler.java index 6a1e2be4..24cf7357 100644 --- a/src/main/java/org/ldk/structs/CustomOnionMessageHandler.java +++ b/src/main/java/org/ldk/structs/CustomOnionMessageHandler.java @@ -50,8 +50,10 @@ public class CustomOnionMessageHandler extends CommonBase { * Called with the custom message that was received, returning a response to send, if any. * * The returned [`Self::CustomMessage`], if any, is enqueued to be sent by [`OnionMessenger`]. + * + * Note that responder (or a relevant inner pointer) may be NULL or all-0s to represent None */ - Option_OnionMessageContentsZ handle_custom_message(OnionMessageContents msg); + Option_C2Tuple_OnionMessageContentsResponseInstructionZZ handle_custom_message(OnionMessageContents message, Option_CVec_u8ZZ context, Responder responder); /** * Read a custom message of type `message_type` from `buffer`, returning `Ok(None)` if the * message type is unknown. @@ -63,19 +65,22 @@ public class CustomOnionMessageHandler extends CommonBase { * Typically, this is used for messages initiating a message flow rather than in response to * another message. The latter should use the return value of [`Self::handle_custom_message`]. */ - ThreeTuple_OnionMessageContentsDestinationBlindedPathZ[] release_pending_custom_messages(); + TwoTuple_OnionMessageContentsMessageSendInstructionsZ[] release_pending_custom_messages(); } private static class LDKCustomOnionMessageHandlerHolder { CustomOnionMessageHandler held; } public static CustomOnionMessageHandler new_impl(CustomOnionMessageHandlerInterface arg) { final LDKCustomOnionMessageHandlerHolder impl_holder = new LDKCustomOnionMessageHandlerHolder(); impl_holder.held = new CustomOnionMessageHandler(new bindings.LDKCustomOnionMessageHandler() { - @Override public long handle_custom_message(long msg) { - OnionMessageContents ret_hu_conv = new OnionMessageContents(null, msg); + @Override public long handle_custom_message(long message, long context, long responder) { + OnionMessageContents ret_hu_conv = new OnionMessageContents(null, message); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - Option_OnionMessageContentsZ ret = arg.handle_custom_message(ret_hu_conv); + org.ldk.structs.Option_CVec_u8ZZ context_hu_conv = org.ldk.structs.Option_CVec_u8ZZ.constr_from_ptr(context); + if (context_hu_conv != null) { context_hu_conv.ptrs_to.add(this); }; + org.ldk.structs.Responder responder_hu_conv = null; if (responder < 0 || responder > 4096) { responder_hu_conv = new org.ldk.structs.Responder(null, responder); } + if (responder_hu_conv != null) { responder_hu_conv.ptrs_to.add(this); }; + Option_C2Tuple_OnionMessageContentsResponseInstructionZZ ret = arg.handle_custom_message(ret_hu_conv, context_hu_conv, responder_hu_conv); Reference.reachabilityFence(arg); long result = ret.clone_ptr(); - if (impl_holder.held != null) { impl_holder.held.ptrs_to.add(ret); }; return result; } @Override public long read_custom_message(long message_type, byte[] buffer) { @@ -85,9 +90,9 @@ public class CustomOnionMessageHandler extends CommonBase { return result; } @Override public long[] release_pending_custom_messages() { - ThreeTuple_OnionMessageContentsDestinationBlindedPathZ[] ret = arg.release_pending_custom_messages(); + TwoTuple_OnionMessageContentsMessageSendInstructionsZ[] ret = arg.release_pending_custom_messages(); Reference.reachabilityFence(arg); - long[] result = ret != null ? Arrays.stream(ret).mapToLong(ret_conv_56 -> ret_conv_56.clone_ptr()).toArray() : null; + long[] result = ret != null ? Arrays.stream(ret).mapToLong(ret_conv_55 -> ret_conv_55.clone_ptr()).toArray() : null; return result; } }); @@ -97,15 +102,19 @@ public class CustomOnionMessageHandler extends CommonBase { * Called with the custom message that was received, returning a response to send, if any. * * The returned [`Self::CustomMessage`], if any, is enqueued to be sent by [`OnionMessenger`]. + * + * Note that responder (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public Option_OnionMessageContentsZ handle_custom_message(org.ldk.structs.OnionMessageContents msg) { - long ret = bindings.CustomOnionMessageHandler_handle_custom_message(this.ptr, msg.ptr); + public Option_C2Tuple_OnionMessageContentsResponseInstructionZZ handle_custom_message(org.ldk.structs.OnionMessageContents message, org.ldk.structs.Option_CVec_u8ZZ context, @Nullable org.ldk.structs.Responder responder) { + long ret = bindings.CustomOnionMessageHandler_handle_custom_message(this.ptr, message.ptr, context.ptr, responder == null ? 0 : responder.ptr); Reference.reachabilityFence(this); - Reference.reachabilityFence(msg); + Reference.reachabilityFence(message); + Reference.reachabilityFence(context); + Reference.reachabilityFence(responder); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Option_OnionMessageContentsZ ret_hu_conv = org.ldk.structs.Option_OnionMessageContentsZ.constr_from_ptr(ret); + org.ldk.structs.Option_C2Tuple_OnionMessageContentsResponseInstructionZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_OnionMessageContentsResponseInstructionZZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - if (this != null) { this.ptrs_to.add(msg); }; + if (this != null) { this.ptrs_to.add(message); }; return ret_hu_conv; } @@ -129,18 +138,18 @@ public class CustomOnionMessageHandler extends CommonBase { * Typically, this is used for messages initiating a message flow rather than in response to * another message. The latter should use the return value of [`Self::handle_custom_message`]. */ - public ThreeTuple_OnionMessageContentsDestinationBlindedPathZ[] release_pending_custom_messages() { + public TwoTuple_OnionMessageContentsMessageSendInstructionsZ[] release_pending_custom_messages() { long[] ret = bindings.CustomOnionMessageHandler_release_pending_custom_messages(this.ptr); Reference.reachabilityFence(this); - int ret_conv_56_len = ret.length; - ThreeTuple_OnionMessageContentsDestinationBlindedPathZ[] ret_conv_56_arr = new ThreeTuple_OnionMessageContentsDestinationBlindedPathZ[ret_conv_56_len]; - for (int e = 0; e < ret_conv_56_len; e++) { - long ret_conv_56 = ret[e]; - ThreeTuple_OnionMessageContentsDestinationBlindedPathZ ret_conv_56_hu_conv = new ThreeTuple_OnionMessageContentsDestinationBlindedPathZ(null, ret_conv_56); - if (ret_conv_56_hu_conv != null) { ret_conv_56_hu_conv.ptrs_to.add(this); }; - ret_conv_56_arr[e] = ret_conv_56_hu_conv; + int ret_conv_55_len = ret.length; + TwoTuple_OnionMessageContentsMessageSendInstructionsZ[] ret_conv_55_arr = new TwoTuple_OnionMessageContentsMessageSendInstructionsZ[ret_conv_55_len]; + for (int d = 0; d < ret_conv_55_len; d++) { + long ret_conv_55 = ret[d]; + TwoTuple_OnionMessageContentsMessageSendInstructionsZ ret_conv_55_hu_conv = new TwoTuple_OnionMessageContentsMessageSendInstructionsZ(null, ret_conv_55); + if (ret_conv_55_hu_conv != null) { ret_conv_55_hu_conv.ptrs_to.add(this); }; + ret_conv_55_arr[d] = ret_conv_55_hu_conv; } - return ret_conv_56_arr; + return ret_conv_55_arr; } } diff --git a/src/main/java/org/ldk/structs/DefaultMessageRouter.java b/src/main/java/org/ldk/structs/DefaultMessageRouter.java index 24ce1e4b..d11cf770 100644 --- a/src/main/java/org/ldk/structs/DefaultMessageRouter.java +++ b/src/main/java/org/ldk/structs/DefaultMessageRouter.java @@ -10,6 +10,13 @@ import javax.annotation.Nullable; /** * A [`MessageRouter`] that can only route to a directly connected [`Destination`]. + * + * # Privacy + * + * Creating [`BlindedMessagePath`]s may affect privacy since, if a suitable path cannot be found, + * it will create a one-hop path using the recipient as the introduction node if it is a announced + * node. Otherwise, there is no way to find a path to the introduction node in order to send a + * message, and thus an `Err` is returned. */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class DefaultMessageRouter extends CommonBase { diff --git a/src/main/java/org/ldk/structs/DefaultRouter.java b/src/main/java/org/ldk/structs/DefaultRouter.java index ef86bda3..49fc7967 100644 --- a/src/main/java/org/ldk/structs/DefaultRouter.java +++ b/src/main/java/org/ldk/structs/DefaultRouter.java @@ -10,6 +10,11 @@ import javax.annotation.Nullable; /** * A [`Router`] implemented using [`find_route`]. + * + * # Privacy + * + * Implements [`MessageRouter`] by delegating to [`DefaultMessageRouter`]. See those docs for + * privacy implications. */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class DefaultRouter extends CommonBase { @@ -37,7 +42,6 @@ public class DefaultRouter extends CommonBase { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(logger); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(entropy_source); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(scorer); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(score_params); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/DelayedPaymentKey.java b/src/main/java/org/ldk/structs/DelayedPaymentKey.java index a849ce5c..13ac2400 100644 --- a/src/main/java/org/ldk/structs/DelayedPaymentKey.java +++ b/src/main/java/org/ldk/structs/DelayedPaymentKey.java @@ -16,7 +16,7 @@ import javax.annotation.Nullable; * punish and claim all the channel funds if the state broadcasted was previously revoked. * * [See the BOLT specs] - * (https://github.com/lightning/bolts/blob/master/03-transactions.md#localpubkey-local_htlcpubkey-remote_htlcpubkey-local_delayedpubkey-and-remote_delayedpubkey-derivation) + * * for more information on key derivation details. */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays diff --git a/src/main/java/org/ldk/structs/DelayedPaymentOutputDescriptor.java b/src/main/java/org/ldk/structs/DelayedPaymentOutputDescriptor.java index efaecbcc..09088105 100644 --- a/src/main/java/org/ldk/structs/DelayedPaymentOutputDescriptor.java +++ b/src/main/java/org/ldk/structs/DelayedPaymentOutputDescriptor.java @@ -41,7 +41,6 @@ public class DelayedPaymentOutputDescriptor extends CommonBase { bindings.DelayedPaymentOutputDescriptor_set_outpoint(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -123,7 +122,6 @@ public class DelayedPaymentOutputDescriptor extends CommonBase { bindings.DelayedPaymentOutputDescriptor_set_revocation_pubkey(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -194,7 +192,6 @@ public class DelayedPaymentOutputDescriptor extends CommonBase { bindings.DelayedPaymentOutputDescriptor_set_channel_transaction_parameters(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -215,9 +212,6 @@ public class DelayedPaymentOutputDescriptor extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.DelayedPaymentOutputDescriptor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.DelayedPaymentOutputDescriptor(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(outpoint_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(revocation_pubkey_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_transaction_parameters_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Description.java b/src/main/java/org/ldk/structs/Description.java index 0e203016..7c88e91b 100644 --- a/src/main/java/org/ldk/structs/Description.java +++ b/src/main/java/org/ldk/structs/Description.java @@ -71,8 +71,8 @@ public class Description extends CommonBase { return this.eq((Description)o); } /** - * Creates a new `Description` if `description` is at most 1023 __bytes__ long, - * returns [`CreationError::DescriptionTooLong`] otherwise + * Creates a new `Description` if `description` is at most 1023 * 5 bits (i.e., 639 bytes) + * long, and returns [`CreationError::DescriptionTooLong`] otherwise. * * Please note that single characters may use more than one byte due to UTF8 encoding. */ @@ -93,7 +93,19 @@ public class Description extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.UntrustedString ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UntrustedString(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - if (this != null) { this.ptrs_to.add(this); }; + ; + return ret_hu_conv; + } + + /** + * Get a reference to the underlying description [`UntrustedString`] + */ + public UntrustedString as_inner() { + long ret = bindings.Description_as_inner(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.UntrustedString ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UntrustedString(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Destination.java b/src/main/java/org/ldk/structs/Destination.java index dd4febe4..11d93aca 100644 --- a/src/main/java/org/ldk/structs/Destination.java +++ b/src/main/java/org/ldk/structs/Destination.java @@ -44,11 +44,11 @@ public class Destination extends CommonBase { * We're sending this onion message to a blinded path. */ public final static class BlindedPath extends Destination { - public final org.ldk.structs.BlindedPath blinded_path; + public final org.ldk.structs.BlindedMessagePath blinded_path; private BlindedPath(long ptr, bindings.LDKDestination.BlindedPath obj) { super(null, ptr); long blinded_path = obj.blinded_path; - org.ldk.structs.BlindedPath blinded_path_hu_conv = null; if (blinded_path < 0 || blinded_path > 4096) { blinded_path_hu_conv = new org.ldk.structs.BlindedPath(null, blinded_path); } + org.ldk.structs.BlindedMessagePath blinded_path_hu_conv = null; if (blinded_path < 0 || blinded_path > 4096) { blinded_path_hu_conv = new org.ldk.structs.BlindedMessagePath(null, blinded_path); } if (blinded_path_hu_conv != null) { blinded_path_hu_conv.ptrs_to.add(this); }; this.blinded_path = blinded_path_hu_conv; } @@ -86,13 +86,12 @@ public class Destination extends CommonBase { /** * Utility method to constructs a new BlindedPath-variant Destination */ - public static Destination blinded_path(org.ldk.structs.BlindedPath a) { + public static Destination blinded_path(org.ldk.structs.BlindedMessagePath a) { long ret = bindings.Destination_blinded_path(a.ptr); Reference.reachabilityFence(a); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Destination ret_hu_conv = org.ldk.structs.Destination.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/EcdsaChannelSigner.java b/src/main/java/org/ldk/structs/EcdsaChannelSigner.java index d5478d36..82f6e673 100644 --- a/src/main/java/org/ldk/structs/EcdsaChannelSigner.java +++ b/src/main/java/org/ldk/structs/EcdsaChannelSigner.java @@ -552,4 +552,22 @@ public class EcdsaChannelSigner extends CommonBase { return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.EcdsaChannelSigner_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of a EcdsaChannelSigner + */ + public EcdsaChannelSigner clone() { + long ret = bindings.EcdsaChannelSigner_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + EcdsaChannelSigner ret_hu_conv = new EcdsaChannelSigner(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/ErroneousField.java b/src/main/java/org/ldk/structs/ErroneousField.java index 9cf9583e..1370ba9b 100644 --- a/src/main/java/org/ldk/structs/ErroneousField.java +++ b/src/main/java/org/ldk/structs/ErroneousField.java @@ -62,7 +62,6 @@ public class ErroneousField extends CommonBase { bindings.ErroneousField_set_suggested_value(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -75,7 +74,6 @@ public class ErroneousField extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ErroneousField ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ErroneousField(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(suggested_value_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ErrorAction.java b/src/main/java/org/ldk/structs/ErrorAction.java index fbbc2384..01387a68 100644 --- a/src/main/java/org/ldk/structs/ErrorAction.java +++ b/src/main/java/org/ldk/structs/ErrorAction.java @@ -174,7 +174,6 @@ public class ErrorAction extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ErrorAction ret_hu_conv = org.ldk.structs.ErrorAction.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; return ret_hu_conv; } @@ -187,7 +186,6 @@ public class ErrorAction extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ErrorAction ret_hu_conv = org.ldk.structs.ErrorAction.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; return ret_hu_conv; } @@ -234,7 +232,6 @@ public class ErrorAction extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ErrorAction ret_hu_conv = org.ldk.structs.ErrorAction.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; return ret_hu_conv; } @@ -248,7 +245,6 @@ public class ErrorAction extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ErrorAction ret_hu_conv = org.ldk.structs.ErrorAction.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ErrorMessage.java b/src/main/java/org/ldk/structs/ErrorMessage.java index 77880a9f..384a54a0 100644 --- a/src/main/java/org/ldk/structs/ErrorMessage.java +++ b/src/main/java/org/ldk/structs/ErrorMessage.java @@ -47,7 +47,6 @@ public class ErrorMessage extends CommonBase { bindings.ErrorMessage_set_channel_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -86,7 +85,6 @@ public class ErrorMessage extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ErrorMessage ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ErrorMessage(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Event.java b/src/main/java/org/ldk/structs/Event.java index 28b27e8b..23432900 100644 --- a/src/main/java/org/ldk/structs/Event.java +++ b/src/main/java/org/ldk/structs/Event.java @@ -28,6 +28,9 @@ public class Event extends CommonBase { if (raw_val.getClass() == bindings.LDKEvent.FundingGenerationReady.class) { return new FundingGenerationReady(ptr, (bindings.LDKEvent.FundingGenerationReady)raw_val); } + if (raw_val.getClass() == bindings.LDKEvent.FundingTxBroadcastSafe.class) { + return new FundingTxBroadcastSafe(ptr, (bindings.LDKEvent.FundingTxBroadcastSafe)raw_val); + } if (raw_val.getClass() == bindings.LDKEvent.PaymentClaimable.class) { return new PaymentClaimable(ptr, (bindings.LDKEvent.PaymentClaimable)raw_val); } @@ -37,8 +40,8 @@ public class Event extends CommonBase { if (raw_val.getClass() == bindings.LDKEvent.ConnectionNeeded.class) { return new ConnectionNeeded(ptr, (bindings.LDKEvent.ConnectionNeeded)raw_val); } - if (raw_val.getClass() == bindings.LDKEvent.InvoiceRequestFailed.class) { - return new InvoiceRequestFailed(ptr, (bindings.LDKEvent.InvoiceRequestFailed)raw_val); + if (raw_val.getClass() == bindings.LDKEvent.InvoiceReceived.class) { + return new InvoiceReceived(ptr, (bindings.LDKEvent.InvoiceReceived)raw_val); } if (raw_val.getClass() == bindings.LDKEvent.PaymentSent.class) { return new PaymentSent(ptr, (bindings.LDKEvent.PaymentSent)raw_val); @@ -91,6 +94,12 @@ public class Event extends CommonBase { if (raw_val.getClass() == bindings.LDKEvent.BumpTransaction.class) { return new BumpTransaction(ptr, (bindings.LDKEvent.BumpTransaction)raw_val); } + if (raw_val.getClass() == bindings.LDKEvent.OnionMessageIntercepted.class) { + return new OnionMessageIntercepted(ptr, (bindings.LDKEvent.OnionMessageIntercepted)raw_val); + } + if (raw_val.getClass() == bindings.LDKEvent.OnionMessagePeerConnected.class) { + return new OnionMessagePeerConnected(ptr, (bindings.LDKEvent.OnionMessagePeerConnected)raw_val); + } assert false; return null; // Unreachable without extending the (internal) bindings interface } @@ -101,6 +110,10 @@ public class Event extends CommonBase { * Note that *all inputs* in the funding transaction must spend SegWit outputs or your * counterparty can steal your funds! * + * # Failure Behavior and Persistence + * This event will eventually be replayed after failures-to-handle (i.e., the event handler + * returning `Err(ReplayEvent ())`), but won't be persisted across restarts. + * * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated */ @@ -153,6 +166,63 @@ public class Event extends CommonBase { this.user_channel_id = user_channel_id_conv; } } + /** + * Used to indicate that the counterparty node has provided the signature(s) required to + * recover our funds in case they go offline. + * + * It is safe (and your responsibility) to broadcast the funding transaction upon receiving this + * event. + * + * This event is only emitted if you called + * [`ChannelManager::unsafe_manual_funding_transaction_generated`] instead of + * [`ChannelManager::funding_transaction_generated`]. + * + * [`ChannelManager::unsafe_manual_funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::unsafe_manual_funding_transaction_generated + * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated + */ + public final static class FundingTxBroadcastSafe extends Event { + /** + * The `channel_id` indicating which channel has reached this stage. + */ + public final org.ldk.structs.ChannelId channel_id; + /** + * The `user_channel_id` value passed in to [`ChannelManager::create_channel`]. + * + * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel + */ + public final org.ldk.util.UInt128 user_channel_id; + /** + * The outpoint of the channel's funding transaction. + */ + public final org.ldk.structs.OutPoint funding_txo; + /** + * The `node_id` of the channel counterparty. + */ + public final byte[] counterparty_node_id; + /** + * The `temporary_channel_id` this channel used to be known by during channel establishment. + */ + public final org.ldk.structs.ChannelId former_temporary_channel_id; + private FundingTxBroadcastSafe(long ptr, bindings.LDKEvent.FundingTxBroadcastSafe obj) { + super(null, ptr); + long channel_id = obj.channel_id; + org.ldk.structs.ChannelId channel_id_hu_conv = null; if (channel_id < 0 || channel_id > 4096) { channel_id_hu_conv = new org.ldk.structs.ChannelId(null, channel_id); } + if (channel_id_hu_conv != null) { channel_id_hu_conv.ptrs_to.add(this); }; + this.channel_id = channel_id_hu_conv; + byte[] user_channel_id = obj.user_channel_id; + org.ldk.util.UInt128 user_channel_id_conv = new org.ldk.util.UInt128(user_channel_id); + this.user_channel_id = user_channel_id_conv; + long funding_txo = obj.funding_txo; + org.ldk.structs.OutPoint funding_txo_hu_conv = null; if (funding_txo < 0 || funding_txo > 4096) { funding_txo_hu_conv = new org.ldk.structs.OutPoint(null, funding_txo); } + if (funding_txo_hu_conv != null) { funding_txo_hu_conv.ptrs_to.add(this); }; + this.funding_txo = funding_txo_hu_conv; + this.counterparty_node_id = obj.counterparty_node_id; + long former_temporary_channel_id = obj.former_temporary_channel_id; + org.ldk.structs.ChannelId former_temporary_channel_id_hu_conv = null; if (former_temporary_channel_id < 0 || former_temporary_channel_id > 4096) { former_temporary_channel_id_hu_conv = new org.ldk.structs.ChannelId(null, former_temporary_channel_id); } + if (former_temporary_channel_id_hu_conv != null) { former_temporary_channel_id_hu_conv.ptrs_to.add(this); }; + this.former_temporary_channel_id = former_temporary_channel_id_hu_conv; + } + } /** * Indicates that we've been offered a payment and it needs to be claimed via calling * [`ChannelManager::claim_funds`] with the preimage given in [`PaymentPurpose`]. @@ -183,6 +253,10 @@ public class Event extends CommonBase { * # Note * This event used to be called `PaymentReceived` in LDK versions 0.0.112 and earlier. * + * # Failure Behavior and Persistence + * This event will eventually be replayed after failures-to-handle (i.e., the event handler + * returning `Err(ReplayEvent ())`) and will be persisted across restarts. + * * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds * [`ChannelManager::claim_funds_with_known_custom_tlvs`]: crate::ln::channelmanager::ChannelManager::claim_funds_with_known_custom_tlvs * [`FailureCode::InvalidOnionPayload`]: crate::ln::channelmanager::FailureCode::InvalidOnionPayload @@ -305,6 +379,10 @@ public class Event extends CommonBase { * [`ChannelManager::claim_funds`] twice for the same [`Event::PaymentClaimable`] you may get * multiple `PaymentClaimed` events. * + * # Failure Behavior and Persistence + * This event will eventually be replayed after failures-to-handle (i.e., the event handler + * returning `Err(ReplayEvent ())`) and will be persisted across restarts. + * * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds */ public final static class PaymentClaimed extends Event { @@ -344,6 +422,15 @@ public class Event extends CommonBase { * serialized prior to LDK version 0.0.117. */ public final org.ldk.structs.Option_u64Z sender_intended_total_msat; + /** + * The fields in the onion which were received with each HTLC. Only fields which were + * identical in each HTLC involved in the payment will be included here. + * + * Payments received on LDK versions prior to 0.0.124 will have this field unset. + * + * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + @Nullable public final org.ldk.structs.RecipientOnionFields onion_fields; private PaymentClaimed(long ptr, bindings.LDKEvent.PaymentClaimed obj) { super(null, ptr); this.receiver_node_id = obj.receiver_node_id; @@ -367,6 +454,10 @@ public class Event extends CommonBase { org.ldk.structs.Option_u64Z sender_intended_total_msat_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(sender_intended_total_msat); if (sender_intended_total_msat_hu_conv != null) { sender_intended_total_msat_hu_conv.ptrs_to.add(this); }; this.sender_intended_total_msat = sender_intended_total_msat_hu_conv; + long onion_fields = obj.onion_fields; + org.ldk.structs.RecipientOnionFields onion_fields_hu_conv = null; if (onion_fields < 0 || onion_fields > 4096) { onion_fields_hu_conv = new org.ldk.structs.RecipientOnionFields(null, onion_fields); } + if (onion_fields_hu_conv != null) { onion_fields_hu_conv.ptrs_to.add(this); }; + this.onion_fields = onion_fields_hu_conv; } } /** @@ -379,6 +470,11 @@ public class Event extends CommonBase { * This event will not be generated for onion message forwards; only for sends including * replies. Handlers should connect to the node otherwise any buffered messages may be lost. * + * # Failure Behavior and Persistence + * This event won't be replayed after failures-to-handle + * (i.e., the event handler returning `Err(ReplayEvent ())`), and also won't be persisted + * across restarts. + * * [`OnionMessage`]: msgs::OnionMessage * [`MessageRouter`]: crate::onion_message::messenger::MessageRouter * [`Destination`]: crate::onion_message::messenger::Destination @@ -409,23 +505,64 @@ public class Event extends CommonBase { } } /** - * Indicates a request for an invoice failed to yield a response in a reasonable amount of time - * or was explicitly abandoned by [`ChannelManager::abandon_payment`]. This may be for an - * [`InvoiceRequest`] sent for an [`Offer`] or for a [`Refund`] that hasn't been redeemed. + * Indicates a [`Bolt12Invoice`] in response to an [`InvoiceRequest`] or a [`Refund`] was + * received. + * + * This event will only be generated if [`UserConfig::manually_handle_bolt12_invoices`] is set. + * Use [`ChannelManager::send_payment_for_bolt12_invoice`] to pay the invoice or + * [`ChannelManager::abandon_payment`] to abandon the associated payment. See those docs for + * further details. + * + * # Failure Behavior and Persistence + * This event will eventually be replayed after failures-to-handle (i.e., the event handler + * returning `Err(ReplayEvent ())`) and will be persisted across restarts. * - * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest - * [`Offer`]: crate::offers::offer::Offer * [`Refund`]: crate::offers::refund::Refund + * [`UserConfig::manually_handle_bolt12_invoices`]: crate::util::config::UserConfig::manually_handle_bolt12_invoices + * [`ChannelManager::send_payment_for_bolt12_invoice`]: crate::ln::channelmanager::ChannelManager::send_payment_for_bolt12_invoice + * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment */ - public final static class InvoiceRequestFailed extends Event { + public final static class InvoiceReceived extends Event { /** - * The `payment_id` to have been associated with payment for the requested invoice. + * The `payment_id` associated with payment for the invoice. */ public final byte[] payment_id; - private InvoiceRequestFailed(long ptr, bindings.LDKEvent.InvoiceRequestFailed obj) { + /** + * The invoice to pay. + */ + public final org.ldk.structs.Bolt12Invoice invoice; + /** + * The context of the [`BlindedMessagePath`] used to send the invoice. + * + * [`BlindedMessagePath`]: crate::blinded_path::message::BlindedMessagePath + */ + public final org.ldk.structs.Option_OffersContextZ context; + /** + * A responder for replying with an [`InvoiceError`] if needed. + * + * `None` if the invoice wasn't sent with a reply path. + * + * [`InvoiceError`]: crate::offers::invoice_error::InvoiceError + * + * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + @Nullable public final org.ldk.structs.Responder responder; + private InvoiceReceived(long ptr, bindings.LDKEvent.InvoiceReceived obj) { super(null, ptr); this.payment_id = obj.payment_id; + long invoice = obj.invoice; + org.ldk.structs.Bolt12Invoice invoice_hu_conv = null; if (invoice < 0 || invoice > 4096) { invoice_hu_conv = new org.ldk.structs.Bolt12Invoice(null, invoice); } + if (invoice_hu_conv != null) { invoice_hu_conv.ptrs_to.add(this); }; + this.invoice = invoice_hu_conv; + long context = obj.context; + org.ldk.structs.Option_OffersContextZ context_hu_conv = org.ldk.structs.Option_OffersContextZ.constr_from_ptr(context); + if (context_hu_conv != null) { context_hu_conv.ptrs_to.add(this); }; + this.context = context_hu_conv; + long responder = obj.responder; + org.ldk.structs.Responder responder_hu_conv = null; if (responder < 0 || responder > 4096) { responder_hu_conv = new org.ldk.structs.Responder(null, responder); } + if (responder_hu_conv != null) { responder_hu_conv.ptrs_to.add(this); }; + this.responder = responder_hu_conv; } } /** @@ -434,6 +571,10 @@ public class Event extends CommonBase { * * Note for MPP payments: in rare cases, this event may be preceded by a `PaymentPathFailed` * event. In this situation, you SHOULD treat this payment as having succeeded. + * + * # Failure Behavior and Persistence + * This event will eventually be replayed after failures-to-handle (i.e., the event handler + * returning `Err(ReplayEvent ())`) and will be persisted across restarts. */ public final static class PaymentSent extends Event { /** @@ -463,6 +604,8 @@ public class Event extends CommonBase { * If the recipient or an intermediate node misbehaves and gives us free money, this may * overstate the amount paid, though this is unlikely. * + * This is only `None` for payments initiated on LDK versions prior to 0.0.103. + * * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees */ public final org.ldk.structs.Option_u64Z fee_paid_msat; @@ -493,6 +636,10 @@ public class Event extends CommonBase { * received and processed. In this case, the [`Event::PaymentFailed`] event MUST be ignored, * and the payment MUST be treated as having succeeded. * + * # Failure Behavior and Persistence + * This event will eventually be replayed after failures-to-handle (i.e., the event handler + * returning `Err(ReplayEvent ())`) and will be persisted across restarts. + * * [`Retry`]: crate::ln::channelmanager::Retry * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment */ @@ -504,20 +651,26 @@ public class Event extends CommonBase { */ public final byte[] payment_id; /** - * The hash that was given to [`ChannelManager::send_payment`]. + * The hash that was given to [`ChannelManager::send_payment`]. `None` if the payment failed + * before receiving an invoice when paying a BOLT12 [`Offer`]. * * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment + * [`Offer`]: crate::offers::offer::Offer */ - public final byte[] payment_hash; + public final org.ldk.structs.Option_ThirtyTwoBytesZ payment_hash; /** * The reason the payment failed. This is only `None` for events generated or serialized - * by versions prior to 0.0.115. + * by versions prior to 0.0.115, or when downgrading to a version with a reason that was + * added after. */ public final org.ldk.structs.Option_PaymentFailureReasonZ reason; private PaymentFailed(long ptr, bindings.LDKEvent.PaymentFailed obj) { super(null, ptr); this.payment_id = obj.payment_id; - this.payment_hash = obj.payment_hash; + long payment_hash = obj.payment_hash; + org.ldk.structs.Option_ThirtyTwoBytesZ payment_hash_hu_conv = org.ldk.structs.Option_ThirtyTwoBytesZ.constr_from_ptr(payment_hash); + if (payment_hash_hu_conv != null) { payment_hash_hu_conv.ptrs_to.add(this); }; + this.payment_hash = payment_hash_hu_conv; long reason = obj.reason; org.ldk.structs.Option_PaymentFailureReasonZ reason_hu_conv = org.ldk.structs.Option_PaymentFailureReasonZ.constr_from_ptr(reason); if (reason_hu_conv != null) { reason_hu_conv.ptrs_to.add(this); }; @@ -529,6 +682,10 @@ public class Event extends CommonBase { * * Always generated after [`Event::PaymentSent`] and thus useful for scoring channels. See * [`Event::PaymentSent`] for obtaining the payment preimage. + * + * # Failure Behavior and Persistence + * This event will eventually be replayed after failures-to-handle (i.e., the event handler + * returning `Err(ReplayEvent ())`) and will be persisted across restarts. */ public final static class PaymentPathSuccessful extends Event { /** @@ -574,6 +731,10 @@ public class Event extends CommonBase { * See [`ChannelManager::abandon_payment`] for giving up on this payment before its retries have * been exhausted. * + * # Failure Behavior and Persistence + * This event will eventually be replayed after failures-to-handle (i.e., the event handler + * returning `Err(ReplayEvent ())`) and will be persisted across restarts. + * * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment */ public final static class PaymentPathFailed extends Event { @@ -644,6 +805,10 @@ public class Event extends CommonBase { } /** * Indicates that a probe payment we sent returned successful, i.e., only failed at the destination. + * + * # Failure Behavior and Persistence + * This event will eventually be replayed after failures-to-handle (i.e., the event handler + * returning `Err(ReplayEvent ())`) and will be persisted across restarts. */ public final static class ProbeSuccessful extends Event { /** @@ -674,6 +839,10 @@ public class Event extends CommonBase { } /** * Indicates that a probe payment we sent failed at an intermediary node on the path. + * + * # Failure Behavior and Persistence + * This event will eventually be replayed after failures-to-handle (i.e., the event handler + * returning `Err(ReplayEvent ())`) and will be persisted across restarts. */ public final static class ProbeFailed extends Event { /** @@ -718,6 +887,10 @@ public class Event extends CommonBase { * Used to indicate that [`ChannelManager::process_pending_htlc_forwards`] should be called at * a time in the future. * + * # Failure Behavior and Persistence + * This event will eventually be replayed after failures-to-handle (i.e., the event handler + * returning `Err(ReplayEvent ())`) and will be regenerated after restarts. + * * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards */ public final static class PendingHTLCsForwardable extends Event { @@ -742,6 +915,10 @@ public class Event extends CommonBase { * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to this event. See * their docs for more information. * + * # Failure Behavior and Persistence + * This event will eventually be replayed after failures-to-handle (i.e., the event handler + * returning `Err(ReplayEvent ())`) and will be persisted across restarts. + * * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs * [`ChannelManager::forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc @@ -797,6 +974,10 @@ public class Event extends CommonBase { * You may hand them to the [`OutputSweeper`] utility which will store and (re-)generate spending * transactions for you. * + * # Failure Behavior and Persistence + * This event will eventually be replayed after failures-to-handle (i.e., the event handler + * returning `Err(ReplayEvent ())`) and will be persisted across restarts. + * * [`OutputSweeper`]: crate::util::sweep::OutputSweeper */ public final static class SpendableOutputs extends Event { @@ -833,6 +1014,10 @@ public class Event extends CommonBase { /** * This event is generated when a payment has been successfully forwarded through us and a * forwarding fee earned. + * + * # Failure Behavior and Persistence + * This event will eventually be replayed after failures-to-handle (i.e., the event handler + * returning `Err(ReplayEvent ())`) and will be persisted across restarts. */ public final static class PaymentForwarded extends Event { /** @@ -948,6 +1133,10 @@ public class Event extends CommonBase { * This event is emitted when the funding transaction has been signed and is broadcast to the * network. For 0conf channels it will be immediately followed by the corresponding * [`Event::ChannelReady`] event. + * + * # Failure Behavior and Persistence + * This event will eventually be replayed after failures-to-handle (i.e., the event handler + * returning `Err(ReplayEvent ())`) and will be persisted across restarts. */ public final static class ChannelPending extends Event { /** @@ -1018,6 +1207,10 @@ public class Event extends CommonBase { * be used. This event is emitted either when the funding transaction has been confirmed * on-chain, or, in case of a 0conf channel, when both parties have confirmed the channel * establishment. + * + * # Failure Behavior and Persistence + * This event will eventually be replayed after failures-to-handle (i.e., the event handler + * returning `Err(ReplayEvent ())`) and will be persisted across restarts. */ public final static class ChannelReady extends Event { /** @@ -1069,6 +1262,10 @@ public class Event extends CommonBase { * * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels + * + * # Failure Behavior and Persistence + * This event will eventually be replayed after failures-to-handle (i.e., the event handler + * returning `Err(ReplayEvent ())`) and will be persisted across restarts. */ public final static class ChannelClosed extends Event { /** @@ -1144,6 +1341,10 @@ public class Event extends CommonBase { * inputs for another purpose. * * This event is not guaranteed to be generated for channels that are closed due to a restart. + * + * # Failure Behavior and Persistence + * This event will eventually be replayed after failures-to-handle (i.e., the event handler + * returning `Err(ReplayEvent ())`) and will be persisted across restarts. */ public final static class DiscardFunding extends Event { /** @@ -1153,14 +1354,17 @@ public class Event extends CommonBase { /** * The full transaction received from the user */ - public final byte[] transaction; + public final org.ldk.structs.FundingInfo funding_info; private DiscardFunding(long ptr, bindings.LDKEvent.DiscardFunding obj) { super(null, ptr); long channel_id = obj.channel_id; org.ldk.structs.ChannelId channel_id_hu_conv = null; if (channel_id < 0 || channel_id > 4096) { channel_id_hu_conv = new org.ldk.structs.ChannelId(null, channel_id); } if (channel_id_hu_conv != null) { channel_id_hu_conv.ptrs_to.add(this); }; this.channel_id = channel_id_hu_conv; - this.transaction = obj.transaction; + long funding_info = obj.funding_info; + org.ldk.structs.FundingInfo funding_info_hu_conv = org.ldk.structs.FundingInfo.constr_from_ptr(funding_info); + if (funding_info_hu_conv != null) { funding_info_hu_conv.ptrs_to.add(this); }; + this.funding_info = funding_info_hu_conv; } } /** @@ -1173,6 +1377,10 @@ public class Event extends CommonBase { * The event is only triggered when a new open channel request is received and the * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. * + * # Failure Behavior and Persistence + * This event will eventually be replayed after failures-to-handle (i.e., the event handler + * returning `Err(ReplayEvent ())`) and will be persisted across restarts. + * * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels @@ -1227,6 +1435,14 @@ public class Event extends CommonBase { * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager */ public final org.ldk.structs.ChannelTypeFeatures channel_type; + /** + * True if this channel is (or will be) publicly-announced. + */ + public final boolean is_announced; + /** + * Channel parameters given by the counterparty. + */ + public final org.ldk.structs.ChannelParameters params; private OpenChannelRequest(long ptr, bindings.LDKEvent.OpenChannelRequest obj) { super(null, ptr); long temporary_channel_id = obj.temporary_channel_id; @@ -1240,6 +1456,11 @@ public class Event extends CommonBase { org.ldk.structs.ChannelTypeFeatures channel_type_hu_conv = null; if (channel_type < 0 || channel_type > 4096) { channel_type_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, channel_type); } if (channel_type_hu_conv != null) { channel_type_hu_conv.ptrs_to.add(this); }; this.channel_type = channel_type_hu_conv; + this.is_announced = obj.is_announced; + long params = obj.params; + org.ldk.structs.ChannelParameters params_hu_conv = null; if (params < 0 || params > 4096) { params_hu_conv = new org.ldk.structs.ChannelParameters(null, params); } + if (params_hu_conv != null) { params_hu_conv.ptrs_to.add(this); }; + this.params = params_hu_conv; } } /** @@ -1255,6 +1476,10 @@ public class Event extends CommonBase { * * This event, however, does not get generated if an HTLC fails to meet the forwarding * requirements (i.e. insufficient fees paid, or a CLTV that is too soon). + * + * # Failure Behavior and Persistence + * This event will eventually be replayed after failures-to-handle (i.e., the event handler + * returning `Err(ReplayEvent ())`) and will be persisted across restarts. */ public final static class HTLCHandlingFailed extends Event { /** @@ -1285,6 +1510,10 @@ public class Event extends CommonBase { * [`ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx`] config flag is set to true. * It is limited to the scope of channels with anchor outputs. * + * # Failure Behavior and Persistence + * This event will eventually be replayed after failures-to-handle (i.e., the event handler + * returning `Err(ReplayEvent ())`), but will only be regenerated as needed after restarts. + * * [`ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx`]: crate::util::config::ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx */ public final static class BumpTransaction extends Event { @@ -1297,6 +1526,60 @@ public class Event extends CommonBase { this.bump_transaction = bump_transaction_hu_conv; } } + /** + * We received an onion message that is intended to be forwarded to a peer + * that is currently offline. This event will only be generated if the + * `OnionMessenger` was initialized with + * [`OnionMessenger::new_with_offline_peer_interception`], see its docs. + * + * # Failure Behavior and Persistence + * This event will eventually be replayed after failures-to-handle (i.e., the event handler + * returning `Err(ReplayEvent ())`), but won't be persisted across restarts. + * + * [`OnionMessenger::new_with_offline_peer_interception`]: crate::onion_message::messenger::OnionMessenger::new_with_offline_peer_interception + */ + public final static class OnionMessageIntercepted extends Event { + /** + * The node id of the offline peer. + */ + public final byte[] peer_node_id; + /** + * The onion message intended to be forwarded to `peer_node_id`. + */ + public final org.ldk.structs.OnionMessage message; + private OnionMessageIntercepted(long ptr, bindings.LDKEvent.OnionMessageIntercepted obj) { + super(null, ptr); + this.peer_node_id = obj.peer_node_id; + long message = obj.message; + org.ldk.structs.OnionMessage message_hu_conv = null; if (message < 0 || message > 4096) { message_hu_conv = new org.ldk.structs.OnionMessage(null, message); } + if (message_hu_conv != null) { message_hu_conv.ptrs_to.add(this); }; + this.message = message_hu_conv; + } + } + /** + * Indicates that an onion message supporting peer has come online and it may + * be time to forward any onion messages that were previously intercepted for + * them. This event will only be generated if the `OnionMessenger` was + * initialized with + * [`OnionMessenger::new_with_offline_peer_interception`], see its docs. + * + * # Failure Behavior and Persistence + * This event will eventually be replayed after failures-to-handle (i.e., the event handler + * returning `Err(ReplayEvent ())`), but won't be persisted across restarts. + * + * [`OnionMessenger::new_with_offline_peer_interception`]: crate::onion_message::messenger::OnionMessenger::new_with_offline_peer_interception + */ + public final static class OnionMessagePeerConnected extends Event { + /** + * The node id of the peer we just connected to, who advertises support for + * onion messages. + */ + public final byte[] peer_node_id; + private OnionMessagePeerConnected(long ptr, bindings.LDKEvent.OnionMessagePeerConnected obj) { + super(null, ptr); + this.peer_node_id = obj.peer_node_id; + } + } long clone_ptr() { long ret = bindings.Event_clone_ptr(this.ptr); Reference.reachabilityFence(this); @@ -1328,7 +1611,22 @@ public class Event extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(temporary_channel_id); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new FundingTxBroadcastSafe-variant Event + */ + public static Event funding_tx_broadcast_safe(org.ldk.structs.ChannelId channel_id, org.ldk.util.UInt128 user_channel_id, org.ldk.structs.OutPoint funding_txo, byte[] counterparty_node_id, org.ldk.structs.ChannelId former_temporary_channel_id) { + long ret = bindings.Event_funding_tx_broadcast_safe(channel_id.ptr, user_channel_id.getLEBytes(), funding_txo.ptr, InternalUtils.check_arr_len(counterparty_node_id, 33), former_temporary_channel_id.ptr); + Reference.reachabilityFence(channel_id); + Reference.reachabilityFence(user_channel_id); + Reference.reachabilityFence(funding_txo); + Reference.reachabilityFence(counterparty_node_id); + Reference.reachabilityFence(former_temporary_channel_id); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; return ret_hu_conv; } @@ -1349,31 +1647,24 @@ public class Event extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(onion_fields); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(purpose); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(via_channel_id); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(via_user_channel_id); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(claim_deadline); }; return ret_hu_conv; } /** * Utility method to constructs a new PaymentClaimed-variant Event */ - public static Event payment_claimed(byte[] receiver_node_id, byte[] payment_hash, long amount_msat, org.ldk.structs.PaymentPurpose purpose, ClaimedHTLC[] htlcs, org.ldk.structs.Option_u64Z sender_intended_total_msat) { - long ret = bindings.Event_payment_claimed(InternalUtils.check_arr_len(receiver_node_id, 33), InternalUtils.check_arr_len(payment_hash, 32), amount_msat, purpose.ptr, htlcs != null ? Arrays.stream(htlcs).mapToLong(htlcs_conv_13 -> htlcs_conv_13.ptr).toArray() : null, sender_intended_total_msat.ptr); + public static Event payment_claimed(byte[] receiver_node_id, byte[] payment_hash, long amount_msat, org.ldk.structs.PaymentPurpose purpose, ClaimedHTLC[] htlcs, org.ldk.structs.Option_u64Z sender_intended_total_msat, org.ldk.structs.RecipientOnionFields onion_fields) { + long ret = bindings.Event_payment_claimed(InternalUtils.check_arr_len(receiver_node_id, 33), InternalUtils.check_arr_len(payment_hash, 32), amount_msat, purpose.ptr, htlcs != null ? Arrays.stream(htlcs).mapToLong(htlcs_conv_13 -> htlcs_conv_13.ptr).toArray() : null, sender_intended_total_msat.ptr, onion_fields.ptr); Reference.reachabilityFence(receiver_node_id); Reference.reachabilityFence(payment_hash); Reference.reachabilityFence(amount_msat); Reference.reachabilityFence(purpose); Reference.reachabilityFence(htlcs); Reference.reachabilityFence(sender_intended_total_msat); + Reference.reachabilityFence(onion_fields); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(purpose); }; - for (ClaimedHTLC htlcs_conv_13: htlcs) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(htlcs_conv_13); }; }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(sender_intended_total_msat); }; return ret_hu_conv; } @@ -1387,16 +1678,18 @@ public class Event extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - for (SocketAddress addresses_conv_15: addresses) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(addresses_conv_15); }; }; return ret_hu_conv; } /** - * Utility method to constructs a new InvoiceRequestFailed-variant Event + * Utility method to constructs a new InvoiceReceived-variant Event */ - public static Event invoice_request_failed(byte[] payment_id) { - long ret = bindings.Event_invoice_request_failed(InternalUtils.check_arr_len(payment_id, 32)); + public static Event invoice_received(byte[] payment_id, org.ldk.structs.Bolt12Invoice invoice, org.ldk.structs.Option_OffersContextZ context, org.ldk.structs.Responder responder) { + long ret = bindings.Event_invoice_received(InternalUtils.check_arr_len(payment_id, 32), invoice.ptr, context.ptr, responder.ptr); Reference.reachabilityFence(payment_id); + Reference.reachabilityFence(invoice); + Reference.reachabilityFence(context); + Reference.reachabilityFence(responder); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; @@ -1415,23 +1708,20 @@ public class Event extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(payment_id); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(fee_paid_msat); }; return ret_hu_conv; } /** * Utility method to constructs a new PaymentFailed-variant Event */ - public static Event payment_failed(byte[] payment_id, byte[] payment_hash, org.ldk.structs.Option_PaymentFailureReasonZ reason) { - long ret = bindings.Event_payment_failed(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_hash, 32), reason.ptr); + public static Event payment_failed(byte[] payment_id, org.ldk.structs.Option_ThirtyTwoBytesZ payment_hash, org.ldk.structs.Option_PaymentFailureReasonZ reason) { + long ret = bindings.Event_payment_failed(InternalUtils.check_arr_len(payment_id, 32), payment_hash.ptr, reason.ptr); Reference.reachabilityFence(payment_id); Reference.reachabilityFence(payment_hash); Reference.reachabilityFence(reason); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(reason); }; return ret_hu_conv; } @@ -1446,8 +1736,6 @@ public class Event extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(payment_hash); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(path); }; return ret_hu_conv; } @@ -1465,10 +1753,6 @@ public class Event extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(payment_id); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(failure); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(path); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(short_channel_id); }; return ret_hu_conv; } @@ -1483,7 +1767,6 @@ public class Event extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(path); }; return ret_hu_conv; } @@ -1499,8 +1782,6 @@ public class Event extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(path); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(short_channel_id); }; return ret_hu_conv; } @@ -1542,8 +1823,6 @@ public class Event extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - for (SpendableOutputDescriptor outputs_conv_27: outputs) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(outputs_conv_27); }; }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id); }; return ret_hu_conv; } @@ -1563,13 +1842,6 @@ public class Event extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(prev_channel_id); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(next_channel_id); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(prev_user_channel_id); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(next_user_channel_id); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(total_fee_earned_msat); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(skimmed_fee_msat); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(outbound_amount_forwarded_msat); }; return ret_hu_conv; } @@ -1587,10 +1859,6 @@ public class Event extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(former_temporary_channel_id); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(funding_txo); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_type); }; return ret_hu_conv; } @@ -1606,8 +1874,6 @@ public class Event extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_type); }; return ret_hu_conv; } @@ -1625,42 +1891,37 @@ public class Event extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(reason); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_capacity_sats); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_funding_txo); }; return ret_hu_conv; } /** * Utility method to constructs a new DiscardFunding-variant Event */ - public static Event discard_funding(org.ldk.structs.ChannelId channel_id, byte[] transaction) { - long ret = bindings.Event_discard_funding(channel_id.ptr, transaction); + public static Event discard_funding(org.ldk.structs.ChannelId channel_id, org.ldk.structs.FundingInfo funding_info) { + long ret = bindings.Event_discard_funding(channel_id.ptr, funding_info.ptr); Reference.reachabilityFence(channel_id); - Reference.reachabilityFence(transaction); + Reference.reachabilityFence(funding_info); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id); }; return ret_hu_conv; } /** * Utility method to constructs a new OpenChannelRequest-variant Event */ - public static Event open_channel_request(org.ldk.structs.ChannelId temporary_channel_id, byte[] counterparty_node_id, long funding_satoshis, long push_msat, org.ldk.structs.ChannelTypeFeatures channel_type) { - long ret = bindings.Event_open_channel_request(temporary_channel_id.ptr, InternalUtils.check_arr_len(counterparty_node_id, 33), funding_satoshis, push_msat, channel_type.ptr); + public static Event open_channel_request(org.ldk.structs.ChannelId temporary_channel_id, byte[] counterparty_node_id, long funding_satoshis, long push_msat, org.ldk.structs.ChannelTypeFeatures channel_type, boolean is_announced, org.ldk.structs.ChannelParameters params) { + long ret = bindings.Event_open_channel_request(temporary_channel_id.ptr, InternalUtils.check_arr_len(counterparty_node_id, 33), funding_satoshis, push_msat, channel_type.ptr, is_announced, params.ptr); Reference.reachabilityFence(temporary_channel_id); Reference.reachabilityFence(counterparty_node_id); Reference.reachabilityFence(funding_satoshis); Reference.reachabilityFence(push_msat); Reference.reachabilityFence(channel_type); + Reference.reachabilityFence(is_announced); + Reference.reachabilityFence(params); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(temporary_channel_id); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_type); }; return ret_hu_conv; } @@ -1674,8 +1935,6 @@ public class Event extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(prev_channel_id); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(failed_next_destination); }; return ret_hu_conv; } @@ -1688,7 +1947,31 @@ public class Event extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new OnionMessageIntercepted-variant Event + */ + public static Event onion_message_intercepted(byte[] peer_node_id, org.ldk.structs.OnionMessage message) { + long ret = bindings.Event_onion_message_intercepted(InternalUtils.check_arr_len(peer_node_id, 33), message.ptr); + Reference.reachabilityFence(peer_node_id); + Reference.reachabilityFence(message); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new OnionMessagePeerConnected-variant Event + */ + public static Event onion_message_peer_connected(byte[] peer_node_id) { + long ret = bindings.Event_onion_message_peer_connected(InternalUtils.check_arr_len(peer_node_id, 33)); + Reference.reachabilityFence(peer_node_id); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/EventHandler.java b/src/main/java/org/ldk/structs/EventHandler.java index 648ac755..5585f747 100644 --- a/src/main/java/org/ldk/structs/EventHandler.java +++ b/src/main/java/org/ldk/structs/EventHandler.java @@ -12,7 +12,7 @@ import javax.annotation.Nullable; * * An async variation also exists for implementations of [`EventsProvider`] that support async * event handling. The async event handler should satisfy the generic bounds: `F: - * core::future::Future, H: Fn(Event) -> F`. + * core::future::Future>, H: Fn(Event) -> F`. */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class EventHandler extends CommonBase { @@ -46,17 +46,19 @@ public class EventHandler extends CommonBase { * * See [`EventsProvider`] for details that must be considered when implementing this method. */ - void handle_event(Event event); + Result_NoneReplayEventZ handle_event(Event event); } private static class LDKEventHandlerHolder { EventHandler held; } public static EventHandler new_impl(EventHandlerInterface arg) { final LDKEventHandlerHolder impl_holder = new LDKEventHandlerHolder(); impl_holder.held = new EventHandler(new bindings.LDKEventHandler() { - @Override public void handle_event(long event) { + @Override public long handle_event(long event) { org.ldk.structs.Event event_hu_conv = org.ldk.structs.Event.constr_from_ptr(event); if (event_hu_conv != null) { event_hu_conv.ptrs_to.add(this); }; - arg.handle_event(event_hu_conv); + Result_NoneReplayEventZ ret = arg.handle_event(event_hu_conv); Reference.reachabilityFence(arg); + long result = ret.clone_ptr(); + return result; } }); return impl_holder.held; @@ -66,11 +68,13 @@ public class EventHandler extends CommonBase { * * See [`EventsProvider`] for details that must be considered when implementing this method. */ - public void handle_event(org.ldk.structs.Event event) { - bindings.EventHandler_handle_event(this.ptr, event.ptr); + public Result_NoneReplayEventZ handle_event(org.ldk.structs.Event event) { + long ret = bindings.EventHandler_handle_event(this.ptr, event.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(event); - if (this != null) { this.ptrs_to.add(event); }; + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneReplayEventZ ret_hu_conv = Result_NoneReplayEventZ.constr_from_ptr(ret); + return ret_hu_conv; } } diff --git a/src/main/java/org/ldk/structs/EventsProvider.java b/src/main/java/org/ldk/structs/EventsProvider.java index a46ddd2c..811439d7 100644 --- a/src/main/java/org/ldk/structs/EventsProvider.java +++ b/src/main/java/org/ldk/structs/EventsProvider.java @@ -23,8 +23,12 @@ import javax.annotation.Nullable; * * In order to ensure no [`Event`]s are lost, implementors of this trait will persist [`Event`]s * and replay any unhandled events on startup. An [`Event`] is considered handled when - * [`process_pending_events`] returns, thus handlers MUST fully handle [`Event`]s and persist any - * relevant changes to disk *before* returning. + * [`process_pending_events`] returns `Ok(())`, thus handlers MUST fully handle [`Event`]s and + * persist any relevant changes to disk *before* returning `Ok(())`. In case of an error (e.g., + * persistence failure) implementors should return `Err(ReplayEvent())`, signalling to the + * [`EventsProvider`] to replay unhandled events on the next invocation (generally immediately). + * Note that some events might not be replayed, please refer to the documentation for + * the individual [`Event`] variants for more detail. * * Further, because an application may crash between an [`Event`] being handled and the * implementor of this trait being re-serialized, [`Event`] handling must be idempotent - in diff --git a/src/main/java/org/ldk/structs/FailureCode.java b/src/main/java/org/ldk/structs/FailureCode.java index a76cbcd2..72265f48 100644 --- a/src/main/java/org/ldk/structs/FailureCode.java +++ b/src/main/java/org/ldk/structs/FailureCode.java @@ -145,7 +145,6 @@ public class FailureCode extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.FailureCode ret_hu_conv = org.ldk.structs.FailureCode.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Filter.java b/src/main/java/org/ldk/structs/Filter.java index b5ab9fe7..f02adbea 100644 --- a/src/main/java/org/ldk/structs/Filter.java +++ b/src/main/java/org/ldk/structs/Filter.java @@ -59,6 +59,11 @@ public class Filter extends CommonBase { /** * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as * a spending condition. + * + * This may be used, for example, to monitor for when a funding transaction confirms. + * + * The `script_pubkey` is provided for informational purposes and may be useful for block + * sources which only support filtering on scripts. */ void register_tx(byte[] txid, byte[] script_pubkey); /** @@ -68,6 +73,9 @@ public class Filter extends CommonBase { * to ensure that also dependent output spents within an already connected block are correctly * handled, e.g., by re-scanning the block in question whenever new outputs have been * registered mid-processing. + * + * This may be used, for example, to monitor for when a funding output is spent (by any + * transaction). */ void register_output(WatchedOutput output); } @@ -91,6 +99,11 @@ public class Filter extends CommonBase { /** * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as * a spending condition. + * + * This may be used, for example, to monitor for when a funding transaction confirms. + * + * The `script_pubkey` is provided for informational purposes and may be useful for block + * sources which only support filtering on scripts. */ public void register_tx(byte[] txid, byte[] script_pubkey) { bindings.Filter_register_tx(this.ptr, InternalUtils.check_arr_len(txid, 32), script_pubkey); @@ -106,12 +119,14 @@ public class Filter extends CommonBase { * to ensure that also dependent output spents within an already connected block are correctly * handled, e.g., by re-scanning the block in question whenever new outputs have been * registered mid-processing. + * + * This may be used, for example, to monitor for when a funding output is spent (by any + * transaction). */ public void register_output(org.ldk.structs.WatchedOutput output) { bindings.Filter_register_output(this.ptr, output.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(output); - if (this != null) { this.ptrs_to.add(output); }; } } diff --git a/src/main/java/org/ldk/structs/ForwardNode.java b/src/main/java/org/ldk/structs/ForwardNode.java deleted file mode 100644 index e651dcbb..00000000 --- a/src/main/java/org/ldk/structs/ForwardNode.java +++ /dev/null @@ -1,116 +0,0 @@ -package org.ldk.structs; - -import org.ldk.impl.bindings; -import org.ldk.enums.*; -import org.ldk.util.*; -import java.util.Arrays; -import java.lang.ref.Reference; -import javax.annotation.Nullable; - - -/** - * An intermediate node, its outbound channel, and relay parameters. - */ -@SuppressWarnings("unchecked") // We correctly assign various generic arrays -public class ForwardNode extends CommonBase { - ForwardNode(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.ForwardNode_free(ptr); } - } - - /** - * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also - * used for [`BlindedPayInfo`] construction. - */ - public ForwardTlvs get_tlvs() { - long ret = bindings.ForwardNode_get_tlvs(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ForwardTlvs ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ForwardTlvs(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - return ret_hu_conv; - } - - /** - * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also - * used for [`BlindedPayInfo`] construction. - */ - public void set_tlvs(org.ldk.structs.ForwardTlvs val) { - bindings.ForwardNode_set_tlvs(this.ptr, val.ptr); - Reference.reachabilityFence(this); - Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; - } - - /** - * This node's pubkey. - */ - public byte[] get_node_id() { - byte[] ret = bindings.ForwardNode_get_node_id(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * This node's pubkey. - */ - public void set_node_id(byte[] val) { - bindings.ForwardNode_set_node_id(this.ptr, InternalUtils.check_arr_len(val, 33)); - Reference.reachabilityFence(this); - Reference.reachabilityFence(val); - } - - /** - * The maximum value, in msat, that may be accepted by this node. - */ - public long get_htlc_maximum_msat() { - long ret = bindings.ForwardNode_get_htlc_maximum_msat(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * The maximum value, in msat, that may be accepted by this node. - */ - public void set_htlc_maximum_msat(long val) { - bindings.ForwardNode_set_htlc_maximum_msat(this.ptr, val); - Reference.reachabilityFence(this); - Reference.reachabilityFence(val); - } - - /** - * Constructs a new ForwardNode given each field - */ - public static ForwardNode of(org.ldk.structs.ForwardTlvs tlvs_arg, byte[] node_id_arg, long htlc_maximum_msat_arg) { - long ret = bindings.ForwardNode_new(tlvs_arg.ptr, InternalUtils.check_arr_len(node_id_arg, 33), htlc_maximum_msat_arg); - Reference.reachabilityFence(tlvs_arg); - Reference.reachabilityFence(node_id_arg); - Reference.reachabilityFence(htlc_maximum_msat_arg); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ForwardNode ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ForwardNode(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(tlvs_arg); }; - return ret_hu_conv; - } - - long clone_ptr() { - long ret = bindings.ForwardNode_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Creates a copy of the ForwardNode - */ - public ForwardNode clone() { - long ret = bindings.ForwardNode_clone(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ForwardNode ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ForwardNode(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - return ret_hu_conv; - } - -} diff --git a/src/main/java/org/ldk/structs/ForwardTlvs.java b/src/main/java/org/ldk/structs/ForwardTlvs.java index 5cc4d289..795fad55 100644 --- a/src/main/java/org/ldk/structs/ForwardTlvs.java +++ b/src/main/java/org/ldk/structs/ForwardTlvs.java @@ -57,7 +57,6 @@ public class ForwardTlvs extends CommonBase { bindings.ForwardTlvs_set_payment_relay(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -79,7 +78,6 @@ public class ForwardTlvs extends CommonBase { bindings.ForwardTlvs_set_payment_constraints(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -107,24 +105,48 @@ public class ForwardTlvs extends CommonBase { bindings.ForwardTlvs_set_features(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; + } + + /** + * Set if this [`BlindedPaymentPath`] is concatenated to another, to indicate the + * [`BlindedPaymentPath::blinding_point`] of the appended blinded path. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + @Nullable + public byte[] get_next_blinding_override() { + byte[] ret = bindings.ForwardTlvs_get_next_blinding_override(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Set if this [`BlindedPaymentPath`] is concatenated to another, to indicate the + * [`BlindedPaymentPath::blinding_point`] of the appended blinded path. + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public void set_next_blinding_override(@Nullable byte[] val) { + bindings.ForwardTlvs_set_next_blinding_override(this.ptr, InternalUtils.check_arr_len(val, 33)); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); } /** * Constructs a new ForwardTlvs given each field + * + * Note that next_blinding_override_arg (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public static ForwardTlvs of(long short_channel_id_arg, org.ldk.structs.PaymentRelay payment_relay_arg, org.ldk.structs.PaymentConstraints payment_constraints_arg, org.ldk.structs.BlindedHopFeatures features_arg) { - long ret = bindings.ForwardTlvs_new(short_channel_id_arg, payment_relay_arg.ptr, payment_constraints_arg.ptr, features_arg.ptr); + public static ForwardTlvs of(long short_channel_id_arg, org.ldk.structs.PaymentRelay payment_relay_arg, org.ldk.structs.PaymentConstraints payment_constraints_arg, org.ldk.structs.BlindedHopFeatures features_arg, @Nullable byte[] next_blinding_override_arg) { + long ret = bindings.ForwardTlvs_new(short_channel_id_arg, payment_relay_arg.ptr, payment_constraints_arg.ptr, features_arg.ptr, InternalUtils.check_arr_len(next_blinding_override_arg, 33)); Reference.reachabilityFence(short_channel_id_arg); Reference.reachabilityFence(payment_relay_arg); Reference.reachabilityFence(payment_constraints_arg); Reference.reachabilityFence(features_arg); + Reference.reachabilityFence(next_blinding_override_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ForwardTlvs ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ForwardTlvs(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(payment_relay_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(payment_constraints_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(features_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/FourTuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ.java b/src/main/java/org/ldk/structs/FourTuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ.java index b9f7aaed..f372f196 100644 --- a/src/main/java/org/ldk/structs/FourTuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ.java +++ b/src/main/java/org/ldk/structs/FourTuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ.java @@ -101,9 +101,6 @@ public class FourTuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ extends Com if (ret >= 0 && ret <= 4096) { return null; } FourTuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ ret_hu_conv = new FourTuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ(null, ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b); }; - for (MonitorEvent c_conv_14: c) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(c_conv_14); }; }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/FundingCreated.java b/src/main/java/org/ldk/structs/FundingCreated.java index f6d7cb4a..956dbdb9 100644 --- a/src/main/java/org/ldk/structs/FundingCreated.java +++ b/src/main/java/org/ldk/structs/FundingCreated.java @@ -43,7 +43,6 @@ public class FundingCreated extends CommonBase { bindings.FundingCreated_set_temporary_channel_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -112,7 +111,6 @@ public class FundingCreated extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.FundingCreated ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.FundingCreated(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(temporary_channel_id_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/FundingInfo.java b/src/main/java/org/ldk/structs/FundingInfo.java new file mode 100644 index 00000000..c83a54c4 --- /dev/null +++ b/src/main/java/org/ldk/structs/FundingInfo.java @@ -0,0 +1,146 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * `FundingInfo` holds information about a channel's funding transaction. + * + * When LDK is set to manual propagation of the funding transaction + * (via [`ChannelManager::unsafe_manual_funding_transaction_generated`), + * LDK does not have the full transaction data. Instead, the `OutPoint` + * for the funding is provided here. + * + * [`ChannelManager::unsafe_manual_funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::unsafe_manual_funding_transaction_generated + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class FundingInfo extends CommonBase { + private FundingInfo(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.FundingInfo_free(ptr); } + } + static FundingInfo constr_from_ptr(long ptr) { + bindings.LDKFundingInfo raw_val = bindings.LDKFundingInfo_ref_from_ptr(ptr); + if (raw_val.getClass() == bindings.LDKFundingInfo.Tx.class) { + return new Tx(ptr, (bindings.LDKFundingInfo.Tx)raw_val); + } + if (raw_val.getClass() == bindings.LDKFundingInfo.OutPoint.class) { + return new OutPoint(ptr, (bindings.LDKFundingInfo.OutPoint)raw_val); + } + assert false; return null; // Unreachable without extending the (internal) bindings interface + } + + /** + * The full funding `Transaction`. + */ + public final static class Tx extends FundingInfo { + /** + * The funding transaction + */ + public final byte[] transaction; + private Tx(long ptr, bindings.LDKFundingInfo.Tx obj) { + super(null, ptr); + this.transaction = obj.transaction; + } + } + /** + * The `OutPoint` of the funding. + */ + public final static class OutPoint extends FundingInfo { + /** + * The outpoint of the funding + */ + public final org.ldk.structs.OutPoint outpoint; + private OutPoint(long ptr, bindings.LDKFundingInfo.OutPoint obj) { + super(null, ptr); + long outpoint = obj.outpoint; + org.ldk.structs.OutPoint outpoint_hu_conv = null; if (outpoint < 0 || outpoint > 4096) { outpoint_hu_conv = new org.ldk.structs.OutPoint(null, outpoint); } + if (outpoint_hu_conv != null) { outpoint_hu_conv.ptrs_to.add(this); }; + this.outpoint = outpoint_hu_conv; + } + } + long clone_ptr() { + long ret = bindings.FundingInfo_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the FundingInfo + */ + public FundingInfo clone() { + long ret = bindings.FundingInfo_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.FundingInfo ret_hu_conv = org.ldk.structs.FundingInfo.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new Tx-variant FundingInfo + */ + public static FundingInfo tx(byte[] transaction) { + long ret = bindings.FundingInfo_tx(transaction); + Reference.reachabilityFence(transaction); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.FundingInfo ret_hu_conv = org.ldk.structs.FundingInfo.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new OutPoint-variant FundingInfo + */ + public static FundingInfo out_point(org.ldk.structs.OutPoint outpoint) { + long ret = bindings.FundingInfo_out_point(outpoint.ptr); + Reference.reachabilityFence(outpoint); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.FundingInfo ret_hu_conv = org.ldk.structs.FundingInfo.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Checks if two FundingInfos contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + */ + public boolean eq(org.ldk.structs.FundingInfo b) { + boolean ret = bindings.FundingInfo_eq(this.ptr, b.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(b); + return ret; + } + + @Override public boolean equals(Object o) { + if (!(o instanceof FundingInfo)) return false; + return this.eq((FundingInfo)o); + } + /** + * Serialize the FundingInfo object into a byte array which can be read by FundingInfo_read + */ + public byte[] write() { + byte[] ret = bindings.FundingInfo_write(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Read a FundingInfo from a byte array, created by FundingInfo_write + */ + public static Result_FundingInfoDecodeErrorZ read(byte[] ser) { + long ret = bindings.FundingInfo_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_FundingInfoDecodeErrorZ ret_hu_conv = Result_FundingInfoDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/FundingSigned.java b/src/main/java/org/ldk/structs/FundingSigned.java index 8a15428a..ffdf7c4d 100644 --- a/src/main/java/org/ldk/structs/FundingSigned.java +++ b/src/main/java/org/ldk/structs/FundingSigned.java @@ -43,7 +43,6 @@ public class FundingSigned extends CommonBase { bindings.FundingSigned_set_channel_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -74,7 +73,6 @@ public class FundingSigned extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.FundingSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.FundingSigned(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/GraphSyncError.java b/src/main/java/org/ldk/structs/GraphSyncError.java index 6f55a704..79d80adb 100644 --- a/src/main/java/org/ldk/structs/GraphSyncError.java +++ b/src/main/java/org/ldk/structs/GraphSyncError.java @@ -85,7 +85,6 @@ public class GraphSyncError extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.GraphSyncError ret_hu_conv = org.ldk.structs.GraphSyncError.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; return ret_hu_conv; } @@ -98,7 +97,6 @@ public class GraphSyncError extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.GraphSyncError ret_hu_conv = org.ldk.structs.GraphSyncError.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/HTLCDescriptor.java b/src/main/java/org/ldk/structs/HTLCDescriptor.java index b4cc5979..bd4f87af 100644 --- a/src/main/java/org/ldk/structs/HTLCDescriptor.java +++ b/src/main/java/org/ldk/structs/HTLCDescriptor.java @@ -39,7 +39,6 @@ public class HTLCDescriptor extends CommonBase { bindings.HTLCDescriptor_set_channel_derivation_parameters(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -145,7 +144,6 @@ public class HTLCDescriptor extends CommonBase { bindings.HTLCDescriptor_set_htlc(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -169,7 +167,6 @@ public class HTLCDescriptor extends CommonBase { bindings.HTLCDescriptor_set_preimage(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -206,9 +203,6 @@ public class HTLCDescriptor extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.HTLCDescriptor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.HTLCDescriptor(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_derivation_parameters_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(htlc_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(preimage_arg); }; return ret_hu_conv; } @@ -340,12 +334,12 @@ public class HTLCDescriptor extends CommonBase { /** * Derives the channel signer required to sign the HTLC input. */ - public WriteableEcdsaChannelSigner derive_channel_signer(org.ldk.structs.SignerProvider signer_provider) { + public EcdsaChannelSigner derive_channel_signer(org.ldk.structs.SignerProvider signer_provider) { long ret = bindings.HTLCDescriptor_derive_channel_signer(this.ptr, signer_provider.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(signer_provider); if (ret >= 0 && ret <= 4096) { return null; } - WriteableEcdsaChannelSigner ret_hu_conv = new WriteableEcdsaChannelSigner(null, ret); + EcdsaChannelSigner ret_hu_conv = new EcdsaChannelSigner(null, ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; if (this != null) { this.ptrs_to.add(signer_provider); }; return ret_hu_conv; diff --git a/src/main/java/org/ldk/structs/HTLCDestination.java b/src/main/java/org/ldk/structs/HTLCDestination.java index f3f56ff1..07996a65 100644 --- a/src/main/java/org/ldk/structs/HTLCDestination.java +++ b/src/main/java/org/ldk/structs/HTLCDestination.java @@ -150,7 +150,6 @@ public class HTLCDestination extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.HTLCDestination ret_hu_conv = org.ldk.structs.HTLCDestination.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/HTLCOutputInCommitment.java b/src/main/java/org/ldk/structs/HTLCOutputInCommitment.java index 4a604c50..0f5d7289 100644 --- a/src/main/java/org/ldk/structs/HTLCOutputInCommitment.java +++ b/src/main/java/org/ldk/structs/HTLCOutputInCommitment.java @@ -123,7 +123,6 @@ public class HTLCOutputInCommitment extends CommonBase { bindings.HTLCOutputInCommitment_set_transaction_output_index(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -139,7 +138,6 @@ public class HTLCOutputInCommitment extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.HTLCOutputInCommitment ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.HTLCOutputInCommitment(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(transaction_output_index_arg); }; return ret_hu_conv; } @@ -178,6 +176,17 @@ public class HTLCOutputInCommitment extends CommonBase { if (!(o instanceof HTLCOutputInCommitment)) return false; return this.eq((HTLCOutputInCommitment)o); } + /** + * Converts HTLC's value with millisatoshi precision into [bitcoin::Amount] with satoshi precision. + * Typically this conversion is needed when transitioning from LN into base-layer Bitcoin, + * e. g. in commitment transactions. + */ + public long to_bitcoin_amount() { + long ret = bindings.HTLCOutputInCommitment_to_bitcoin_amount(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read */ diff --git a/src/main/java/org/ldk/structs/HeldHtlcAvailable.java b/src/main/java/org/ldk/structs/HeldHtlcAvailable.java new file mode 100644 index 00000000..19200562 --- /dev/null +++ b/src/main/java/org/ldk/structs/HeldHtlcAvailable.java @@ -0,0 +1,93 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * An HTLC destined for the recipient of this message is being held upstream. The reply path + * accompanying this onion message should be used to send a [`ReleaseHeldHtlc`] response, which + * will cause the upstream HTLC to be released. + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class HeldHtlcAvailable extends CommonBase { + HeldHtlcAvailable(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.HeldHtlcAvailable_free(ptr); } + } + + /** + * The secret that will be used by the recipient of this message to release the held HTLC. + */ + public byte[] get_payment_release_secret() { + byte[] ret = bindings.HeldHtlcAvailable_get_payment_release_secret(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * The secret that will be used by the recipient of this message to release the held HTLC. + */ + public void set_payment_release_secret(byte[] val) { + bindings.HeldHtlcAvailable_set_payment_release_secret(this.ptr, InternalUtils.check_arr_len(val, 32)); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * Constructs a new HeldHtlcAvailable given each field + */ + public static HeldHtlcAvailable of(byte[] payment_release_secret_arg) { + long ret = bindings.HeldHtlcAvailable_new(InternalUtils.check_arr_len(payment_release_secret_arg, 32)); + Reference.reachabilityFence(payment_release_secret_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.HeldHtlcAvailable ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.HeldHtlcAvailable(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + long clone_ptr() { + long ret = bindings.HeldHtlcAvailable_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the HeldHtlcAvailable + */ + public HeldHtlcAvailable clone() { + long ret = bindings.HeldHtlcAvailable_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.HeldHtlcAvailable ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.HeldHtlcAvailable(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Serialize the HeldHtlcAvailable object into a byte array which can be read by HeldHtlcAvailable_read + */ + public byte[] write() { + byte[] ret = bindings.HeldHtlcAvailable_write(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Read a HeldHtlcAvailable from a byte array, created by HeldHtlcAvailable_write + */ + public static Result_HeldHtlcAvailableDecodeErrorZ read(byte[] ser) { + long ret = bindings.HeldHtlcAvailable_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_HeldHtlcAvailableDecodeErrorZ ret_hu_conv = Result_HeldHtlcAvailableDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/HolderCommitmentTransaction.java b/src/main/java/org/ldk/structs/HolderCommitmentTransaction.java index 3c2d930f..f1be08a8 100644 --- a/src/main/java/org/ldk/structs/HolderCommitmentTransaction.java +++ b/src/main/java/org/ldk/structs/HolderCommitmentTransaction.java @@ -112,7 +112,6 @@ public class HolderCommitmentTransaction extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.HolderCommitmentTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.HolderCommitmentTransaction(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(commitment_tx); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/HtlcKey.java b/src/main/java/org/ldk/structs/HtlcKey.java index ec96e612..a64ea276 100644 --- a/src/main/java/org/ldk/structs/HtlcKey.java +++ b/src/main/java/org/ldk/structs/HtlcKey.java @@ -16,7 +16,7 @@ import javax.annotation.Nullable; * Thus, both channel counterparties' HTLC keys will appears in each HTLC output's script. * * [See the BOLT specs] - * (https://github.com/lightning/bolts/blob/master/03-transactions.md#localpubkey-local_htlcpubkey-remote_htlcpubkey-local_delayedpubkey-and-remote_delayedpubkey-derivation) + * * for more information on key derivation details. */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays diff --git a/src/main/java/org/ldk/structs/IgnoringMessageHandler.java b/src/main/java/org/ldk/structs/IgnoringMessageHandler.java index 36021b73..dafad191 100644 --- a/src/main/java/org/ldk/structs/IgnoringMessageHandler.java +++ b/src/main/java/org/ldk/structs/IgnoringMessageHandler.java @@ -32,19 +32,6 @@ public class IgnoringMessageHandler extends CommonBase { return ret_hu_conv; } - /** - * Constructs a new EventsProvider which calls the relevant methods on this_arg. - * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is - */ - public EventsProvider as_EventsProvider() { - long ret = bindings.IgnoringMessageHandler_as_EventsProvider(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - EventsProvider ret_hu_conv = new EventsProvider(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - return ret_hu_conv; - } - /** * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg. * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is @@ -97,6 +84,19 @@ public class IgnoringMessageHandler extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new AsyncPaymentsMessageHandler which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned AsyncPaymentsMessageHandler must be freed before this_arg is + */ + public AsyncPaymentsMessageHandler as_AsyncPaymentsMessageHandler() { + long ret = bindings.IgnoringMessageHandler_as_AsyncPaymentsMessageHandler(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + AsyncPaymentsMessageHandler ret_hu_conv = new AsyncPaymentsMessageHandler(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + /** * Constructs a new CustomOnionMessageHandler which calls the relevant methods on this_arg. * This copies the `inner` pointer in this_arg and thus the returned CustomOnionMessageHandler must be freed before this_arg is diff --git a/src/main/java/org/ldk/structs/InMemorySigner.java b/src/main/java/org/ldk/structs/InMemorySigner.java index 7e53df1f..fecbba75 100644 --- a/src/main/java/org/ldk/structs/InMemorySigner.java +++ b/src/main/java/org/ldk/structs/InMemorySigner.java @@ -9,7 +9,7 @@ import javax.annotation.Nullable; /** - * A simple implementation of [`WriteableEcdsaChannelSigner`] that just keeps the private keys in memory. + * A simple implementation of [`EcdsaChannelSigner`] that just keeps the private keys in memory. * * This implementation performs no policy checks and is insufficient by itself as * a secure external signer. @@ -379,19 +379,6 @@ public class InMemorySigner extends CommonBase { return ret_hu_conv; } - /** - * Constructs a new WriteableEcdsaChannelSigner which calls the relevant methods on this_arg. - * This copies the `inner` pointer in this_arg and thus the returned WriteableEcdsaChannelSigner must be freed before this_arg is - */ - public WriteableEcdsaChannelSigner as_WriteableEcdsaChannelSigner() { - long ret = bindings.InMemorySigner_as_WriteableEcdsaChannelSigner(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - WriteableEcdsaChannelSigner ret_hu_conv = new WriteableEcdsaChannelSigner(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - return ret_hu_conv; - } - /** * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read */ diff --git a/src/main/java/org/ldk/structs/InboundHTLCDetails.java b/src/main/java/org/ldk/structs/InboundHTLCDetails.java index 91255996..94c2bb40 100644 --- a/src/main/java/org/ldk/structs/InboundHTLCDetails.java +++ b/src/main/java/org/ldk/structs/InboundHTLCDetails.java @@ -133,7 +133,6 @@ public class InboundHTLCDetails extends CommonBase { bindings.InboundHTLCDetails_set_state(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -188,7 +187,6 @@ public class InboundHTLCDetails extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.InboundHTLCDetails ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InboundHTLCDetails(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(state_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Init.java b/src/main/java/org/ldk/structs/Init.java index b2abc86d..66d76105 100644 --- a/src/main/java/org/ldk/structs/Init.java +++ b/src/main/java/org/ldk/structs/Init.java @@ -41,7 +41,6 @@ public class Init extends CommonBase { bindings.Init_set_features(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -69,7 +68,6 @@ public class Init extends CommonBase { bindings.Init_set_networks(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -101,7 +99,6 @@ public class Init extends CommonBase { bindings.Init_set_remote_network_address(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -115,9 +112,6 @@ public class Init extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Init ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Init(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(features_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(networks_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(remote_network_address_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/InitFeatures.java b/src/main/java/org/ldk/structs/InitFeatures.java index 418f79e8..f49c6e88 100644 --- a/src/main/java/org/ldk/structs/InitFeatures.java +++ b/src/main/java/org/ldk/structs/InitFeatures.java @@ -20,6 +20,26 @@ public class InitFeatures extends CommonBase { if (ptr != 0) { bindings.InitFeatures_free(ptr); } } + /** + * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read + */ + public byte[] write() { + byte[] ret = bindings.InitFeatures_write(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Read a InitFeatures from a byte array, created by InitFeatures_write + */ + public static Result_InitFeaturesDecodeErrorZ read(byte[] ser) { + long ret = bindings.InitFeatures_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InitFeaturesDecodeErrorZ ret_hu_conv = Result_InitFeaturesDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + /** * Checks if two InitFeaturess contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. @@ -78,6 +98,25 @@ public class InitFeatures extends CommonBase { return ret_hu_conv; } + /** + * Returns the feature set as a list of bytes, in little-endian. This is in reverse byte order + * from most on-the-wire encodings. + */ + public byte[] le_flags() { + byte[] ret = bindings.InitFeatures_le_flags(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Returns true if this `Features` has any optional flags set + */ + public boolean supports_any_optional_bits() { + boolean ret = bindings.InitFeatures_supports_any_optional_bits(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * Returns true if this `Features` object contains required features unknown by `other`. */ @@ -89,6 +128,17 @@ public class InitFeatures extends CommonBase { return ret; } + /** + * Returns the set of required features unknown by `other`, as their bit position. + */ + public long[] required_unknown_bits_from(org.ldk.structs.InitFeatures other) { + long[] ret = bindings.InitFeatures_required_unknown_bits_from(this.ptr, other.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(other); + if (this != null) { this.ptrs_to.add(other); }; + return ret; + } + /** * Returns true if this `Features` object contains unknown feature flags which are set as * \"required\". @@ -99,6 +149,15 @@ public class InitFeatures extends CommonBase { return ret; } + /** + * Returns true if this `Features` supports any bits which we do not know of + */ + public boolean supports_unknown_bits() { + boolean ret = bindings.InitFeatures_supports_unknown_bits(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * Sets a required feature bit. Errors if `bit` is outside the feature range as defined * by [BOLT 9]. @@ -172,25 +231,68 @@ public class InitFeatures extends CommonBase { } /** - * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read + * Unsets the `upfront_shutdown_script` feature */ - public byte[] write() { - byte[] ret = bindings.InitFeatures_write(this.ptr); + public InitFeatures clear_upfront_shutdown_script() { + long ret = bindings.InitFeatures_clear_upfront_shutdown_script(this.ptr); Reference.reachabilityFence(this); - return ret; + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.InitFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InitFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + ; + return ret_hu_conv; } /** - * Read a InitFeatures from a byte array, created by InitFeatures_write + * Unsets the `shutdown_anysegwit` feature */ - public static Result_InitFeaturesDecodeErrorZ read(byte[] ser) { - long ret = bindings.InitFeatures_read(ser); - Reference.reachabilityFence(ser); + public InitFeatures clear_shutdown_anysegwit() { + long ret = bindings.InitFeatures_clear_shutdown_anysegwit(this.ptr); + Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - Result_InitFeaturesDecodeErrorZ ret_hu_conv = Result_InitFeaturesDecodeErrorZ.constr_from_ptr(ret); + org.ldk.structs.InitFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InitFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + ; return ret_hu_conv; } + /** + * Unsets the `wumbo` feature + */ + public InitFeatures clear_wumbo() { + long ret = bindings.InitFeatures_clear_wumbo(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.InitFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InitFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + ; + return ret_hu_conv; + } + + /** + * Unsets the `scid_privacy` feature + */ + public void clear_scid_privacy() { + bindings.InitFeatures_clear_scid_privacy(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Unsets the `anchors_zero_fee_htlc_tx` feature + */ + public void clear_anchors_zero_fee_htlc_tx() { + bindings.InitFeatures_clear_anchors_zero_fee_htlc_tx(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Unsets the `route_blinding` feature + */ + public void clear_route_blinding() { + bindings.InitFeatures_clear_route_blinding(this.ptr); + Reference.reachabilityFence(this); + } + /** * Set this feature as optional. */ diff --git a/src/main/java/org/ldk/structs/Input.java b/src/main/java/org/ldk/structs/Input.java index 4f25ed3f..fecddaf6 100644 --- a/src/main/java/org/ldk/structs/Input.java +++ b/src/main/java/org/ldk/structs/Input.java @@ -41,7 +41,6 @@ public class Input extends CommonBase { bindings.Input_set_outpoint(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -97,7 +96,6 @@ public class Input extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Input ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Input(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(outpoint_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/IntroductionNode.java b/src/main/java/org/ldk/structs/IntroductionNode.java index 13d25d44..7d9df31b 100644 --- a/src/main/java/org/ldk/structs/IntroductionNode.java +++ b/src/main/java/org/ldk/structs/IntroductionNode.java @@ -9,7 +9,7 @@ import javax.annotation.Nullable; /** - * The unblinded node in a [`BlindedPath`]. + * The unblinded node in a blinded path. */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class IntroductionNode extends CommonBase { diff --git a/src/main/java/org/ldk/structs/InvoiceError.java b/src/main/java/org/ldk/structs/InvoiceError.java index 2905273b..b275f65d 100644 --- a/src/main/java/org/ldk/structs/InvoiceError.java +++ b/src/main/java/org/ldk/structs/InvoiceError.java @@ -53,7 +53,6 @@ public class InvoiceError extends CommonBase { bindings.InvoiceError_set_erroneous_field(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -75,7 +74,6 @@ public class InvoiceError extends CommonBase { bindings.InvoiceError_set_message(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -90,8 +88,6 @@ public class InvoiceError extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.InvoiceError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceError(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(erroneous_field_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(message_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/InvoiceRequest.java b/src/main/java/org/ldk/structs/InvoiceRequest.java index 8f96274f..5893b4bd 100644 --- a/src/main/java/org/ldk/structs/InvoiceRequest.java +++ b/src/main/java/org/ldk/structs/InvoiceRequest.java @@ -142,18 +142,18 @@ public class InvoiceRequest extends CommonBase { * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide * recipient privacy by obfuscating its node id. */ - public BlindedPath[] paths() { + public BlindedMessagePath[] paths() { long[] ret = bindings.InvoiceRequest_paths(this.ptr); Reference.reachabilityFence(this); - int ret_conv_13_len = ret.length; - BlindedPath[] ret_conv_13_arr = new BlindedPath[ret_conv_13_len]; - for (int n = 0; n < ret_conv_13_len; n++) { - long ret_conv_13 = ret[n]; - org.ldk.structs.BlindedPath ret_conv_13_hu_conv = null; if (ret_conv_13 < 0 || ret_conv_13 > 4096) { ret_conv_13_hu_conv = new org.ldk.structs.BlindedPath(null, ret_conv_13); } - if (ret_conv_13_hu_conv != null) { ret_conv_13_hu_conv.ptrs_to.add(this); }; - ret_conv_13_arr[n] = ret_conv_13_hu_conv; + int ret_conv_20_len = ret.length; + BlindedMessagePath[] ret_conv_20_arr = new BlindedMessagePath[ret_conv_20_len]; + for (int u = 0; u < ret_conv_20_len; u++) { + long ret_conv_20 = ret[u]; + org.ldk.structs.BlindedMessagePath ret_conv_20_hu_conv = null; if (ret_conv_20 < 0 || ret_conv_20 > 4096) { ret_conv_20_hu_conv = new org.ldk.structs.BlindedMessagePath(null, ret_conv_20); } + if (ret_conv_20_hu_conv != null) { ret_conv_20_hu_conv.ptrs_to.add(this); }; + ret_conv_20_arr[u] = ret_conv_20_hu_conv; } - return ret_conv_13_arr; + return ret_conv_20_arr; } /** @@ -274,8 +274,8 @@ public class InvoiceRequest extends CommonBase { * * [`Duration`]: core::time::Duration */ - public Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ respond_with(TwoTuple_BlindedPayInfoBlindedPathZ[] payment_paths, byte[] payment_hash) { - long ret = bindings.InvoiceRequest_respond_with(this.ptr, payment_paths != null ? Arrays.stream(payment_paths).mapToLong(payment_paths_conv_37 -> payment_paths_conv_37.ptr).toArray() : null, InternalUtils.check_arr_len(payment_hash, 32)); + public Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ respond_with(BlindedPaymentPath[] payment_paths, byte[] payment_hash) { + long ret = bindings.InvoiceRequest_respond_with(this.ptr, payment_paths != null ? Arrays.stream(payment_paths).mapToLong(payment_paths_conv_20 -> payment_paths_conv_20.ptr).toArray() : null, InternalUtils.check_arr_len(payment_hash, 32)); Reference.reachabilityFence(this); Reference.reachabilityFence(payment_paths); Reference.reachabilityFence(payment_hash); @@ -304,13 +304,15 @@ public class InvoiceRequest extends CommonBase { * # Note * * If the originating [`Offer`] was created using [`OfferBuilder::deriving_signing_pubkey`], - * then use [`InvoiceRequest::verify`] and [`VerifiedInvoiceRequest`] methods instead. + * then first use [`InvoiceRequest::verify_using_metadata`] or + * [`InvoiceRequest::verify_using_recipient_data`] and then [`VerifiedInvoiceRequest`] methods + * instead. * * [`Bolt12Invoice::created_at`]: crate::offers::invoice::Bolt12Invoice::created_at * [`OfferBuilder::deriving_signing_pubkey`]: crate::offers::offer::OfferBuilder::deriving_signing_pubkey */ - public Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ respond_with_no_std(TwoTuple_BlindedPayInfoBlindedPathZ[] payment_paths, byte[] payment_hash, long created_at) { - long ret = bindings.InvoiceRequest_respond_with_no_std(this.ptr, payment_paths != null ? Arrays.stream(payment_paths).mapToLong(payment_paths_conv_37 -> payment_paths_conv_37.ptr).toArray() : null, InternalUtils.check_arr_len(payment_hash, 32), created_at); + public Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ respond_with_no_std(BlindedPaymentPath[] payment_paths, byte[] payment_hash, long created_at) { + long ret = bindings.InvoiceRequest_respond_with_no_std(this.ptr, payment_paths != null ? Arrays.stream(payment_paths).mapToLong(payment_paths_conv_20 -> payment_paths_conv_20.ptr).toArray() : null, InternalUtils.check_arr_len(payment_hash, 32), created_at); Reference.reachabilityFence(this); Reference.reachabilityFence(payment_paths); Reference.reachabilityFence(payment_hash); @@ -321,20 +323,43 @@ public class InvoiceRequest extends CommonBase { } /** - * Verifies that the request was for an offer created using the given key. Returns the verified - * request which contains the derived keys needed to sign a [`Bolt12Invoice`] for the request - * if they could be extracted from the metadata. + * Verifies that the request was for an offer created using the given key by checking the + * metadata from the offer. + * + * Returns the verified request which contains the derived keys needed to sign a + * [`Bolt12Invoice`] for the request if they could be extracted from the metadata. + * + * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice + */ + public Result_VerifiedInvoiceRequestNoneZ verify_using_metadata(org.ldk.structs.ExpandedKey key) { + long ret = bindings.InvoiceRequest_verify_using_metadata(this.ptr, key.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(key); + if (ret >= 0 && ret <= 4096) { return null; } + Result_VerifiedInvoiceRequestNoneZ ret_hu_conv = Result_VerifiedInvoiceRequestNoneZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.add(key); }; + ; + return ret_hu_conv; + } + + /** + * Verifies that the request was for an offer created using the given key by checking a nonce + * included with the [`BlindedMessagePath`] for which the request was sent through. + * + * Returns the verified request which contains the derived keys needed to sign a + * [`Bolt12Invoice`] for the request if they could be extracted from the metadata. * * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice */ - public Result_VerifiedInvoiceRequestNoneZ verify(org.ldk.structs.ExpandedKey key) { - long ret = bindings.InvoiceRequest_verify(this.ptr, key.ptr); + public Result_VerifiedInvoiceRequestNoneZ verify_using_recipient_data(org.ldk.structs.Nonce nonce, org.ldk.structs.ExpandedKey key) { + long ret = bindings.InvoiceRequest_verify_using_recipient_data(this.ptr, nonce.ptr, key.ptr); Reference.reachabilityFence(this); + Reference.reachabilityFence(nonce); Reference.reachabilityFence(key); if (ret >= 0 && ret <= 4096) { return null; } Result_VerifiedInvoiceRequestNoneZ ret_hu_conv = Result_VerifiedInvoiceRequestNoneZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.add(key); }; - if (this != null) { this.ptrs_to.add(this); }; + ; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/InvoiceRequestFeatures.java b/src/main/java/org/ldk/structs/InvoiceRequestFeatures.java index 3d761183..eb6a2232 100644 --- a/src/main/java/org/ldk/structs/InvoiceRequestFeatures.java +++ b/src/main/java/org/ldk/structs/InvoiceRequestFeatures.java @@ -78,6 +78,25 @@ public class InvoiceRequestFeatures extends CommonBase { return ret_hu_conv; } + /** + * Returns the feature set as a list of bytes, in little-endian. This is in reverse byte order + * from most on-the-wire encodings. + */ + public byte[] le_flags() { + byte[] ret = bindings.InvoiceRequestFeatures_le_flags(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Returns true if this `Features` has any optional flags set + */ + public boolean supports_any_optional_bits() { + boolean ret = bindings.InvoiceRequestFeatures_supports_any_optional_bits(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * Returns true if this `Features` object contains required features unknown by `other`. */ @@ -89,6 +108,17 @@ public class InvoiceRequestFeatures extends CommonBase { return ret; } + /** + * Returns the set of required features unknown by `other`, as their bit position. + */ + public long[] required_unknown_bits_from(org.ldk.structs.InvoiceRequestFeatures other) { + long[] ret = bindings.InvoiceRequestFeatures_required_unknown_bits_from(this.ptr, other.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(other); + if (this != null) { this.ptrs_to.add(other); }; + return ret; + } + /** * Returns true if this `Features` object contains unknown feature flags which are set as * \"required\". @@ -99,6 +129,15 @@ public class InvoiceRequestFeatures extends CommonBase { return ret; } + /** + * Returns true if this `Features` supports any bits which we do not know of + */ + public boolean supports_unknown_bits() { + boolean ret = bindings.InvoiceRequestFeatures_supports_unknown_bits(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * Sets a required feature bit. Errors if `bit` is outside the feature range as defined * by [BOLT 9]. diff --git a/src/main/java/org/ldk/structs/InvoiceRequestFields.java b/src/main/java/org/ldk/structs/InvoiceRequestFields.java index a44ad955..2fc96ad7 100644 --- a/src/main/java/org/ldk/structs/InvoiceRequestFields.java +++ b/src/main/java/org/ldk/structs/InvoiceRequestFields.java @@ -59,7 +59,6 @@ public class InvoiceRequestFields extends CommonBase { bindings.InvoiceRequestFields_set_quantity(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -88,7 +87,6 @@ public class InvoiceRequestFields extends CommonBase { bindings.InvoiceRequestFields_set_payer_note_truncated(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -104,8 +102,6 @@ public class InvoiceRequestFields extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.InvoiceRequestFields ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceRequestFields(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(quantity_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(payer_note_truncated_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/InvoiceWithDerivedSigningPubkeyBuilder.java b/src/main/java/org/ldk/structs/InvoiceWithDerivedSigningPubkeyBuilder.java index be96052d..c33e8d25 100644 --- a/src/main/java/org/ldk/structs/InvoiceWithDerivedSigningPubkeyBuilder.java +++ b/src/main/java/org/ldk/structs/InvoiceWithDerivedSigningPubkeyBuilder.java @@ -49,7 +49,8 @@ public class InvoiceWithDerivedSigningPubkeyBuilder extends CommonBase { } /** - * Sets the [`Bolt12Invoice::relative_expiry`] as seconds since [`Bolt12Invoice::created_at`]. + * Sets the [`Bolt12Invoice::relative_expiry`] + * as seconds since [`Bolt12Invoice::created_at`]. * Any expiry that has already passed is valid and can be checked for using * [`Bolt12Invoice::is_expired`]. * @@ -134,8 +135,8 @@ public class InvoiceWithDerivedSigningPubkeyBuilder extends CommonBase { } /** - * Sets [`Bolt12Invoice::invoice_features`] to indicate MPP may be used. Otherwise, MPP is - * disallowed. + * Sets [`Bolt12Invoice::invoice_features`] + * to indicate MPP may be used. Otherwise, MPP is disallowed. */ public void allow_mpp() { bindings.InvoiceWithDerivedSigningPubkeyBuilder_allow_mpp(this.ptr); diff --git a/src/main/java/org/ldk/structs/InvoiceWithExplicitSigningPubkeyBuilder.java b/src/main/java/org/ldk/structs/InvoiceWithExplicitSigningPubkeyBuilder.java index 5843ee22..c0a612fd 100644 --- a/src/main/java/org/ldk/structs/InvoiceWithExplicitSigningPubkeyBuilder.java +++ b/src/main/java/org/ldk/structs/InvoiceWithExplicitSigningPubkeyBuilder.java @@ -50,7 +50,8 @@ public class InvoiceWithExplicitSigningPubkeyBuilder extends CommonBase { } /** - * Sets the [`Bolt12Invoice::relative_expiry`] as seconds since [`Bolt12Invoice::created_at`]. + * Sets the [`Bolt12Invoice::relative_expiry`] + * as seconds since [`Bolt12Invoice::created_at`]. * Any expiry that has already passed is valid and can be checked for using * [`Bolt12Invoice::is_expired`]. * @@ -135,8 +136,8 @@ public class InvoiceWithExplicitSigningPubkeyBuilder extends CommonBase { } /** - * Sets [`Bolt12Invoice::invoice_features`] to indicate MPP may be used. Otherwise, MPP is - * disallowed. + * Sets [`Bolt12Invoice::invoice_features`] + * to indicate MPP may be used. Otherwise, MPP is disallowed. */ public void allow_mpp() { bindings.InvoiceWithExplicitSigningPubkeyBuilder_allow_mpp(this.ptr); diff --git a/src/main/java/org/ldk/structs/KeysManager.java b/src/main/java/org/ldk/structs/KeysManager.java index 4aa05cae..c3e587a4 100644 --- a/src/main/java/org/ldk/structs/KeysManager.java +++ b/src/main/java/org/ldk/structs/KeysManager.java @@ -72,7 +72,7 @@ public class KeysManager extends CommonBase { } /** - * Derive an old [`WriteableEcdsaChannelSigner`] containing per-channel secrets based on a key derivation parameters. + * Derive an old [`EcdsaChannelSigner`] containing per-channel secrets based on a key derivation parameters. */ public InMemorySigner derive_channel_keys(long channel_value_satoshis, byte[] params) { long ret = bindings.KeysManager_derive_channel_keys(this.ptr, channel_value_satoshis, InternalUtils.check_arr_len(params, 32)); @@ -86,7 +86,7 @@ public class KeysManager extends CommonBase { } /** - * Signs the given [`PartiallySignedTransaction`] which spends the given [`SpendableOutputDescriptor`]s. + * Signs the given [`Psbt`] which spends the given [`SpendableOutputDescriptor`]s. * The resulting inputs will be finalized and the PSBT will be ready for broadcast if there * are no other inputs that need signing. * @@ -102,7 +102,6 @@ public class KeysManager extends CommonBase { Reference.reachabilityFence(psbt); if (ret >= 0 && ret <= 4096) { return null; } Result_CVec_u8ZNoneZ ret_hu_conv = Result_CVec_u8ZNoneZ.constr_from_ptr(ret); - for (SpendableOutputDescriptor descriptors_conv_27: descriptors) { if (this != null) { this.ptrs_to.add(descriptors_conv_27); }; }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/LightningError.java b/src/main/java/org/ldk/structs/LightningError.java index b05371ff..08beb58d 100644 --- a/src/main/java/org/ldk/structs/LightningError.java +++ b/src/main/java/org/ldk/structs/LightningError.java @@ -57,7 +57,6 @@ public class LightningError extends CommonBase { bindings.LightningError_set_action(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -70,7 +69,6 @@ public class LightningError extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.LightningError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.LightningError(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(action_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/MaxDustHTLCExposure.java b/src/main/java/org/ldk/structs/MaxDustHTLCExposure.java index 2bd6f0c1..f74f72f4 100644 --- a/src/main/java/org/ldk/structs/MaxDustHTLCExposure.java +++ b/src/main/java/org/ldk/structs/MaxDustHTLCExposure.java @@ -50,9 +50,9 @@ public class MaxDustHTLCExposure extends CommonBase { } } /** - * This sets a multiplier on the [`ConfirmationTarget::OnChainSweep`] feerate (in sats/KW) to - * determine the maximum allowed dust exposure. If this variant is used then the maximum dust - * exposure in millisatoshis is calculated as: + * This sets a multiplier on the [`ConfirmationTarget::MaximumFeeEstimate`] feerate (in + * sats/KW) to determine the maximum allowed dust exposure. If this variant is used then the + * maximum dust exposure in millisatoshis is calculated as: * `feerate_per_kw * value`. For example, with our default value * `FeeRateMultiplier(10_000)`: * @@ -75,7 +75,7 @@ public class MaxDustHTLCExposure extends CommonBase { * by default this will be set to a [`Self::FixedLimitMsat`] of 5,000,000 msat. * * [`FeeEstimator`]: crate::chain::chaininterface::FeeEstimator - * [`ConfirmationTarget::OnChainSweep`]: crate::chain::chaininterface::ConfirmationTarget::OnChainSweep + * [`ConfirmationTarget::MaximumFeeEstimate`]: crate::chain::chaininterface::ConfirmationTarget::MaximumFeeEstimate */ public final static class FeeRateMultiplier extends MaxDustHTLCExposure { public final long fee_rate_multiplier; diff --git a/src/main/java/org/ldk/structs/MessageContext.java b/src/main/java/org/ldk/structs/MessageContext.java new file mode 100644 index 00000000..3b9d5c35 --- /dev/null +++ b/src/main/java/org/ldk/structs/MessageContext.java @@ -0,0 +1,126 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * Additional data included by the recipient in a [`BlindedMessagePath`]. + * + * This data is encrypted by the recipient and will be given to the corresponding message handler + * when handling a message sent over the [`BlindedMessagePath`]. The recipient can use this data to + * authenticate the message or for further processing if needed. + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class MessageContext extends CommonBase { + private MessageContext(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.MessageContext_free(ptr); } + } + static MessageContext constr_from_ptr(long ptr) { + bindings.LDKMessageContext raw_val = bindings.LDKMessageContext_ref_from_ptr(ptr); + if (raw_val.getClass() == bindings.LDKMessageContext.Offers.class) { + return new Offers(ptr, (bindings.LDKMessageContext.Offers)raw_val); + } + if (raw_val.getClass() == bindings.LDKMessageContext.Custom.class) { + return new Custom(ptr, (bindings.LDKMessageContext.Custom)raw_val); + } + assert false; return null; // Unreachable without extending the (internal) bindings interface + } + + /** + * Context specific to an [`OffersMessage`]. + * + * [`OffersMessage`]: crate::onion_message::offers::OffersMessage + */ + public final static class Offers extends MessageContext { + public final org.ldk.structs.OffersContext offers; + private Offers(long ptr, bindings.LDKMessageContext.Offers obj) { + super(null, ptr); + long offers = obj.offers; + org.ldk.structs.OffersContext offers_hu_conv = org.ldk.structs.OffersContext.constr_from_ptr(offers); + if (offers_hu_conv != null) { offers_hu_conv.ptrs_to.add(this); }; + this.offers = offers_hu_conv; + } + } + /** + * Context specific to a [`CustomOnionMessageHandler::CustomMessage`]. + * + * [`CustomOnionMessageHandler::CustomMessage`]: crate::onion_message::messenger::CustomOnionMessageHandler::CustomMessage + */ + public final static class Custom extends MessageContext { + public final byte[] custom; + private Custom(long ptr, bindings.LDKMessageContext.Custom obj) { + super(null, ptr); + this.custom = obj.custom; + } + } + long clone_ptr() { + long ret = bindings.MessageContext_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the MessageContext + */ + public MessageContext clone() { + long ret = bindings.MessageContext_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageContext ret_hu_conv = org.ldk.structs.MessageContext.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new Offers-variant MessageContext + */ + public static MessageContext offers(org.ldk.structs.OffersContext a) { + long ret = bindings.MessageContext_offers(a.ptr); + Reference.reachabilityFence(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageContext ret_hu_conv = org.ldk.structs.MessageContext.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new Custom-variant MessageContext + */ + public static MessageContext custom(byte[] a) { + long ret = bindings.MessageContext_custom(a); + Reference.reachabilityFence(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageContext ret_hu_conv = org.ldk.structs.MessageContext.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Serialize the MessageContext object into a byte array which can be read by MessageContext_read + */ + public byte[] write() { + byte[] ret = bindings.MessageContext_write(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Read a MessageContext from a byte array, created by MessageContext_write + */ + public static Result_MessageContextDecodeErrorZ read(byte[] ser) { + long ret = bindings.MessageContext_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_MessageContextDecodeErrorZ ret_hu_conv = Result_MessageContextDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/MessageForwardNode.java b/src/main/java/org/ldk/structs/MessageForwardNode.java new file mode 100644 index 00000000..350b5db0 --- /dev/null +++ b/src/main/java/org/ldk/structs/MessageForwardNode.java @@ -0,0 +1,126 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * An intermediate node, and possibly a short channel id leading to the next node. + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class MessageForwardNode extends CommonBase { + MessageForwardNode(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.MessageForwardNode_free(ptr); } + } + + /** + * This node's pubkey. + */ + public byte[] get_node_id() { + byte[] ret = bindings.MessageForwardNode_get_node_id(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * This node's pubkey. + */ + public void set_node_id(byte[] val) { + bindings.MessageForwardNode_set_node_id(this.ptr, InternalUtils.check_arr_len(val, 33)); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * The channel between `node_id` and the next hop. If set, the constructed [`BlindedHop`]'s + * `encrypted_payload` will use this instead of the next [`MessageForwardNode::node_id`] for a + * more compact representation. + */ + public Option_u64Z get_short_channel_id() { + long ret = bindings.MessageForwardNode_get_short_channel_id(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * The channel between `node_id` and the next hop. If set, the constructed [`BlindedHop`]'s + * `encrypted_payload` will use this instead of the next [`MessageForwardNode::node_id`] for a + * more compact representation. + */ + public void set_short_channel_id(org.ldk.structs.Option_u64Z val) { + bindings.MessageForwardNode_set_short_channel_id(this.ptr, val.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * Constructs a new MessageForwardNode given each field + */ + public static MessageForwardNode of(byte[] node_id_arg, org.ldk.structs.Option_u64Z short_channel_id_arg) { + long ret = bindings.MessageForwardNode_new(InternalUtils.check_arr_len(node_id_arg, 33), short_channel_id_arg.ptr); + Reference.reachabilityFence(node_id_arg); + Reference.reachabilityFence(short_channel_id_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageForwardNode ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.MessageForwardNode(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + long clone_ptr() { + long ret = bindings.MessageForwardNode_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the MessageForwardNode + */ + public MessageForwardNode clone() { + long ret = bindings.MessageForwardNode_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageForwardNode ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.MessageForwardNode(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Generates a non-cryptographic 64-bit hash of the MessageForwardNode. + */ + public long hash() { + long ret = bindings.MessageForwardNode_hash(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + @Override public int hashCode() { + return (int)this.hash(); + } + /** + * Checks if two MessageForwardNodes contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public boolean eq(org.ldk.structs.MessageForwardNode b) { + boolean ret = bindings.MessageForwardNode_eq(this.ptr, b.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(b); + if (this != null) { this.ptrs_to.add(b); }; + return ret; + } + + @Override public boolean equals(Object o) { + if (!(o instanceof MessageForwardNode)) return false; + return this.eq((MessageForwardNode)o); + } +} diff --git a/src/main/java/org/ldk/structs/MessageRouter.java b/src/main/java/org/ldk/structs/MessageRouter.java index 04c36d21..5384786c 100644 --- a/src/main/java/org/ldk/structs/MessageRouter.java +++ b/src/main/java/org/ldk/structs/MessageRouter.java @@ -42,10 +42,26 @@ public class MessageRouter extends CommonBase { */ Result_OnionMessagePathNoneZ find_path(byte[] sender, byte[][] peers, Destination destination); /** - * Creates [`BlindedPath`]s to the `recipient` node. The nodes in `peers` are assumed to be - * direct peers with the `recipient`. + * Creates [`BlindedMessagePath`]s to the `recipient` node. The nodes in `peers` are assumed to + * be direct peers with the `recipient`. */ - Result_CVec_BlindedPathZNoneZ create_blinded_paths(byte[] recipient, byte[][] peers); + Result_CVec_BlindedMessagePathZNoneZ create_blinded_paths(byte[] recipient, MessageContext context, byte[][] peers); + /** + * Creates compact [`BlindedMessagePath`]s to the `recipient` node. The nodes in `peers` are + * assumed to be direct peers with the `recipient`. + * + * Compact blinded paths use short channel ids instead of pubkeys for a smaller serialization, + * which is beneficial when a QR code is used to transport the data. The SCID is passed using + * a [`MessageForwardNode`] but may be `None` for graceful degradation. + * + * Implementations using additional intermediate nodes are responsible for using a + * [`MessageForwardNode`] with `Some` short channel id, if possible. Similarly, implementations + * should call [`BlindedMessagePath::use_compact_introduction_node`]. + * + * The provided implementation simply delegates to [`MessageRouter::create_blinded_paths`], + * ignoring the short channel ids. + */ + Result_CVec_BlindedMessagePathZNoneZ create_compact_blinded_paths(byte[] recipient, MessageContext context, MessageForwardNode[] peers); } private static class LDKMessageRouterHolder { MessageRouter held; } public static MessageRouter new_impl(MessageRouterInterface arg) { @@ -59,8 +75,26 @@ public class MessageRouter extends CommonBase { long result = ret.clone_ptr(); return result; } - @Override public long create_blinded_paths(byte[] recipient, byte[][] peers) { - Result_CVec_BlindedPathZNoneZ ret = arg.create_blinded_paths(recipient, peers); + @Override public long create_blinded_paths(byte[] recipient, long context, byte[][] peers) { + org.ldk.structs.MessageContext context_hu_conv = org.ldk.structs.MessageContext.constr_from_ptr(context); + if (context_hu_conv != null) { context_hu_conv.ptrs_to.add(this); }; + Result_CVec_BlindedMessagePathZNoneZ ret = arg.create_blinded_paths(recipient, context_hu_conv, peers); + Reference.reachabilityFence(arg); + long result = ret.clone_ptr(); + return result; + } + @Override public long create_compact_blinded_paths(byte[] recipient, long context, long[] peers) { + org.ldk.structs.MessageContext context_hu_conv = org.ldk.structs.MessageContext.constr_from_ptr(context); + if (context_hu_conv != null) { context_hu_conv.ptrs_to.add(this); }; + int peers_conv_20_len = peers.length; + MessageForwardNode[] peers_conv_20_arr = new MessageForwardNode[peers_conv_20_len]; + for (int u = 0; u < peers_conv_20_len; u++) { + long peers_conv_20 = peers[u]; + org.ldk.structs.MessageForwardNode peers_conv_20_hu_conv = null; if (peers_conv_20 < 0 || peers_conv_20 > 4096) { peers_conv_20_hu_conv = new org.ldk.structs.MessageForwardNode(null, peers_conv_20); } + if (peers_conv_20_hu_conv != null) { peers_conv_20_hu_conv.ptrs_to.add(this); }; + peers_conv_20_arr[u] = peers_conv_20_hu_conv; + } + Result_CVec_BlindedMessagePathZNoneZ ret = arg.create_compact_blinded_paths(recipient, context_hu_conv, peers_conv_20_arr); Reference.reachabilityFence(arg); long result = ret.clone_ptr(); return result; @@ -79,21 +113,47 @@ public class MessageRouter extends CommonBase { Reference.reachabilityFence(destination); if (ret >= 0 && ret <= 4096) { return null; } Result_OnionMessagePathNoneZ ret_hu_conv = Result_OnionMessagePathNoneZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.add(destination); }; return ret_hu_conv; } /** - * Creates [`BlindedPath`]s to the `recipient` node. The nodes in `peers` are assumed to be - * direct peers with the `recipient`. + * Creates [`BlindedMessagePath`]s to the `recipient` node. The nodes in `peers` are assumed to + * be direct peers with the `recipient`. + */ + public Result_CVec_BlindedMessagePathZNoneZ create_blinded_paths(byte[] recipient, org.ldk.structs.MessageContext context, byte[][] peers) { + long ret = bindings.MessageRouter_create_blinded_paths(this.ptr, InternalUtils.check_arr_len(recipient, 33), context.ptr, peers != null ? Arrays.stream(peers).map(peers_conv_8 -> InternalUtils.check_arr_len(peers_conv_8, 33)).toArray(byte[][]::new) : null); + Reference.reachabilityFence(this); + Reference.reachabilityFence(recipient); + Reference.reachabilityFence(context); + Reference.reachabilityFence(peers); + if (ret >= 0 && ret <= 4096) { return null; } + Result_CVec_BlindedMessagePathZNoneZ ret_hu_conv = Result_CVec_BlindedMessagePathZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates compact [`BlindedMessagePath`]s to the `recipient` node. The nodes in `peers` are + * assumed to be direct peers with the `recipient`. + * + * Compact blinded paths use short channel ids instead of pubkeys for a smaller serialization, + * which is beneficial when a QR code is used to transport the data. The SCID is passed using + * a [`MessageForwardNode`] but may be `None` for graceful degradation. + * + * Implementations using additional intermediate nodes are responsible for using a + * [`MessageForwardNode`] with `Some` short channel id, if possible. Similarly, implementations + * should call [`BlindedMessagePath::use_compact_introduction_node`]. + * + * The provided implementation simply delegates to [`MessageRouter::create_blinded_paths`], + * ignoring the short channel ids. */ - public Result_CVec_BlindedPathZNoneZ create_blinded_paths(byte[] recipient, byte[][] peers) { - long ret = bindings.MessageRouter_create_blinded_paths(this.ptr, InternalUtils.check_arr_len(recipient, 33), peers != null ? Arrays.stream(peers).map(peers_conv_8 -> InternalUtils.check_arr_len(peers_conv_8, 33)).toArray(byte[][]::new) : null); + public Result_CVec_BlindedMessagePathZNoneZ create_compact_blinded_paths(byte[] recipient, org.ldk.structs.MessageContext context, MessageForwardNode[] peers) { + long ret = bindings.MessageRouter_create_compact_blinded_paths(this.ptr, InternalUtils.check_arr_len(recipient, 33), context.ptr, peers != null ? Arrays.stream(peers).mapToLong(peers_conv_20 -> peers_conv_20.ptr).toArray() : null); Reference.reachabilityFence(this); Reference.reachabilityFence(recipient); + Reference.reachabilityFence(context); Reference.reachabilityFence(peers); if (ret >= 0 && ret <= 4096) { return null; } - Result_CVec_BlindedPathZNoneZ ret_hu_conv = Result_CVec_BlindedPathZNoneZ.constr_from_ptr(ret); + Result_CVec_BlindedMessagePathZNoneZ ret_hu_conv = Result_CVec_BlindedMessagePathZNoneZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/MessageSendEvent.java b/src/main/java/org/ldk/structs/MessageSendEvent.java index 61d968b9..9f191571 100644 --- a/src/main/java/org/ldk/structs/MessageSendEvent.java +++ b/src/main/java/org/ldk/structs/MessageSendEvent.java @@ -44,8 +44,8 @@ public class MessageSendEvent extends CommonBase { if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendStfu.class) { return new SendStfu(ptr, (bindings.LDKMessageSendEvent.SendStfu)raw_val); } - if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendSplice.class) { - return new SendSplice(ptr, (bindings.LDKMessageSendEvent.SendSplice)raw_val); + if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendSpliceInit.class) { + return new SendSpliceInit(ptr, (bindings.LDKMessageSendEvent.SendSpliceInit)raw_val); } if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendSpliceAck.class) { return new SendSpliceAck(ptr, (bindings.LDKMessageSendEvent.SendSpliceAck)raw_val); @@ -286,9 +286,9 @@ public class MessageSendEvent extends CommonBase { } } /** - * Used to indicate that a splice message should be sent to the peer with the given node id. + * Used to indicate that a splice_init message should be sent to the peer with the given node id. */ - public final static class SendSplice extends MessageSendEvent { + public final static class SendSpliceInit extends MessageSendEvent { /** * The node_id of the node which should receive this message */ @@ -296,12 +296,12 @@ public class MessageSendEvent extends CommonBase { /** * The message which should be sent. */ - public final org.ldk.structs.Splice msg; - private SendSplice(long ptr, bindings.LDKMessageSendEvent.SendSplice obj) { + public final org.ldk.structs.SpliceInit msg; + private SendSpliceInit(long ptr, bindings.LDKMessageSendEvent.SendSpliceInit obj) { super(null, ptr); this.node_id = obj.node_id; long msg = obj.msg; - org.ldk.structs.Splice msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.Splice(null, msg); } + org.ldk.structs.SpliceInit msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.SpliceInit(null, msg); } if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); }; this.msg = msg_hu_conv; } @@ -941,7 +941,6 @@ public class MessageSendEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; return ret_hu_conv; } @@ -955,7 +954,6 @@ public class MessageSendEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; return ret_hu_conv; } @@ -969,7 +967,6 @@ public class MessageSendEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; return ret_hu_conv; } @@ -983,7 +980,6 @@ public class MessageSendEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; return ret_hu_conv; } @@ -997,7 +993,6 @@ public class MessageSendEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; return ret_hu_conv; } @@ -1011,7 +1006,6 @@ public class MessageSendEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; return ret_hu_conv; } @@ -1025,21 +1019,19 @@ public class MessageSendEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; return ret_hu_conv; } /** - * Utility method to constructs a new SendSplice-variant MessageSendEvent + * Utility method to constructs a new SendSpliceInit-variant MessageSendEvent */ - public static MessageSendEvent send_splice(byte[] node_id, org.ldk.structs.Splice msg) { - long ret = bindings.MessageSendEvent_send_splice(InternalUtils.check_arr_len(node_id, 33), msg.ptr); + public static MessageSendEvent send_splice_init(byte[] node_id, org.ldk.structs.SpliceInit msg) { + long ret = bindings.MessageSendEvent_send_splice_init(InternalUtils.check_arr_len(node_id, 33), msg.ptr); Reference.reachabilityFence(node_id); Reference.reachabilityFence(msg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; return ret_hu_conv; } @@ -1053,7 +1045,6 @@ public class MessageSendEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; return ret_hu_conv; } @@ -1067,7 +1058,6 @@ public class MessageSendEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; return ret_hu_conv; } @@ -1081,7 +1071,6 @@ public class MessageSendEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; return ret_hu_conv; } @@ -1095,7 +1084,6 @@ public class MessageSendEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; return ret_hu_conv; } @@ -1109,7 +1097,6 @@ public class MessageSendEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; return ret_hu_conv; } @@ -1123,7 +1110,6 @@ public class MessageSendEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; return ret_hu_conv; } @@ -1137,7 +1123,6 @@ public class MessageSendEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; return ret_hu_conv; } @@ -1151,7 +1136,6 @@ public class MessageSendEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; return ret_hu_conv; } @@ -1165,7 +1149,6 @@ public class MessageSendEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; return ret_hu_conv; } @@ -1179,7 +1162,6 @@ public class MessageSendEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; return ret_hu_conv; } @@ -1193,7 +1175,6 @@ public class MessageSendEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; return ret_hu_conv; } @@ -1207,7 +1188,6 @@ public class MessageSendEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; return ret_hu_conv; } @@ -1221,7 +1201,6 @@ public class MessageSendEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; return ret_hu_conv; } @@ -1235,7 +1214,6 @@ public class MessageSendEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(updates); }; return ret_hu_conv; } @@ -1249,7 +1227,6 @@ public class MessageSendEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; return ret_hu_conv; } @@ -1263,7 +1240,6 @@ public class MessageSendEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; return ret_hu_conv; } @@ -1277,7 +1253,6 @@ public class MessageSendEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; return ret_hu_conv; } @@ -1291,7 +1266,6 @@ public class MessageSendEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; return ret_hu_conv; } @@ -1306,8 +1280,6 @@ public class MessageSendEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(update_msg); }; return ret_hu_conv; } @@ -1321,8 +1293,6 @@ public class MessageSendEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(update_msg); }; return ret_hu_conv; } @@ -1335,7 +1305,6 @@ public class MessageSendEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; return ret_hu_conv; } @@ -1348,7 +1317,6 @@ public class MessageSendEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; return ret_hu_conv; } @@ -1362,7 +1330,6 @@ public class MessageSendEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; return ret_hu_conv; } @@ -1376,7 +1343,6 @@ public class MessageSendEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(action); }; return ret_hu_conv; } @@ -1390,7 +1356,6 @@ public class MessageSendEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; return ret_hu_conv; } @@ -1404,7 +1369,6 @@ public class MessageSendEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; return ret_hu_conv; } @@ -1418,7 +1382,6 @@ public class MessageSendEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; return ret_hu_conv; } @@ -1432,7 +1395,6 @@ public class MessageSendEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/MessageSendEventsProvider.java b/src/main/java/org/ldk/structs/MessageSendEventsProvider.java index 05e7e154..47ad9907 100644 --- a/src/main/java/org/ldk/structs/MessageSendEventsProvider.java +++ b/src/main/java/org/ldk/structs/MessageSendEventsProvider.java @@ -51,7 +51,6 @@ public class MessageSendEventsProvider extends CommonBase { MessageSendEvent[] ret = arg.get_and_clear_pending_msg_events(); Reference.reachabilityFence(arg); long[] result = ret != null ? Arrays.stream(ret).mapToLong(ret_conv_18 -> ret_conv_18.clone_ptr()).toArray() : null; - for (MessageSendEvent ret_conv_18: ret) { if (impl_holder.held != null) { impl_holder.held.ptrs_to.add(ret_conv_18); }; }; return result; } }); diff --git a/src/main/java/org/ldk/structs/MessageSendInstructions.java b/src/main/java/org/ldk/structs/MessageSendInstructions.java new file mode 100644 index 00000000..0d3be729 --- /dev/null +++ b/src/main/java/org/ldk/structs/MessageSendInstructions.java @@ -0,0 +1,191 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * Instructions for how and where to send a message. + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class MessageSendInstructions extends CommonBase { + private MessageSendInstructions(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.MessageSendInstructions_free(ptr); } + } + static MessageSendInstructions constr_from_ptr(long ptr) { + bindings.LDKMessageSendInstructions raw_val = bindings.LDKMessageSendInstructions_ref_from_ptr(ptr); + if (raw_val.getClass() == bindings.LDKMessageSendInstructions.WithSpecifiedReplyPath.class) { + return new WithSpecifiedReplyPath(ptr, (bindings.LDKMessageSendInstructions.WithSpecifiedReplyPath)raw_val); + } + if (raw_val.getClass() == bindings.LDKMessageSendInstructions.WithReplyPath.class) { + return new WithReplyPath(ptr, (bindings.LDKMessageSendInstructions.WithReplyPath)raw_val); + } + if (raw_val.getClass() == bindings.LDKMessageSendInstructions.WithoutReplyPath.class) { + return new WithoutReplyPath(ptr, (bindings.LDKMessageSendInstructions.WithoutReplyPath)raw_val); + } + if (raw_val.getClass() == bindings.LDKMessageSendInstructions.ForReply.class) { + return new ForReply(ptr, (bindings.LDKMessageSendInstructions.ForReply)raw_val); + } + assert false; return null; // Unreachable without extending the (internal) bindings interface + } + + /** + * Indicates that a message should be sent including the provided reply path for the recipient + * to respond. + */ + public final static class WithSpecifiedReplyPath extends MessageSendInstructions { + /** + * The destination where we need to send our message. + */ + public final org.ldk.structs.Destination destination; + /** + * The reply path which should be included in the message. + */ + public final org.ldk.structs.BlindedMessagePath reply_path; + private WithSpecifiedReplyPath(long ptr, bindings.LDKMessageSendInstructions.WithSpecifiedReplyPath obj) { + super(null, ptr); + long destination = obj.destination; + org.ldk.structs.Destination destination_hu_conv = org.ldk.structs.Destination.constr_from_ptr(destination); + if (destination_hu_conv != null) { destination_hu_conv.ptrs_to.add(this); }; + this.destination = destination_hu_conv; + long reply_path = obj.reply_path; + org.ldk.structs.BlindedMessagePath reply_path_hu_conv = null; if (reply_path < 0 || reply_path > 4096) { reply_path_hu_conv = new org.ldk.structs.BlindedMessagePath(null, reply_path); } + if (reply_path_hu_conv != null) { reply_path_hu_conv.ptrs_to.add(this); }; + this.reply_path = reply_path_hu_conv; + } + } + /** + * Indicates that a message should be sent including a reply path for the recipient to + * respond. + */ + public final static class WithReplyPath extends MessageSendInstructions { + /** + * The destination where we need to send our message. + */ + public final org.ldk.structs.Destination destination; + /** + * The context to include in the reply path we'll give the recipient so they can respond + * to us. + */ + public final org.ldk.structs.MessageContext context; + private WithReplyPath(long ptr, bindings.LDKMessageSendInstructions.WithReplyPath obj) { + super(null, ptr); + long destination = obj.destination; + org.ldk.structs.Destination destination_hu_conv = org.ldk.structs.Destination.constr_from_ptr(destination); + if (destination_hu_conv != null) { destination_hu_conv.ptrs_to.add(this); }; + this.destination = destination_hu_conv; + long context = obj.context; + org.ldk.structs.MessageContext context_hu_conv = org.ldk.structs.MessageContext.constr_from_ptr(context); + if (context_hu_conv != null) { context_hu_conv.ptrs_to.add(this); }; + this.context = context_hu_conv; + } + } + /** + * Indicates that a message should be sent without including a reply path, preventing the + * recipient from responding. + */ + public final static class WithoutReplyPath extends MessageSendInstructions { + /** + * The destination where we need to send our message. + */ + public final org.ldk.structs.Destination destination; + private WithoutReplyPath(long ptr, bindings.LDKMessageSendInstructions.WithoutReplyPath obj) { + super(null, ptr); + long destination = obj.destination; + org.ldk.structs.Destination destination_hu_conv = org.ldk.structs.Destination.constr_from_ptr(destination); + if (destination_hu_conv != null) { destination_hu_conv.ptrs_to.add(this); }; + this.destination = destination_hu_conv; + } + } + /** + * Indicates that a message is being sent as a reply to a received message. + */ + public final static class ForReply extends MessageSendInstructions { + /** + * The instructions provided by the [`Responder`]. + */ + public final org.ldk.structs.ResponseInstruction instructions; + private ForReply(long ptr, bindings.LDKMessageSendInstructions.ForReply obj) { + super(null, ptr); + long instructions = obj.instructions; + org.ldk.structs.ResponseInstruction instructions_hu_conv = null; if (instructions < 0 || instructions > 4096) { instructions_hu_conv = new org.ldk.structs.ResponseInstruction(null, instructions); } + if (instructions_hu_conv != null) { instructions_hu_conv.ptrs_to.add(this); }; + this.instructions = instructions_hu_conv; + } + } + long clone_ptr() { + long ret = bindings.MessageSendInstructions_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the MessageSendInstructions + */ + public MessageSendInstructions clone() { + long ret = bindings.MessageSendInstructions_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageSendInstructions ret_hu_conv = org.ldk.structs.MessageSendInstructions.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new WithSpecifiedReplyPath-variant MessageSendInstructions + */ + public static MessageSendInstructions with_specified_reply_path(org.ldk.structs.Destination destination, org.ldk.structs.BlindedMessagePath reply_path) { + long ret = bindings.MessageSendInstructions_with_specified_reply_path(destination.ptr, reply_path.ptr); + Reference.reachabilityFence(destination); + Reference.reachabilityFence(reply_path); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageSendInstructions ret_hu_conv = org.ldk.structs.MessageSendInstructions.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new WithReplyPath-variant MessageSendInstructions + */ + public static MessageSendInstructions with_reply_path(org.ldk.structs.Destination destination, org.ldk.structs.MessageContext context) { + long ret = bindings.MessageSendInstructions_with_reply_path(destination.ptr, context.ptr); + Reference.reachabilityFence(destination); + Reference.reachabilityFence(context); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageSendInstructions ret_hu_conv = org.ldk.structs.MessageSendInstructions.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new WithoutReplyPath-variant MessageSendInstructions + */ + public static MessageSendInstructions without_reply_path(org.ldk.structs.Destination destination) { + long ret = bindings.MessageSendInstructions_without_reply_path(destination.ptr); + Reference.reachabilityFence(destination); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageSendInstructions ret_hu_conv = org.ldk.structs.MessageSendInstructions.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new ForReply-variant MessageSendInstructions + */ + public static MessageSendInstructions for_reply(org.ldk.structs.ResponseInstruction instructions) { + long ret = bindings.MessageSendInstructions_for_reply(instructions.ptr); + Reference.reachabilityFence(instructions); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageSendInstructions ret_hu_conv = org.ldk.structs.MessageSendInstructions.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/MonitorEvent.java b/src/main/java/org/ldk/structs/MonitorEvent.java index 5908a1de..f055b4f2 100644 --- a/src/main/java/org/ldk/structs/MonitorEvent.java +++ b/src/main/java/org/ldk/structs/MonitorEvent.java @@ -159,7 +159,6 @@ public class MonitorEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MonitorEvent ret_hu_conv = org.ldk.structs.MonitorEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; return ret_hu_conv; } @@ -174,9 +173,6 @@ public class MonitorEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MonitorEvent ret_hu_conv = org.ldk.structs.MonitorEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(reason); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(outpoint); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id); }; return ret_hu_conv; } @@ -189,7 +185,6 @@ public class MonitorEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MonitorEvent ret_hu_conv = org.ldk.structs.MonitorEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; return ret_hu_conv; } @@ -204,8 +199,6 @@ public class MonitorEvent extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MonitorEvent ret_hu_conv = org.ldk.structs.MonitorEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(funding_txo); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/MonitorUpdateId.java b/src/main/java/org/ldk/structs/MonitorUpdateId.java deleted file mode 100644 index 14c6d5ca..00000000 --- a/src/main/java/org/ldk/structs/MonitorUpdateId.java +++ /dev/null @@ -1,70 +0,0 @@ -package org.ldk.structs; - -import org.ldk.impl.bindings; -import org.ldk.enums.*; -import org.ldk.util.*; -import java.util.Arrays; -import java.lang.ref.Reference; -import javax.annotation.Nullable; - - -/** - * An opaque identifier describing a specific [`Persist`] method call. - */ -@SuppressWarnings("unchecked") // We correctly assign various generic arrays -public class MonitorUpdateId extends CommonBase { - MonitorUpdateId(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.MonitorUpdateId_free(ptr); } - } - - long clone_ptr() { - long ret = bindings.MonitorUpdateId_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Creates a copy of the MonitorUpdateId - */ - public MonitorUpdateId clone() { - long ret = bindings.MonitorUpdateId_clone(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.MonitorUpdateId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.MonitorUpdateId(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - return ret_hu_conv; - } - - /** - * Generates a non-cryptographic 64-bit hash of the MonitorUpdateId. - */ - public long hash() { - long ret = bindings.MonitorUpdateId_hash(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - @Override public int hashCode() { - return (int)this.hash(); - } - /** - * Checks if two MonitorUpdateIds contain equal inner contents. - * This ignores pointers and is_owned flags and looks at the values in fields. - * Two objects with NULL inner values will be considered "equal" here. - */ - public boolean eq(org.ldk.structs.MonitorUpdateId b) { - boolean ret = bindings.MonitorUpdateId_eq(this.ptr, b.ptr); - Reference.reachabilityFence(this); - Reference.reachabilityFence(b); - if (this != null) { this.ptrs_to.add(b); }; - return ret; - } - - @Override public boolean equals(Object o) { - if (!(o instanceof MonitorUpdateId)) return false; - return this.eq((MonitorUpdateId)o); - } -} diff --git a/src/main/java/org/ldk/structs/MonitorUpdatingPersister.java b/src/main/java/org/ldk/structs/MonitorUpdatingPersister.java index c71b5c44..9d390444 100644 --- a/src/main/java/org/ldk/structs/MonitorUpdatingPersister.java +++ b/src/main/java/org/ldk/structs/MonitorUpdatingPersister.java @@ -120,13 +120,15 @@ public class MonitorUpdatingPersister extends CommonBase { * - [`MonitorUpdatingPersister`] will potentially have more listing to do if you need to run * [`MonitorUpdatingPersister::cleanup_stale_updates`]. */ - public static MonitorUpdatingPersister of(org.ldk.structs.KVStore kv_store, org.ldk.structs.Logger logger, long maximum_pending_updates, org.ldk.structs.EntropySource entropy_source, org.ldk.structs.SignerProvider signer_provider) { - long ret = bindings.MonitorUpdatingPersister_new(kv_store.ptr, logger.ptr, maximum_pending_updates, entropy_source.ptr, signer_provider.ptr); + public static MonitorUpdatingPersister of(org.ldk.structs.KVStore kv_store, org.ldk.structs.Logger logger, long maximum_pending_updates, org.ldk.structs.EntropySource entropy_source, org.ldk.structs.SignerProvider signer_provider, org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator) { + long ret = bindings.MonitorUpdatingPersister_new(kv_store.ptr, logger.ptr, maximum_pending_updates, entropy_source.ptr, signer_provider.ptr, broadcaster.ptr, fee_estimator.ptr); Reference.reachabilityFence(kv_store); Reference.reachabilityFence(logger); Reference.reachabilityFence(maximum_pending_updates); Reference.reachabilityFence(entropy_source); Reference.reachabilityFence(signer_provider); + Reference.reachabilityFence(broadcaster); + Reference.reachabilityFence(fee_estimator); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MonitorUpdatingPersister ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.MonitorUpdatingPersister(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; @@ -134,6 +136,8 @@ public class MonitorUpdatingPersister extends CommonBase { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(logger); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(entropy_source); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(signer_provider); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(broadcaster); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(fee_estimator); }; return ret_hu_conv; } @@ -144,15 +148,11 @@ public class MonitorUpdatingPersister extends CommonBase { * [`io::ErrorKind::NotFound`] variant correctly. For more information, please see the * documentation for [`MonitorUpdatingPersister`]. */ - public Result_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ read_all_channel_monitors_with_updates(org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator) { - long ret = bindings.MonitorUpdatingPersister_read_all_channel_monitors_with_updates(this.ptr, broadcaster.ptr, fee_estimator.ptr); + public Result_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ read_all_channel_monitors_with_updates() { + long ret = bindings.MonitorUpdatingPersister_read_all_channel_monitors_with_updates(this.ptr); Reference.reachabilityFence(this); - Reference.reachabilityFence(broadcaster); - Reference.reachabilityFence(fee_estimator); if (ret >= 0 && ret <= 4096) { return null; } Result_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ ret_hu_conv = Result_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.add(broadcaster); }; - if (this != null) { this.ptrs_to.add(fee_estimator); }; return ret_hu_conv; } @@ -175,16 +175,12 @@ public class MonitorUpdatingPersister extends CommonBase { * Loading a large number of monitors will be faster if done in parallel. You can use this * function to accomplish this. Take care to limit the number of parallel readers. */ - public Result_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ read_channel_monitor_with_updates(org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator, java.lang.String monitor_key) { - long ret = bindings.MonitorUpdatingPersister_read_channel_monitor_with_updates(this.ptr, broadcaster.ptr, fee_estimator.ptr, monitor_key); + public Result_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ read_channel_monitor_with_updates(java.lang.String monitor_key) { + long ret = bindings.MonitorUpdatingPersister_read_channel_monitor_with_updates(this.ptr, monitor_key); Reference.reachabilityFence(this); - Reference.reachabilityFence(broadcaster); - Reference.reachabilityFence(fee_estimator); Reference.reachabilityFence(monitor_key); if (ret >= 0 && ret <= 4096) { return null; } Result_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ ret_hu_conv = Result_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.add(broadcaster); }; - if (this != null) { this.ptrs_to.add(fee_estimator); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/NetworkGraph.java b/src/main/java/org/ldk/structs/NetworkGraph.java index f8f09dca..c9f86046 100644 --- a/src/main/java/org/ldk/structs/NetworkGraph.java +++ b/src/main/java/org/ldk/structs/NetworkGraph.java @@ -22,8 +22,6 @@ public class NetworkGraph extends CommonBase { /** * Handles any network updates originating from [`Event`]s. - * Note that this will skip applying any [`NetworkUpdate::ChannelUpdateMessage`] to avoid - * leaking possibly identifying information of the sender to the public network. * * [`Event`]: crate::events::Event */ @@ -235,7 +233,6 @@ public class NetworkGraph extends CommonBase { Reference.reachabilityFence(node_id_2); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.add(features); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/NetworkUpdate.java b/src/main/java/org/ldk/structs/NetworkUpdate.java index e1d1be45..f57803db 100644 --- a/src/main/java/org/ldk/structs/NetworkUpdate.java +++ b/src/main/java/org/ldk/structs/NetworkUpdate.java @@ -24,9 +24,6 @@ public class NetworkUpdate extends CommonBase { } static NetworkUpdate constr_from_ptr(long ptr) { bindings.LDKNetworkUpdate raw_val = bindings.LDKNetworkUpdate_ref_from_ptr(ptr); - if (raw_val.getClass() == bindings.LDKNetworkUpdate.ChannelUpdateMessage.class) { - return new ChannelUpdateMessage(ptr, (bindings.LDKNetworkUpdate.ChannelUpdateMessage)raw_val); - } if (raw_val.getClass() == bindings.LDKNetworkUpdate.ChannelFailure.class) { return new ChannelFailure(ptr, (bindings.LDKNetworkUpdate.ChannelFailure)raw_val); } @@ -36,23 +33,6 @@ public class NetworkUpdate extends CommonBase { assert false; return null; // Unreachable without extending the (internal) bindings interface } - /** - * An error indicating a `channel_update` messages should be applied via - * [`NetworkGraph::update_channel`]. - */ - public final static class ChannelUpdateMessage extends NetworkUpdate { - /** - * The update to apply via [`NetworkGraph::update_channel`]. - */ - public final org.ldk.structs.ChannelUpdate msg; - private ChannelUpdateMessage(long ptr, bindings.LDKNetworkUpdate.ChannelUpdateMessage obj) { - super(null, ptr); - long msg = obj.msg; - org.ldk.structs.ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelUpdate(null, msg); } - if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); }; - this.msg = msg_hu_conv; - } - } /** * An error indicating that a channel failed to route a payment, which should be applied via * [`NetworkGraph::channel_failed_permanent`] if permanent. @@ -111,19 +91,6 @@ public class NetworkUpdate extends CommonBase { return ret_hu_conv; } - /** - * Utility method to constructs a new ChannelUpdateMessage-variant NetworkUpdate - */ - public static NetworkUpdate channel_update_message(org.ldk.structs.ChannelUpdate msg) { - long ret = bindings.NetworkUpdate_channel_update_message(msg.ptr); - Reference.reachabilityFence(msg); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.NetworkUpdate ret_hu_conv = org.ldk.structs.NetworkUpdate.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; - return ret_hu_conv; - } - /** * Utility method to constructs a new ChannelFailure-variant NetworkUpdate */ diff --git a/src/main/java/org/ldk/structs/NodeAnnouncement.java b/src/main/java/org/ldk/structs/NodeAnnouncement.java index d4323176..19e8d8f0 100644 --- a/src/main/java/org/ldk/structs/NodeAnnouncement.java +++ b/src/main/java/org/ldk/structs/NodeAnnouncement.java @@ -59,7 +59,6 @@ public class NodeAnnouncement extends CommonBase { bindings.NodeAnnouncement_set_contents(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -72,7 +71,6 @@ public class NodeAnnouncement extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.NodeAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAnnouncement(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(contents_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/NodeAnnouncementDetails.java b/src/main/java/org/ldk/structs/NodeAnnouncementDetails.java new file mode 100644 index 00000000..fcf87deb --- /dev/null +++ b/src/main/java/org/ldk/structs/NodeAnnouncementDetails.java @@ -0,0 +1,186 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * Non-relayable information received in the latest node_announcement from this node. + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class NodeAnnouncementDetails extends CommonBase { + NodeAnnouncementDetails(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.NodeAnnouncementDetails_free(ptr); } + } + + /** + * Protocol features the node announced support for + */ + public NodeFeatures get_features() { + long ret = bindings.NodeAnnouncementDetails_get_features(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Protocol features the node announced support for + */ + public void set_features(org.ldk.structs.NodeFeatures val) { + bindings.NodeAnnouncementDetails_set_features(this.ptr, val.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * When the last known update to the node state was issued. + * Value is opaque, as set in the announcement. + */ + public int get_last_update() { + int ret = bindings.NodeAnnouncementDetails_get_last_update(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * When the last known update to the node state was issued. + * Value is opaque, as set in the announcement. + */ + public void set_last_update(int val) { + bindings.NodeAnnouncementDetails_set_last_update(this.ptr, val); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * Color assigned to the node + */ + public byte[] get_rgb() { + byte[] ret = bindings.NodeAnnouncementDetails_get_rgb(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Color assigned to the node + */ + public void set_rgb(byte[] val) { + bindings.NodeAnnouncementDetails_set_rgb(this.ptr, InternalUtils.check_arr_len(val, 3)); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * Moniker assigned to the node. + * May be invalid or malicious (eg control chars), + * should not be exposed to the user. + */ + public NodeAlias get_alias() { + long ret = bindings.NodeAnnouncementDetails_get_alias(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.NodeAlias ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAlias(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Moniker assigned to the node. + * May be invalid or malicious (eg control chars), + * should not be exposed to the user. + */ + public void set_alias(org.ldk.structs.NodeAlias val) { + bindings.NodeAnnouncementDetails_set_alias(this.ptr, val.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * Internet-level addresses via which one can connect to the node + * + * Returns a copy of the field. + */ + public SocketAddress[] get_addresses() { + long[] ret = bindings.NodeAnnouncementDetails_get_addresses(this.ptr); + Reference.reachabilityFence(this); + int ret_conv_15_len = ret.length; + SocketAddress[] ret_conv_15_arr = new SocketAddress[ret_conv_15_len]; + for (int p = 0; p < ret_conv_15_len; p++) { + long ret_conv_15 = ret[p]; + org.ldk.structs.SocketAddress ret_conv_15_hu_conv = org.ldk.structs.SocketAddress.constr_from_ptr(ret_conv_15); + if (ret_conv_15_hu_conv != null) { ret_conv_15_hu_conv.ptrs_to.add(this); }; + ret_conv_15_arr[p] = ret_conv_15_hu_conv; + } + return ret_conv_15_arr; + } + + /** + * Internet-level addresses via which one can connect to the node + */ + public void set_addresses(SocketAddress[] val) { + bindings.NodeAnnouncementDetails_set_addresses(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_15 -> val_conv_15.ptr).toArray() : null); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * Constructs a new NodeAnnouncementDetails given each field + */ + public static NodeAnnouncementDetails of(org.ldk.structs.NodeFeatures features_arg, int last_update_arg, byte[] rgb_arg, org.ldk.structs.NodeAlias alias_arg, SocketAddress[] addresses_arg) { + long ret = bindings.NodeAnnouncementDetails_new(features_arg.ptr, last_update_arg, InternalUtils.check_arr_len(rgb_arg, 3), alias_arg.ptr, addresses_arg != null ? Arrays.stream(addresses_arg).mapToLong(addresses_arg_conv_15 -> addresses_arg_conv_15.ptr).toArray() : null); + Reference.reachabilityFence(features_arg); + Reference.reachabilityFence(last_update_arg); + Reference.reachabilityFence(rgb_arg); + Reference.reachabilityFence(alias_arg); + Reference.reachabilityFence(addresses_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.NodeAnnouncementDetails ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAnnouncementDetails(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + long clone_ptr() { + long ret = bindings.NodeAnnouncementDetails_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the NodeAnnouncementDetails + */ + public NodeAnnouncementDetails clone() { + long ret = bindings.NodeAnnouncementDetails_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.NodeAnnouncementDetails ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAnnouncementDetails(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Checks if two NodeAnnouncementDetailss contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public boolean eq(org.ldk.structs.NodeAnnouncementDetails b) { + boolean ret = bindings.NodeAnnouncementDetails_eq(this.ptr, b.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(b); + if (this != null) { this.ptrs_to.add(b); }; + return ret; + } + + @Override public boolean equals(Object o) { + if (!(o instanceof NodeAnnouncementDetails)) return false; + return this.eq((NodeAnnouncementDetails)o); + } +} diff --git a/src/main/java/org/ldk/structs/NodeAnnouncementInfo.java b/src/main/java/org/ldk/structs/NodeAnnouncementInfo.java index 92b69eaf..61ea03f7 100644 --- a/src/main/java/org/ldk/structs/NodeAnnouncementInfo.java +++ b/src/main/java/org/ldk/structs/NodeAnnouncementInfo.java @@ -13,188 +13,154 @@ import javax.annotation.Nullable; */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class NodeAnnouncementInfo extends CommonBase { - NodeAnnouncementInfo(Object _dummy, long ptr) { super(ptr); } + private NodeAnnouncementInfo(Object _dummy, long ptr) { super(ptr); } @Override @SuppressWarnings("deprecation") protected void finalize() throws Throwable { super.finalize(); if (ptr != 0) { bindings.NodeAnnouncementInfo_free(ptr); } } - - /** - * Protocol features the node announced support for - */ - public NodeFeatures get_features() { - long ret = bindings.NodeAnnouncementInfo_get_features(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeFeatures(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - return ret_hu_conv; + static NodeAnnouncementInfo constr_from_ptr(long ptr) { + bindings.LDKNodeAnnouncementInfo raw_val = bindings.LDKNodeAnnouncementInfo_ref_from_ptr(ptr); + if (raw_val.getClass() == bindings.LDKNodeAnnouncementInfo.Relayed.class) { + return new Relayed(ptr, (bindings.LDKNodeAnnouncementInfo.Relayed)raw_val); + } + if (raw_val.getClass() == bindings.LDKNodeAnnouncementInfo.Local.class) { + return new Local(ptr, (bindings.LDKNodeAnnouncementInfo.Local)raw_val); + } + assert false; return null; // Unreachable without extending the (internal) bindings interface } /** - * Protocol features the node announced support for + * An initial announcement of the node + * Everything else is useful only for sending out for initial routing sync. + * Not stored if contains excess data to prevent DoS. */ - public void set_features(org.ldk.structs.NodeFeatures val) { - bindings.NodeAnnouncementInfo_set_features(this.ptr, val.ptr); - Reference.reachabilityFence(this); - Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; + public final static class Relayed extends NodeAnnouncementInfo { + public final org.ldk.structs.NodeAnnouncement relayed; + private Relayed(long ptr, bindings.LDKNodeAnnouncementInfo.Relayed obj) { + super(null, ptr); + long relayed = obj.relayed; + org.ldk.structs.NodeAnnouncement relayed_hu_conv = null; if (relayed < 0 || relayed > 4096) { relayed_hu_conv = new org.ldk.structs.NodeAnnouncement(null, relayed); } + if (relayed_hu_conv != null) { relayed_hu_conv.ptrs_to.add(this); }; + this.relayed = relayed_hu_conv; + } } - /** - * When the last known update to the node state was issued. - * Value is opaque, as set in the announcement. + * Non-relayable information received in the latest node_announcement from this node. */ - public int get_last_update() { - int ret = bindings.NodeAnnouncementInfo_get_last_update(this.ptr); - Reference.reachabilityFence(this); - return ret; + public final static class Local extends NodeAnnouncementInfo { + public final org.ldk.structs.NodeAnnouncementDetails local; + private Local(long ptr, bindings.LDKNodeAnnouncementInfo.Local obj) { + super(null, ptr); + long local = obj.local; + org.ldk.structs.NodeAnnouncementDetails local_hu_conv = null; if (local < 0 || local > 4096) { local_hu_conv = new org.ldk.structs.NodeAnnouncementDetails(null, local); } + if (local_hu_conv != null) { local_hu_conv.ptrs_to.add(this); }; + this.local = local_hu_conv; + } } - - /** - * When the last known update to the node state was issued. - * Value is opaque, as set in the announcement. - */ - public void set_last_update(int val) { - bindings.NodeAnnouncementInfo_set_last_update(this.ptr, val); + long clone_ptr() { + long ret = bindings.NodeAnnouncementInfo_clone_ptr(this.ptr); Reference.reachabilityFence(this); - Reference.reachabilityFence(val); + return ret; } /** - * Color assigned to the node + * Creates a copy of the NodeAnnouncementInfo */ - public byte[] get_rgb() { - byte[] ret = bindings.NodeAnnouncementInfo_get_rgb(this.ptr); + public NodeAnnouncementInfo clone() { + long ret = bindings.NodeAnnouncementInfo_clone(this.ptr); Reference.reachabilityFence(this); - return ret; + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.NodeAnnouncementInfo ret_hu_conv = org.ldk.structs.NodeAnnouncementInfo.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; } /** - * Color assigned to the node + * Utility method to constructs a new Relayed-variant NodeAnnouncementInfo */ - public void set_rgb(byte[] val) { - bindings.NodeAnnouncementInfo_set_rgb(this.ptr, InternalUtils.check_arr_len(val, 3)); - Reference.reachabilityFence(this); - Reference.reachabilityFence(val); + public static NodeAnnouncementInfo relayed(org.ldk.structs.NodeAnnouncement a) { + long ret = bindings.NodeAnnouncementInfo_relayed(a.ptr); + Reference.reachabilityFence(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.NodeAnnouncementInfo ret_hu_conv = org.ldk.structs.NodeAnnouncementInfo.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; } /** - * Moniker assigned to the node. - * May be invalid or malicious (eg control chars), - * should not be exposed to the user. + * Utility method to constructs a new Local-variant NodeAnnouncementInfo */ - public NodeAlias get_alias() { - long ret = bindings.NodeAnnouncementInfo_get_alias(this.ptr); - Reference.reachabilityFence(this); + public static NodeAnnouncementInfo local(org.ldk.structs.NodeAnnouncementDetails a) { + long ret = bindings.NodeAnnouncementInfo_local(a.ptr); + Reference.reachabilityFence(a); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.NodeAlias ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAlias(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + org.ldk.structs.NodeAnnouncementInfo ret_hu_conv = org.ldk.structs.NodeAnnouncementInfo.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; return ret_hu_conv; } /** - * Moniker assigned to the node. - * May be invalid or malicious (eg control chars), - * should not be exposed to the user. + * Checks if two NodeAnnouncementInfos contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. */ - public void set_alias(org.ldk.structs.NodeAlias val) { - bindings.NodeAnnouncementInfo_set_alias(this.ptr, val.ptr); + public boolean eq(org.ldk.structs.NodeAnnouncementInfo b) { + boolean ret = bindings.NodeAnnouncementInfo_eq(this.ptr, b.ptr); Reference.reachabilityFence(this); - Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; + Reference.reachabilityFence(b); + return ret; } + @Override public boolean equals(Object o) { + if (!(o instanceof NodeAnnouncementInfo)) return false; + return this.eq((NodeAnnouncementInfo)o); + } /** - * An initial announcement of the node - * Mostly redundant with the data we store in fields explicitly. - * Everything else is useful only for sending out for initial routing sync. - * Not stored if contains excess data to prevent DoS. - * - * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + * Protocol features the node announced support for */ - @Nullable - public NodeAnnouncement get_announcement_message() { - long ret = bindings.NodeAnnouncementInfo_get_announcement_message(this.ptr); + public NodeFeatures features() { + long ret = bindings.NodeAnnouncementInfo_features(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.NodeAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAnnouncement(null, ret); } + org.ldk.structs.NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeFeatures(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; return ret_hu_conv; } /** - * An initial announcement of the node - * Mostly redundant with the data we store in fields explicitly. - * Everything else is useful only for sending out for initial routing sync. - * Not stored if contains excess data to prevent DoS. + * When the last known update to the node state was issued. * - * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + * Value may or may not be a timestamp, depending on the policy of the origin node. */ - public void set_announcement_message(@Nullable org.ldk.structs.NodeAnnouncement val) { - bindings.NodeAnnouncementInfo_set_announcement_message(this.ptr, val == null ? 0 : val.ptr); + public int last_update() { + int ret = bindings.NodeAnnouncementInfo_last_update(this.ptr); Reference.reachabilityFence(this); - Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; + return ret; } /** - * Constructs a new NodeAnnouncementInfo given each field - * - * Note that announcement_message_arg (or a relevant inner pointer) may be NULL or all-0s to represent None + * Color assigned to the node */ - public static NodeAnnouncementInfo of(org.ldk.structs.NodeFeatures features_arg, int last_update_arg, byte[] rgb_arg, org.ldk.structs.NodeAlias alias_arg, @Nullable org.ldk.structs.NodeAnnouncement announcement_message_arg) { - long ret = bindings.NodeAnnouncementInfo_new(features_arg.ptr, last_update_arg, InternalUtils.check_arr_len(rgb_arg, 3), alias_arg.ptr, announcement_message_arg == null ? 0 : announcement_message_arg.ptr); - Reference.reachabilityFence(features_arg); - Reference.reachabilityFence(last_update_arg); - Reference.reachabilityFence(rgb_arg); - Reference.reachabilityFence(alias_arg); - Reference.reachabilityFence(announcement_message_arg); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.NodeAnnouncementInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAnnouncementInfo(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(features_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(alias_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(announcement_message_arg); }; - return ret_hu_conv; - } - - long clone_ptr() { - long ret = bindings.NodeAnnouncementInfo_clone_ptr(this.ptr); + public byte[] rgb() { + byte[] ret = bindings.NodeAnnouncementInfo_rgb(this.ptr); Reference.reachabilityFence(this); return ret; } /** - * Creates a copy of the NodeAnnouncementInfo + * Moniker assigned to the node. + * + * May be invalid or malicious (eg control chars), should not be exposed to the user. */ - public NodeAnnouncementInfo clone() { - long ret = bindings.NodeAnnouncementInfo_clone(this.ptr); + public NodeAlias alias() { + long ret = bindings.NodeAnnouncementInfo_alias(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.NodeAnnouncementInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAnnouncementInfo(null, ret); } + org.ldk.structs.NodeAlias ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAlias(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; return ret_hu_conv; } - /** - * Checks if two NodeAnnouncementInfos contain equal inner contents. - * This ignores pointers and is_owned flags and looks at the values in fields. - * Two objects with NULL inner values will be considered "equal" here. - */ - public boolean eq(org.ldk.structs.NodeAnnouncementInfo b) { - boolean ret = bindings.NodeAnnouncementInfo_eq(this.ptr, b.ptr); - Reference.reachabilityFence(this); - Reference.reachabilityFence(b); - if (this != null) { this.ptrs_to.add(b); }; - return ret; - } - - @Override public boolean equals(Object o) { - if (!(o instanceof NodeAnnouncementInfo)) return false; - return this.eq((NodeAnnouncementInfo)o); - } /** * Internet-level addresses via which one can connect to the node */ @@ -212,6 +178,23 @@ public class NodeAnnouncementInfo extends CommonBase { return ret_conv_15_arr; } + /** + * An initial announcement of the node + * + * Not stored if contains excess data to prevent DoS. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + @Nullable + public NodeAnnouncement announcement_message() { + long ret = bindings.NodeAnnouncementInfo_announcement_message(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.NodeAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAnnouncement(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + /** * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read */ diff --git a/src/main/java/org/ldk/structs/NodeFeatures.java b/src/main/java/org/ldk/structs/NodeFeatures.java index bebcc26b..9763da3c 100644 --- a/src/main/java/org/ldk/structs/NodeFeatures.java +++ b/src/main/java/org/ldk/structs/NodeFeatures.java @@ -20,6 +20,26 @@ public class NodeFeatures extends CommonBase { if (ptr != 0) { bindings.NodeFeatures_free(ptr); } } + /** + * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read + */ + public byte[] write() { + byte[] ret = bindings.NodeFeatures_write(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Read a NodeFeatures from a byte array, created by NodeFeatures_write + */ + public static Result_NodeFeaturesDecodeErrorZ read(byte[] ser) { + long ret = bindings.NodeFeatures_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NodeFeaturesDecodeErrorZ ret_hu_conv = Result_NodeFeaturesDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + /** * Checks if two NodeFeaturess contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. @@ -78,6 +98,25 @@ public class NodeFeatures extends CommonBase { return ret_hu_conv; } + /** + * Returns the feature set as a list of bytes, in little-endian. This is in reverse byte order + * from most on-the-wire encodings. + */ + public byte[] le_flags() { + byte[] ret = bindings.NodeFeatures_le_flags(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Returns true if this `Features` has any optional flags set + */ + public boolean supports_any_optional_bits() { + boolean ret = bindings.NodeFeatures_supports_any_optional_bits(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * Returns true if this `Features` object contains required features unknown by `other`. */ @@ -89,6 +128,17 @@ public class NodeFeatures extends CommonBase { return ret; } + /** + * Returns the set of required features unknown by `other`, as their bit position. + */ + public long[] required_unknown_bits_from(org.ldk.structs.NodeFeatures other) { + long[] ret = bindings.NodeFeatures_required_unknown_bits_from(this.ptr, other.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(other); + if (this != null) { this.ptrs_to.add(other); }; + return ret; + } + /** * Returns true if this `Features` object contains unknown feature flags which are set as * \"required\". @@ -99,6 +149,15 @@ public class NodeFeatures extends CommonBase { return ret; } + /** + * Returns true if this `Features` supports any bits which we do not know of + */ + public boolean supports_unknown_bits() { + boolean ret = bindings.NodeFeatures_supports_unknown_bits(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * Sets a required feature bit. Errors if `bit` is outside the feature range as defined * by [BOLT 9]. @@ -172,25 +231,68 @@ public class NodeFeatures extends CommonBase { } /** - * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read + * Unsets the `upfront_shutdown_script` feature */ - public byte[] write() { - byte[] ret = bindings.NodeFeatures_write(this.ptr); + public NodeFeatures clear_upfront_shutdown_script() { + long ret = bindings.NodeFeatures_clear_upfront_shutdown_script(this.ptr); Reference.reachabilityFence(this); - return ret; + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + ; + return ret_hu_conv; } /** - * Read a NodeFeatures from a byte array, created by NodeFeatures_write + * Unsets the `shutdown_anysegwit` feature */ - public static Result_NodeFeaturesDecodeErrorZ read(byte[] ser) { - long ret = bindings.NodeFeatures_read(ser); - Reference.reachabilityFence(ser); + public NodeFeatures clear_shutdown_anysegwit() { + long ret = bindings.NodeFeatures_clear_shutdown_anysegwit(this.ptr); + Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - Result_NodeFeaturesDecodeErrorZ ret_hu_conv = Result_NodeFeaturesDecodeErrorZ.constr_from_ptr(ret); + org.ldk.structs.NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + ; return ret_hu_conv; } + /** + * Unsets the `wumbo` feature + */ + public NodeFeatures clear_wumbo() { + long ret = bindings.NodeFeatures_clear_wumbo(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + ; + return ret_hu_conv; + } + + /** + * Unsets the `scid_privacy` feature + */ + public void clear_scid_privacy() { + bindings.NodeFeatures_clear_scid_privacy(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Unsets the `anchors_zero_fee_htlc_tx` feature + */ + public void clear_anchors_zero_fee_htlc_tx() { + bindings.NodeFeatures_clear_anchors_zero_fee_htlc_tx(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Unsets the `route_blinding` feature + */ + public void clear_route_blinding() { + bindings.NodeFeatures_clear_route_blinding(this.ptr); + Reference.reachabilityFence(this); + } + /** * Set this feature as optional. */ diff --git a/src/main/java/org/ldk/structs/NodeId.java b/src/main/java/org/ldk/structs/NodeId.java index 85f16693..f9a79026 100644 --- a/src/main/java/org/ldk/structs/NodeId.java +++ b/src/main/java/org/ldk/structs/NodeId.java @@ -38,6 +38,23 @@ public class NodeId extends CommonBase { return ret_hu_conv; } + /** + * Checks if two NodeIds contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public boolean eq(org.ldk.structs.NodeId b) { + boolean ret = bindings.NodeId_eq(this.ptr, b.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(b); + if (this != null) { this.ptrs_to.add(b); }; + return ret; + } + + @Override public boolean equals(Object o) { + if (!(o instanceof NodeId)) return false; + return this.eq((NodeId)o); + } /** * Create a new NodeId from a public key */ diff --git a/src/main/java/org/ldk/structs/NodeInfo.java b/src/main/java/org/ldk/structs/NodeInfo.java index 660052a6..92e85c66 100644 --- a/src/main/java/org/ldk/structs/NodeInfo.java +++ b/src/main/java/org/ldk/structs/NodeInfo.java @@ -45,14 +45,13 @@ public class NodeInfo extends CommonBase { * Optional because we store a Node entry after learning about it from * a channel announcement, but before receiving a node announcement. * - * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + * Returns a copy of the field. */ - @Nullable - public NodeAnnouncementInfo get_announcement_info() { + public Option_NodeAnnouncementInfoZ get_announcement_info() { long ret = bindings.NodeInfo_get_announcement_info(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.NodeAnnouncementInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAnnouncementInfo(null, ret); } + org.ldk.structs.Option_NodeAnnouncementInfoZ ret_hu_conv = org.ldk.structs.Option_NodeAnnouncementInfoZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; return ret_hu_conv; } @@ -61,30 +60,11 @@ public class NodeInfo extends CommonBase { * More information about a node from node_announcement. * Optional because we store a Node entry after learning about it from * a channel announcement, but before receiving a node announcement. - * - * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public void set_announcement_info(@Nullable org.ldk.structs.NodeAnnouncementInfo val) { - bindings.NodeInfo_set_announcement_info(this.ptr, val == null ? 0 : val.ptr); + public void set_announcement_info(org.ldk.structs.Option_NodeAnnouncementInfoZ val) { + bindings.NodeInfo_set_announcement_info(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; - } - - /** - * Constructs a new NodeInfo given each field - * - * Note that announcement_info_arg (or a relevant inner pointer) may be NULL or all-0s to represent None - */ - public static NodeInfo of(long[] channels_arg, @Nullable org.ldk.structs.NodeAnnouncementInfo announcement_info_arg) { - long ret = bindings.NodeInfo_new(channels_arg, announcement_info_arg == null ? 0 : announcement_info_arg.ptr); - Reference.reachabilityFence(channels_arg); - Reference.reachabilityFence(announcement_info_arg); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.NodeInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeInfo(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(announcement_info_arg); }; - return ret_hu_conv; } long clone_ptr() { diff --git a/src/main/java/org/ldk/structs/NodeSigner.java b/src/main/java/org/ldk/structs/NodeSigner.java index 21250887..c82804d4 100644 --- a/src/main/java/org/ldk/structs/NodeSigner.java +++ b/src/main/java/org/ldk/structs/NodeSigner.java @@ -82,7 +82,7 @@ public class NodeSigner extends CommonBase { * * Errors if the [`Recipient`] variant is not supported by the implementation. */ - Result_RecoverableSignatureNoneZ sign_invoice(byte[] hrp_bytes, UInt5[] invoice_data, Recipient recipient); + Result_RecoverableSignatureNoneZ sign_invoice(RawBolt11Invoice invoice, Recipient recipient); /** * Signs the [`TaggedHash`] of a BOLT 12 invoice request. * @@ -145,15 +145,9 @@ public class NodeSigner extends CommonBase { long result = ret.clone_ptr(); return result; } - @Override public long sign_invoice(byte[] hrp_bytes, byte[] invoice_data, Recipient recipient) { - int invoice_data_conv_7_len = invoice_data.length; - UInt5[] invoice_data_conv_7_arr = new UInt5[invoice_data_conv_7_len]; - for (int h = 0; h < invoice_data_conv_7_len; h++) { - byte invoice_data_conv_7 = invoice_data[h]; - UInt5 invoice_data_conv_7_conv = new UInt5(invoice_data_conv_7); - invoice_data_conv_7_arr[h] = invoice_data_conv_7_conv; - } - Result_RecoverableSignatureNoneZ ret = arg.sign_invoice(hrp_bytes, invoice_data_conv_7_arr, recipient); + @Override public long sign_invoice(long invoice, Recipient recipient) { + org.ldk.structs.RawBolt11Invoice invoice_hu_conv = null; if (invoice < 0 || invoice > 4096) { invoice_hu_conv = new org.ldk.structs.RawBolt11Invoice(null, invoice); } + Result_RecoverableSignatureNoneZ ret = arg.sign_invoice(invoice_hu_conv, recipient); Reference.reachabilityFence(arg); long result = ret.clone_ptr(); return result; @@ -235,7 +229,6 @@ public class NodeSigner extends CommonBase { Reference.reachabilityFence(tweak); if (ret >= 0 && ret <= 4096) { return null; } Result_ThirtyTwoBytesNoneZ ret_hu_conv = Result_ThirtyTwoBytesNoneZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.add(tweak); }; return ret_hu_conv; } @@ -252,14 +245,14 @@ public class NodeSigner extends CommonBase { * * Errors if the [`Recipient`] variant is not supported by the implementation. */ - public Result_RecoverableSignatureNoneZ sign_invoice(byte[] hrp_bytes, UInt5[] invoice_data, org.ldk.enums.Recipient recipient) { - long ret = bindings.NodeSigner_sign_invoice(this.ptr, hrp_bytes, invoice_data != null ? InternalUtils.convUInt5Array(invoice_data) : null, recipient); + public Result_RecoverableSignatureNoneZ sign_invoice(org.ldk.structs.RawBolt11Invoice invoice, org.ldk.enums.Recipient recipient) { + long ret = bindings.NodeSigner_sign_invoice(this.ptr, invoice.ptr, recipient); Reference.reachabilityFence(this); - Reference.reachabilityFence(hrp_bytes); - Reference.reachabilityFence(invoice_data); + Reference.reachabilityFence(invoice); Reference.reachabilityFence(recipient); if (ret >= 0 && ret <= 4096) { return null; } Result_RecoverableSignatureNoneZ ret_hu_conv = Result_RecoverableSignatureNoneZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.add(invoice); }; return ret_hu_conv; } @@ -323,7 +316,6 @@ public class NodeSigner extends CommonBase { Reference.reachabilityFence(msg); if (ret >= 0 && ret <= 4096) { return null; } Result_ECDSASignatureNoneZ ret_hu_conv = Result_ECDSASignatureNoneZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.add(msg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Nonce.java b/src/main/java/org/ldk/structs/Nonce.java new file mode 100644 index 00000000..e5317517 --- /dev/null +++ b/src/main/java/org/ldk/structs/Nonce.java @@ -0,0 +1,107 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * A 128-bit number used only once. + * + * Needed when constructing [`Offer::metadata`] and deriving [`Offer::signing_pubkey`] from + * [`ExpandedKey`]. Must not be reused for any other derivation without first hashing. + * + * [`Offer::metadata`]: crate::offers::offer::Offer::metadata + * [`Offer::signing_pubkey`]: crate::offers::offer::Offer::signing_pubkey + * [`ExpandedKey`]: crate::ln::inbound_payment::ExpandedKey + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Nonce extends CommonBase { + Nonce(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.Nonce_free(ptr); } + } + + long clone_ptr() { + long ret = bindings.Nonce_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the Nonce + */ + public Nonce clone() { + long ret = bindings.Nonce_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Nonce ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Nonce(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Checks if two Nonces contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public boolean eq(org.ldk.structs.Nonce b) { + boolean ret = bindings.Nonce_eq(this.ptr, b.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(b); + if (this != null) { this.ptrs_to.add(b); }; + return ret; + } + + @Override public boolean equals(Object o) { + if (!(o instanceof Nonce)) return false; + return this.eq((Nonce)o); + } + /** + * Creates a `Nonce` from the given [`EntropySource`]. + */ + public static Nonce from_entropy_source(org.ldk.structs.EntropySource entropy_source) { + long ret = bindings.Nonce_from_entropy_source(entropy_source.ptr); + Reference.reachabilityFence(entropy_source); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Nonce ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Nonce(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(entropy_source); }; + return ret_hu_conv; + } + + /** + * Returns a slice of the underlying bytes of size [`Nonce::LENGTH`]. + */ + public byte[] as_slice() { + byte[] ret = bindings.Nonce_as_slice(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Serialize the Nonce object into a byte array which can be read by Nonce_read + */ + public byte[] write() { + byte[] ret = bindings.Nonce_write(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Read a Nonce from a byte array, created by Nonce_write + */ + public static Result_NonceDecodeErrorZ read(byte[] ser) { + long ret = bindings.Nonce_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NonceDecodeErrorZ ret_hu_conv = Result_NonceDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Offer.java b/src/main/java/org/ldk/structs/Offer.java index fcb1600c..282feaac 100644 --- a/src/main/java/org/ldk/structs/Offer.java +++ b/src/main/java/org/ldk/structs/Offer.java @@ -18,7 +18,7 @@ import javax.annotation.Nullable; * Offers may be denominated in currency other than bitcoin but are ultimately paid using the * latter. * - * Through the use of [`BlindedPath`]s, offers provide recipient privacy. + * Through the use of [`BlindedMessagePath`]s, offers provide recipient privacy. * * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice @@ -148,18 +148,18 @@ public class Offer extends CommonBase { * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide * recipient privacy by obfuscating its node id. */ - public BlindedPath[] paths() { + public BlindedMessagePath[] paths() { long[] ret = bindings.Offer_paths(this.ptr); Reference.reachabilityFence(this); - int ret_conv_13_len = ret.length; - BlindedPath[] ret_conv_13_arr = new BlindedPath[ret_conv_13_len]; - for (int n = 0; n < ret_conv_13_len; n++) { - long ret_conv_13 = ret[n]; - org.ldk.structs.BlindedPath ret_conv_13_hu_conv = null; if (ret_conv_13 < 0 || ret_conv_13 > 4096) { ret_conv_13_hu_conv = new org.ldk.structs.BlindedPath(null, ret_conv_13); } - if (ret_conv_13_hu_conv != null) { ret_conv_13_hu_conv.ptrs_to.add(this); }; - ret_conv_13_arr[n] = ret_conv_13_hu_conv; + int ret_conv_20_len = ret.length; + BlindedMessagePath[] ret_conv_20_arr = new BlindedMessagePath[ret_conv_20_len]; + for (int u = 0; u < ret_conv_20_len; u++) { + long ret_conv_20 = ret[u]; + org.ldk.structs.BlindedMessagePath ret_conv_20_hu_conv = null; if (ret_conv_20 < 0 || ret_conv_20 > 4096) { ret_conv_20_hu_conv = new org.ldk.structs.BlindedMessagePath(null, ret_conv_20); } + if (ret_conv_20_hu_conv != null) { ret_conv_20_hu_conv.ptrs_to.add(this); }; + ret_conv_20_arr[u] = ret_conv_20_hu_conv; } - return ret_conv_13_arr; + return ret_conv_20_arr; } /** @@ -253,8 +253,9 @@ public class Offer extends CommonBase { * - derives the [`InvoiceRequest::payer_id`] such that a different key can be used for each * request, * - sets [`InvoiceRequest::payer_metadata`] when [`InvoiceRequestBuilder::build`] is called - * such that it can be used by [`Bolt12Invoice::verify`] to determine if the invoice was - * requested using a base [`ExpandedKey`] from which the payer id was derived, and + * such that it can be used by [`Bolt12Invoice::verify_using_metadata`] to determine if the + * invoice was requested using a base [`ExpandedKey`] from which the payer id was derived, + * and * - includes the [`PaymentId`] encrypted in [`InvoiceRequest::payer_metadata`] so that it can * be used when sending the payment for the requested invoice. * @@ -262,19 +263,18 @@ public class Offer extends CommonBase { * * [`InvoiceRequest::payer_id`]: crate::offers::invoice_request::InvoiceRequest::payer_id * [`InvoiceRequest::payer_metadata`]: crate::offers::invoice_request::InvoiceRequest::payer_metadata - * [`Bolt12Invoice::verify`]: crate::offers::invoice::Bolt12Invoice::verify + * [`Bolt12Invoice::verify_using_metadata`]: crate::offers::invoice::Bolt12Invoice::verify_using_metadata * [`ExpandedKey`]: crate::ln::inbound_payment::ExpandedKey */ - public Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ request_invoice_deriving_payer_id(org.ldk.structs.ExpandedKey expanded_key, org.ldk.structs.EntropySource entropy_source, byte[] payment_id) { - long ret = bindings.Offer_request_invoice_deriving_payer_id(this.ptr, expanded_key.ptr, entropy_source.ptr, InternalUtils.check_arr_len(payment_id, 32)); + public Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ request_invoice_deriving_payer_id(org.ldk.structs.ExpandedKey expanded_key, org.ldk.structs.Nonce nonce, byte[] payment_id) { + long ret = bindings.Offer_request_invoice_deriving_payer_id(this.ptr, expanded_key.ptr, nonce.ptr, InternalUtils.check_arr_len(payment_id, 32)); Reference.reachabilityFence(this); Reference.reachabilityFence(expanded_key); - Reference.reachabilityFence(entropy_source); + Reference.reachabilityFence(nonce); Reference.reachabilityFence(payment_id); if (ret >= 0 && ret <= 4096) { return null; } Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ ret_hu_conv = Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.add(expanded_key); }; - if (this != null) { this.ptrs_to.add(entropy_source); }; return ret_hu_conv; } @@ -286,17 +286,16 @@ public class Offer extends CommonBase { * * [`InvoiceRequest::payer_id`]: crate::offers::invoice_request::InvoiceRequest::payer_id */ - public Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ request_invoice_deriving_metadata(byte[] payer_id, org.ldk.structs.ExpandedKey expanded_key, org.ldk.structs.EntropySource entropy_source, byte[] payment_id) { - long ret = bindings.Offer_request_invoice_deriving_metadata(this.ptr, InternalUtils.check_arr_len(payer_id, 33), expanded_key.ptr, entropy_source.ptr, InternalUtils.check_arr_len(payment_id, 32)); + public Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ request_invoice_deriving_metadata(byte[] payer_id, org.ldk.structs.ExpandedKey expanded_key, org.ldk.structs.Nonce nonce, byte[] payment_id) { + long ret = bindings.Offer_request_invoice_deriving_metadata(this.ptr, InternalUtils.check_arr_len(payer_id, 33), expanded_key.ptr, nonce.ptr, InternalUtils.check_arr_len(payment_id, 32)); Reference.reachabilityFence(this); Reference.reachabilityFence(payer_id); Reference.reachabilityFence(expanded_key); - Reference.reachabilityFence(entropy_source); + Reference.reachabilityFence(nonce); Reference.reachabilityFence(payment_id); if (ret >= 0 && ret <= 4096) { return null; } Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ ret_hu_conv = Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.add(expanded_key); }; - if (this != null) { this.ptrs_to.add(entropy_source); }; return ret_hu_conv; } @@ -337,6 +336,17 @@ public class Offer extends CommonBase { @Override public int hashCode() { return (int)this.hash(); } + /** + * Read a Offer from a byte array, created by Offer_write + */ + public static Result_OfferDecodeErrorZ read(byte[] ser) { + long ret = bindings.Offer_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OfferDecodeErrorZ ret_hu_conv = Result_OfferDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + /** * Serialize the Offer object into a byte array which can be read by Offer_read */ diff --git a/src/main/java/org/ldk/structs/OfferFeatures.java b/src/main/java/org/ldk/structs/OfferFeatures.java index e269852c..c7222f43 100644 --- a/src/main/java/org/ldk/structs/OfferFeatures.java +++ b/src/main/java/org/ldk/structs/OfferFeatures.java @@ -78,6 +78,25 @@ public class OfferFeatures extends CommonBase { return ret_hu_conv; } + /** + * Returns the feature set as a list of bytes, in little-endian. This is in reverse byte order + * from most on-the-wire encodings. + */ + public byte[] le_flags() { + byte[] ret = bindings.OfferFeatures_le_flags(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Returns true if this `Features` has any optional flags set + */ + public boolean supports_any_optional_bits() { + boolean ret = bindings.OfferFeatures_supports_any_optional_bits(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * Returns true if this `Features` object contains required features unknown by `other`. */ @@ -89,6 +108,17 @@ public class OfferFeatures extends CommonBase { return ret; } + /** + * Returns the set of required features unknown by `other`, as their bit position. + */ + public long[] required_unknown_bits_from(org.ldk.structs.OfferFeatures other) { + long[] ret = bindings.OfferFeatures_required_unknown_bits_from(this.ptr, other.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(other); + if (this != null) { this.ptrs_to.add(other); }; + return ret; + } + /** * Returns true if this `Features` object contains unknown feature flags which are set as * \"required\". @@ -99,6 +129,15 @@ public class OfferFeatures extends CommonBase { return ret; } + /** + * Returns true if this `Features` supports any bits which we do not know of + */ + public boolean supports_unknown_bits() { + boolean ret = bindings.OfferFeatures_supports_unknown_bits(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * Sets a required feature bit. Errors if `bit` is outside the feature range as defined * by [BOLT 9]. diff --git a/src/main/java/org/ldk/structs/OfferWithDerivedMetadataBuilder.java b/src/main/java/org/ldk/structs/OfferWithDerivedMetadataBuilder.java index ca06e84c..6c11f19b 100644 --- a/src/main/java/org/ldk/structs/OfferWithDerivedMetadataBuilder.java +++ b/src/main/java/org/ldk/structs/OfferWithDerivedMetadataBuilder.java @@ -44,27 +44,29 @@ public class OfferWithDerivedMetadataBuilder extends CommonBase { /** * Similar to [`OfferBuilder::new`] except, if [`OfferBuilder::path`] is called, the signing - * pubkey is derived from the given [`ExpandedKey`] and [`EntropySource`]. This provides - * recipient privacy by using a different signing pubkey for each offer. Otherwise, the - * provided `node_id` is used for the signing pubkey. + * pubkey is derived from the given [`ExpandedKey`] and [`Nonce`]. This provides recipient + * privacy by using a different signing pubkey for each offer. Otherwise, the provided + * `node_id` is used for the signing pubkey. * * Also, sets the metadata when [`OfferBuilder::build`] is called such that it can be used by - * [`InvoiceRequest::verify`] to determine if the request was produced for the offer given an - * [`ExpandedKey`]. + * [`InvoiceRequest::verify_using_metadata`] to determine if the request was produced for the + * offer given an [`ExpandedKey`]. However, if [`OfferBuilder::path`] is called, then the + * metadata will not be set and must be included in each [`BlindedMessagePath`] instead. In this case, + * use [`InvoiceRequest::verify_using_recipient_data`]. * - * [`InvoiceRequest::verify`]: crate::offers::invoice_request::InvoiceRequest::verify + * [`InvoiceRequest::verify_using_metadata`]: crate::offers::invoice_request::InvoiceRequest::verify_using_metadata + * [`InvoiceRequest::verify_using_recipient_data`]: crate::offers::invoice_request::InvoiceRequest::verify_using_recipient_data * [`ExpandedKey`]: crate::ln::inbound_payment::ExpandedKey */ - public static OfferWithDerivedMetadataBuilder deriving_signing_pubkey(byte[] node_id, org.ldk.structs.ExpandedKey expanded_key, org.ldk.structs.EntropySource entropy_source) { - long ret = bindings.OfferWithDerivedMetadataBuilder_deriving_signing_pubkey(InternalUtils.check_arr_len(node_id, 33), expanded_key.ptr, entropy_source.ptr); + public static OfferWithDerivedMetadataBuilder deriving_signing_pubkey(byte[] node_id, org.ldk.structs.ExpandedKey expanded_key, org.ldk.structs.Nonce nonce) { + long ret = bindings.OfferWithDerivedMetadataBuilder_deriving_signing_pubkey(InternalUtils.check_arr_len(node_id, 33), expanded_key.ptr, nonce.ptr); Reference.reachabilityFence(node_id); Reference.reachabilityFence(expanded_key); - Reference.reachabilityFence(entropy_source); + Reference.reachabilityFence(nonce); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.OfferWithDerivedMetadataBuilder ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OfferWithDerivedMetadataBuilder(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(expanded_key); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(entropy_source); }; return ret_hu_conv; } @@ -80,7 +82,7 @@ public class OfferWithDerivedMetadataBuilder extends CommonBase { bindings.OfferWithDerivedMetadataBuilder_chain(this.ptr, network); Reference.reachabilityFence(this); Reference.reachabilityFence(network); - if (this != null) { this.ptrs_to.add(this); }; + ; } /** @@ -92,7 +94,7 @@ public class OfferWithDerivedMetadataBuilder extends CommonBase { bindings.OfferWithDerivedMetadataBuilder_amount_msats(this.ptr, amount_msats); Reference.reachabilityFence(this); Reference.reachabilityFence(amount_msats); - if (this != null) { this.ptrs_to.add(this); }; + ; } /** @@ -105,7 +107,7 @@ public class OfferWithDerivedMetadataBuilder extends CommonBase { bindings.OfferWithDerivedMetadataBuilder_absolute_expiry(this.ptr, absolute_expiry); Reference.reachabilityFence(this); Reference.reachabilityFence(absolute_expiry); - if (this != null) { this.ptrs_to.add(this); }; + ; } /** @@ -117,7 +119,7 @@ public class OfferWithDerivedMetadataBuilder extends CommonBase { bindings.OfferWithDerivedMetadataBuilder_description(this.ptr, description); Reference.reachabilityFence(this); Reference.reachabilityFence(description); - if (this != null) { this.ptrs_to.add(this); }; + ; } /** @@ -129,7 +131,7 @@ public class OfferWithDerivedMetadataBuilder extends CommonBase { bindings.OfferWithDerivedMetadataBuilder_issuer(this.ptr, issuer); Reference.reachabilityFence(this); Reference.reachabilityFence(issuer); - if (this != null) { this.ptrs_to.add(this); }; + ; } /** @@ -139,12 +141,11 @@ public class OfferWithDerivedMetadataBuilder extends CommonBase { * Successive calls to this method will add another blinded path. Caller is responsible for not * adding duplicate paths. */ - public void path(org.ldk.structs.BlindedPath path) { + public void path(org.ldk.structs.BlindedMessagePath path) { bindings.OfferWithDerivedMetadataBuilder_path(this.ptr, path.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(path); - if (this != null) { this.ptrs_to.add(path); }; - if (this != null) { this.ptrs_to.add(this); }; + ; } /** @@ -157,8 +158,7 @@ public class OfferWithDerivedMetadataBuilder extends CommonBase { bindings.OfferWithDerivedMetadataBuilder_supported_quantity(this.ptr, quantity.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(quantity); - if (this != null) { this.ptrs_to.add(quantity); }; - if (this != null) { this.ptrs_to.add(this); }; + ; } /** @@ -169,7 +169,7 @@ public class OfferWithDerivedMetadataBuilder extends CommonBase { Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } Result_OfferBolt12SemanticErrorZ ret_hu_conv = Result_OfferBolt12SemanticErrorZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.add(this); }; + ; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/OfferWithExplicitMetadataBuilder.java b/src/main/java/org/ldk/structs/OfferWithExplicitMetadataBuilder.java index d92f2632..3867ed62 100644 --- a/src/main/java/org/ldk/structs/OfferWithExplicitMetadataBuilder.java +++ b/src/main/java/org/ldk/structs/OfferWithExplicitMetadataBuilder.java @@ -76,7 +76,7 @@ public class OfferWithExplicitMetadataBuilder extends CommonBase { Reference.reachabilityFence(metadata); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneBolt12SemanticErrorZ ret_hu_conv = Result_NoneBolt12SemanticErrorZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.add(this); }; + ; return ret_hu_conv; } @@ -92,7 +92,7 @@ public class OfferWithExplicitMetadataBuilder extends CommonBase { bindings.OfferWithExplicitMetadataBuilder_chain(this.ptr, network); Reference.reachabilityFence(this); Reference.reachabilityFence(network); - if (this != null) { this.ptrs_to.add(this); }; + ; } /** @@ -104,7 +104,7 @@ public class OfferWithExplicitMetadataBuilder extends CommonBase { bindings.OfferWithExplicitMetadataBuilder_amount_msats(this.ptr, amount_msats); Reference.reachabilityFence(this); Reference.reachabilityFence(amount_msats); - if (this != null) { this.ptrs_to.add(this); }; + ; } /** @@ -117,7 +117,7 @@ public class OfferWithExplicitMetadataBuilder extends CommonBase { bindings.OfferWithExplicitMetadataBuilder_absolute_expiry(this.ptr, absolute_expiry); Reference.reachabilityFence(this); Reference.reachabilityFence(absolute_expiry); - if (this != null) { this.ptrs_to.add(this); }; + ; } /** @@ -129,7 +129,7 @@ public class OfferWithExplicitMetadataBuilder extends CommonBase { bindings.OfferWithExplicitMetadataBuilder_description(this.ptr, description); Reference.reachabilityFence(this); Reference.reachabilityFence(description); - if (this != null) { this.ptrs_to.add(this); }; + ; } /** @@ -141,7 +141,7 @@ public class OfferWithExplicitMetadataBuilder extends CommonBase { bindings.OfferWithExplicitMetadataBuilder_issuer(this.ptr, issuer); Reference.reachabilityFence(this); Reference.reachabilityFence(issuer); - if (this != null) { this.ptrs_to.add(this); }; + ; } /** @@ -151,12 +151,11 @@ public class OfferWithExplicitMetadataBuilder extends CommonBase { * Successive calls to this method will add another blinded path. Caller is responsible for not * adding duplicate paths. */ - public void path(org.ldk.structs.BlindedPath path) { + public void path(org.ldk.structs.BlindedMessagePath path) { bindings.OfferWithExplicitMetadataBuilder_path(this.ptr, path.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(path); - if (this != null) { this.ptrs_to.add(path); }; - if (this != null) { this.ptrs_to.add(this); }; + ; } /** @@ -169,8 +168,7 @@ public class OfferWithExplicitMetadataBuilder extends CommonBase { bindings.OfferWithExplicitMetadataBuilder_supported_quantity(this.ptr, quantity.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(quantity); - if (this != null) { this.ptrs_to.add(quantity); }; - if (this != null) { this.ptrs_to.add(this); }; + ; } /** @@ -181,7 +179,7 @@ public class OfferWithExplicitMetadataBuilder extends CommonBase { Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } Result_OfferBolt12SemanticErrorZ ret_hu_conv = Result_OfferBolt12SemanticErrorZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.add(this); }; + ; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/OffersContext.java b/src/main/java/org/ldk/structs/OffersContext.java new file mode 100644 index 00000000..9a346e8d --- /dev/null +++ b/src/main/java/org/ldk/structs/OffersContext.java @@ -0,0 +1,222 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * Contains data specific to an [`OffersMessage`]. + * + * [`OffersMessage`]: crate::onion_message::offers::OffersMessage + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class OffersContext extends CommonBase { + private OffersContext(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.OffersContext_free(ptr); } + } + static OffersContext constr_from_ptr(long ptr) { + bindings.LDKOffersContext raw_val = bindings.LDKOffersContext_ref_from_ptr(ptr); + if (raw_val.getClass() == bindings.LDKOffersContext.InvoiceRequest.class) { + return new InvoiceRequest(ptr, (bindings.LDKOffersContext.InvoiceRequest)raw_val); + } + if (raw_val.getClass() == bindings.LDKOffersContext.OutboundPayment.class) { + return new OutboundPayment(ptr, (bindings.LDKOffersContext.OutboundPayment)raw_val); + } + if (raw_val.getClass() == bindings.LDKOffersContext.InboundPayment.class) { + return new InboundPayment(ptr, (bindings.LDKOffersContext.InboundPayment)raw_val); + } + assert false; return null; // Unreachable without extending the (internal) bindings interface + } + + /** + * Context used by a [`BlindedMessagePath`] within an [`Offer`]. + * + * This variant is intended to be received when handling an [`InvoiceRequest`]. + * + * [`Offer`]: crate::offers::offer::Offer + * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest + */ + public final static class InvoiceRequest extends OffersContext { + /** + * A nonce used for authenticating that an [`InvoiceRequest`] is for a valid [`Offer`] and + * for deriving the offer's signing keys. + * + * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest + * [`Offer`]: crate::offers::offer::Offer + */ + public final org.ldk.structs.Nonce nonce; + private InvoiceRequest(long ptr, bindings.LDKOffersContext.InvoiceRequest obj) { + super(null, ptr); + long nonce = obj.nonce; + org.ldk.structs.Nonce nonce_hu_conv = null; if (nonce < 0 || nonce > 4096) { nonce_hu_conv = new org.ldk.structs.Nonce(null, nonce); } + if (nonce_hu_conv != null) { nonce_hu_conv.ptrs_to.add(this); }; + this.nonce = nonce_hu_conv; + } + } + /** + * Context used by a [`BlindedMessagePath`] within a [`Refund`] or as a reply path for an + * [`InvoiceRequest`]. + * + * This variant is intended to be received when handling a [`Bolt12Invoice`] or an + * [`InvoiceError`]. + * + * [`Refund`]: crate::offers::refund::Refund + * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest + * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice + * [`InvoiceError`]: crate::offers::invoice_error::InvoiceError + */ + public final static class OutboundPayment extends OffersContext { + /** + * Payment ID used when creating a [`Refund`] or [`InvoiceRequest`]. + * + * [`Refund`]: crate::offers::refund::Refund + * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest + */ + public final byte[] payment_id; + /** + * A nonce used for authenticating that a [`Bolt12Invoice`] is for a valid [`Refund`] or + * [`InvoiceRequest`] and for deriving their signing keys. + * + * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice + * [`Refund`]: crate::offers::refund::Refund + * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest + */ + public final org.ldk.structs.Nonce nonce; + /** + * Authentication code for the [`PaymentId`], which should be checked when the context is + * used with an [`InvoiceError`]. + * + * [`InvoiceError`]: crate::offers::invoice_error::InvoiceError + * + * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + @Nullable public final byte[] hmac; + private OutboundPayment(long ptr, bindings.LDKOffersContext.OutboundPayment obj) { + super(null, ptr); + this.payment_id = obj.payment_id; + long nonce = obj.nonce; + org.ldk.structs.Nonce nonce_hu_conv = null; if (nonce < 0 || nonce > 4096) { nonce_hu_conv = new org.ldk.structs.Nonce(null, nonce); } + if (nonce_hu_conv != null) { nonce_hu_conv.ptrs_to.add(this); }; + this.nonce = nonce_hu_conv; + this.hmac = obj.hmac; + } + } + /** + * Context used by a [`BlindedMessagePath`] as a reply path for a [`Bolt12Invoice`]. + * + * This variant is intended to be received when handling an [`InvoiceError`]. + * + * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice + * [`InvoiceError`]: crate::offers::invoice_error::InvoiceError + */ + public final static class InboundPayment extends OffersContext { + /** + * The same payment hash as [`Bolt12Invoice::payment_hash`]. + * + * [`Bolt12Invoice::payment_hash`]: crate::offers::invoice::Bolt12Invoice::payment_hash + */ + public final byte[] payment_hash; + private InboundPayment(long ptr, bindings.LDKOffersContext.InboundPayment obj) { + super(null, ptr); + this.payment_hash = obj.payment_hash; + } + } + long clone_ptr() { + long ret = bindings.OffersContext_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the OffersContext + */ + public OffersContext clone() { + long ret = bindings.OffersContext_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OffersContext ret_hu_conv = org.ldk.structs.OffersContext.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new InvoiceRequest-variant OffersContext + */ + public static OffersContext invoice_request(org.ldk.structs.Nonce nonce) { + long ret = bindings.OffersContext_invoice_request(nonce.ptr); + Reference.reachabilityFence(nonce); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OffersContext ret_hu_conv = org.ldk.structs.OffersContext.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new OutboundPayment-variant OffersContext + */ + public static OffersContext outbound_payment(byte[] payment_id, org.ldk.structs.Nonce nonce, byte[] hmac) { + long ret = bindings.OffersContext_outbound_payment(InternalUtils.check_arr_len(payment_id, 32), nonce.ptr, InternalUtils.check_arr_len(hmac, 32)); + Reference.reachabilityFence(payment_id); + Reference.reachabilityFence(nonce); + Reference.reachabilityFence(hmac); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OffersContext ret_hu_conv = org.ldk.structs.OffersContext.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new InboundPayment-variant OffersContext + */ + public static OffersContext inbound_payment(byte[] payment_hash) { + long ret = bindings.OffersContext_inbound_payment(InternalUtils.check_arr_len(payment_hash, 32)); + Reference.reachabilityFence(payment_hash); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OffersContext ret_hu_conv = org.ldk.structs.OffersContext.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Checks if two OffersContexts contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + */ + public boolean eq(org.ldk.structs.OffersContext b) { + boolean ret = bindings.OffersContext_eq(this.ptr, b.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(b); + return ret; + } + + @Override public boolean equals(Object o) { + if (!(o instanceof OffersContext)) return false; + return this.eq((OffersContext)o); + } + /** + * Serialize the OffersContext object into a byte array which can be read by OffersContext_read + */ + public byte[] write() { + byte[] ret = bindings.OffersContext_write(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Read a OffersContext from a byte array, created by OffersContext_write + */ + public static Result_OffersContextDecodeErrorZ read(byte[] ser) { + long ret = bindings.OffersContext_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OffersContextDecodeErrorZ ret_hu_conv = Result_OffersContextDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/OffersMessage.java b/src/main/java/org/ldk/structs/OffersMessage.java index 9ce51311..8a950bb6 100644 --- a/src/main/java/org/ldk/structs/OffersMessage.java +++ b/src/main/java/org/ldk/structs/OffersMessage.java @@ -105,7 +105,6 @@ public class OffersMessage extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.OffersMessage ret_hu_conv = org.ldk.structs.OffersMessage.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; return ret_hu_conv; } @@ -118,7 +117,6 @@ public class OffersMessage extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.OffersMessage ret_hu_conv = org.ldk.structs.OffersMessage.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; return ret_hu_conv; } @@ -131,7 +129,6 @@ public class OffersMessage extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.OffersMessage ret_hu_conv = org.ldk.structs.OffersMessage.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/OffersMessageHandler.java b/src/main/java/org/ldk/structs/OffersMessageHandler.java index 471e53c2..f3d3e3a7 100644 --- a/src/main/java/org/ldk/structs/OffersMessageHandler.java +++ b/src/main/java/org/ldk/structs/OffersMessageHandler.java @@ -46,33 +46,38 @@ public class OffersMessageHandler extends CommonBase { * The returned [`OffersMessage`], if any, is enqueued to be sent by [`OnionMessenger`]. * * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger + * + * Note that responder (or a relevant inner pointer) may be NULL or all-0s to represent None */ - Option_OffersMessageZ handle_message(OffersMessage message); + Option_C2Tuple_OffersMessageResponseInstructionZZ handle_message(OffersMessage message, Option_OffersContextZ context, Responder responder); /** * Releases any [`OffersMessage`]s that need to be sent. * * Typically, this is used for messages initiating a payment flow rather than in response to * another message. The latter should use the return value of [`Self::handle_message`]. */ - ThreeTuple_OffersMessageDestinationBlindedPathZ[] release_pending_messages(); + TwoTuple_OffersMessageMessageSendInstructionsZ[] release_pending_messages(); } private static class LDKOffersMessageHandlerHolder { OffersMessageHandler held; } public static OffersMessageHandler new_impl(OffersMessageHandlerInterface arg) { final LDKOffersMessageHandlerHolder impl_holder = new LDKOffersMessageHandlerHolder(); impl_holder.held = new OffersMessageHandler(new bindings.LDKOffersMessageHandler() { - @Override public long handle_message(long message) { + @Override public long handle_message(long message, long context, long responder) { org.ldk.structs.OffersMessage message_hu_conv = org.ldk.structs.OffersMessage.constr_from_ptr(message); if (message_hu_conv != null) { message_hu_conv.ptrs_to.add(this); }; - Option_OffersMessageZ ret = arg.handle_message(message_hu_conv); + org.ldk.structs.Option_OffersContextZ context_hu_conv = org.ldk.structs.Option_OffersContextZ.constr_from_ptr(context); + if (context_hu_conv != null) { context_hu_conv.ptrs_to.add(this); }; + org.ldk.structs.Responder responder_hu_conv = null; if (responder < 0 || responder > 4096) { responder_hu_conv = new org.ldk.structs.Responder(null, responder); } + if (responder_hu_conv != null) { responder_hu_conv.ptrs_to.add(this); }; + Option_C2Tuple_OffersMessageResponseInstructionZZ ret = arg.handle_message(message_hu_conv, context_hu_conv, responder_hu_conv); Reference.reachabilityFence(arg); long result = ret.clone_ptr(); - if (impl_holder.held != null) { impl_holder.held.ptrs_to.add(ret); }; return result; } @Override public long[] release_pending_messages() { - ThreeTuple_OffersMessageDestinationBlindedPathZ[] ret = arg.release_pending_messages(); + TwoTuple_OffersMessageMessageSendInstructionsZ[] ret = arg.release_pending_messages(); Reference.reachabilityFence(arg); - long[] result = ret != null ? Arrays.stream(ret).mapToLong(ret_conv_49 -> ret_conv_49.clone_ptr()).toArray() : null; + long[] result = ret != null ? Arrays.stream(ret).mapToLong(ret_conv_48 -> ret_conv_48.clone_ptr()).toArray() : null; return result; } }); @@ -85,15 +90,18 @@ public class OffersMessageHandler extends CommonBase { * The returned [`OffersMessage`], if any, is enqueued to be sent by [`OnionMessenger`]. * * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger + * + * Note that responder (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public Option_OffersMessageZ handle_message(org.ldk.structs.OffersMessage message) { - long ret = bindings.OffersMessageHandler_handle_message(this.ptr, message.ptr); + public Option_C2Tuple_OffersMessageResponseInstructionZZ handle_message(org.ldk.structs.OffersMessage message, org.ldk.structs.Option_OffersContextZ context, @Nullable org.ldk.structs.Responder responder) { + long ret = bindings.OffersMessageHandler_handle_message(this.ptr, message.ptr, context.ptr, responder == null ? 0 : responder.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(message); + Reference.reachabilityFence(context); + Reference.reachabilityFence(responder); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Option_OffersMessageZ ret_hu_conv = org.ldk.structs.Option_OffersMessageZ.constr_from_ptr(ret); + org.ldk.structs.Option_C2Tuple_OffersMessageResponseInstructionZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_OffersMessageResponseInstructionZZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - if (this != null) { this.ptrs_to.add(message); }; return ret_hu_conv; } @@ -103,18 +111,18 @@ public class OffersMessageHandler extends CommonBase { * Typically, this is used for messages initiating a payment flow rather than in response to * another message. The latter should use the return value of [`Self::handle_message`]. */ - public ThreeTuple_OffersMessageDestinationBlindedPathZ[] release_pending_messages() { + public TwoTuple_OffersMessageMessageSendInstructionsZ[] release_pending_messages() { long[] ret = bindings.OffersMessageHandler_release_pending_messages(this.ptr); Reference.reachabilityFence(this); - int ret_conv_49_len = ret.length; - ThreeTuple_OffersMessageDestinationBlindedPathZ[] ret_conv_49_arr = new ThreeTuple_OffersMessageDestinationBlindedPathZ[ret_conv_49_len]; - for (int x = 0; x < ret_conv_49_len; x++) { - long ret_conv_49 = ret[x]; - ThreeTuple_OffersMessageDestinationBlindedPathZ ret_conv_49_hu_conv = new ThreeTuple_OffersMessageDestinationBlindedPathZ(null, ret_conv_49); - if (ret_conv_49_hu_conv != null) { ret_conv_49_hu_conv.ptrs_to.add(this); }; - ret_conv_49_arr[x] = ret_conv_49_hu_conv; + int ret_conv_48_len = ret.length; + TwoTuple_OffersMessageMessageSendInstructionsZ[] ret_conv_48_arr = new TwoTuple_OffersMessageMessageSendInstructionsZ[ret_conv_48_len]; + for (int w = 0; w < ret_conv_48_len; w++) { + long ret_conv_48 = ret[w]; + TwoTuple_OffersMessageMessageSendInstructionsZ ret_conv_48_hu_conv = new TwoTuple_OffersMessageMessageSendInstructionsZ(null, ret_conv_48); + if (ret_conv_48_hu_conv != null) { ret_conv_48_hu_conv.ptrs_to.add(this); }; + ret_conv_48_arr[w] = ret_conv_48_hu_conv; } - return ret_conv_49_arr; + return ret_conv_48_arr; } } diff --git a/src/main/java/org/ldk/structs/OnionMessage.java b/src/main/java/org/ldk/structs/OnionMessage.java index d16ba3a5..0cb60e4b 100644 --- a/src/main/java/org/ldk/structs/OnionMessage.java +++ b/src/main/java/org/ldk/structs/OnionMessage.java @@ -57,7 +57,6 @@ public class OnionMessage extends CommonBase { bindings.OnionMessage_set_onion_routing_packet(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -70,7 +69,6 @@ public class OnionMessage extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.OnionMessage ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OnionMessage(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(onion_routing_packet_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/OnionMessageContents.java b/src/main/java/org/ldk/structs/OnionMessageContents.java index 999f5a01..b1f656ad 100644 --- a/src/main/java/org/ldk/structs/OnionMessageContents.java +++ b/src/main/java/org/ldk/structs/OnionMessageContents.java @@ -41,6 +41,10 @@ public class OnionMessageContents extends CommonBase { * Returns the TLV type identifying the message contents. MUST be >= 64. */ long tlv_type(); + /** + * Returns the message type + */ + String msg_type(); /** * Serialize the object into a byte array */ @@ -59,6 +63,11 @@ public class OnionMessageContents extends CommonBase { Reference.reachabilityFence(arg); return ret; } + @Override public String msg_type() { + String ret = arg.msg_type(); + Reference.reachabilityFence(arg); + return ret; + } @Override public byte[] write() { byte[] ret = arg.write(); Reference.reachabilityFence(arg); @@ -81,6 +90,15 @@ public class OnionMessageContents extends CommonBase { return ret; } + /** + * Returns the message type + */ + public String msg_type() { + String ret = bindings.OnionMessageContents_msg_type(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * Serialize the object into a byte array */ diff --git a/src/main/java/org/ldk/structs/OnionMessageHandler.java b/src/main/java/org/ldk/structs/OnionMessageHandler.java index 3667968f..5977e721 100644 --- a/src/main/java/org/ldk/structs/OnionMessageHandler.java +++ b/src/main/java/org/ldk/structs/OnionMessageHandler.java @@ -37,16 +37,6 @@ public class OnionMessageHandler extends CommonBase { ptr = 0; } public static interface OnionMessageHandlerInterface { - /** - * Because much of the lightning network does not yet support forwarding onion messages, we - * may need to directly connect to a node which will forward a message for us. In such a case, - * this method will return the set of nodes which need connection by node_id and the - * corresponding socket addresses where they may accept incoming connections. - * - * Thus, this method should be polled regularly to detect messages await such a direct - * connection. - */ - TwoTuple_PublicKeyCVec_SocketAddressZZ[] get_and_clear_connections_needed(); /** * Handle an incoming `onion_message` message from the given peer. */ @@ -95,12 +85,6 @@ public class OnionMessageHandler extends CommonBase { public static OnionMessageHandler new_impl(OnionMessageHandlerInterface arg) { final LDKOnionMessageHandlerHolder impl_holder = new LDKOnionMessageHandlerHolder(); impl_holder.held = new OnionMessageHandler(new bindings.LDKOnionMessageHandler() { - @Override public long[] get_and_clear_connections_needed() { - TwoTuple_PublicKeyCVec_SocketAddressZZ[] ret = arg.get_and_clear_connections_needed(); - Reference.reachabilityFence(arg); - long[] result = ret != null ? Arrays.stream(ret).mapToLong(ret_conv_40 -> ret_conv_40.clone_ptr()).toArray() : null; - return result; - } @Override public void handle_onion_message(byte[] peer_node_id, long msg) { org.ldk.structs.OnionMessage msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.OnionMessage(null, msg); } arg.handle_onion_message(peer_node_id, msg_hu_conv); @@ -142,29 +126,6 @@ public class OnionMessageHandler extends CommonBase { }); return impl_holder.held; } - /** - * Because much of the lightning network does not yet support forwarding onion messages, we - * may need to directly connect to a node which will forward a message for us. In such a case, - * this method will return the set of nodes which need connection by node_id and the - * corresponding socket addresses where they may accept incoming connections. - * - * Thus, this method should be polled regularly to detect messages await such a direct - * connection. - */ - public TwoTuple_PublicKeyCVec_SocketAddressZZ[] get_and_clear_connections_needed() { - long[] ret = bindings.OnionMessageHandler_get_and_clear_connections_needed(this.ptr); - Reference.reachabilityFence(this); - int ret_conv_40_len = ret.length; - TwoTuple_PublicKeyCVec_SocketAddressZZ[] ret_conv_40_arr = new TwoTuple_PublicKeyCVec_SocketAddressZZ[ret_conv_40_len]; - for (int o = 0; o < ret_conv_40_len; o++) { - long ret_conv_40 = ret[o]; - TwoTuple_PublicKeyCVec_SocketAddressZZ ret_conv_40_hu_conv = new TwoTuple_PublicKeyCVec_SocketAddressZZ(null, ret_conv_40); - if (ret_conv_40_hu_conv != null) { ret_conv_40_hu_conv.ptrs_to.add(this); }; - ret_conv_40_arr[o] = ret_conv_40_hu_conv; - } - return ret_conv_40_arr; - } - /** * Handle an incoming `onion_message` message from the given peer. */ diff --git a/src/main/java/org/ldk/structs/OnionMessagePath.java b/src/main/java/org/ldk/structs/OnionMessagePath.java index 6aa48fdf..3782d688 100644 --- a/src/main/java/org/ldk/structs/OnionMessagePath.java +++ b/src/main/java/org/ldk/structs/OnionMessagePath.java @@ -59,7 +59,6 @@ public class OnionMessagePath extends CommonBase { bindings.OnionMessagePath_set_destination(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -89,7 +88,6 @@ public class OnionMessagePath extends CommonBase { bindings.OnionMessagePath_set_first_node_addresses(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -103,8 +101,6 @@ public class OnionMessagePath extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.OnionMessagePath ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OnionMessagePath(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(destination_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(first_node_addresses_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/OnionMessenger.java b/src/main/java/org/ldk/structs/OnionMessenger.java index 0f877193..798d2deb 100644 --- a/src/main/java/org/ldk/structs/OnionMessenger.java +++ b/src/main/java/org/ldk/structs/OnionMessenger.java @@ -30,12 +30,13 @@ import javax.annotation.Nullable; * ``` * # extern crate bitcoin; * # use bitcoin::hashes::_export::_core::time::Duration; - * # use bitcoin::hashes::hex::FromHex; + * # use bitcoin::hex::FromHex; * # use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey, self}; - * # use lightning::blinded_path::{BlindedPath, EmptyNodeIdLookUp}; + * # use lightning::blinded_path::EmptyNodeIdLookUp; + * # use lightning::blinded_path::message::{BlindedMessagePath, MessageForwardNode, MessageContext}; * # use lightning::sign::{EntropySource, KeysManager}; * # use lightning::ln::peer_handler::IgnoringMessageHandler; - * # use lightning::onion_message::messenger::{Destination, MessageRouter, OnionMessagePath, OnionMessenger}; + * # use lightning::onion_message::messenger::{Destination, MessageRouter, MessageSendInstructions, OnionMessagePath, OnionMessenger}; * # use lightning::onion_message::packet::OnionMessageContents; * # use lightning::util::logger::{Logger, Record}; * # use lightning::util::ser::{Writeable, Writer}; @@ -59,8 +60,8 @@ import javax.annotation.Nullable; * # }) * # } * # fn create_blinded_paths( - * # &self, _recipient: PublicKey, _peers: Vec, _secp_ctx: &Secp256k1 - * # ) -> Result, ()> { + * # &self, _recipient: PublicKey, _context: MessageContext, _peers: Vec, _secp_ctx: &Secp256k1 + * # ) -> Result, ()> { * # unreachable!() * # } * # } @@ -77,11 +78,12 @@ import javax.annotation.Nullable; * # let message_router = Arc::new(FakeMessageRouter {}); * # let custom_message_handler = IgnoringMessageHandler {}; * # let offers_message_handler = IgnoringMessageHandler {}; + * # let async_payments_message_handler = IgnoringMessageHandler {}; * Create the onion messenger. This must use the same `keys_manager` as is passed to your * ChannelManager. * let onion_messenger = OnionMessenger::new( * &keys_manager, &keys_manager, logger, &node_id_lookup, message_router, - * &offers_message_handler, &custom_message_handler + * &offers_message_handler, &async_payments_message_handler, &custom_message_handler * ); * * # #[derive(Debug, Clone)] @@ -97,23 +99,28 @@ import javax.annotation.Nullable; * \t\t# let your_custom_message_type = 42; * \t\tyour_custom_message_type * \t} + * \tfn msg_type(&self) -> &'static str { \"YourCustomMessageType\" } * } * Send a custom onion message to a node id. * let destination = Destination::Node(destination_node_id); - * let reply_path = None; + * let instructions = MessageSendInstructions::WithoutReplyPath { destination }; * # let message = YourCustomMessage {}; - * onion_messenger.send_onion_message(message, destination, reply_path); + * onion_messenger.send_onion_message(message, instructions); * * Create a blinded path to yourself, for someone to send an onion message to. * # let your_node_id = hop_node_id1; - * let hops = [hop_node_id3, hop_node_id4, your_node_id]; - * let blinded_path = BlindedPath::new_for_message(&hops, &keys_manager, &secp_ctx).unwrap(); + * let hops = [ + * \tMessageForwardNode { node_id: hop_node_id3, short_channel_id: None }, + * \tMessageForwardNode { node_id: hop_node_id4, short_channel_id: None }, + * ]; + * let context = MessageContext::Custom(Vec::new()); + * let blinded_path = BlindedMessagePath::new(&hops, your_node_id, context, &keys_manager, &secp_ctx).unwrap(); * * Send a custom onion message to a blinded path. * let destination = Destination::BlindedPath(blinded_path); - * let reply_path = None; + * let instructions = MessageSendInstructions::WithoutReplyPath { destination }; * # let message = YourCustomMessage {}; - * onion_messenger.send_onion_message(message, destination, reply_path); + * onion_messenger.send_onion_message(message, instructions); * ``` * * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest @@ -132,14 +139,15 @@ public class OnionMessenger extends CommonBase { * Constructs a new `OnionMessenger` to send, forward, and delegate received onion messages to * their respective handlers. */ - public static OnionMessenger of(org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.structs.NodeIdLookUp node_id_lookup, org.ldk.structs.MessageRouter message_router, org.ldk.structs.OffersMessageHandler offers_handler, org.ldk.structs.CustomOnionMessageHandler custom_handler) { - long ret = bindings.OnionMessenger_new(entropy_source.ptr, node_signer.ptr, logger.ptr, node_id_lookup.ptr, message_router.ptr, offers_handler.ptr, custom_handler.ptr); + public static OnionMessenger of(org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.structs.NodeIdLookUp node_id_lookup, org.ldk.structs.MessageRouter message_router, org.ldk.structs.OffersMessageHandler offers_handler, org.ldk.structs.AsyncPaymentsMessageHandler async_payments_handler, org.ldk.structs.CustomOnionMessageHandler custom_handler) { + long ret = bindings.OnionMessenger_new(entropy_source.ptr, node_signer.ptr, logger.ptr, node_id_lookup.ptr, message_router.ptr, offers_handler.ptr, async_payments_handler.ptr, custom_handler.ptr); Reference.reachabilityFence(entropy_source); Reference.reachabilityFence(node_signer); Reference.reachabilityFence(logger); Reference.reachabilityFence(node_id_lookup); Reference.reachabilityFence(message_router); Reference.reachabilityFence(offers_handler); + Reference.reachabilityFence(async_payments_handler); Reference.reachabilityFence(custom_handler); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.OnionMessenger ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OnionMessenger(null, ret); } @@ -150,28 +158,137 @@ public class OnionMessenger extends CommonBase { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(node_id_lookup); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(message_router); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(offers_handler); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(async_payments_handler); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(custom_handler); }; return ret_hu_conv; } /** - * Sends an [`OnionMessage`] with the given `contents` to `destination`. + * Similar to [`Self::new`], but rather than dropping onion messages that are + * intended to be forwarded to offline peers, we will intercept them for + * later forwarding. * - * See [`OnionMessenger`] for example usage. + * Interception flow: + * 1. If an onion message for an offline peer is received, `OnionMessenger` will + * generate an [`Event::OnionMessageIntercepted`]. Event handlers can + * then choose to persist this onion message for later forwarding, or drop + * it. + * 2. When the offline peer later comes back online, `OnionMessenger` will + * generate an [`Event::OnionMessagePeerConnected`]. Event handlers will + * then fetch all previously intercepted onion messages for this peer. + * 3. Once the stored onion messages are fetched, they can finally be + * forwarded to the now-online peer via [`Self::forward_onion_message`]. * - * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None + * # Note + * + * LDK will not rate limit how many [`Event::OnionMessageIntercepted`]s + * are generated, so it is the caller's responsibility to limit how many + * onion messages are persisted and only persist onion messages for relevant + * peers. */ - public Result_SendSuccessSendErrorZ send_onion_message(org.ldk.structs.OnionMessageContents contents, org.ldk.structs.Destination destination, @Nullable org.ldk.structs.BlindedPath reply_path) { - long ret = bindings.OnionMessenger_send_onion_message(this.ptr, contents.ptr, destination.ptr, reply_path == null ? 0 : reply_path.ptr); + public static OnionMessenger new_with_offline_peer_interception(org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.structs.NodeIdLookUp node_id_lookup, org.ldk.structs.MessageRouter message_router, org.ldk.structs.OffersMessageHandler offers_handler, org.ldk.structs.AsyncPaymentsMessageHandler async_payments_handler, org.ldk.structs.CustomOnionMessageHandler custom_handler) { + long ret = bindings.OnionMessenger_new_with_offline_peer_interception(entropy_source.ptr, node_signer.ptr, logger.ptr, node_id_lookup.ptr, message_router.ptr, offers_handler.ptr, async_payments_handler.ptr, custom_handler.ptr); + Reference.reachabilityFence(entropy_source); + Reference.reachabilityFence(node_signer); + Reference.reachabilityFence(logger); + Reference.reachabilityFence(node_id_lookup); + Reference.reachabilityFence(message_router); + Reference.reachabilityFence(offers_handler); + Reference.reachabilityFence(async_payments_handler); + Reference.reachabilityFence(custom_handler); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OnionMessenger ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OnionMessenger(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(entropy_source); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(node_signer); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(logger); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(node_id_lookup); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(message_router); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(offers_handler); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(async_payments_handler); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(custom_handler); }; + return ret_hu_conv; + } + + /** + * Sends an [`OnionMessage`] based on its [`MessageSendInstructions`]. + */ + public Result_SendSuccessSendErrorZ send_onion_message(org.ldk.structs.OnionMessageContents contents, org.ldk.structs.MessageSendInstructions instructions) { + long ret = bindings.OnionMessenger_send_onion_message(this.ptr, contents.ptr, instructions.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(contents); - Reference.reachabilityFence(destination); - Reference.reachabilityFence(reply_path); + Reference.reachabilityFence(instructions); if (ret >= 0 && ret <= 4096) { return null; } Result_SendSuccessSendErrorZ ret_hu_conv = Result_SendSuccessSendErrorZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.add(contents); }; - if (this != null) { this.ptrs_to.add(destination); }; - if (this != null) { this.ptrs_to.add(reply_path); }; + return ret_hu_conv; + } + + /** + * Forwards an [`OnionMessage`] to `peer_node_id`. Useful if we initialized + * the [`OnionMessenger`] with [`Self::new_with_offline_peer_interception`] + * and want to forward a previously intercepted onion message to a peer that + * has just come online. + */ + public Result_NoneSendErrorZ forward_onion_message(org.ldk.structs.OnionMessage message, byte[] peer_node_id) { + long ret = bindings.OnionMessenger_forward_onion_message(this.ptr, message.ptr, InternalUtils.check_arr_len(peer_node_id, 33)); + Reference.reachabilityFence(this); + Reference.reachabilityFence(message); + Reference.reachabilityFence(peer_node_id); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneSendErrorZ ret_hu_conv = Result_NoneSendErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Handles the response to an [`OnionMessage`] based on its [`ResponseInstruction`], + * enqueueing any response for sending. + * + * This function is useful for asynchronous handling of [`OnionMessage`]s. + * Handlers have the option to return `None`, indicating that no immediate response should be + * sent. Then, they can transfer the associated [`Responder`] to another task responsible for + * generating the response asynchronously. Subsequently, when the response is prepared and + * ready for sending, that task can invoke this method to enqueue the response for delivery. + */ + public Result_SendSuccessSendErrorZ handle_onion_message_response(org.ldk.structs.OnionMessageContents response, org.ldk.structs.ResponseInstruction instructions) { + long ret = bindings.OnionMessenger_handle_onion_message_response(this.ptr, response.ptr, instructions.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(response); + Reference.reachabilityFence(instructions); + if (ret >= 0 && ret <= 4096) { return null; } + Result_SendSuccessSendErrorZ ret_hu_conv = Result_SendSuccessSendErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.add(response); }; + return ret_hu_conv; + } + + /** + * Gets a [`Future`] that completes when an event is available via + * [`EventsProvider::process_pending_events`] or [`Self::process_pending_events_async`]. + * + * Note that callbacks registered on the [`Future`] MUST NOT call back into this + * [`OnionMessenger`] and should instead register actions to be taken later. + * + * [`EventsProvider::process_pending_events`]: crate::events::EventsProvider::process_pending_events + */ + public Future get_update_future() { + long ret = bindings.OnionMessenger_get_update_future(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Future ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Future(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Constructs a new EventsProvider which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is + */ + public EventsProvider as_EventsProvider() { + long ret = bindings.OnionMessenger_as_EventsProvider(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + EventsProvider ret_hu_conv = new EventsProvider(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/OpenChannel.java b/src/main/java/org/ldk/structs/OpenChannel.java index 7df31138..44670d60 100644 --- a/src/main/java/org/ldk/structs/OpenChannel.java +++ b/src/main/java/org/ldk/structs/OpenChannel.java @@ -43,7 +43,6 @@ public class OpenChannel extends CommonBase { bindings.OpenChannel_set_common_fields(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -93,7 +92,6 @@ public class OpenChannel extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.OpenChannel ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OpenChannel(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(common_fields_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/OpenChannelV2.java b/src/main/java/org/ldk/structs/OpenChannelV2.java index 114e942a..de138eff 100644 --- a/src/main/java/org/ldk/structs/OpenChannelV2.java +++ b/src/main/java/org/ldk/structs/OpenChannelV2.java @@ -41,7 +41,6 @@ public class OpenChannelV2 extends CommonBase { bindings.OpenChannelV2_set_common_fields(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -129,7 +128,6 @@ public class OpenChannelV2 extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.OpenChannelV2 ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OpenChannelV2(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(common_fields_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Option_APIErrorZ.java b/src/main/java/org/ldk/structs/Option_APIErrorZ.java index 5fad89c3..6b4da189 100644 --- a/src/main/java/org/ldk/structs/Option_APIErrorZ.java +++ b/src/main/java/org/ldk/structs/Option_APIErrorZ.java @@ -60,7 +60,6 @@ public class Option_APIErrorZ extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_APIErrorZ ret_hu_conv = org.ldk.structs.Option_APIErrorZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Option_AmountZ.java b/src/main/java/org/ldk/structs/Option_AmountZ.java index e65d45d2..ed8163ae 100644 --- a/src/main/java/org/ldk/structs/Option_AmountZ.java +++ b/src/main/java/org/ldk/structs/Option_AmountZ.java @@ -60,7 +60,6 @@ public class Option_AmountZ extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_AmountZ ret_hu_conv = org.ldk.structs.Option_AmountZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Option_C2Tuple_OffersMessageResponseInstructionZZ.java b/src/main/java/org/ldk/structs/Option_C2Tuple_OffersMessageResponseInstructionZZ.java new file mode 100644 index 00000000..358f6b4b --- /dev/null +++ b/src/main/java/org/ldk/structs/Option_C2Tuple_OffersMessageResponseInstructionZZ.java @@ -0,0 +1,96 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * An enum which can either contain a crate::c_types::derived::C2Tuple_OffersMessageResponseInstructionZ or not + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Option_C2Tuple_OffersMessageResponseInstructionZZ extends CommonBase { + private Option_C2Tuple_OffersMessageResponseInstructionZZ(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.COption_C2Tuple_OffersMessageResponseInstructionZZ_free(ptr); } + } + static Option_C2Tuple_OffersMessageResponseInstructionZZ constr_from_ptr(long ptr) { + bindings.LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ raw_val = bindings.LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_ref_from_ptr(ptr); + if (raw_val.getClass() == bindings.LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ.Some.class) { + return new Some(ptr, (bindings.LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ.Some)raw_val); + } + if (raw_val.getClass() == bindings.LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ.None.class) { + return new None(ptr, (bindings.LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ.None)raw_val); + } + assert false; return null; // Unreachable without extending the (internal) bindings interface + } + + /** + * When we're in this state, this COption_C2Tuple_OffersMessageResponseInstructionZZ contains a crate::c_types::derived::C2Tuple_OffersMessageResponseInstructionZ + */ + public final static class Some extends Option_C2Tuple_OffersMessageResponseInstructionZZ { + public final org.ldk.structs.TwoTuple_OffersMessageResponseInstructionZ some; + private Some(long ptr, bindings.LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ.Some obj) { + super(null, ptr); + long some = obj.some; + TwoTuple_OffersMessageResponseInstructionZ some_hu_conv = new TwoTuple_OffersMessageResponseInstructionZ(null, some); + if (some_hu_conv != null) { some_hu_conv.ptrs_to.add(this); }; + this.some = some_hu_conv; + } + } + /** + * When we're in this state, this COption_C2Tuple_OffersMessageResponseInstructionZZ contains nothing + */ + public final static class None extends Option_C2Tuple_OffersMessageResponseInstructionZZ { + private None(long ptr, bindings.LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ.None obj) { + super(null, ptr); + } + } + /** + * Constructs a new COption_C2Tuple_OffersMessageResponseInstructionZZ containing a crate::c_types::derived::C2Tuple_OffersMessageResponseInstructionZ + */ + public static Option_C2Tuple_OffersMessageResponseInstructionZZ some(org.ldk.structs.TwoTuple_OffersMessageResponseInstructionZ o) { + long ret = bindings.COption_C2Tuple_OffersMessageResponseInstructionZZ_some(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_OffersMessageResponseInstructionZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_OffersMessageResponseInstructionZZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Constructs a new COption_C2Tuple_OffersMessageResponseInstructionZZ containing nothing + */ + public static Option_C2Tuple_OffersMessageResponseInstructionZZ none() { + long ret = bindings.COption_C2Tuple_OffersMessageResponseInstructionZZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_OffersMessageResponseInstructionZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_OffersMessageResponseInstructionZZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + long clone_ptr() { + long ret = bindings.COption_C2Tuple_OffersMessageResponseInstructionZZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new COption_C2Tuple_OffersMessageResponseInstructionZZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_C2Tuple_OffersMessageResponseInstructionZZ clone() { + long ret = bindings.COption_C2Tuple_OffersMessageResponseInstructionZZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_OffersMessageResponseInstructionZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_OffersMessageResponseInstructionZZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Option_C2Tuple_OnionMessageContentsResponseInstructionZZ.java b/src/main/java/org/ldk/structs/Option_C2Tuple_OnionMessageContentsResponseInstructionZZ.java new file mode 100644 index 00000000..d9b3230b --- /dev/null +++ b/src/main/java/org/ldk/structs/Option_C2Tuple_OnionMessageContentsResponseInstructionZZ.java @@ -0,0 +1,96 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * An enum which can either contain a crate::c_types::derived::C2Tuple_OnionMessageContentsResponseInstructionZ or not + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Option_C2Tuple_OnionMessageContentsResponseInstructionZZ extends CommonBase { + private Option_C2Tuple_OnionMessageContentsResponseInstructionZZ(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_free(ptr); } + } + static Option_C2Tuple_OnionMessageContentsResponseInstructionZZ constr_from_ptr(long ptr) { + bindings.LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ raw_val = bindings.LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_ref_from_ptr(ptr); + if (raw_val.getClass() == bindings.LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ.Some.class) { + return new Some(ptr, (bindings.LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ.Some)raw_val); + } + if (raw_val.getClass() == bindings.LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ.None.class) { + return new None(ptr, (bindings.LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ.None)raw_val); + } + assert false; return null; // Unreachable without extending the (internal) bindings interface + } + + /** + * When we're in this state, this COption_C2Tuple_OnionMessageContentsResponseInstructionZZ contains a crate::c_types::derived::C2Tuple_OnionMessageContentsResponseInstructionZ + */ + public final static class Some extends Option_C2Tuple_OnionMessageContentsResponseInstructionZZ { + public final org.ldk.structs.TwoTuple_OnionMessageContentsResponseInstructionZ some; + private Some(long ptr, bindings.LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ.Some obj) { + super(null, ptr); + long some = obj.some; + TwoTuple_OnionMessageContentsResponseInstructionZ some_hu_conv = new TwoTuple_OnionMessageContentsResponseInstructionZ(null, some); + if (some_hu_conv != null) { some_hu_conv.ptrs_to.add(this); }; + this.some = some_hu_conv; + } + } + /** + * When we're in this state, this COption_C2Tuple_OnionMessageContentsResponseInstructionZZ contains nothing + */ + public final static class None extends Option_C2Tuple_OnionMessageContentsResponseInstructionZZ { + private None(long ptr, bindings.LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ.None obj) { + super(null, ptr); + } + } + /** + * Constructs a new COption_C2Tuple_OnionMessageContentsResponseInstructionZZ containing a crate::c_types::derived::C2Tuple_OnionMessageContentsResponseInstructionZ + */ + public static Option_C2Tuple_OnionMessageContentsResponseInstructionZZ some(org.ldk.structs.TwoTuple_OnionMessageContentsResponseInstructionZ o) { + long ret = bindings.COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_some(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_OnionMessageContentsResponseInstructionZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_OnionMessageContentsResponseInstructionZZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Constructs a new COption_C2Tuple_OnionMessageContentsResponseInstructionZZ containing nothing + */ + public static Option_C2Tuple_OnionMessageContentsResponseInstructionZZ none() { + long ret = bindings.COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_OnionMessageContentsResponseInstructionZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_OnionMessageContentsResponseInstructionZZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + long clone_ptr() { + long ret = bindings.COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new COption_C2Tuple_OnionMessageContentsResponseInstructionZZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_C2Tuple_OnionMessageContentsResponseInstructionZZ clone() { + long ret = bindings.COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_OnionMessageContentsResponseInstructionZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_OnionMessageContentsResponseInstructionZZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ.java b/src/main/java/org/ldk/structs/Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ.java new file mode 100644 index 00000000..c945b4c5 --- /dev/null +++ b/src/main/java/org/ldk/structs/Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ.java @@ -0,0 +1,96 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * An enum which can either contain a crate::c_types::derived::C2Tuple_ReleaseHeldHtlcResponseInstructionZ or not + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ extends CommonBase { + private Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_free(ptr); } + } + static Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ constr_from_ptr(long ptr) { + bindings.LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ raw_val = bindings.LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_ref_from_ptr(ptr); + if (raw_val.getClass() == bindings.LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ.Some.class) { + return new Some(ptr, (bindings.LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ.Some)raw_val); + } + if (raw_val.getClass() == bindings.LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ.None.class) { + return new None(ptr, (bindings.LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ.None)raw_val); + } + assert false; return null; // Unreachable without extending the (internal) bindings interface + } + + /** + * When we're in this state, this COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ contains a crate::c_types::derived::C2Tuple_ReleaseHeldHtlcResponseInstructionZ + */ + public final static class Some extends Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ { + public final org.ldk.structs.TwoTuple_ReleaseHeldHtlcResponseInstructionZ some; + private Some(long ptr, bindings.LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ.Some obj) { + super(null, ptr); + long some = obj.some; + TwoTuple_ReleaseHeldHtlcResponseInstructionZ some_hu_conv = new TwoTuple_ReleaseHeldHtlcResponseInstructionZ(null, some); + if (some_hu_conv != null) { some_hu_conv.ptrs_to.add(this); }; + this.some = some_hu_conv; + } + } + /** + * When we're in this state, this COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ contains nothing + */ + public final static class None extends Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ { + private None(long ptr, bindings.LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ.None obj) { + super(null, ptr); + } + } + /** + * Constructs a new COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ containing a crate::c_types::derived::C2Tuple_ReleaseHeldHtlcResponseInstructionZ + */ + public static Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ some(org.ldk.structs.TwoTuple_ReleaseHeldHtlcResponseInstructionZ o) { + long ret = bindings.COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_some(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Constructs a new COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ containing nothing + */ + public static Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ none() { + long ret = bindings.COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + long clone_ptr() { + long ret = bindings.COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ clone() { + long ret = bindings.COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ.java b/src/main/java/org/ldk/structs/Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ.java index 2c858205..f29acff2 100644 --- a/src/main/java/org/ldk/structs/Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ.java +++ b/src/main/java/org/ldk/structs/Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ.java @@ -60,6 +60,7 @@ public class Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Option_CVec_SocketAddressZZ.java b/src/main/java/org/ldk/structs/Option_CVec_SocketAddressZZ.java index 40991aed..35b66875 100644 --- a/src/main/java/org/ldk/structs/Option_CVec_SocketAddressZZ.java +++ b/src/main/java/org/ldk/structs/Option_CVec_SocketAddressZZ.java @@ -66,7 +66,6 @@ public class Option_CVec_SocketAddressZZ extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_CVec_SocketAddressZZ ret_hu_conv = org.ldk.structs.Option_CVec_SocketAddressZZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - for (SocketAddress o_conv_15: o) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o_conv_15); }; }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Option_ClosureReasonZ.java b/src/main/java/org/ldk/structs/Option_ClosureReasonZ.java index f90d61a0..a69184f1 100644 --- a/src/main/java/org/ldk/structs/Option_ClosureReasonZ.java +++ b/src/main/java/org/ldk/structs/Option_ClosureReasonZ.java @@ -60,7 +60,6 @@ public class Option_ClosureReasonZ extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_ClosureReasonZ ret_hu_conv = org.ldk.structs.Option_ClosureReasonZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Option_EventZ.java b/src/main/java/org/ldk/structs/Option_EventZ.java index 4d28ec92..c095504a 100644 --- a/src/main/java/org/ldk/structs/Option_EventZ.java +++ b/src/main/java/org/ldk/structs/Option_EventZ.java @@ -60,7 +60,6 @@ public class Option_EventZ extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_EventZ ret_hu_conv = org.ldk.structs.Option_EventZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Option_HTLCDestinationZ.java b/src/main/java/org/ldk/structs/Option_HTLCDestinationZ.java index c82c9dfd..a708d579 100644 --- a/src/main/java/org/ldk/structs/Option_HTLCDestinationZ.java +++ b/src/main/java/org/ldk/structs/Option_HTLCDestinationZ.java @@ -60,7 +60,6 @@ public class Option_HTLCDestinationZ extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_HTLCDestinationZ ret_hu_conv = org.ldk.structs.Option_HTLCDestinationZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Option_MaxDustHTLCExposureZ.java b/src/main/java/org/ldk/structs/Option_MaxDustHTLCExposureZ.java index f599b8b9..1fde8d0a 100644 --- a/src/main/java/org/ldk/structs/Option_MaxDustHTLCExposureZ.java +++ b/src/main/java/org/ldk/structs/Option_MaxDustHTLCExposureZ.java @@ -60,7 +60,6 @@ public class Option_MaxDustHTLCExposureZ extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_MaxDustHTLCExposureZ ret_hu_conv = org.ldk.structs.Option_MaxDustHTLCExposureZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Option_MessageContextZ.java b/src/main/java/org/ldk/structs/Option_MessageContextZ.java new file mode 100644 index 00000000..04029dfc --- /dev/null +++ b/src/main/java/org/ldk/structs/Option_MessageContextZ.java @@ -0,0 +1,96 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * An enum which can either contain a crate::lightning::blinded_path::message::MessageContext or not + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Option_MessageContextZ extends CommonBase { + private Option_MessageContextZ(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.COption_MessageContextZ_free(ptr); } + } + static Option_MessageContextZ constr_from_ptr(long ptr) { + bindings.LDKCOption_MessageContextZ raw_val = bindings.LDKCOption_MessageContextZ_ref_from_ptr(ptr); + if (raw_val.getClass() == bindings.LDKCOption_MessageContextZ.Some.class) { + return new Some(ptr, (bindings.LDKCOption_MessageContextZ.Some)raw_val); + } + if (raw_val.getClass() == bindings.LDKCOption_MessageContextZ.None.class) { + return new None(ptr, (bindings.LDKCOption_MessageContextZ.None)raw_val); + } + assert false; return null; // Unreachable without extending the (internal) bindings interface + } + + /** + * When we're in this state, this COption_MessageContextZ contains a crate::lightning::blinded_path::message::MessageContext + */ + public final static class Some extends Option_MessageContextZ { + public final org.ldk.structs.MessageContext some; + private Some(long ptr, bindings.LDKCOption_MessageContextZ.Some obj) { + super(null, ptr); + long some = obj.some; + org.ldk.structs.MessageContext some_hu_conv = org.ldk.structs.MessageContext.constr_from_ptr(some); + if (some_hu_conv != null) { some_hu_conv.ptrs_to.add(this); }; + this.some = some_hu_conv; + } + } + /** + * When we're in this state, this COption_MessageContextZ contains nothing + */ + public final static class None extends Option_MessageContextZ { + private None(long ptr, bindings.LDKCOption_MessageContextZ.None obj) { + super(null, ptr); + } + } + /** + * Constructs a new COption_MessageContextZ containing a crate::lightning::blinded_path::message::MessageContext + */ + public static Option_MessageContextZ some(org.ldk.structs.MessageContext o) { + long ret = bindings.COption_MessageContextZ_some(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_MessageContextZ ret_hu_conv = org.ldk.structs.Option_MessageContextZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Constructs a new COption_MessageContextZ containing nothing + */ + public static Option_MessageContextZ none() { + long ret = bindings.COption_MessageContextZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_MessageContextZ ret_hu_conv = org.ldk.structs.Option_MessageContextZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + long clone_ptr() { + long ret = bindings.COption_MessageContextZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new COption_MessageContextZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_MessageContextZ clone() { + long ret = bindings.COption_MessageContextZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_MessageContextZ ret_hu_conv = org.ldk.structs.Option_MessageContextZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Option_MonitorEventZ.java b/src/main/java/org/ldk/structs/Option_MonitorEventZ.java index 317c7f55..b2fa91a8 100644 --- a/src/main/java/org/ldk/structs/Option_MonitorEventZ.java +++ b/src/main/java/org/ldk/structs/Option_MonitorEventZ.java @@ -60,7 +60,6 @@ public class Option_MonitorEventZ extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_MonitorEventZ ret_hu_conv = org.ldk.structs.Option_MonitorEventZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Option_NetworkUpdateZ.java b/src/main/java/org/ldk/structs/Option_NetworkUpdateZ.java index c2621537..fbee2dc3 100644 --- a/src/main/java/org/ldk/structs/Option_NetworkUpdateZ.java +++ b/src/main/java/org/ldk/structs/Option_NetworkUpdateZ.java @@ -60,7 +60,6 @@ public class Option_NetworkUpdateZ extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_NetworkUpdateZ ret_hu_conv = org.ldk.structs.Option_NetworkUpdateZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Option_NodeAnnouncementInfoZ.java b/src/main/java/org/ldk/structs/Option_NodeAnnouncementInfoZ.java new file mode 100644 index 00000000..4ec0e171 --- /dev/null +++ b/src/main/java/org/ldk/structs/Option_NodeAnnouncementInfoZ.java @@ -0,0 +1,96 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * An enum which can either contain a crate::lightning::routing::gossip::NodeAnnouncementInfo or not + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Option_NodeAnnouncementInfoZ extends CommonBase { + private Option_NodeAnnouncementInfoZ(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.COption_NodeAnnouncementInfoZ_free(ptr); } + } + static Option_NodeAnnouncementInfoZ constr_from_ptr(long ptr) { + bindings.LDKCOption_NodeAnnouncementInfoZ raw_val = bindings.LDKCOption_NodeAnnouncementInfoZ_ref_from_ptr(ptr); + if (raw_val.getClass() == bindings.LDKCOption_NodeAnnouncementInfoZ.Some.class) { + return new Some(ptr, (bindings.LDKCOption_NodeAnnouncementInfoZ.Some)raw_val); + } + if (raw_val.getClass() == bindings.LDKCOption_NodeAnnouncementInfoZ.None.class) { + return new None(ptr, (bindings.LDKCOption_NodeAnnouncementInfoZ.None)raw_val); + } + assert false; return null; // Unreachable without extending the (internal) bindings interface + } + + /** + * When we're in this state, this COption_NodeAnnouncementInfoZ contains a crate::lightning::routing::gossip::NodeAnnouncementInfo + */ + public final static class Some extends Option_NodeAnnouncementInfoZ { + public final org.ldk.structs.NodeAnnouncementInfo some; + private Some(long ptr, bindings.LDKCOption_NodeAnnouncementInfoZ.Some obj) { + super(null, ptr); + long some = obj.some; + org.ldk.structs.NodeAnnouncementInfo some_hu_conv = org.ldk.structs.NodeAnnouncementInfo.constr_from_ptr(some); + if (some_hu_conv != null) { some_hu_conv.ptrs_to.add(this); }; + this.some = some_hu_conv; + } + } + /** + * When we're in this state, this COption_NodeAnnouncementInfoZ contains nothing + */ + public final static class None extends Option_NodeAnnouncementInfoZ { + private None(long ptr, bindings.LDKCOption_NodeAnnouncementInfoZ.None obj) { + super(null, ptr); + } + } + /** + * Constructs a new COption_NodeAnnouncementInfoZ containing a crate::lightning::routing::gossip::NodeAnnouncementInfo + */ + public static Option_NodeAnnouncementInfoZ some(org.ldk.structs.NodeAnnouncementInfo o) { + long ret = bindings.COption_NodeAnnouncementInfoZ_some(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_NodeAnnouncementInfoZ ret_hu_conv = org.ldk.structs.Option_NodeAnnouncementInfoZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Constructs a new COption_NodeAnnouncementInfoZ containing nothing + */ + public static Option_NodeAnnouncementInfoZ none() { + long ret = bindings.COption_NodeAnnouncementInfoZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_NodeAnnouncementInfoZ ret_hu_conv = org.ldk.structs.Option_NodeAnnouncementInfoZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + long clone_ptr() { + long ret = bindings.COption_NodeAnnouncementInfoZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new COption_NodeAnnouncementInfoZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_NodeAnnouncementInfoZ clone() { + long ret = bindings.COption_NodeAnnouncementInfoZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_NodeAnnouncementInfoZ ret_hu_conv = org.ldk.structs.Option_NodeAnnouncementInfoZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Option_OffersContextZ.java b/src/main/java/org/ldk/structs/Option_OffersContextZ.java new file mode 100644 index 00000000..9f4b8570 --- /dev/null +++ b/src/main/java/org/ldk/structs/Option_OffersContextZ.java @@ -0,0 +1,96 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * An enum which can either contain a crate::lightning::blinded_path::message::OffersContext or not + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Option_OffersContextZ extends CommonBase { + private Option_OffersContextZ(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.COption_OffersContextZ_free(ptr); } + } + static Option_OffersContextZ constr_from_ptr(long ptr) { + bindings.LDKCOption_OffersContextZ raw_val = bindings.LDKCOption_OffersContextZ_ref_from_ptr(ptr); + if (raw_val.getClass() == bindings.LDKCOption_OffersContextZ.Some.class) { + return new Some(ptr, (bindings.LDKCOption_OffersContextZ.Some)raw_val); + } + if (raw_val.getClass() == bindings.LDKCOption_OffersContextZ.None.class) { + return new None(ptr, (bindings.LDKCOption_OffersContextZ.None)raw_val); + } + assert false; return null; // Unreachable without extending the (internal) bindings interface + } + + /** + * When we're in this state, this COption_OffersContextZ contains a crate::lightning::blinded_path::message::OffersContext + */ + public final static class Some extends Option_OffersContextZ { + public final org.ldk.structs.OffersContext some; + private Some(long ptr, bindings.LDKCOption_OffersContextZ.Some obj) { + super(null, ptr); + long some = obj.some; + org.ldk.structs.OffersContext some_hu_conv = org.ldk.structs.OffersContext.constr_from_ptr(some); + if (some_hu_conv != null) { some_hu_conv.ptrs_to.add(this); }; + this.some = some_hu_conv; + } + } + /** + * When we're in this state, this COption_OffersContextZ contains nothing + */ + public final static class None extends Option_OffersContextZ { + private None(long ptr, bindings.LDKCOption_OffersContextZ.None obj) { + super(null, ptr); + } + } + /** + * Constructs a new COption_OffersContextZ containing a crate::lightning::blinded_path::message::OffersContext + */ + public static Option_OffersContextZ some(org.ldk.structs.OffersContext o) { + long ret = bindings.COption_OffersContextZ_some(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_OffersContextZ ret_hu_conv = org.ldk.structs.Option_OffersContextZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Constructs a new COption_OffersContextZ containing nothing + */ + public static Option_OffersContextZ none() { + long ret = bindings.COption_OffersContextZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_OffersContextZ ret_hu_conv = org.ldk.structs.Option_OffersContextZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + long clone_ptr() { + long ret = bindings.COption_OffersContextZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new COption_OffersContextZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_OffersContextZ clone() { + long ret = bindings.COption_OffersContextZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_OffersContextZ ret_hu_conv = org.ldk.structs.Option_OffersContextZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Option_OffersMessageZ.java b/src/main/java/org/ldk/structs/Option_OffersMessageZ.java deleted file mode 100644 index 88f6da76..00000000 --- a/src/main/java/org/ldk/structs/Option_OffersMessageZ.java +++ /dev/null @@ -1,97 +0,0 @@ -package org.ldk.structs; - -import org.ldk.impl.bindings; -import org.ldk.enums.*; -import org.ldk.util.*; -import java.util.Arrays; -import java.lang.ref.Reference; -import javax.annotation.Nullable; - - -/** - * An enum which can either contain a crate::lightning::onion_message::offers::OffersMessage or not - */ -@SuppressWarnings("unchecked") // We correctly assign various generic arrays -public class Option_OffersMessageZ extends CommonBase { - private Option_OffersMessageZ(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.COption_OffersMessageZ_free(ptr); } - } - static Option_OffersMessageZ constr_from_ptr(long ptr) { - bindings.LDKCOption_OffersMessageZ raw_val = bindings.LDKCOption_OffersMessageZ_ref_from_ptr(ptr); - if (raw_val.getClass() == bindings.LDKCOption_OffersMessageZ.Some.class) { - return new Some(ptr, (bindings.LDKCOption_OffersMessageZ.Some)raw_val); - } - if (raw_val.getClass() == bindings.LDKCOption_OffersMessageZ.None.class) { - return new None(ptr, (bindings.LDKCOption_OffersMessageZ.None)raw_val); - } - assert false; return null; // Unreachable without extending the (internal) bindings interface - } - - /** - * When we're in this state, this COption_OffersMessageZ contains a crate::lightning::onion_message::offers::OffersMessage - */ - public final static class Some extends Option_OffersMessageZ { - public final org.ldk.structs.OffersMessage some; - private Some(long ptr, bindings.LDKCOption_OffersMessageZ.Some obj) { - super(null, ptr); - long some = obj.some; - org.ldk.structs.OffersMessage some_hu_conv = org.ldk.structs.OffersMessage.constr_from_ptr(some); - if (some_hu_conv != null) { some_hu_conv.ptrs_to.add(this); }; - this.some = some_hu_conv; - } - } - /** - * When we're in this state, this COption_OffersMessageZ contains nothing - */ - public final static class None extends Option_OffersMessageZ { - private None(long ptr, bindings.LDKCOption_OffersMessageZ.None obj) { - super(null, ptr); - } - } - /** - * Constructs a new COption_OffersMessageZ containing a crate::lightning::onion_message::offers::OffersMessage - */ - public static Option_OffersMessageZ some(org.ldk.structs.OffersMessage o) { - long ret = bindings.COption_OffersMessageZ_some(o.ptr); - Reference.reachabilityFence(o); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Option_OffersMessageZ ret_hu_conv = org.ldk.structs.Option_OffersMessageZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; - return ret_hu_conv; - } - - /** - * Constructs a new COption_OffersMessageZ containing nothing - */ - public static Option_OffersMessageZ none() { - long ret = bindings.COption_OffersMessageZ_none(); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Option_OffersMessageZ ret_hu_conv = org.ldk.structs.Option_OffersMessageZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - return ret_hu_conv; - } - - long clone_ptr() { - long ret = bindings.COption_OffersMessageZ_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Creates a new COption_OffersMessageZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Option_OffersMessageZ clone() { - long ret = bindings.COption_OffersMessageZ_clone(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Option_OffersMessageZ ret_hu_conv = org.ldk.structs.Option_OffersMessageZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - return ret_hu_conv; - } - -} diff --git a/src/main/java/org/ldk/structs/Option_PathFailureZ.java b/src/main/java/org/ldk/structs/Option_PathFailureZ.java index d41c3e7b..29b5f9af 100644 --- a/src/main/java/org/ldk/structs/Option_PathFailureZ.java +++ b/src/main/java/org/ldk/structs/Option_PathFailureZ.java @@ -60,7 +60,6 @@ public class Option_PathFailureZ extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_PathFailureZ ret_hu_conv = org.ldk.structs.Option_PathFailureZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Option_PaymentContextZ.java b/src/main/java/org/ldk/structs/Option_PaymentContextZ.java index 89dec36f..fcff043e 100644 --- a/src/main/java/org/ldk/structs/Option_PaymentContextZ.java +++ b/src/main/java/org/ldk/structs/Option_PaymentContextZ.java @@ -60,7 +60,6 @@ public class Option_PaymentContextZ extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_PaymentContextZ ret_hu_conv = org.ldk.structs.Option_PaymentContextZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Option_QuantityZ.java b/src/main/java/org/ldk/structs/Option_QuantityZ.java index e457bb1a..1f0fcdb2 100644 --- a/src/main/java/org/ldk/structs/Option_QuantityZ.java +++ b/src/main/java/org/ldk/structs/Option_QuantityZ.java @@ -60,7 +60,6 @@ public class Option_QuantityZ extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_QuantityZ ret_hu_conv = org.ldk.structs.Option_QuantityZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Option_SecretKeyZ.java b/src/main/java/org/ldk/structs/Option_SecretKeyZ.java deleted file mode 100644 index 10b2100f..00000000 --- a/src/main/java/org/ldk/structs/Option_SecretKeyZ.java +++ /dev/null @@ -1,93 +0,0 @@ -package org.ldk.structs; - -import org.ldk.impl.bindings; -import org.ldk.enums.*; -import org.ldk.util.*; -import java.util.Arrays; -import java.lang.ref.Reference; -import javax.annotation.Nullable; - - -/** - * An enum which can either contain a crate::c_types::SecretKey or not - */ -@SuppressWarnings("unchecked") // We correctly assign various generic arrays -public class Option_SecretKeyZ extends CommonBase { - private Option_SecretKeyZ(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.COption_SecretKeyZ_free(ptr); } - } - static Option_SecretKeyZ constr_from_ptr(long ptr) { - bindings.LDKCOption_SecretKeyZ raw_val = bindings.LDKCOption_SecretKeyZ_ref_from_ptr(ptr); - if (raw_val.getClass() == bindings.LDKCOption_SecretKeyZ.Some.class) { - return new Some(ptr, (bindings.LDKCOption_SecretKeyZ.Some)raw_val); - } - if (raw_val.getClass() == bindings.LDKCOption_SecretKeyZ.None.class) { - return new None(ptr, (bindings.LDKCOption_SecretKeyZ.None)raw_val); - } - assert false; return null; // Unreachable without extending the (internal) bindings interface - } - - /** - * When we're in this state, this COption_SecretKeyZ contains a crate::c_types::SecretKey - */ - public final static class Some extends Option_SecretKeyZ { - public final byte[] some; - private Some(long ptr, bindings.LDKCOption_SecretKeyZ.Some obj) { - super(null, ptr); - this.some = obj.some; - } - } - /** - * When we're in this state, this COption_SecretKeyZ contains nothing - */ - public final static class None extends Option_SecretKeyZ { - private None(long ptr, bindings.LDKCOption_SecretKeyZ.None obj) { - super(null, ptr); - } - } - /** - * Constructs a new COption_SecretKeyZ containing a crate::c_types::SecretKey - */ - public static Option_SecretKeyZ some(byte[] o) { - long ret = bindings.COption_SecretKeyZ_some(InternalUtils.check_arr_len(o, 32)); - Reference.reachabilityFence(o); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Option_SecretKeyZ ret_hu_conv = org.ldk.structs.Option_SecretKeyZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - return ret_hu_conv; - } - - /** - * Constructs a new COption_SecretKeyZ containing nothing - */ - public static Option_SecretKeyZ none() { - long ret = bindings.COption_SecretKeyZ_none(); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Option_SecretKeyZ ret_hu_conv = org.ldk.structs.Option_SecretKeyZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - return ret_hu_conv; - } - - long clone_ptr() { - long ret = bindings.COption_SecretKeyZ_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Creates a new COption_SecretKeyZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Option_SecretKeyZ clone() { - long ret = bindings.COption_SecretKeyZ_clone(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Option_SecretKeyZ ret_hu_conv = org.ldk.structs.Option_SecretKeyZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - return ret_hu_conv; - } - -} diff --git a/src/main/java/org/ldk/structs/Option_SocketAddressZ.java b/src/main/java/org/ldk/structs/Option_SocketAddressZ.java index 5fffe517..d18c38ea 100644 --- a/src/main/java/org/ldk/structs/Option_SocketAddressZ.java +++ b/src/main/java/org/ldk/structs/Option_SocketAddressZ.java @@ -60,7 +60,6 @@ public class Option_SocketAddressZ extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_SocketAddressZ ret_hu_conv = org.ldk.structs.Option_SocketAddressZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/OutPoint.java b/src/main/java/org/ldk/structs/OutPoint.java index 457def11..92268b6b 100644 --- a/src/main/java/org/ldk/structs/OutPoint.java +++ b/src/main/java/org/ldk/structs/OutPoint.java @@ -11,7 +11,7 @@ import javax.annotation.Nullable; /** * A reference to a transaction output. * - * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32 + * Differs from bitcoin::transaction::OutPoint as the index is a u16 instead of u32 * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way. */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays diff --git a/src/main/java/org/ldk/structs/OutboundHTLCDetails.java b/src/main/java/org/ldk/structs/OutboundHTLCDetails.java index b7024345..bb2a4df0 100644 --- a/src/main/java/org/ldk/structs/OutboundHTLCDetails.java +++ b/src/main/java/org/ldk/structs/OutboundHTLCDetails.java @@ -49,7 +49,6 @@ public class OutboundHTLCDetails extends CommonBase { bindings.OutboundHTLCDetails_set_htlc_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -141,7 +140,6 @@ public class OutboundHTLCDetails extends CommonBase { bindings.OutboundHTLCDetails_set_state(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -163,7 +161,6 @@ public class OutboundHTLCDetails extends CommonBase { bindings.OutboundHTLCDetails_set_skimmed_fee_msat(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -219,9 +216,6 @@ public class OutboundHTLCDetails extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.OutboundHTLCDetails ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutboundHTLCDetails(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(htlc_id_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(state_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(skimmed_fee_msat_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/OutputSpendStatus.java b/src/main/java/org/ldk/structs/OutputSpendStatus.java index ed4f80d0..c5bd8fe1 100644 --- a/src/main/java/org/ldk/structs/OutputSpendStatus.java +++ b/src/main/java/org/ldk/structs/OutputSpendStatus.java @@ -134,7 +134,6 @@ public class OutputSpendStatus extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.OutputSpendStatus ret_hu_conv = org.ldk.structs.OutputSpendStatus.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(delayed_until_height); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/OutputSpender.java b/src/main/java/org/ldk/structs/OutputSpender.java index 325ba25d..0a00ac20 100644 --- a/src/main/java/org/ldk/structs/OutputSpender.java +++ b/src/main/java/org/ldk/structs/OutputSpender.java @@ -108,8 +108,6 @@ public class OutputSpender extends CommonBase { Reference.reachabilityFence(locktime); if (ret >= 0 && ret <= 4096) { return null; } Result_TransactionNoneZ ret_hu_conv = Result_TransactionNoneZ.constr_from_ptr(ret); - for (SpendableOutputDescriptor descriptors_conv_27: descriptors) { if (this != null) { this.ptrs_to.add(descriptors_conv_27); }; }; - if (this != null) { this.ptrs_to.add(locktime); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/OutputSweeper.java b/src/main/java/org/ldk/structs/OutputSweeper.java index a42f8340..ce7d1c4d 100644 --- a/src/main/java/org/ldk/structs/OutputSweeper.java +++ b/src/main/java/org/ldk/structs/OutputSweeper.java @@ -52,7 +52,6 @@ public class OutputSweeper extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.OutputSweeper ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutputSweeper(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(best_block); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(broadcaster); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(fee_estimator); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(chain_data_source); }; @@ -91,9 +90,6 @@ public class OutputSweeper extends CommonBase { Reference.reachabilityFence(delay_until_height); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); - for (SpendableOutputDescriptor output_descriptors_conv_27: output_descriptors) { if (this != null) { this.ptrs_to.add(output_descriptors_conv_27); }; }; - if (this != null) { this.ptrs_to.add(channel_id); }; - if (this != null) { this.ptrs_to.add(delay_until_height); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ParseOrSemanticError.java b/src/main/java/org/ldk/structs/ParseOrSemanticError.java index 66fd0ed6..43775b55 100644 --- a/src/main/java/org/ldk/structs/ParseOrSemanticError.java +++ b/src/main/java/org/ldk/structs/ParseOrSemanticError.java @@ -82,7 +82,6 @@ public class ParseOrSemanticError extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ParseOrSemanticError ret_hu_conv = org.ldk.structs.ParseOrSemanticError.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ParsedOnionMessageContents.java b/src/main/java/org/ldk/structs/ParsedOnionMessageContents.java index 66e55d1b..7c1eeb30 100644 --- a/src/main/java/org/ldk/structs/ParsedOnionMessageContents.java +++ b/src/main/java/org/ldk/structs/ParsedOnionMessageContents.java @@ -85,7 +85,6 @@ public class ParsedOnionMessageContents extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ParsedOnionMessageContents ret_hu_conv = org.ldk.structs.ParsedOnionMessageContents.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Path.java b/src/main/java/org/ldk/structs/Path.java index 72b6a875..92aad1c0 100644 --- a/src/main/java/org/ldk/structs/Path.java +++ b/src/main/java/org/ldk/structs/Path.java @@ -45,7 +45,6 @@ public class Path extends CommonBase { bindings.Path_set_hops(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_10 -> val_conv_10.ptr).toArray() : null); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - for (RouteHop val_conv_10: val) { if (this != null) { this.ptrs_to.add(val_conv_10); }; }; } /** @@ -72,7 +71,6 @@ public class Path extends CommonBase { bindings.Path_set_blinded_tail(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -87,8 +85,6 @@ public class Path extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Path ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Path(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - for (RouteHop hops_arg_conv_10: hops_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(hops_arg_conv_10); }; }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(blinded_tail_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/PathFailure.java b/src/main/java/org/ldk/structs/PathFailure.java index 7c631d80..e1b5cd88 100644 --- a/src/main/java/org/ldk/structs/PathFailure.java +++ b/src/main/java/org/ldk/structs/PathFailure.java @@ -98,7 +98,6 @@ public class PathFailure extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PathFailure ret_hu_conv = org.ldk.structs.PathFailure.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(err); }; return ret_hu_conv; } @@ -111,7 +110,6 @@ public class PathFailure extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PathFailure ret_hu_conv = org.ldk.structs.PathFailure.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(network_update); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Payee.java b/src/main/java/org/ldk/structs/Payee.java index bf515f7a..628a6732 100644 --- a/src/main/java/org/ldk/structs/Payee.java +++ b/src/main/java/org/ldk/structs/Payee.java @@ -40,7 +40,7 @@ public class Payee extends CommonBase { * Aggregated routing info and blinded paths, for routing to the payee without knowing their * node id. */ - public final TwoTuple_BlindedPayInfoBlindedPathZ[] route_hints; + public final BlindedPaymentPath[] route_hints; /** * Features supported by the payee. * @@ -53,15 +53,15 @@ public class Payee extends CommonBase { private Blinded(long ptr, bindings.LDKPayee.Blinded obj) { super(null, ptr); long[] route_hints = obj.route_hints; - int route_hints_conv_37_len = route_hints.length; - TwoTuple_BlindedPayInfoBlindedPathZ[] route_hints_conv_37_arr = new TwoTuple_BlindedPayInfoBlindedPathZ[route_hints_conv_37_len]; - for (int l = 0; l < route_hints_conv_37_len; l++) { - long route_hints_conv_37 = route_hints[l]; - TwoTuple_BlindedPayInfoBlindedPathZ route_hints_conv_37_hu_conv = new TwoTuple_BlindedPayInfoBlindedPathZ(null, route_hints_conv_37); - if (route_hints_conv_37_hu_conv != null) { route_hints_conv_37_hu_conv.ptrs_to.add(this); }; - route_hints_conv_37_arr[l] = route_hints_conv_37_hu_conv; + int route_hints_conv_20_len = route_hints.length; + BlindedPaymentPath[] route_hints_conv_20_arr = new BlindedPaymentPath[route_hints_conv_20_len]; + for (int u = 0; u < route_hints_conv_20_len; u++) { + long route_hints_conv_20 = route_hints[u]; + org.ldk.structs.BlindedPaymentPath route_hints_conv_20_hu_conv = null; if (route_hints_conv_20 < 0 || route_hints_conv_20 > 4096) { route_hints_conv_20_hu_conv = new org.ldk.structs.BlindedPaymentPath(null, route_hints_conv_20); } + if (route_hints_conv_20_hu_conv != null) { route_hints_conv_20_hu_conv.ptrs_to.add(this); }; + route_hints_conv_20_arr[u] = route_hints_conv_20_hu_conv; } - this.route_hints = route_hints_conv_37_arr; + this.route_hints = route_hints_conv_20_arr; long features = obj.features; org.ldk.structs.Bolt12InvoiceFeatures features_hu_conv = null; if (features < 0 || features > 4096) { features_hu_conv = new org.ldk.structs.Bolt12InvoiceFeatures(null, features); } if (features_hu_conv != null) { features_hu_conv.ptrs_to.add(this); }; @@ -136,14 +136,13 @@ public class Payee extends CommonBase { /** * Utility method to constructs a new Blinded-variant Payee */ - public static Payee blinded(TwoTuple_BlindedPayInfoBlindedPathZ[] route_hints, org.ldk.structs.Bolt12InvoiceFeatures features) { - long ret = bindings.Payee_blinded(route_hints != null ? Arrays.stream(route_hints).mapToLong(route_hints_conv_37 -> route_hints_conv_37.ptr).toArray() : null, features.ptr); + public static Payee blinded(BlindedPaymentPath[] route_hints, org.ldk.structs.Bolt12InvoiceFeatures features) { + long ret = bindings.Payee_blinded(route_hints != null ? Arrays.stream(route_hints).mapToLong(route_hints_conv_20 -> route_hints_conv_20.ptr).toArray() : null, features.ptr); Reference.reachabilityFence(route_hints); Reference.reachabilityFence(features); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Payee ret_hu_conv = org.ldk.structs.Payee.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(features); }; return ret_hu_conv; } @@ -159,8 +158,6 @@ public class Payee extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Payee ret_hu_conv = org.ldk.structs.Payee.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - for (RouteHint route_hints_conv_11: route_hints) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(route_hints_conv_11); }; }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(features); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/PaymentContext.java b/src/main/java/org/ldk/structs/PaymentContext.java index 0204f15c..4508c14c 100644 --- a/src/main/java/org/ldk/structs/PaymentContext.java +++ b/src/main/java/org/ldk/structs/PaymentContext.java @@ -9,10 +9,9 @@ import javax.annotation.Nullable; /** - * The context of an inbound payment, which is included in a [`BlindedPath`] via [`ReceiveTlvs`] - * and surfaced in [`PaymentPurpose`]. + * The context of an inbound payment, which is included in a [`BlindedPaymentPath`] via + * [`ReceiveTlvs`] and surfaced in [`PaymentPurpose`]. * - * [`BlindedPath`]: crate::blinded_path::BlindedPath * [`PaymentPurpose`]: crate::events::PaymentPurpose */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays @@ -107,7 +106,6 @@ public class PaymentContext extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PaymentContext ret_hu_conv = org.ldk.structs.PaymentContext.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; return ret_hu_conv; } @@ -120,7 +118,6 @@ public class PaymentContext extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PaymentContext ret_hu_conv = org.ldk.structs.PaymentContext.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; return ret_hu_conv; } @@ -133,7 +130,6 @@ public class PaymentContext extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PaymentContext ret_hu_conv = org.ldk.structs.PaymentContext.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/PaymentForwardNode.java b/src/main/java/org/ldk/structs/PaymentForwardNode.java new file mode 100644 index 00000000..0b87a4c6 --- /dev/null +++ b/src/main/java/org/ldk/structs/PaymentForwardNode.java @@ -0,0 +1,114 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * An intermediate node, its outbound channel, and relay parameters. + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class PaymentForwardNode extends CommonBase { + PaymentForwardNode(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.PaymentForwardNode_free(ptr); } + } + + /** + * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also + * used for [`BlindedPayInfo`] construction. + */ + public ForwardTlvs get_tlvs() { + long ret = bindings.PaymentForwardNode_get_tlvs(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ForwardTlvs ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ForwardTlvs(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also + * used for [`BlindedPayInfo`] construction. + */ + public void set_tlvs(org.ldk.structs.ForwardTlvs val) { + bindings.PaymentForwardNode_set_tlvs(this.ptr, val.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * This node's pubkey. + */ + public byte[] get_node_id() { + byte[] ret = bindings.PaymentForwardNode_get_node_id(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * This node's pubkey. + */ + public void set_node_id(byte[] val) { + bindings.PaymentForwardNode_set_node_id(this.ptr, InternalUtils.check_arr_len(val, 33)); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * The maximum value, in msat, that may be accepted by this node. + */ + public long get_htlc_maximum_msat() { + long ret = bindings.PaymentForwardNode_get_htlc_maximum_msat(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * The maximum value, in msat, that may be accepted by this node. + */ + public void set_htlc_maximum_msat(long val) { + bindings.PaymentForwardNode_set_htlc_maximum_msat(this.ptr, val); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * Constructs a new PaymentForwardNode given each field + */ + public static PaymentForwardNode of(org.ldk.structs.ForwardTlvs tlvs_arg, byte[] node_id_arg, long htlc_maximum_msat_arg) { + long ret = bindings.PaymentForwardNode_new(tlvs_arg.ptr, InternalUtils.check_arr_len(node_id_arg, 33), htlc_maximum_msat_arg); + Reference.reachabilityFence(tlvs_arg); + Reference.reachabilityFence(node_id_arg); + Reference.reachabilityFence(htlc_maximum_msat_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.PaymentForwardNode ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PaymentForwardNode(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + long clone_ptr() { + long ret = bindings.PaymentForwardNode_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the PaymentForwardNode + */ + public PaymentForwardNode clone() { + long ret = bindings.PaymentForwardNode_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.PaymentForwardNode ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PaymentForwardNode(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/PaymentParameters.java b/src/main/java/org/ldk/structs/PaymentParameters.java index 4be6c024..76aa5fe8 100644 --- a/src/main/java/org/ldk/structs/PaymentParameters.java +++ b/src/main/java/org/ldk/structs/PaymentParameters.java @@ -39,7 +39,6 @@ public class PaymentParameters extends CommonBase { bindings.PaymentParameters_set_payee(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -61,7 +60,6 @@ public class PaymentParameters extends CommonBase { bindings.PaymentParameters_set_expiry_time(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -104,6 +102,26 @@ public class PaymentParameters extends CommonBase { Reference.reachabilityFence(val); } + /** + * The maximum number of [`Path::hops`] in any returned path. + * Defaults to [`MAX_PATH_LENGTH_ESTIMATE`]. + */ + public byte get_max_path_length() { + byte ret = bindings.PaymentParameters_get_max_path_length(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * The maximum number of [`Path::hops`] in any returned path. + * Defaults to [`MAX_PATH_LENGTH_ESTIMATE`]. + */ + public void set_max_path_length(byte val) { + bindings.PaymentParameters_set_max_path_length(this.ptr, val); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + /** * Selects the maximum share of a channel's total capacity which will be sent over a channel, * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas @@ -197,20 +215,19 @@ public class PaymentParameters extends CommonBase { /** * Constructs a new PaymentParameters given each field */ - public static PaymentParameters of(org.ldk.structs.Payee payee_arg, org.ldk.structs.Option_u64Z expiry_time_arg, int max_total_cltv_expiry_delta_arg, byte max_path_count_arg, byte max_channel_saturation_power_of_half_arg, long[] previously_failed_channels_arg, long[] previously_failed_blinded_path_idxs_arg) { - long ret = bindings.PaymentParameters_new(payee_arg.ptr, expiry_time_arg.ptr, max_total_cltv_expiry_delta_arg, max_path_count_arg, max_channel_saturation_power_of_half_arg, previously_failed_channels_arg, previously_failed_blinded_path_idxs_arg); + public static PaymentParameters of(org.ldk.structs.Payee payee_arg, org.ldk.structs.Option_u64Z expiry_time_arg, int max_total_cltv_expiry_delta_arg, byte max_path_count_arg, byte max_path_length_arg, byte max_channel_saturation_power_of_half_arg, long[] previously_failed_channels_arg, long[] previously_failed_blinded_path_idxs_arg) { + long ret = bindings.PaymentParameters_new(payee_arg.ptr, expiry_time_arg.ptr, max_total_cltv_expiry_delta_arg, max_path_count_arg, max_path_length_arg, max_channel_saturation_power_of_half_arg, previously_failed_channels_arg, previously_failed_blinded_path_idxs_arg); Reference.reachabilityFence(payee_arg); Reference.reachabilityFence(expiry_time_arg); Reference.reachabilityFence(max_total_cltv_expiry_delta_arg); Reference.reachabilityFence(max_path_count_arg); + Reference.reachabilityFence(max_path_length_arg); Reference.reachabilityFence(max_channel_saturation_power_of_half_arg); Reference.reachabilityFence(previously_failed_channels_arg); Reference.reachabilityFence(previously_failed_blinded_path_idxs_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PaymentParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PaymentParameters(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(payee_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(expiry_time_arg); }; return ret_hu_conv; } @@ -340,8 +357,8 @@ public class PaymentParameters extends CommonBase { /** * Creates parameters for paying to a blinded payee from the provided blinded route hints. */ - public static PaymentParameters blinded(TwoTuple_BlindedPayInfoBlindedPathZ[] blinded_route_hints) { - long ret = bindings.PaymentParameters_blinded(blinded_route_hints != null ? Arrays.stream(blinded_route_hints).mapToLong(blinded_route_hints_conv_37 -> blinded_route_hints_conv_37.ptr).toArray() : null); + public static PaymentParameters blinded(BlindedPaymentPath[] blinded_route_hints) { + long ret = bindings.PaymentParameters_blinded(blinded_route_hints != null ? Arrays.stream(blinded_route_hints).mapToLong(blinded_route_hints_conv_20 -> blinded_route_hints_conv_20.ptr).toArray() : null); Reference.reachabilityFence(blinded_route_hints); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PaymentParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PaymentParameters(null, ret); } diff --git a/src/main/java/org/ldk/structs/PaymentPurpose.java b/src/main/java/org/ldk/structs/PaymentPurpose.java index 5b915e2f..cdb692b7 100644 --- a/src/main/java/org/ldk/structs/PaymentPurpose.java +++ b/src/main/java/org/ldk/structs/PaymentPurpose.java @@ -194,7 +194,6 @@ public class PaymentPurpose extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PaymentPurpose ret_hu_conv = org.ldk.structs.PaymentPurpose.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(payment_preimage); }; return ret_hu_conv; } @@ -209,8 +208,6 @@ public class PaymentPurpose extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PaymentPurpose ret_hu_conv = org.ldk.structs.PaymentPurpose.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(payment_preimage); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(payment_context); }; return ret_hu_conv; } @@ -225,8 +222,6 @@ public class PaymentPurpose extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PaymentPurpose ret_hu_conv = org.ldk.structs.PaymentPurpose.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(payment_preimage); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(payment_context); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/PaymentSendFailure.java b/src/main/java/org/ldk/structs/PaymentSendFailure.java index 5805c66b..98baefad 100644 --- a/src/main/java/org/ldk/structs/PaymentSendFailure.java +++ b/src/main/java/org/ldk/structs/PaymentSendFailure.java @@ -208,7 +208,6 @@ public class PaymentSendFailure extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PaymentSendFailure ret_hu_conv = org.ldk.structs.PaymentSendFailure.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; return ret_hu_conv; } @@ -233,7 +232,6 @@ public class PaymentSendFailure extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PaymentSendFailure ret_hu_conv = org.ldk.structs.PaymentSendFailure.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - for (APIError a_conv_10: a) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a_conv_10); }; }; return ret_hu_conv; } @@ -259,7 +257,6 @@ public class PaymentSendFailure extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PaymentSendFailure ret_hu_conv = org.ldk.structs.PaymentSendFailure.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(failed_paths_retry); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/PeeledOnion.java b/src/main/java/org/ldk/structs/PeeledOnion.java index 587c32b9..f5717267 100644 --- a/src/main/java/org/ldk/structs/PeeledOnion.java +++ b/src/main/java/org/ldk/structs/PeeledOnion.java @@ -50,27 +50,27 @@ public class PeeledOnion extends CommonBase { } } /** - * Received onion message, with decrypted contents, path_id, and reply path + * Received onion message, with decrypted contents, context, and reply path */ public final static class Receive extends PeeledOnion { public final org.ldk.structs.ParsedOnionMessageContents _0; + public final org.ldk.structs.Option_MessageContextZ _1; /** * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None */ - @Nullable public final byte[] _1; - /** - * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None - */ - @Nullable public final org.ldk.structs.BlindedPath _2; + @Nullable public final org.ldk.structs.BlindedMessagePath _2; private Receive(long ptr, bindings.LDKPeeledOnion.Receive obj) { super(null, ptr); long _0 = obj._0; org.ldk.structs.ParsedOnionMessageContents _0_hu_conv = org.ldk.structs.ParsedOnionMessageContents.constr_from_ptr(_0); if (_0_hu_conv != null) { _0_hu_conv.ptrs_to.add(this); }; this._0 = _0_hu_conv; - this._1 = obj._1; + long _1 = obj._1; + org.ldk.structs.Option_MessageContextZ _1_hu_conv = org.ldk.structs.Option_MessageContextZ.constr_from_ptr(_1); + if (_1_hu_conv != null) { _1_hu_conv.ptrs_to.add(this); }; + this._1 = _1_hu_conv; long _2 = obj._2; - org.ldk.structs.BlindedPath _2_hu_conv = null; if (_2 < 0 || _2 > 4096) { _2_hu_conv = new org.ldk.structs.BlindedPath(null, _2); } + org.ldk.structs.BlindedMessagePath _2_hu_conv = null; if (_2 < 0 || _2 > 4096) { _2_hu_conv = new org.ldk.structs.BlindedMessagePath(null, _2); } if (_2_hu_conv != null) { _2_hu_conv.ptrs_to.add(this); }; this._2 = _2_hu_conv; } @@ -103,16 +103,14 @@ public class PeeledOnion extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PeeledOnion ret_hu_conv = org.ldk.structs.PeeledOnion.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b); }; return ret_hu_conv; } /** * Utility method to constructs a new Receive-variant PeeledOnion */ - public static PeeledOnion receive(org.ldk.structs.ParsedOnionMessageContents a, byte[] b, org.ldk.structs.BlindedPath c) { - long ret = bindings.PeeledOnion_receive(a.ptr, InternalUtils.check_arr_len(b, 32), c.ptr); + public static PeeledOnion receive(org.ldk.structs.ParsedOnionMessageContents a, org.ldk.structs.Option_MessageContextZ b, org.ldk.structs.BlindedMessagePath c) { + long ret = bindings.PeeledOnion_receive(a.ptr, b.ptr, c.ptr); Reference.reachabilityFence(a); Reference.reachabilityFence(b); Reference.reachabilityFence(c); @@ -120,7 +118,6 @@ public class PeeledOnion extends CommonBase { org.ldk.structs.PeeledOnion ret_hu_conv = org.ldk.structs.PeeledOnion.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(c); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/PeerDetails.java b/src/main/java/org/ldk/structs/PeerDetails.java index 9e449104..e2153f67 100644 --- a/src/main/java/org/ldk/structs/PeerDetails.java +++ b/src/main/java/org/ldk/structs/PeerDetails.java @@ -71,7 +71,6 @@ public class PeerDetails extends CommonBase { bindings.PeerDetails_set_socket_address(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -93,7 +92,6 @@ public class PeerDetails extends CommonBase { bindings.PeerDetails_set_init_features(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -130,8 +128,6 @@ public class PeerDetails extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PeerDetails ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PeerDetails(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(socket_address_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(init_features_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/PeerManager.java b/src/main/java/org/ldk/structs/PeerManager.java index fbec38a6..3242ca13 100644 --- a/src/main/java/org/ldk/structs/PeerManager.java +++ b/src/main/java/org/ldk/structs/PeerManager.java @@ -133,7 +133,6 @@ public class PeerManager extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } Result_CVec_u8ZPeerHandleErrorZ ret_hu_conv = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.add(descriptor); }; - if (this != null) { this.ptrs_to.add(remote_network_address); }; return ret_hu_conv; } @@ -162,7 +161,6 @@ public class PeerManager extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } Result_NonePeerHandleErrorZ ret_hu_conv = Result_NonePeerHandleErrorZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.add(descriptor); }; - if (this != null) { this.ptrs_to.add(remote_network_address); }; return ret_hu_conv; } @@ -316,7 +314,6 @@ public class PeerManager extends CommonBase { Reference.reachabilityFence(rgb); Reference.reachabilityFence(alias); Reference.reachabilityFence(addresses); - for (SocketAddress addresses_conv_15: addresses) { if (this != null) { this.ptrs_to.add(addresses_conv_15); }; }; } } diff --git a/src/main/java/org/ldk/structs/PendingHTLCInfo.java b/src/main/java/org/ldk/structs/PendingHTLCInfo.java index 2dae1fed..87b22c8b 100644 --- a/src/main/java/org/ldk/structs/PendingHTLCInfo.java +++ b/src/main/java/org/ldk/structs/PendingHTLCInfo.java @@ -40,7 +40,6 @@ public class PendingHTLCInfo extends CommonBase { bindings.PendingHTLCInfo_set_routing(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -108,7 +107,6 @@ public class PendingHTLCInfo extends CommonBase { bindings.PendingHTLCInfo_set_incoming_amt_msat(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -204,7 +202,6 @@ public class PendingHTLCInfo extends CommonBase { bindings.PendingHTLCInfo_set_skimmed_fee_msat(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -222,9 +219,6 @@ public class PendingHTLCInfo extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PendingHTLCInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PendingHTLCInfo(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(routing_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(incoming_amt_msat_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(skimmed_fee_msat_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/PendingHTLCRouting.java b/src/main/java/org/ldk/structs/PendingHTLCRouting.java index 2284ea64..3d4773c0 100644 --- a/src/main/java/org/ldk/structs/PendingHTLCRouting.java +++ b/src/main/java/org/ldk/structs/PendingHTLCRouting.java @@ -251,8 +251,6 @@ public class PendingHTLCRouting extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PendingHTLCRouting ret_hu_conv = org.ldk.structs.PendingHTLCRouting.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(onion_packet); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(blinded); }; return ret_hu_conv; } @@ -271,9 +269,6 @@ public class PendingHTLCRouting extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PendingHTLCRouting ret_hu_conv = org.ldk.structs.PendingHTLCRouting.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(payment_data); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(payment_metadata); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(payment_context); }; return ret_hu_conv; } @@ -291,8 +286,6 @@ public class PendingHTLCRouting extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PendingHTLCRouting ret_hu_conv = org.ldk.structs.PendingHTLCRouting.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(payment_data); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(payment_metadata); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Persist.java b/src/main/java/org/ldk/structs/Persist.java index baf592f1..d7097c7f 100644 --- a/src/main/java/org/ldk/structs/Persist.java +++ b/src/main/java/org/ldk/structs/Persist.java @@ -40,7 +40,7 @@ import javax.annotation.Nullable; * All calls should generally spawn a background task and immediately return * [`ChannelMonitorUpdateStatus::InProgress`]. Once the update completes, * [`ChainMonitor::channel_monitor_updated`] should be called with the corresponding - * [`MonitorUpdateId`]. + * [`ChannelMonitor::get_latest_update_id`] or [`ChannelMonitorUpdate::update_id`]. * * Note that unlike the direct [`chain::Watch`] interface, * [`ChainMonitor::channel_monitor_updated`] must be called once for *each* update which occurs. @@ -99,8 +99,9 @@ public class Persist extends CommonBase { * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint * and the stored channel data). Note that you **must** persist every new monitor to disk. * - * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`], - * if you return [`ChannelMonitorUpdateStatus::InProgress`]. + * The [`ChannelMonitor::get_latest_update_id`] uniquely links this call to [`ChainMonitor::channel_monitor_updated`]. + * For [`Persist::persist_new_channel`], it is only necessary to call [`ChainMonitor::channel_monitor_updated`] + * when you return [`ChannelMonitorUpdateStatus::InProgress`]. * * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor` * and [`ChannelMonitorUpdateStatus`] for requirements when returning errors. @@ -108,7 +109,7 @@ public class Persist extends CommonBase { * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager * [`Writeable::write`]: crate::util::ser::Writeable::write */ - ChannelMonitorUpdateStatus persist_new_channel(OutPoint channel_funding_outpoint, ChannelMonitor data, MonitorUpdateId update_id); + ChannelMonitorUpdateStatus persist_new_channel(OutPoint channel_funding_outpoint, ChannelMonitor monitor); /** * Update one channel's data. The provided [`ChannelMonitor`] has already applied the given * update. @@ -126,7 +127,9 @@ public class Persist extends CommonBase { * If an implementer chooses to persist the updates only, they need to make * sure that all the updates are applied to the `ChannelMonitors` *before * the set of channel monitors is given to the `ChannelManager` - * deserialization routine. See [`ChannelMonitor::update_monitor`] for + * deserialization routine. If there are any gaps in the persisted [`ChannelMonitorUpdate`]s, + * implementer can safely ignore [`ChannelMonitorUpdate`]s after the gap and load without them. + * See [`ChannelMonitor::update_monitor`] for * applying a monitor update to a monitor. If full `ChannelMonitors` are * persisted, then there is no need to persist individual updates. * @@ -135,8 +138,10 @@ public class Persist extends CommonBase { * them in batches. The size of each monitor grows `O(number of state updates)` * whereas updates are small and `O(1)`. * - * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`], - * if you return [`ChannelMonitorUpdateStatus::InProgress`]. + * The [`ChannelMonitorUpdate::update_id`] or [`ChannelMonitor::get_latest_update_id`] uniquely + * links this call to [`ChainMonitor::channel_monitor_updated`]. + * For [`Persist::update_persisted_channel`], it is only necessary to call [`ChainMonitor::channel_monitor_updated`] + * when a [`ChannelMonitorUpdate`] is provided and when you return [`ChannelMonitorUpdateStatus::InProgress`]. * * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`, * [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and @@ -144,9 +149,9 @@ public class Persist extends CommonBase { * * [`Writeable::write`]: crate::util::ser::Writeable::write * - * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None + * Note that monitor_update (or a relevant inner pointer) may be NULL or all-0s to represent None */ - ChannelMonitorUpdateStatus update_persisted_channel(OutPoint channel_funding_outpoint, ChannelMonitorUpdate update, ChannelMonitor data, MonitorUpdateId update_id); + ChannelMonitorUpdateStatus update_persisted_channel(OutPoint channel_funding_outpoint, ChannelMonitorUpdate monitor_update, ChannelMonitor monitor); /** * Prevents the channel monitor from being loaded on startup. * @@ -159,25 +164,21 @@ public class Persist extends CommonBase { public static Persist new_impl(PersistInterface arg) { final LDKPersistHolder impl_holder = new LDKPersistHolder(); impl_holder.held = new Persist(new bindings.LDKPersist() { - @Override public ChannelMonitorUpdateStatus persist_new_channel(long channel_funding_outpoint, long data, long update_id) { + @Override public ChannelMonitorUpdateStatus persist_new_channel(long channel_funding_outpoint, long monitor) { org.ldk.structs.OutPoint channel_funding_outpoint_hu_conv = null; if (channel_funding_outpoint < 0 || channel_funding_outpoint > 4096) { channel_funding_outpoint_hu_conv = new org.ldk.structs.OutPoint(null, channel_funding_outpoint); } if (channel_funding_outpoint_hu_conv != null) { channel_funding_outpoint_hu_conv.ptrs_to.add(this); }; - org.ldk.structs.ChannelMonitor data_hu_conv = null; if (data < 0 || data > 4096) { data_hu_conv = new org.ldk.structs.ChannelMonitor(null, data); } - org.ldk.structs.MonitorUpdateId update_id_hu_conv = null; if (update_id < 0 || update_id > 4096) { update_id_hu_conv = new org.ldk.structs.MonitorUpdateId(null, update_id); } - if (update_id_hu_conv != null) { update_id_hu_conv.ptrs_to.add(this); }; - ChannelMonitorUpdateStatus ret = arg.persist_new_channel(channel_funding_outpoint_hu_conv, data_hu_conv, update_id_hu_conv); + org.ldk.structs.ChannelMonitor monitor_hu_conv = null; if (monitor < 0 || monitor > 4096) { monitor_hu_conv = new org.ldk.structs.ChannelMonitor(null, monitor); } + ChannelMonitorUpdateStatus ret = arg.persist_new_channel(channel_funding_outpoint_hu_conv, monitor_hu_conv); Reference.reachabilityFence(arg); return ret; } - @Override public ChannelMonitorUpdateStatus update_persisted_channel(long channel_funding_outpoint, long update, long data, long update_id) { + @Override public ChannelMonitorUpdateStatus update_persisted_channel(long channel_funding_outpoint, long monitor_update, long monitor) { org.ldk.structs.OutPoint channel_funding_outpoint_hu_conv = null; if (channel_funding_outpoint < 0 || channel_funding_outpoint > 4096) { channel_funding_outpoint_hu_conv = new org.ldk.structs.OutPoint(null, channel_funding_outpoint); } if (channel_funding_outpoint_hu_conv != null) { channel_funding_outpoint_hu_conv.ptrs_to.add(this); }; - org.ldk.structs.ChannelMonitorUpdate update_hu_conv = null; if (update < 0 || update > 4096) { update_hu_conv = new org.ldk.structs.ChannelMonitorUpdate(null, update); } - if (update_hu_conv != null) { update_hu_conv.ptrs_to.add(this); }; - org.ldk.structs.ChannelMonitor data_hu_conv = null; if (data < 0 || data > 4096) { data_hu_conv = new org.ldk.structs.ChannelMonitor(null, data); } - org.ldk.structs.MonitorUpdateId update_id_hu_conv = null; if (update_id < 0 || update_id > 4096) { update_id_hu_conv = new org.ldk.structs.MonitorUpdateId(null, update_id); } - if (update_id_hu_conv != null) { update_id_hu_conv.ptrs_to.add(this); }; - ChannelMonitorUpdateStatus ret = arg.update_persisted_channel(channel_funding_outpoint_hu_conv, update_hu_conv, data_hu_conv, update_id_hu_conv); + org.ldk.structs.ChannelMonitorUpdate monitor_update_hu_conv = null; if (monitor_update < 0 || monitor_update > 4096) { monitor_update_hu_conv = new org.ldk.structs.ChannelMonitorUpdate(null, monitor_update); } + if (monitor_update_hu_conv != null) { monitor_update_hu_conv.ptrs_to.add(this); }; + org.ldk.structs.ChannelMonitor monitor_hu_conv = null; if (monitor < 0 || monitor > 4096) { monitor_hu_conv = new org.ldk.structs.ChannelMonitor(null, monitor); } + ChannelMonitorUpdateStatus ret = arg.update_persisted_channel(channel_funding_outpoint_hu_conv, monitor_update_hu_conv, monitor_hu_conv); Reference.reachabilityFence(arg); return ret; } @@ -198,8 +199,9 @@ public class Persist extends CommonBase { * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint * and the stored channel data). Note that you **must** persist every new monitor to disk. * - * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`], - * if you return [`ChannelMonitorUpdateStatus::InProgress`]. + * The [`ChannelMonitor::get_latest_update_id`] uniquely links this call to [`ChainMonitor::channel_monitor_updated`]. + * For [`Persist::persist_new_channel`], it is only necessary to call [`ChainMonitor::channel_monitor_updated`] + * when you return [`ChannelMonitorUpdateStatus::InProgress`]. * * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor` * and [`ChannelMonitorUpdateStatus`] for requirements when returning errors. @@ -207,15 +209,12 @@ public class Persist extends CommonBase { * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager * [`Writeable::write`]: crate::util::ser::Writeable::write */ - public ChannelMonitorUpdateStatus persist_new_channel(org.ldk.structs.OutPoint channel_funding_outpoint, org.ldk.structs.ChannelMonitor data, org.ldk.structs.MonitorUpdateId update_id) { - ChannelMonitorUpdateStatus ret = bindings.Persist_persist_new_channel(this.ptr, channel_funding_outpoint.ptr, data.ptr, update_id.ptr); + public ChannelMonitorUpdateStatus persist_new_channel(org.ldk.structs.OutPoint channel_funding_outpoint, org.ldk.structs.ChannelMonitor monitor) { + ChannelMonitorUpdateStatus ret = bindings.Persist_persist_new_channel(this.ptr, channel_funding_outpoint.ptr, monitor.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(channel_funding_outpoint); - Reference.reachabilityFence(data); - Reference.reachabilityFence(update_id); - if (this != null) { this.ptrs_to.add(channel_funding_outpoint); }; - if (this != null) { this.ptrs_to.add(data); }; - if (this != null) { this.ptrs_to.add(update_id); }; + Reference.reachabilityFence(monitor); + if (this != null) { this.ptrs_to.add(monitor); }; return ret; } @@ -236,7 +235,9 @@ public class Persist extends CommonBase { * If an implementer chooses to persist the updates only, they need to make * sure that all the updates are applied to the `ChannelMonitors` *before * the set of channel monitors is given to the `ChannelManager` - * deserialization routine. See [`ChannelMonitor::update_monitor`] for + * deserialization routine. If there are any gaps in the persisted [`ChannelMonitorUpdate`]s, + * implementer can safely ignore [`ChannelMonitorUpdate`]s after the gap and load without them. + * See [`ChannelMonitor::update_monitor`] for * applying a monitor update to a monitor. If full `ChannelMonitors` are * persisted, then there is no need to persist individual updates. * @@ -245,8 +246,10 @@ public class Persist extends CommonBase { * them in batches. The size of each monitor grows `O(number of state updates)` * whereas updates are small and `O(1)`. * - * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`], - * if you return [`ChannelMonitorUpdateStatus::InProgress`]. + * The [`ChannelMonitorUpdate::update_id`] or [`ChannelMonitor::get_latest_update_id`] uniquely + * links this call to [`ChainMonitor::channel_monitor_updated`]. + * For [`Persist::update_persisted_channel`], it is only necessary to call [`ChainMonitor::channel_monitor_updated`] + * when a [`ChannelMonitorUpdate`] is provided and when you return [`ChannelMonitorUpdateStatus::InProgress`]. * * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`, * [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and @@ -254,19 +257,15 @@ public class Persist extends CommonBase { * * [`Writeable::write`]: crate::util::ser::Writeable::write * - * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None + * Note that monitor_update (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public ChannelMonitorUpdateStatus update_persisted_channel(org.ldk.structs.OutPoint channel_funding_outpoint, @Nullable org.ldk.structs.ChannelMonitorUpdate update, org.ldk.structs.ChannelMonitor data, org.ldk.structs.MonitorUpdateId update_id) { - ChannelMonitorUpdateStatus ret = bindings.Persist_update_persisted_channel(this.ptr, channel_funding_outpoint.ptr, update == null ? 0 : update.ptr, data.ptr, update_id.ptr); + public ChannelMonitorUpdateStatus update_persisted_channel(org.ldk.structs.OutPoint channel_funding_outpoint, @Nullable org.ldk.structs.ChannelMonitorUpdate monitor_update, org.ldk.structs.ChannelMonitor monitor) { + ChannelMonitorUpdateStatus ret = bindings.Persist_update_persisted_channel(this.ptr, channel_funding_outpoint.ptr, monitor_update == null ? 0 : monitor_update.ptr, monitor.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(channel_funding_outpoint); - Reference.reachabilityFence(update); - Reference.reachabilityFence(data); - Reference.reachabilityFence(update_id); - if (this != null) { this.ptrs_to.add(channel_funding_outpoint); }; - if (this != null) { this.ptrs_to.add(update); }; - if (this != null) { this.ptrs_to.add(data); }; - if (this != null) { this.ptrs_to.add(update_id); }; + Reference.reachabilityFence(monitor_update); + Reference.reachabilityFence(monitor); + if (this != null) { this.ptrs_to.add(monitor); }; return ret; } @@ -280,7 +279,6 @@ public class Persist extends CommonBase { bindings.Persist_archive_persisted_channel(this.ptr, channel_funding_outpoint.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(channel_funding_outpoint); - if (this != null) { this.ptrs_to.add(channel_funding_outpoint); }; } } diff --git a/src/main/java/org/ldk/structs/PhantomRouteHints.java b/src/main/java/org/ldk/structs/PhantomRouteHints.java index 19b2686b..b0eb5e13 100644 --- a/src/main/java/org/ldk/structs/PhantomRouteHints.java +++ b/src/main/java/org/ldk/structs/PhantomRouteHints.java @@ -46,7 +46,6 @@ public class PhantomRouteHints extends CommonBase { bindings.PhantomRouteHints_set_channels(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_16 -> val_conv_16.ptr).toArray() : null); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - for (ChannelDetails val_conv_16: val) { if (this != null) { this.ptrs_to.add(val_conv_16); }; }; } /** @@ -98,7 +97,6 @@ public class PhantomRouteHints extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PhantomRouteHints ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PhantomRouteHints(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - for (ChannelDetails channels_arg_conv_16: channels_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channels_arg_conv_16); }; }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/PrivateRoute.java b/src/main/java/org/ldk/structs/PrivateRoute.java index 5524d3c2..592cff6d 100644 --- a/src/main/java/org/ldk/structs/PrivateRoute.java +++ b/src/main/java/org/ldk/structs/PrivateRoute.java @@ -78,7 +78,6 @@ public class PrivateRoute extends CommonBase { Reference.reachabilityFence(hops); if (ret >= 0 && ret <= 4096) { return null; } Result_PrivateRouteCreationErrorZ ret_hu_conv = Result_PrivateRouteCreationErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(hops); }; return ret_hu_conv; } @@ -91,7 +90,7 @@ public class PrivateRoute extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.RouteHint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RouteHint(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - if (this != null) { this.ptrs_to.add(this); }; + ; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ProbabilisticScorer.java b/src/main/java/org/ldk/structs/ProbabilisticScorer.java index 6ade87c7..488de5c9 100644 --- a/src/main/java/org/ldk/structs/ProbabilisticScorer.java +++ b/src/main/java/org/ldk/structs/ProbabilisticScorer.java @@ -62,7 +62,6 @@ public class ProbabilisticScorer extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ProbabilisticScorer ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ProbabilisticScorer(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(decay_params); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(network_graph); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(logger); }; return ret_hu_conv; @@ -218,7 +217,6 @@ public class ProbabilisticScorer extends CommonBase { Reference.reachabilityFence(arg_c); if (ret >= 0 && ret <= 4096) { return null; } Result_ProbabilisticScorerDecodeErrorZ ret_hu_conv = Result_ProbabilisticScorerDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(arg_a); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(arg_b); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(arg_c); }; return ret_hu_conv; diff --git a/src/main/java/org/ldk/structs/ProbabilisticScoringFeeParameters.java b/src/main/java/org/ldk/structs/ProbabilisticScoringFeeParameters.java index 82489802..560c7ad6 100644 --- a/src/main/java/org/ldk/structs/ProbabilisticScoringFeeParameters.java +++ b/src/main/java/org/ldk/structs/ProbabilisticScoringFeeParameters.java @@ -476,7 +476,6 @@ public class ProbabilisticScoringFeeParameters extends CommonBase { bindings.ProbabilisticScoringFeeParameters_add_banned_from_list(this.ptr, node_ids != null ? Arrays.stream(node_ids).mapToLong(node_ids_conv_8 -> node_ids_conv_8.ptr).toArray() : null); Reference.reachabilityFence(this); Reference.reachabilityFence(node_ids); - for (NodeId node_ids_conv_8: node_ids) { if (this != null) { this.ptrs_to.add(node_ids_conv_8); }; }; } /** diff --git a/src/main/java/org/ldk/structs/ProbeSendFailure.java b/src/main/java/org/ldk/structs/ProbeSendFailure.java index bb1438dd..de005273 100644 --- a/src/main/java/org/ldk/structs/ProbeSendFailure.java +++ b/src/main/java/org/ldk/structs/ProbeSendFailure.java @@ -92,7 +92,6 @@ public class ProbeSendFailure extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ProbeSendFailure ret_hu_conv = org.ldk.structs.ProbeSendFailure.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/RapidGossipSync.java b/src/main/java/org/ldk/structs/RapidGossipSync.java index 54e4717b..bc28d25f 100644 --- a/src/main/java/org/ldk/structs/RapidGossipSync.java +++ b/src/main/java/org/ldk/structs/RapidGossipSync.java @@ -85,7 +85,6 @@ public class RapidGossipSync extends CommonBase { Reference.reachabilityFence(current_time_unix); if (ret >= 0 && ret <= 4096) { return null; } Result_u32GraphSyncErrorZ ret_hu_conv = Result_u32GraphSyncErrorZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.add(current_time_unix); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/RawBolt11Invoice.java b/src/main/java/org/ldk/structs/RawBolt11Invoice.java index 29e49b8b..9cea302f 100644 --- a/src/main/java/org/ldk/structs/RawBolt11Invoice.java +++ b/src/main/java/org/ldk/structs/RawBolt11Invoice.java @@ -43,7 +43,6 @@ public class RawBolt11Invoice extends CommonBase { bindings.RawBolt11Invoice_set_data(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** diff --git a/src/main/java/org/ldk/structs/RawDataPart.java b/src/main/java/org/ldk/structs/RawDataPart.java index 3c730c9c..26973ef8 100644 --- a/src/main/java/org/ldk/structs/RawDataPart.java +++ b/src/main/java/org/ldk/structs/RawDataPart.java @@ -39,7 +39,6 @@ public class RawDataPart extends CommonBase { bindings.RawDataPart_set_timestamp(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** diff --git a/src/main/java/org/ldk/structs/ReceiveTlvs.java b/src/main/java/org/ldk/structs/ReceiveTlvs.java index 9b095526..fbf438c6 100644 --- a/src/main/java/org/ldk/structs/ReceiveTlvs.java +++ b/src/main/java/org/ldk/structs/ReceiveTlvs.java @@ -58,7 +58,6 @@ public class ReceiveTlvs extends CommonBase { bindings.ReceiveTlvs_set_payment_constraints(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -80,7 +79,6 @@ public class ReceiveTlvs extends CommonBase { bindings.ReceiveTlvs_set_payment_context(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -94,8 +92,6 @@ public class ReceiveTlvs extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ReceiveTlvs ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ReceiveTlvs(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(payment_constraints_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(payment_context_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/RecentPaymentDetails.java b/src/main/java/org/ldk/structs/RecentPaymentDetails.java index 895d56a7..a035fec6 100644 --- a/src/main/java/org/ldk/structs/RecentPaymentDetails.java +++ b/src/main/java/org/ldk/structs/RecentPaymentDetails.java @@ -177,7 +177,6 @@ public class RecentPaymentDetails extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.RecentPaymentDetails ret_hu_conv = org.ldk.structs.RecentPaymentDetails.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(payment_hash); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/RecipientOnionFields.java b/src/main/java/org/ldk/structs/RecipientOnionFields.java index cf4a3094..bc963721 100644 --- a/src/main/java/org/ldk/structs/RecipientOnionFields.java +++ b/src/main/java/org/ldk/structs/RecipientOnionFields.java @@ -62,7 +62,6 @@ public class RecipientOnionFields extends CommonBase { bindings.RecipientOnionFields_set_payment_secret(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -108,7 +107,6 @@ public class RecipientOnionFields extends CommonBase { bindings.RecipientOnionFields_set_payment_metadata(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } long clone_ptr() { @@ -215,7 +213,7 @@ public class RecipientOnionFields extends CommonBase { Reference.reachabilityFence(custom_tlvs); if (ret >= 0 && ret <= 4096) { return null; } Result_RecipientOnionFieldsNoneZ ret_hu_conv = Result_RecipientOnionFieldsNoneZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.add(this); }; + ; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Record.java b/src/main/java/org/ldk/structs/Record.java index 6e9bd3e6..1c7c85fd 100644 --- a/src/main/java/org/ldk/structs/Record.java +++ b/src/main/java/org/ldk/structs/Record.java @@ -96,7 +96,6 @@ public class Record extends CommonBase { bindings.Record_set_channel_id(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -171,14 +170,41 @@ public class Record extends CommonBase { Reference.reachabilityFence(val); } + /** + * The payment hash. + * + * Note that this is only filled in for logs pertaining to a specific payment, and will be + * `None` for logs which are not directly related to a payment. + */ + public Option_ThirtyTwoBytesZ get_payment_hash() { + long ret = bindings.Record_get_payment_hash(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_ThirtyTwoBytesZ ret_hu_conv = org.ldk.structs.Option_ThirtyTwoBytesZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * The payment hash. + * + * Note that this is only filled in for logs pertaining to a specific payment, and will be + * `None` for logs which are not directly related to a payment. + */ + public void set_payment_hash(org.ldk.structs.Option_ThirtyTwoBytesZ val) { + bindings.Record_set_payment_hash(this.ptr, val.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + /** * Constructs a new Record given each field * * Note that peer_id_arg (or a relevant inner pointer) may be NULL or all-0s to represent None * Note that channel_id_arg (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public static Record of(org.ldk.enums.Level level_arg, @Nullable byte[] peer_id_arg, @Nullable org.ldk.structs.ChannelId channel_id_arg, java.lang.String args_arg, java.lang.String module_path_arg, java.lang.String file_arg, int line_arg) { - long ret = bindings.Record_new(level_arg, InternalUtils.check_arr_len(peer_id_arg, 33), channel_id_arg == null ? 0 : channel_id_arg.ptr, args_arg, module_path_arg, file_arg, line_arg); + public static Record of(org.ldk.enums.Level level_arg, @Nullable byte[] peer_id_arg, @Nullable org.ldk.structs.ChannelId channel_id_arg, java.lang.String args_arg, java.lang.String module_path_arg, java.lang.String file_arg, int line_arg, org.ldk.structs.Option_ThirtyTwoBytesZ payment_hash_arg) { + long ret = bindings.Record_new(level_arg, InternalUtils.check_arr_len(peer_id_arg, 33), channel_id_arg == null ? 0 : channel_id_arg.ptr, args_arg, module_path_arg, file_arg, line_arg, payment_hash_arg.ptr); Reference.reachabilityFence(level_arg); Reference.reachabilityFence(peer_id_arg); Reference.reachabilityFence(channel_id_arg); @@ -186,10 +212,10 @@ public class Record extends CommonBase { Reference.reachabilityFence(module_path_arg); Reference.reachabilityFence(file_arg); Reference.reachabilityFence(line_arg); + Reference.reachabilityFence(payment_hash_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Record ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Record(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Refund.java b/src/main/java/org/ldk/structs/Refund.java index 69be10f0..a9ed2993 100644 --- a/src/main/java/org/ldk/structs/Refund.java +++ b/src/main/java/org/ldk/structs/Refund.java @@ -111,18 +111,18 @@ public class Refund extends CommonBase { * Paths to the sender originating from publicly reachable nodes. Blinded paths provide sender * privacy by obfuscating its node id. */ - public BlindedPath[] paths() { + public BlindedMessagePath[] paths() { long[] ret = bindings.Refund_paths(this.ptr); Reference.reachabilityFence(this); - int ret_conv_13_len = ret.length; - BlindedPath[] ret_conv_13_arr = new BlindedPath[ret_conv_13_len]; - for (int n = 0; n < ret_conv_13_len; n++) { - long ret_conv_13 = ret[n]; - org.ldk.structs.BlindedPath ret_conv_13_hu_conv = null; if (ret_conv_13 < 0 || ret_conv_13 > 4096) { ret_conv_13_hu_conv = new org.ldk.structs.BlindedPath(null, ret_conv_13); } - if (ret_conv_13_hu_conv != null) { ret_conv_13_hu_conv.ptrs_to.add(this); }; - ret_conv_13_arr[n] = ret_conv_13_hu_conv; + int ret_conv_20_len = ret.length; + BlindedMessagePath[] ret_conv_20_arr = new BlindedMessagePath[ret_conv_20_len]; + for (int u = 0; u < ret_conv_20_len; u++) { + long ret_conv_20 = ret[u]; + org.ldk.structs.BlindedMessagePath ret_conv_20_hu_conv = null; if (ret_conv_20 < 0 || ret_conv_20 > 4096) { ret_conv_20_hu_conv = new org.ldk.structs.BlindedMessagePath(null, ret_conv_20); } + if (ret_conv_20_hu_conv != null) { ret_conv_20_hu_conv.ptrs_to.add(this); }; + ret_conv_20_arr[u] = ret_conv_20_hu_conv; } - return ret_conv_13_arr; + return ret_conv_20_arr; } /** @@ -220,6 +220,17 @@ public class Refund extends CommonBase { @Override public int hashCode() { return (int)this.hash(); } + /** + * Read a Refund from a byte array, created by Refund_write + */ + public static Result_RefundDecodeErrorZ read(byte[] ser) { + long ret = bindings.Refund_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_RefundDecodeErrorZ ret_hu_conv = Result_RefundDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + /** * Serialize the Refund object into a byte array which can be read by Refund_read */ diff --git a/src/main/java/org/ldk/structs/RefundMaybeWithDerivedMetadataBuilder.java b/src/main/java/org/ldk/structs/RefundMaybeWithDerivedMetadataBuilder.java index 0d347006..27739841 100644 --- a/src/main/java/org/ldk/structs/RefundMaybeWithDerivedMetadataBuilder.java +++ b/src/main/java/org/ldk/structs/RefundMaybeWithDerivedMetadataBuilder.java @@ -73,26 +73,29 @@ public class RefundMaybeWithDerivedMetadataBuilder extends CommonBase { * different payer id for each refund, assuming a different nonce is used. Otherwise, the * provided `node_id` is used for the payer id. * - * Also, sets the metadata when [`RefundBuilder::build`] is called such that it can be used to - * verify that an [`InvoiceRequest`] was produced for the refund given an [`ExpandedKey`]. + * Also, sets the metadata when [`RefundBuilder::build`] is called such that it can be used by + * [`Bolt12Invoice::verify_using_metadata`] to determine if the invoice was produced for the + * refund given an [`ExpandedKey`]. However, if [`RefundBuilder::path`] is called, then the + * metadata must be included in each [`BlindedMessagePath`] instead. In this case, use + * [`Bolt12Invoice::verify_using_payer_data`]. * * The `payment_id` is encrypted in the metadata and should be unique. This ensures that only * one invoice will be paid for the refund and that payments can be uniquely identified. * - * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest + * [`Bolt12Invoice::verify_using_metadata`]: crate::offers::invoice::Bolt12Invoice::verify_using_metadata + * [`Bolt12Invoice::verify_using_payer_data`]: crate::offers::invoice::Bolt12Invoice::verify_using_payer_data * [`ExpandedKey`]: crate::ln::inbound_payment::ExpandedKey */ - public static Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ deriving_payer_id(byte[] node_id, org.ldk.structs.ExpandedKey expanded_key, org.ldk.structs.EntropySource entropy_source, long amount_msats, byte[] payment_id) { - long ret = bindings.RefundMaybeWithDerivedMetadataBuilder_deriving_payer_id(InternalUtils.check_arr_len(node_id, 33), expanded_key.ptr, entropy_source.ptr, amount_msats, InternalUtils.check_arr_len(payment_id, 32)); + public static Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ deriving_payer_id(byte[] node_id, org.ldk.structs.ExpandedKey expanded_key, org.ldk.structs.Nonce nonce, long amount_msats, byte[] payment_id) { + long ret = bindings.RefundMaybeWithDerivedMetadataBuilder_deriving_payer_id(InternalUtils.check_arr_len(node_id, 33), expanded_key.ptr, nonce.ptr, amount_msats, InternalUtils.check_arr_len(payment_id, 32)); Reference.reachabilityFence(node_id); Reference.reachabilityFence(expanded_key); - Reference.reachabilityFence(entropy_source); + Reference.reachabilityFence(nonce); Reference.reachabilityFence(amount_msats); Reference.reachabilityFence(payment_id); if (ret >= 0 && ret <= 4096) { return null; } Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ ret_hu_conv = Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(expanded_key); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(entropy_source); }; return ret_hu_conv; } @@ -105,7 +108,7 @@ public class RefundMaybeWithDerivedMetadataBuilder extends CommonBase { bindings.RefundMaybeWithDerivedMetadataBuilder_description(this.ptr, description); Reference.reachabilityFence(this); Reference.reachabilityFence(description); - if (this != null) { this.ptrs_to.add(this); }; + ; } /** @@ -118,7 +121,7 @@ public class RefundMaybeWithDerivedMetadataBuilder extends CommonBase { bindings.RefundMaybeWithDerivedMetadataBuilder_absolute_expiry(this.ptr, absolute_expiry); Reference.reachabilityFence(this); Reference.reachabilityFence(absolute_expiry); - if (this != null) { this.ptrs_to.add(this); }; + ; } /** @@ -130,7 +133,7 @@ public class RefundMaybeWithDerivedMetadataBuilder extends CommonBase { bindings.RefundMaybeWithDerivedMetadataBuilder_issuer(this.ptr, issuer); Reference.reachabilityFence(this); Reference.reachabilityFence(issuer); - if (this != null) { this.ptrs_to.add(this); }; + ; } /** @@ -140,12 +143,11 @@ public class RefundMaybeWithDerivedMetadataBuilder extends CommonBase { * Successive calls to this method will add another blinded path. Caller is responsible for not * adding duplicate paths. */ - public void path(org.ldk.structs.BlindedPath path) { + public void path(org.ldk.structs.BlindedMessagePath path) { bindings.RefundMaybeWithDerivedMetadataBuilder_path(this.ptr, path.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(path); - if (this != null) { this.ptrs_to.add(path); }; - if (this != null) { this.ptrs_to.add(this); }; + ; } /** @@ -158,7 +160,7 @@ public class RefundMaybeWithDerivedMetadataBuilder extends CommonBase { bindings.RefundMaybeWithDerivedMetadataBuilder_chain(this.ptr, network); Reference.reachabilityFence(this); Reference.reachabilityFence(network); - if (this != null) { this.ptrs_to.add(this); }; + ; } /** @@ -176,7 +178,7 @@ public class RefundMaybeWithDerivedMetadataBuilder extends CommonBase { bindings.RefundMaybeWithDerivedMetadataBuilder_quantity(this.ptr, quantity); Reference.reachabilityFence(this); Reference.reachabilityFence(quantity); - if (this != null) { this.ptrs_to.add(this); }; + ; } /** @@ -188,7 +190,7 @@ public class RefundMaybeWithDerivedMetadataBuilder extends CommonBase { bindings.RefundMaybeWithDerivedMetadataBuilder_payer_note(this.ptr, payer_note); Reference.reachabilityFence(this); Reference.reachabilityFence(payer_note); - if (this != null) { this.ptrs_to.add(this); }; + ; } /** @@ -199,7 +201,7 @@ public class RefundMaybeWithDerivedMetadataBuilder extends CommonBase { Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } Result_RefundBolt12SemanticErrorZ ret_hu_conv = Result_RefundBolt12SemanticErrorZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.add(this); }; + ; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ReleaseHeldHtlc.java b/src/main/java/org/ldk/structs/ReleaseHeldHtlc.java new file mode 100644 index 00000000..20803307 --- /dev/null +++ b/src/main/java/org/ldk/structs/ReleaseHeldHtlc.java @@ -0,0 +1,106 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * Releases the HTLC corresponding to an inbound [`HeldHtlcAvailable`] message. + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class ReleaseHeldHtlc extends CommonBase { + ReleaseHeldHtlc(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.ReleaseHeldHtlc_free(ptr); } + } + + /** + * Used to release the HTLC held upstream if it matches the corresponding + * [`HeldHtlcAvailable::payment_release_secret`]. + */ + public byte[] get_payment_release_secret() { + byte[] ret = bindings.ReleaseHeldHtlc_get_payment_release_secret(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Used to release the HTLC held upstream if it matches the corresponding + * [`HeldHtlcAvailable::payment_release_secret`]. + */ + public void set_payment_release_secret(byte[] val) { + bindings.ReleaseHeldHtlc_set_payment_release_secret(this.ptr, InternalUtils.check_arr_len(val, 32)); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * Constructs a new ReleaseHeldHtlc given each field + */ + public static ReleaseHeldHtlc of(byte[] payment_release_secret_arg) { + long ret = bindings.ReleaseHeldHtlc_new(InternalUtils.check_arr_len(payment_release_secret_arg, 32)); + Reference.reachabilityFence(payment_release_secret_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ReleaseHeldHtlc ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ReleaseHeldHtlc(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + long clone_ptr() { + long ret = bindings.ReleaseHeldHtlc_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the ReleaseHeldHtlc + */ + public ReleaseHeldHtlc clone() { + long ret = bindings.ReleaseHeldHtlc_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ReleaseHeldHtlc ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ReleaseHeldHtlc(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Constructs a new OnionMessageContents which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned OnionMessageContents must be freed before this_arg is + */ + public OnionMessageContents as_OnionMessageContents() { + long ret = bindings.ReleaseHeldHtlc_as_OnionMessageContents(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + OnionMessageContents ret_hu_conv = new OnionMessageContents(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Serialize the ReleaseHeldHtlc object into a byte array which can be read by ReleaseHeldHtlc_read + */ + public byte[] write() { + byte[] ret = bindings.ReleaseHeldHtlc_write(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Read a ReleaseHeldHtlc from a byte array, created by ReleaseHeldHtlc_write + */ + public static Result_ReleaseHeldHtlcDecodeErrorZ read(byte[] ser) { + long ret = bindings.ReleaseHeldHtlc_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ReleaseHeldHtlcDecodeErrorZ ret_hu_conv = Result_ReleaseHeldHtlcDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/ReplayEvent.java b/src/main/java/org/ldk/structs/ReplayEvent.java new file mode 100644 index 00000000..6c177c6b --- /dev/null +++ b/src/main/java/org/ldk/structs/ReplayEvent.java @@ -0,0 +1,56 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * An error type that may be returned to LDK in order to safely abort event handling if it can't + * currently succeed (e.g., due to a persistence failure). + * + * Depending on the type, LDK may ensure the event is persisted and will eventually be replayed. + * Please refer to the documentation of each [`Event`] variant for more details. + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class ReplayEvent extends CommonBase { + ReplayEvent(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.ReplayEvent_free(ptr); } + } + + /** + * Constructs a new ReplayEvent given each field + */ + public static ReplayEvent of() { + long ret = bindings.ReplayEvent_new(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ReplayEvent ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ReplayEvent(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + long clone_ptr() { + long ret = bindings.ReplayEvent_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the ReplayEvent + */ + public ReplayEvent clone() { + long ret = bindings.ReplayEvent_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ReplayEvent ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ReplayEvent(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Responder.java b/src/main/java/org/ldk/structs/Responder.java new file mode 100644 index 00000000..78c1a24b --- /dev/null +++ b/src/main/java/org/ldk/structs/Responder.java @@ -0,0 +1,110 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * The `Responder` struct creates an appropriate [`ResponseInstruction`] for responding to a + * message. + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Responder extends CommonBase { + Responder(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.Responder_free(ptr); } + } + + long clone_ptr() { + long ret = bindings.Responder_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the Responder + */ + public Responder clone() { + long ret = bindings.Responder_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Responder ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Responder(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Checks if two Responders contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public boolean eq(org.ldk.structs.Responder b) { + boolean ret = bindings.Responder_eq(this.ptr, b.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(b); + if (this != null) { this.ptrs_to.add(b); }; + return ret; + } + + @Override public boolean equals(Object o) { + if (!(o instanceof Responder)) return false; + return this.eq((Responder)o); + } + /** + * Serialize the Responder object into a byte array which can be read by Responder_read + */ + public byte[] write() { + byte[] ret = bindings.Responder_write(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Read a Responder from a byte array, created by Responder_write + */ + public static Result_ResponderDecodeErrorZ read(byte[] ser) { + long ret = bindings.Responder_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ResponderDecodeErrorZ ret_hu_conv = Result_ResponderDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a [`ResponseInstruction`] for responding without including a reply path. + * + * Use when the recipient doesn't need to send back a reply to us. + */ + public ResponseInstruction respond() { + long ret = bindings.Responder_respond(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ResponseInstruction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ResponseInstruction(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + ; + return ret_hu_conv; + } + + /** + * Creates a [`ResponseInstruction`] for responding including a reply path. + * + * Use when the recipient needs to send back a reply to us. + */ + public ResponseInstruction respond_with_reply_path(org.ldk.structs.MessageContext context) { + long ret = bindings.Responder_respond_with_reply_path(this.ptr, context.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(context); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ResponseInstruction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ResponseInstruction(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + ; + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/ResponseInstruction.java b/src/main/java/org/ldk/structs/ResponseInstruction.java new file mode 100644 index 00000000..7c8d62b3 --- /dev/null +++ b/src/main/java/org/ldk/structs/ResponseInstruction.java @@ -0,0 +1,41 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * Instructions for how and where to send the response to an onion message. + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class ResponseInstruction extends CommonBase { + ResponseInstruction(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.ResponseInstruction_free(ptr); } + } + + long clone_ptr() { + long ret = bindings.ResponseInstruction_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the ResponseInstruction + */ + public ResponseInstruction clone() { + long ret = bindings.ResponseInstruction_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ResponseInstruction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ResponseInstruction(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_AcceptChannelDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_AcceptChannelDecodeErrorZ.java index 9d542e44..9e717b33 100644 --- a/src/main/java/org/ldk/structs/Result_AcceptChannelDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_AcceptChannelDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_AcceptChannelDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_AcceptChannelDecodeErrorZ ret_hu_conv = Result_AcceptChannelDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_AcceptChannelDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_AcceptChannelDecodeErrorZ ret_hu_conv = Result_AcceptChannelDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_AcceptChannelV2DecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_AcceptChannelV2DecodeErrorZ.java index 04d923a3..90d7e0cd 100644 --- a/src/main/java/org/ldk/structs/Result_AcceptChannelV2DecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_AcceptChannelV2DecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_AcceptChannelV2DecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_AcceptChannelV2DecodeErrorZ ret_hu_conv = Result_AcceptChannelV2DecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_AcceptChannelV2DecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_AcceptChannelV2DecodeErrorZ ret_hu_conv = Result_AcceptChannelV2DecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_AnnouncementSignaturesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_AnnouncementSignaturesDecodeErrorZ.java index af832ca4..3a8107d1 100644 --- a/src/main/java/org/ldk/structs/Result_AnnouncementSignaturesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_AnnouncementSignaturesDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_AnnouncementSignaturesDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_AnnouncementSignaturesDecodeErrorZ ret_hu_conv = Result_AnnouncementSignaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_AnnouncementSignaturesDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_AnnouncementSignaturesDecodeErrorZ ret_hu_conv = Result_AnnouncementSignaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_AsyncPaymentsMessageDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_AsyncPaymentsMessageDecodeErrorZ.java new file mode 100644 index 00000000..cb206b21 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_AsyncPaymentsMessageDecodeErrorZ.java @@ -0,0 +1,98 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + +public class Result_AsyncPaymentsMessageDecodeErrorZ extends CommonBase { + private Result_AsyncPaymentsMessageDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_AsyncPaymentsMessageDecodeErrorZ_free(ptr); } super.finalize(); + } + + protected void force_free() { + if (ptr != 0) { bindings.CResult_AsyncPaymentsMessageDecodeErrorZ_free(ptr); ptr = 0; } + } + + static Result_AsyncPaymentsMessageDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_AsyncPaymentsMessageDecodeErrorZ_is_ok(ptr)) { + return new Result_AsyncPaymentsMessageDecodeErrorZ_OK(null, ptr); + } else { + return new Result_AsyncPaymentsMessageDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_AsyncPaymentsMessageDecodeErrorZ_OK extends Result_AsyncPaymentsMessageDecodeErrorZ { + public final AsyncPaymentsMessage res; + private Result_AsyncPaymentsMessageDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.CResult_AsyncPaymentsMessageDecodeErrorZ_get_ok(ptr); + org.ldk.structs.AsyncPaymentsMessage res_hu_conv = org.ldk.structs.AsyncPaymentsMessage.constr_from_ptr(res); + if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; + this.res = res_hu_conv; + } + } + + public static final class Result_AsyncPaymentsMessageDecodeErrorZ_Err extends Result_AsyncPaymentsMessageDecodeErrorZ { + public final DecodeError err; + private Result_AsyncPaymentsMessageDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.CResult_AsyncPaymentsMessageDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_AsyncPaymentsMessageDecodeErrorZ in the success state. + */ + public static Result_AsyncPaymentsMessageDecodeErrorZ ok(org.ldk.structs.AsyncPaymentsMessage o) { + long ret = bindings.CResult_AsyncPaymentsMessageDecodeErrorZ_ok(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_AsyncPaymentsMessageDecodeErrorZ ret_hu_conv = Result_AsyncPaymentsMessageDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_AsyncPaymentsMessageDecodeErrorZ in the error state. + */ + public static Result_AsyncPaymentsMessageDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_AsyncPaymentsMessageDecodeErrorZ_err(e.ptr); + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_AsyncPaymentsMessageDecodeErrorZ ret_hu_conv = Result_AsyncPaymentsMessageDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_AsyncPaymentsMessageDecodeErrorZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_AsyncPaymentsMessageDecodeErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_AsyncPaymentsMessageDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_AsyncPaymentsMessageDecodeErrorZ clone() { + long ret = bindings.CResult_AsyncPaymentsMessageDecodeErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_AsyncPaymentsMessageDecodeErrorZ ret_hu_conv = Result_AsyncPaymentsMessageDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_BestBlockDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_BestBlockDecodeErrorZ.java index a0272313..3f0d4400 100644 --- a/src/main/java/org/ldk/structs/Result_BestBlockDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_BestBlockDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_BestBlockDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_BestBlockDecodeErrorZ ret_hu_conv = Result_BestBlockDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_BestBlockDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_BestBlockDecodeErrorZ ret_hu_conv = Result_BestBlockDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_BigSizeDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_BigSizeDecodeErrorZ.java index 63d1f604..ea98a132 100644 --- a/src/main/java/org/ldk/structs/Result_BigSizeDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_BigSizeDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_BigSizeDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_BigSizeDecodeErrorZ ret_hu_conv = Result_BigSizeDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_BigSizeDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_BigSizeDecodeErrorZ ret_hu_conv = Result_BigSizeDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_BlindedFailureDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_BlindedFailureDecodeErrorZ.java index dc95d603..027e2c12 100644 --- a/src/main/java/org/ldk/structs/Result_BlindedFailureDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_BlindedFailureDecodeErrorZ.java @@ -62,7 +62,6 @@ public class Result_BlindedFailureDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_BlindedFailureDecodeErrorZ ret_hu_conv = Result_BlindedFailureDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_BlindedForwardDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_BlindedForwardDecodeErrorZ.java index 1bf34cc0..06e36186 100644 --- a/src/main/java/org/ldk/structs/Result_BlindedForwardDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_BlindedForwardDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_BlindedForwardDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_BlindedForwardDecodeErrorZ ret_hu_conv = Result_BlindedForwardDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_BlindedForwardDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_BlindedForwardDecodeErrorZ ret_hu_conv = Result_BlindedForwardDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_BlindedHopDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_BlindedHopDecodeErrorZ.java index def09774..3746cdc1 100644 --- a/src/main/java/org/ldk/structs/Result_BlindedHopDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_BlindedHopDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_BlindedHopDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_BlindedHopDecodeErrorZ ret_hu_conv = Result_BlindedHopDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_BlindedHopDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_BlindedHopDecodeErrorZ ret_hu_conv = Result_BlindedHopDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_BlindedHopFeaturesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_BlindedHopFeaturesDecodeErrorZ.java index aa5d82de..a581d66c 100644 --- a/src/main/java/org/ldk/structs/Result_BlindedHopFeaturesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_BlindedHopFeaturesDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_BlindedHopFeaturesDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_BlindedHopFeaturesDecodeErrorZ ret_hu_conv = Result_BlindedHopFeaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_BlindedHopFeaturesDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_BlindedHopFeaturesDecodeErrorZ ret_hu_conv = Result_BlindedHopFeaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_BlindedMessagePathDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_BlindedMessagePathDecodeErrorZ.java new file mode 100644 index 00000000..428233d9 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_BlindedMessagePathDecodeErrorZ.java @@ -0,0 +1,98 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + +public class Result_BlindedMessagePathDecodeErrorZ extends CommonBase { + private Result_BlindedMessagePathDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_BlindedMessagePathDecodeErrorZ_free(ptr); } super.finalize(); + } + + protected void force_free() { + if (ptr != 0) { bindings.CResult_BlindedMessagePathDecodeErrorZ_free(ptr); ptr = 0; } + } + + static Result_BlindedMessagePathDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_BlindedMessagePathDecodeErrorZ_is_ok(ptr)) { + return new Result_BlindedMessagePathDecodeErrorZ_OK(null, ptr); + } else { + return new Result_BlindedMessagePathDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_BlindedMessagePathDecodeErrorZ_OK extends Result_BlindedMessagePathDecodeErrorZ { + public final BlindedMessagePath res; + private Result_BlindedMessagePathDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.CResult_BlindedMessagePathDecodeErrorZ_get_ok(ptr); + org.ldk.structs.BlindedMessagePath res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.BlindedMessagePath(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; + this.res = res_hu_conv; + } + } + + public static final class Result_BlindedMessagePathDecodeErrorZ_Err extends Result_BlindedMessagePathDecodeErrorZ { + public final DecodeError err; + private Result_BlindedMessagePathDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.CResult_BlindedMessagePathDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_BlindedMessagePathDecodeErrorZ in the success state. + */ + public static Result_BlindedMessagePathDecodeErrorZ ok(org.ldk.structs.BlindedMessagePath o) { + long ret = bindings.CResult_BlindedMessagePathDecodeErrorZ_ok(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedMessagePathDecodeErrorZ ret_hu_conv = Result_BlindedMessagePathDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_BlindedMessagePathDecodeErrorZ in the error state. + */ + public static Result_BlindedMessagePathDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_BlindedMessagePathDecodeErrorZ_err(e.ptr); + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedMessagePathDecodeErrorZ ret_hu_conv = Result_BlindedMessagePathDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_BlindedMessagePathDecodeErrorZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_BlindedMessagePathDecodeErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_BlindedMessagePathDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_BlindedMessagePathDecodeErrorZ clone() { + long ret = bindings.CResult_BlindedMessagePathDecodeErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedMessagePathDecodeErrorZ ret_hu_conv = Result_BlindedMessagePathDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_BlindedMessagePathNoneZ.java b/src/main/java/org/ldk/structs/Result_BlindedMessagePathNoneZ.java new file mode 100644 index 00000000..8af3995a --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_BlindedMessagePathNoneZ.java @@ -0,0 +1,92 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + +public class Result_BlindedMessagePathNoneZ extends CommonBase { + private Result_BlindedMessagePathNoneZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_BlindedMessagePathNoneZ_free(ptr); } super.finalize(); + } + + protected void force_free() { + if (ptr != 0) { bindings.CResult_BlindedMessagePathNoneZ_free(ptr); ptr = 0; } + } + + static Result_BlindedMessagePathNoneZ constr_from_ptr(long ptr) { + if (bindings.CResult_BlindedMessagePathNoneZ_is_ok(ptr)) { + return new Result_BlindedMessagePathNoneZ_OK(null, ptr); + } else { + return new Result_BlindedMessagePathNoneZ_Err(null, ptr); + } + } + public static final class Result_BlindedMessagePathNoneZ_OK extends Result_BlindedMessagePathNoneZ { + public final BlindedMessagePath res; + private Result_BlindedMessagePathNoneZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.CResult_BlindedMessagePathNoneZ_get_ok(ptr); + org.ldk.structs.BlindedMessagePath res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.BlindedMessagePath(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; + this.res = res_hu_conv; + } + } + + public static final class Result_BlindedMessagePathNoneZ_Err extends Result_BlindedMessagePathNoneZ { + private Result_BlindedMessagePathNoneZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + } + } + + /** + * Creates a new CResult_BlindedMessagePathNoneZ in the success state. + */ + public static Result_BlindedMessagePathNoneZ ok(org.ldk.structs.BlindedMessagePath o) { + long ret = bindings.CResult_BlindedMessagePathNoneZ_ok(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedMessagePathNoneZ ret_hu_conv = Result_BlindedMessagePathNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_BlindedMessagePathNoneZ in the error state. + */ + public static Result_BlindedMessagePathNoneZ err() { + long ret = bindings.CResult_BlindedMessagePathNoneZ_err(); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedMessagePathNoneZ ret_hu_conv = Result_BlindedMessagePathNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_BlindedMessagePathNoneZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_BlindedMessagePathNoneZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_BlindedMessagePathNoneZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_BlindedMessagePathNoneZ clone() { + long ret = bindings.CResult_BlindedMessagePathNoneZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedMessagePathNoneZ ret_hu_conv = Result_BlindedMessagePathNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_BlindedPathDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_BlindedPathDecodeErrorZ.java deleted file mode 100644 index 28364c14..00000000 --- a/src/main/java/org/ldk/structs/Result_BlindedPathDecodeErrorZ.java +++ /dev/null @@ -1,100 +0,0 @@ -package org.ldk.structs; - -import org.ldk.impl.bindings; -import org.ldk.enums.*; -import org.ldk.util.*; -import java.util.Arrays; -import java.lang.ref.Reference; -import javax.annotation.Nullable; - -public class Result_BlindedPathDecodeErrorZ extends CommonBase { - private Result_BlindedPathDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } - protected void finalize() throws Throwable { - if (ptr != 0) { bindings.CResult_BlindedPathDecodeErrorZ_free(ptr); } super.finalize(); - } - - protected void force_free() { - if (ptr != 0) { bindings.CResult_BlindedPathDecodeErrorZ_free(ptr); ptr = 0; } - } - - static Result_BlindedPathDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.CResult_BlindedPathDecodeErrorZ_is_ok(ptr)) { - return new Result_BlindedPathDecodeErrorZ_OK(null, ptr); - } else { - return new Result_BlindedPathDecodeErrorZ_Err(null, ptr); - } - } - public static final class Result_BlindedPathDecodeErrorZ_OK extends Result_BlindedPathDecodeErrorZ { - public final BlindedPath res; - private Result_BlindedPathDecodeErrorZ_OK(Object _dummy, long ptr) { - super(_dummy, ptr); - long res = bindings.CResult_BlindedPathDecodeErrorZ_get_ok(ptr); - org.ldk.structs.BlindedPath res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.BlindedPath(null, res); } - if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; - this.res = res_hu_conv; - } - } - - public static final class Result_BlindedPathDecodeErrorZ_Err extends Result_BlindedPathDecodeErrorZ { - public final DecodeError err; - private Result_BlindedPathDecodeErrorZ_Err(Object _dummy, long ptr) { - super(_dummy, ptr); - long err = bindings.CResult_BlindedPathDecodeErrorZ_get_err(ptr); - org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); - if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); }; - this.err = err_hu_conv; - } - } - - /** - * Creates a new CResult_BlindedPathDecodeErrorZ in the success state. - */ - public static Result_BlindedPathDecodeErrorZ ok(org.ldk.structs.BlindedPath o) { - long ret = bindings.CResult_BlindedPathDecodeErrorZ_ok(o.ptr); - Reference.reachabilityFence(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_BlindedPathDecodeErrorZ ret_hu_conv = Result_BlindedPathDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; - return ret_hu_conv; - } - - /** - * Creates a new CResult_BlindedPathDecodeErrorZ in the error state. - */ - public static Result_BlindedPathDecodeErrorZ err(org.ldk.structs.DecodeError e) { - long ret = bindings.CResult_BlindedPathDecodeErrorZ_err(e.ptr); - Reference.reachabilityFence(e); - if (ret >= 0 && ret <= 4096) { return null; } - Result_BlindedPathDecodeErrorZ ret_hu_conv = Result_BlindedPathDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; - return ret_hu_conv; - } - - /** - * Checks if the given object is currently in the success state - */ - public boolean is_ok() { - boolean ret = bindings.CResult_BlindedPathDecodeErrorZ_is_ok(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - long clone_ptr() { - long ret = bindings.CResult_BlindedPathDecodeErrorZ_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Creates a new CResult_BlindedPathDecodeErrorZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_BlindedPathDecodeErrorZ clone() { - long ret = bindings.CResult_BlindedPathDecodeErrorZ_clone(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_BlindedPathDecodeErrorZ ret_hu_conv = Result_BlindedPathDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} diff --git a/src/main/java/org/ldk/structs/Result_BlindedPathNoneZ.java b/src/main/java/org/ldk/structs/Result_BlindedPathNoneZ.java deleted file mode 100644 index 81d152bd..00000000 --- a/src/main/java/org/ldk/structs/Result_BlindedPathNoneZ.java +++ /dev/null @@ -1,93 +0,0 @@ -package org.ldk.structs; - -import org.ldk.impl.bindings; -import org.ldk.enums.*; -import org.ldk.util.*; -import java.util.Arrays; -import java.lang.ref.Reference; -import javax.annotation.Nullable; - -public class Result_BlindedPathNoneZ extends CommonBase { - private Result_BlindedPathNoneZ(Object _dummy, long ptr) { super(ptr); } - protected void finalize() throws Throwable { - if (ptr != 0) { bindings.CResult_BlindedPathNoneZ_free(ptr); } super.finalize(); - } - - protected void force_free() { - if (ptr != 0) { bindings.CResult_BlindedPathNoneZ_free(ptr); ptr = 0; } - } - - static Result_BlindedPathNoneZ constr_from_ptr(long ptr) { - if (bindings.CResult_BlindedPathNoneZ_is_ok(ptr)) { - return new Result_BlindedPathNoneZ_OK(null, ptr); - } else { - return new Result_BlindedPathNoneZ_Err(null, ptr); - } - } - public static final class Result_BlindedPathNoneZ_OK extends Result_BlindedPathNoneZ { - public final BlindedPath res; - private Result_BlindedPathNoneZ_OK(Object _dummy, long ptr) { - super(_dummy, ptr); - long res = bindings.CResult_BlindedPathNoneZ_get_ok(ptr); - org.ldk.structs.BlindedPath res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.BlindedPath(null, res); } - if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; - this.res = res_hu_conv; - } - } - - public static final class Result_BlindedPathNoneZ_Err extends Result_BlindedPathNoneZ { - private Result_BlindedPathNoneZ_Err(Object _dummy, long ptr) { - super(_dummy, ptr); - } - } - - /** - * Creates a new CResult_BlindedPathNoneZ in the success state. - */ - public static Result_BlindedPathNoneZ ok(org.ldk.structs.BlindedPath o) { - long ret = bindings.CResult_BlindedPathNoneZ_ok(o.ptr); - Reference.reachabilityFence(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_BlindedPathNoneZ ret_hu_conv = Result_BlindedPathNoneZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; - return ret_hu_conv; - } - - /** - * Creates a new CResult_BlindedPathNoneZ in the error state. - */ - public static Result_BlindedPathNoneZ err() { - long ret = bindings.CResult_BlindedPathNoneZ_err(); - if (ret >= 0 && ret <= 4096) { return null; } - Result_BlindedPathNoneZ ret_hu_conv = Result_BlindedPathNoneZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Checks if the given object is currently in the success state - */ - public boolean is_ok() { - boolean ret = bindings.CResult_BlindedPathNoneZ_is_ok(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - long clone_ptr() { - long ret = bindings.CResult_BlindedPathNoneZ_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Creates a new CResult_BlindedPathNoneZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_BlindedPathNoneZ clone() { - long ret = bindings.CResult_BlindedPathNoneZ_clone(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_BlindedPathNoneZ ret_hu_conv = Result_BlindedPathNoneZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} diff --git a/src/main/java/org/ldk/structs/Result_BlindedPayInfoDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_BlindedPayInfoDecodeErrorZ.java index 25eb505d..397216b1 100644 --- a/src/main/java/org/ldk/structs/Result_BlindedPayInfoDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_BlindedPayInfoDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_BlindedPayInfoDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_BlindedPayInfoDecodeErrorZ ret_hu_conv = Result_BlindedPayInfoDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_BlindedPayInfoDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_BlindedPayInfoDecodeErrorZ ret_hu_conv = Result_BlindedPayInfoDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_BlindedPaymentPathNoneZ.java b/src/main/java/org/ldk/structs/Result_BlindedPaymentPathNoneZ.java new file mode 100644 index 00000000..4156ed73 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_BlindedPaymentPathNoneZ.java @@ -0,0 +1,92 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + +public class Result_BlindedPaymentPathNoneZ extends CommonBase { + private Result_BlindedPaymentPathNoneZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_BlindedPaymentPathNoneZ_free(ptr); } super.finalize(); + } + + protected void force_free() { + if (ptr != 0) { bindings.CResult_BlindedPaymentPathNoneZ_free(ptr); ptr = 0; } + } + + static Result_BlindedPaymentPathNoneZ constr_from_ptr(long ptr) { + if (bindings.CResult_BlindedPaymentPathNoneZ_is_ok(ptr)) { + return new Result_BlindedPaymentPathNoneZ_OK(null, ptr); + } else { + return new Result_BlindedPaymentPathNoneZ_Err(null, ptr); + } + } + public static final class Result_BlindedPaymentPathNoneZ_OK extends Result_BlindedPaymentPathNoneZ { + public final BlindedPaymentPath res; + private Result_BlindedPaymentPathNoneZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.CResult_BlindedPaymentPathNoneZ_get_ok(ptr); + org.ldk.structs.BlindedPaymentPath res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.BlindedPaymentPath(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; + this.res = res_hu_conv; + } + } + + public static final class Result_BlindedPaymentPathNoneZ_Err extends Result_BlindedPaymentPathNoneZ { + private Result_BlindedPaymentPathNoneZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + } + } + + /** + * Creates a new CResult_BlindedPaymentPathNoneZ in the success state. + */ + public static Result_BlindedPaymentPathNoneZ ok(org.ldk.structs.BlindedPaymentPath o) { + long ret = bindings.CResult_BlindedPaymentPathNoneZ_ok(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedPaymentPathNoneZ ret_hu_conv = Result_BlindedPaymentPathNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_BlindedPaymentPathNoneZ in the error state. + */ + public static Result_BlindedPaymentPathNoneZ err() { + long ret = bindings.CResult_BlindedPaymentPathNoneZ_err(); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedPaymentPathNoneZ ret_hu_conv = Result_BlindedPaymentPathNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_BlindedPaymentPathNoneZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_BlindedPaymentPathNoneZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_BlindedPaymentPathNoneZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_BlindedPaymentPathNoneZ clone() { + long ret = bindings.CResult_BlindedPaymentPathNoneZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedPaymentPathNoneZ ret_hu_conv = Result_BlindedPaymentPathNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_BlindedTailDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_BlindedTailDecodeErrorZ.java index cf61db88..3a899f70 100644 --- a/src/main/java/org/ldk/structs/Result_BlindedTailDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_BlindedTailDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_BlindedTailDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_BlindedTailDecodeErrorZ ret_hu_conv = Result_BlindedTailDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_BlindedTailDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_BlindedTailDecodeErrorZ ret_hu_conv = Result_BlindedTailDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_Bolt11InvoiceBolt11SemanticErrorZ.java b/src/main/java/org/ldk/structs/Result_Bolt11InvoiceBolt11SemanticErrorZ.java index 8e58721d..01682334 100644 --- a/src/main/java/org/ldk/structs/Result_Bolt11InvoiceBolt11SemanticErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_Bolt11InvoiceBolt11SemanticErrorZ.java @@ -51,7 +51,6 @@ public class Result_Bolt11InvoiceBolt11SemanticErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_Bolt11InvoiceBolt11SemanticErrorZ ret_hu_conv = Result_Bolt11InvoiceBolt11SemanticErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_Bolt11InvoiceFeaturesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_Bolt11InvoiceFeaturesDecodeErrorZ.java index a6641c36..2f322379 100644 --- a/src/main/java/org/ldk/structs/Result_Bolt11InvoiceFeaturesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_Bolt11InvoiceFeaturesDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_Bolt11InvoiceFeaturesDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_Bolt11InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_Bolt11InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_Bolt11InvoiceFeaturesDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_Bolt11InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_Bolt11InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_Bolt11InvoiceParseOrSemanticErrorZ.java b/src/main/java/org/ldk/structs/Result_Bolt11InvoiceParseOrSemanticErrorZ.java index 14b185e7..920704bd 100644 --- a/src/main/java/org/ldk/structs/Result_Bolt11InvoiceParseOrSemanticErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_Bolt11InvoiceParseOrSemanticErrorZ.java @@ -54,7 +54,6 @@ public class Result_Bolt11InvoiceParseOrSemanticErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_Bolt11InvoiceParseOrSemanticErrorZ ret_hu_conv = Result_Bolt11InvoiceParseOrSemanticErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_Bolt11InvoiceParseOrSemanticErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_Bolt11InvoiceParseOrSemanticErrorZ ret_hu_conv = Result_Bolt11InvoiceParseOrSemanticErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_Bolt11InvoiceSignOrCreationErrorZ.java b/src/main/java/org/ldk/structs/Result_Bolt11InvoiceSignOrCreationErrorZ.java index 46677b31..c2e5ddc5 100644 --- a/src/main/java/org/ldk/structs/Result_Bolt11InvoiceSignOrCreationErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_Bolt11InvoiceSignOrCreationErrorZ.java @@ -54,7 +54,6 @@ public class Result_Bolt11InvoiceSignOrCreationErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_Bolt11InvoiceSignOrCreationErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_Bolt12InvoiceBolt12SemanticErrorZ.java b/src/main/java/org/ldk/structs/Result_Bolt12InvoiceBolt12SemanticErrorZ.java index 3797f9f5..b16005e6 100644 --- a/src/main/java/org/ldk/structs/Result_Bolt12InvoiceBolt12SemanticErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_Bolt12InvoiceBolt12SemanticErrorZ.java @@ -51,7 +51,6 @@ public class Result_Bolt12InvoiceBolt12SemanticErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_Bolt12InvoiceBolt12SemanticErrorZ ret_hu_conv = Result_Bolt12InvoiceBolt12SemanticErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_Bolt12InvoiceDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_Bolt12InvoiceDecodeErrorZ.java new file mode 100644 index 00000000..3b8eaca4 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_Bolt12InvoiceDecodeErrorZ.java @@ -0,0 +1,98 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + +public class Result_Bolt12InvoiceDecodeErrorZ extends CommonBase { + private Result_Bolt12InvoiceDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_Bolt12InvoiceDecodeErrorZ_free(ptr); } super.finalize(); + } + + protected void force_free() { + if (ptr != 0) { bindings.CResult_Bolt12InvoiceDecodeErrorZ_free(ptr); ptr = 0; } + } + + static Result_Bolt12InvoiceDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_Bolt12InvoiceDecodeErrorZ_is_ok(ptr)) { + return new Result_Bolt12InvoiceDecodeErrorZ_OK(null, ptr); + } else { + return new Result_Bolt12InvoiceDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_Bolt12InvoiceDecodeErrorZ_OK extends Result_Bolt12InvoiceDecodeErrorZ { + public final Bolt12Invoice res; + private Result_Bolt12InvoiceDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.CResult_Bolt12InvoiceDecodeErrorZ_get_ok(ptr); + org.ldk.structs.Bolt12Invoice res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.Bolt12Invoice(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; + this.res = res_hu_conv; + } + } + + public static final class Result_Bolt12InvoiceDecodeErrorZ_Err extends Result_Bolt12InvoiceDecodeErrorZ { + public final DecodeError err; + private Result_Bolt12InvoiceDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.CResult_Bolt12InvoiceDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_Bolt12InvoiceDecodeErrorZ in the success state. + */ + public static Result_Bolt12InvoiceDecodeErrorZ ok(org.ldk.structs.Bolt12Invoice o) { + long ret = bindings.CResult_Bolt12InvoiceDecodeErrorZ_ok(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt12InvoiceDecodeErrorZ ret_hu_conv = Result_Bolt12InvoiceDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_Bolt12InvoiceDecodeErrorZ in the error state. + */ + public static Result_Bolt12InvoiceDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_Bolt12InvoiceDecodeErrorZ_err(e.ptr); + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt12InvoiceDecodeErrorZ ret_hu_conv = Result_Bolt12InvoiceDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_Bolt12InvoiceDecodeErrorZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_Bolt12InvoiceDecodeErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_Bolt12InvoiceDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_Bolt12InvoiceDecodeErrorZ clone() { + long ret = bindings.CResult_Bolt12InvoiceDecodeErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt12InvoiceDecodeErrorZ ret_hu_conv = Result_Bolt12InvoiceDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_Bolt12InvoiceFeaturesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_Bolt12InvoiceFeaturesDecodeErrorZ.java index 2eb37a3a..c1a3865a 100644 --- a/src/main/java/org/ldk/structs/Result_Bolt12InvoiceFeaturesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_Bolt12InvoiceFeaturesDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_Bolt12InvoiceFeaturesDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_Bolt12InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_Bolt12InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_Bolt12InvoiceFeaturesDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_Bolt12InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_Bolt12InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_Bolt12OfferContextDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_Bolt12OfferContextDecodeErrorZ.java index 2534878e..92155229 100644 --- a/src/main/java/org/ldk/structs/Result_Bolt12OfferContextDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_Bolt12OfferContextDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_Bolt12OfferContextDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_Bolt12OfferContextDecodeErrorZ ret_hu_conv = Result_Bolt12OfferContextDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_Bolt12OfferContextDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_Bolt12OfferContextDecodeErrorZ ret_hu_conv = Result_Bolt12OfferContextDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_Bolt12RefundContextDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_Bolt12RefundContextDecodeErrorZ.java index 55cbc6ba..e56f8d7d 100644 --- a/src/main/java/org/ldk/structs/Result_Bolt12RefundContextDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_Bolt12RefundContextDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_Bolt12RefundContextDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_Bolt12RefundContextDecodeErrorZ ret_hu_conv = Result_Bolt12RefundContextDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_Bolt12RefundContextDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_Bolt12RefundContextDecodeErrorZ ret_hu_conv = Result_Bolt12RefundContextDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.java index 82cc7840..1e920b42 100644 --- a/src/main/java/org/ldk/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_BuiltCommitmentTransactionDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_BuiltCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_BuiltCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_BuiltCommitmentTransactionDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_BuiltCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_BuiltCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ.java index a0cdbcc3..63ec9650 100644 --- a/src/main/java/org/ldk/structs/Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ.java @@ -54,6 +54,7 @@ public class Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ extends CommonBa Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -65,7 +66,6 @@ public class Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ extends CommonBa Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.java b/src/main/java/org/ldk/structs/Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.java deleted file mode 100644 index dbd9cadb..00000000 --- a/src/main/java/org/ldk/structs/Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.java +++ /dev/null @@ -1,92 +0,0 @@ -package org.ldk.structs; - -import org.ldk.impl.bindings; -import org.ldk.enums.*; -import org.ldk.util.*; -import java.util.Arrays; -import java.lang.ref.Reference; -import javax.annotation.Nullable; - -public class Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ extends CommonBase { - private Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ(Object _dummy, long ptr) { super(ptr); } - protected void finalize() throws Throwable { - if (ptr != 0) { bindings.CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free(ptr); } super.finalize(); - } - - protected void force_free() { - if (ptr != 0) { bindings.CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free(ptr); ptr = 0; } - } - - static Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ constr_from_ptr(long ptr) { - if (bindings.CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_is_ok(ptr)) { - return new Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_OK(null, ptr); - } else { - return new Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_Err(null, ptr); - } - } - public static final class Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_OK extends Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ { - public final TwoTuple_BlindedPayInfoBlindedPathZ res; - private Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_OK(Object _dummy, long ptr) { - super(_dummy, ptr); - long res = bindings.CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_get_ok(ptr); - TwoTuple_BlindedPayInfoBlindedPathZ res_hu_conv = new TwoTuple_BlindedPayInfoBlindedPathZ(null, res); - if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; - this.res = res_hu_conv; - } - } - - public static final class Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_Err extends Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ { - private Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_Err(Object _dummy, long ptr) { - super(_dummy, ptr); - } - } - - /** - * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ in the success state. - */ - public static Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ ok(org.ldk.structs.TwoTuple_BlindedPayInfoBlindedPathZ o) { - long ret = bindings.CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_ok(o.ptr); - Reference.reachabilityFence(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ ret_hu_conv = Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ in the error state. - */ - public static Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ err() { - long ret = bindings.CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_err(); - if (ret >= 0 && ret <= 4096) { return null; } - Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ ret_hu_conv = Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Checks if the given object is currently in the success state - */ - public boolean is_ok() { - boolean ret = bindings.CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_is_ok(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - long clone_ptr() { - long ret = bindings.CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ clone() { - long ret = bindings.CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ ret_hu_conv = Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} diff --git a/src/main/java/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ.java index 16cbce6c..43b24fe0 100644 --- a/src/main/java/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ.java @@ -54,6 +54,7 @@ public class Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ extends Co Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ ret_hu_conv = Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -65,7 +66,6 @@ public class Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ extends Co Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ ret_hu_conv = Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ.java index c5e191c9..f9d5b27b 100644 --- a/src/main/java/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ.java @@ -65,7 +65,6 @@ public class Result_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ extends Co Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ ret_hu_conv = Result_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ.java b/src/main/java/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ.java index c3cd1ccb..86243bb2 100644 --- a/src/main/java/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ.java +++ b/src/main/java/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ.java @@ -65,7 +65,6 @@ public class Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ ext Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ ret_hu_conv = Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ.java b/src/main/java/org/ldk/structs/Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ.java index 8e31a770..f6bbeafb 100644 --- a/src/main/java/org/ldk/structs/Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ.java @@ -65,7 +65,6 @@ public class Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSe Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ ret_hu_conv = Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_COption_APIErrorZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_COption_APIErrorZDecodeErrorZ.java index 01947c94..0c1e8a43 100644 --- a/src/main/java/org/ldk/structs/Result_COption_APIErrorZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_COption_APIErrorZDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_COption_APIErrorZDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_APIErrorZDecodeErrorZ ret_hu_conv = Result_COption_APIErrorZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_COption_APIErrorZDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_APIErrorZDecodeErrorZ ret_hu_conv = Result_COption_APIErrorZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_COption_ClosureReasonZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_COption_ClosureReasonZDecodeErrorZ.java index ac6831ec..bf3a72ef 100644 --- a/src/main/java/org/ldk/structs/Result_COption_ClosureReasonZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_COption_ClosureReasonZDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_COption_ClosureReasonZDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_ClosureReasonZDecodeErrorZ ret_hu_conv = Result_COption_ClosureReasonZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_COption_ClosureReasonZDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_ClosureReasonZDecodeErrorZ ret_hu_conv = Result_COption_ClosureReasonZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_COption_EventZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_COption_EventZDecodeErrorZ.java index 11de4281..4ad79f30 100644 --- a/src/main/java/org/ldk/structs/Result_COption_EventZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_COption_EventZDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_COption_EventZDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_EventZDecodeErrorZ ret_hu_conv = Result_COption_EventZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_COption_EventZDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_EventZDecodeErrorZ ret_hu_conv = Result_COption_EventZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_COption_HTLCDestinationZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_COption_HTLCDestinationZDecodeErrorZ.java index a9f4097c..0712692f 100644 --- a/src/main/java/org/ldk/structs/Result_COption_HTLCDestinationZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_COption_HTLCDestinationZDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_COption_HTLCDestinationZDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_HTLCDestinationZDecodeErrorZ ret_hu_conv = Result_COption_HTLCDestinationZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_COption_HTLCDestinationZDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_HTLCDestinationZDecodeErrorZ ret_hu_conv = Result_COption_HTLCDestinationZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_COption_InboundHTLCStateDetailsZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_COption_InboundHTLCStateDetailsZDecodeErrorZ.java index 6a3d1d66..91c18477 100644 --- a/src/main/java/org/ldk/structs/Result_COption_InboundHTLCStateDetailsZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_COption_InboundHTLCStateDetailsZDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_COption_InboundHTLCStateDetailsZDecodeErrorZ extends CommonB Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_InboundHTLCStateDetailsZDecodeErrorZ ret_hu_conv = Result_COption_InboundHTLCStateDetailsZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_COption_InboundHTLCStateDetailsZDecodeErrorZ extends CommonB Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_InboundHTLCStateDetailsZDecodeErrorZ ret_hu_conv = Result_COption_InboundHTLCStateDetailsZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_COption_MonitorEventZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_COption_MonitorEventZDecodeErrorZ.java index 52dd23c1..aaee5005 100644 --- a/src/main/java/org/ldk/structs/Result_COption_MonitorEventZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_COption_MonitorEventZDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_COption_MonitorEventZDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_MonitorEventZDecodeErrorZ ret_hu_conv = Result_COption_MonitorEventZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_COption_MonitorEventZDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_MonitorEventZDecodeErrorZ ret_hu_conv = Result_COption_MonitorEventZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_COption_NetworkUpdateZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_COption_NetworkUpdateZDecodeErrorZ.java index 329513e1..7ef20b4a 100644 --- a/src/main/java/org/ldk/structs/Result_COption_NetworkUpdateZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_COption_NetworkUpdateZDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_COption_NetworkUpdateZDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_NetworkUpdateZDecodeErrorZ ret_hu_conv = Result_COption_NetworkUpdateZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_COption_NetworkUpdateZDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_NetworkUpdateZDecodeErrorZ ret_hu_conv = Result_COption_NetworkUpdateZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_COption_OnionMessageContentsZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_COption_OnionMessageContentsZDecodeErrorZ.java index d48fb1fe..2ce4f4ad 100644 --- a/src/main/java/org/ldk/structs/Result_COption_OnionMessageContentsZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_COption_OnionMessageContentsZDecodeErrorZ.java @@ -66,7 +66,6 @@ public class Result_COption_OnionMessageContentsZDecodeErrorZ extends CommonBase Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_OnionMessageContentsZDecodeErrorZ ret_hu_conv = Result_COption_OnionMessageContentsZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ.java index b293255b..445c7c21 100644 --- a/src/main/java/org/ldk/structs/Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ extends Common Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ ret_hu_conv = Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ extends Common Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ ret_hu_conv = Result_COption_OutboundHTLCStateDetailsZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_COption_PathFailureZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_COption_PathFailureZDecodeErrorZ.java index 4fc09432..dfaec59c 100644 --- a/src/main/java/org/ldk/structs/Result_COption_PathFailureZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_COption_PathFailureZDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_COption_PathFailureZDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_PathFailureZDecodeErrorZ ret_hu_conv = Result_COption_PathFailureZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_COption_PathFailureZDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_PathFailureZDecodeErrorZ ret_hu_conv = Result_COption_PathFailureZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_COption_PaymentFailureReasonZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_COption_PaymentFailureReasonZDecodeErrorZ.java new file mode 100644 index 00000000..f1e60fa5 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_COption_PaymentFailureReasonZDecodeErrorZ.java @@ -0,0 +1,98 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + +public class Result_COption_PaymentFailureReasonZDecodeErrorZ extends CommonBase { + private Result_COption_PaymentFailureReasonZDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_COption_PaymentFailureReasonZDecodeErrorZ_free(ptr); } super.finalize(); + } + + protected void force_free() { + if (ptr != 0) { bindings.CResult_COption_PaymentFailureReasonZDecodeErrorZ_free(ptr); ptr = 0; } + } + + static Result_COption_PaymentFailureReasonZDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_COption_PaymentFailureReasonZDecodeErrorZ_is_ok(ptr)) { + return new Result_COption_PaymentFailureReasonZDecodeErrorZ_OK(null, ptr); + } else { + return new Result_COption_PaymentFailureReasonZDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_COption_PaymentFailureReasonZDecodeErrorZ_OK extends Result_COption_PaymentFailureReasonZDecodeErrorZ { + public final Option_PaymentFailureReasonZ res; + private Result_COption_PaymentFailureReasonZDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.CResult_COption_PaymentFailureReasonZDecodeErrorZ_get_ok(ptr); + org.ldk.structs.Option_PaymentFailureReasonZ res_hu_conv = org.ldk.structs.Option_PaymentFailureReasonZ.constr_from_ptr(res); + if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; + this.res = res_hu_conv; + } + } + + public static final class Result_COption_PaymentFailureReasonZDecodeErrorZ_Err extends Result_COption_PaymentFailureReasonZDecodeErrorZ { + public final DecodeError err; + private Result_COption_PaymentFailureReasonZDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.CResult_COption_PaymentFailureReasonZDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_COption_PaymentFailureReasonZDecodeErrorZ in the success state. + */ + public static Result_COption_PaymentFailureReasonZDecodeErrorZ ok(org.ldk.structs.Option_PaymentFailureReasonZ o) { + long ret = bindings.CResult_COption_PaymentFailureReasonZDecodeErrorZ_ok(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_PaymentFailureReasonZDecodeErrorZ ret_hu_conv = Result_COption_PaymentFailureReasonZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_COption_PaymentFailureReasonZDecodeErrorZ in the error state. + */ + public static Result_COption_PaymentFailureReasonZDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_COption_PaymentFailureReasonZDecodeErrorZ_err(e.ptr); + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_PaymentFailureReasonZDecodeErrorZ ret_hu_conv = Result_COption_PaymentFailureReasonZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_COption_PaymentFailureReasonZDecodeErrorZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_COption_PaymentFailureReasonZDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_COption_PaymentFailureReasonZDecodeErrorZ clone() { + long ret = bindings.CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_PaymentFailureReasonZDecodeErrorZ ret_hu_conv = Result_COption_PaymentFailureReasonZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_COption_TypeZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_COption_TypeZDecodeErrorZ.java index 7f6903db..ce1e3697 100644 --- a/src/main/java/org/ldk/structs/Result_COption_TypeZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_COption_TypeZDecodeErrorZ.java @@ -66,7 +66,6 @@ public class Result_COption_TypeZDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_TypeZDecodeErrorZ ret_hu_conv = Result_COption_TypeZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_CVec_BlindedMessagePathZNoneZ.java b/src/main/java/org/ldk/structs/Result_CVec_BlindedMessagePathZNoneZ.java new file mode 100644 index 00000000..36c625ce --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_CVec_BlindedMessagePathZNoneZ.java @@ -0,0 +1,98 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + +public class Result_CVec_BlindedMessagePathZNoneZ extends CommonBase { + private Result_CVec_BlindedMessagePathZNoneZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_CVec_BlindedMessagePathZNoneZ_free(ptr); } super.finalize(); + } + + protected void force_free() { + if (ptr != 0) { bindings.CResult_CVec_BlindedMessagePathZNoneZ_free(ptr); ptr = 0; } + } + + static Result_CVec_BlindedMessagePathZNoneZ constr_from_ptr(long ptr) { + if (bindings.CResult_CVec_BlindedMessagePathZNoneZ_is_ok(ptr)) { + return new Result_CVec_BlindedMessagePathZNoneZ_OK(null, ptr); + } else { + return new Result_CVec_BlindedMessagePathZNoneZ_Err(null, ptr); + } + } + public static final class Result_CVec_BlindedMessagePathZNoneZ_OK extends Result_CVec_BlindedMessagePathZNoneZ { + public final BlindedMessagePath[] res; + private Result_CVec_BlindedMessagePathZNoneZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long[] res = bindings.CResult_CVec_BlindedMessagePathZNoneZ_get_ok(ptr); + int res_conv_20_len = res.length; + BlindedMessagePath[] res_conv_20_arr = new BlindedMessagePath[res_conv_20_len]; + for (int u = 0; u < res_conv_20_len; u++) { + long res_conv_20 = res[u]; + org.ldk.structs.BlindedMessagePath res_conv_20_hu_conv = null; if (res_conv_20 < 0 || res_conv_20 > 4096) { res_conv_20_hu_conv = new org.ldk.structs.BlindedMessagePath(null, res_conv_20); } + if (res_conv_20_hu_conv != null) { res_conv_20_hu_conv.ptrs_to.add(this); }; + res_conv_20_arr[u] = res_conv_20_hu_conv; + } + this.res = res_conv_20_arr; + } + } + + public static final class Result_CVec_BlindedMessagePathZNoneZ_Err extends Result_CVec_BlindedMessagePathZNoneZ { + private Result_CVec_BlindedMessagePathZNoneZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + } + } + + /** + * Creates a new CResult_CVec_BlindedMessagePathZNoneZ in the success state. + */ + public static Result_CVec_BlindedMessagePathZNoneZ ok(BlindedMessagePath[] o) { + long ret = bindings.CResult_CVec_BlindedMessagePathZNoneZ_ok(o != null ? Arrays.stream(o).mapToLong(o_conv_20 -> o_conv_20.ptr).toArray() : null); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_CVec_BlindedMessagePathZNoneZ ret_hu_conv = Result_CVec_BlindedMessagePathZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_CVec_BlindedMessagePathZNoneZ in the error state. + */ + public static Result_CVec_BlindedMessagePathZNoneZ err() { + long ret = bindings.CResult_CVec_BlindedMessagePathZNoneZ_err(); + if (ret >= 0 && ret <= 4096) { return null; } + Result_CVec_BlindedMessagePathZNoneZ ret_hu_conv = Result_CVec_BlindedMessagePathZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_CVec_BlindedMessagePathZNoneZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_CVec_BlindedMessagePathZNoneZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_CVec_BlindedMessagePathZNoneZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_CVec_BlindedMessagePathZNoneZ clone() { + long ret = bindings.CResult_CVec_BlindedMessagePathZNoneZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_CVec_BlindedMessagePathZNoneZ ret_hu_conv = Result_CVec_BlindedMessagePathZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_CVec_BlindedPathZNoneZ.java b/src/main/java/org/ldk/structs/Result_CVec_BlindedPathZNoneZ.java deleted file mode 100644 index d6a8765c..00000000 --- a/src/main/java/org/ldk/structs/Result_CVec_BlindedPathZNoneZ.java +++ /dev/null @@ -1,99 +0,0 @@ -package org.ldk.structs; - -import org.ldk.impl.bindings; -import org.ldk.enums.*; -import org.ldk.util.*; -import java.util.Arrays; -import java.lang.ref.Reference; -import javax.annotation.Nullable; - -public class Result_CVec_BlindedPathZNoneZ extends CommonBase { - private Result_CVec_BlindedPathZNoneZ(Object _dummy, long ptr) { super(ptr); } - protected void finalize() throws Throwable { - if (ptr != 0) { bindings.CResult_CVec_BlindedPathZNoneZ_free(ptr); } super.finalize(); - } - - protected void force_free() { - if (ptr != 0) { bindings.CResult_CVec_BlindedPathZNoneZ_free(ptr); ptr = 0; } - } - - static Result_CVec_BlindedPathZNoneZ constr_from_ptr(long ptr) { - if (bindings.CResult_CVec_BlindedPathZNoneZ_is_ok(ptr)) { - return new Result_CVec_BlindedPathZNoneZ_OK(null, ptr); - } else { - return new Result_CVec_BlindedPathZNoneZ_Err(null, ptr); - } - } - public static final class Result_CVec_BlindedPathZNoneZ_OK extends Result_CVec_BlindedPathZNoneZ { - public final BlindedPath[] res; - private Result_CVec_BlindedPathZNoneZ_OK(Object _dummy, long ptr) { - super(_dummy, ptr); - long[] res = bindings.CResult_CVec_BlindedPathZNoneZ_get_ok(ptr); - int res_conv_13_len = res.length; - BlindedPath[] res_conv_13_arr = new BlindedPath[res_conv_13_len]; - for (int n = 0; n < res_conv_13_len; n++) { - long res_conv_13 = res[n]; - org.ldk.structs.BlindedPath res_conv_13_hu_conv = null; if (res_conv_13 < 0 || res_conv_13 > 4096) { res_conv_13_hu_conv = new org.ldk.structs.BlindedPath(null, res_conv_13); } - if (res_conv_13_hu_conv != null) { res_conv_13_hu_conv.ptrs_to.add(this); }; - res_conv_13_arr[n] = res_conv_13_hu_conv; - } - this.res = res_conv_13_arr; - } - } - - public static final class Result_CVec_BlindedPathZNoneZ_Err extends Result_CVec_BlindedPathZNoneZ { - private Result_CVec_BlindedPathZNoneZ_Err(Object _dummy, long ptr) { - super(_dummy, ptr); - } - } - - /** - * Creates a new CResult_CVec_BlindedPathZNoneZ in the success state. - */ - public static Result_CVec_BlindedPathZNoneZ ok(BlindedPath[] o) { - long ret = bindings.CResult_CVec_BlindedPathZNoneZ_ok(o != null ? Arrays.stream(o).mapToLong(o_conv_13 -> o_conv_13.ptr).toArray() : null); - Reference.reachabilityFence(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_CVec_BlindedPathZNoneZ ret_hu_conv = Result_CVec_BlindedPathZNoneZ.constr_from_ptr(ret); - for (BlindedPath o_conv_13: o) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o_conv_13); }; }; - return ret_hu_conv; - } - - /** - * Creates a new CResult_CVec_BlindedPathZNoneZ in the error state. - */ - public static Result_CVec_BlindedPathZNoneZ err() { - long ret = bindings.CResult_CVec_BlindedPathZNoneZ_err(); - if (ret >= 0 && ret <= 4096) { return null; } - Result_CVec_BlindedPathZNoneZ ret_hu_conv = Result_CVec_BlindedPathZNoneZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Checks if the given object is currently in the success state - */ - public boolean is_ok() { - boolean ret = bindings.CResult_CVec_BlindedPathZNoneZ_is_ok(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - long clone_ptr() { - long ret = bindings.CResult_CVec_BlindedPathZNoneZ_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Creates a new CResult_CVec_BlindedPathZNoneZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_CVec_BlindedPathZNoneZ clone() { - long ret = bindings.CResult_CVec_BlindedPathZNoneZ_clone(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_CVec_BlindedPathZNoneZ ret_hu_conv = Result_CVec_BlindedPathZNoneZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} diff --git a/src/main/java/org/ldk/structs/Result_CVec_BlindedPaymentPathZNoneZ.java b/src/main/java/org/ldk/structs/Result_CVec_BlindedPaymentPathZNoneZ.java new file mode 100644 index 00000000..a88381f6 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_CVec_BlindedPaymentPathZNoneZ.java @@ -0,0 +1,98 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + +public class Result_CVec_BlindedPaymentPathZNoneZ extends CommonBase { + private Result_CVec_BlindedPaymentPathZNoneZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_CVec_BlindedPaymentPathZNoneZ_free(ptr); } super.finalize(); + } + + protected void force_free() { + if (ptr != 0) { bindings.CResult_CVec_BlindedPaymentPathZNoneZ_free(ptr); ptr = 0; } + } + + static Result_CVec_BlindedPaymentPathZNoneZ constr_from_ptr(long ptr) { + if (bindings.CResult_CVec_BlindedPaymentPathZNoneZ_is_ok(ptr)) { + return new Result_CVec_BlindedPaymentPathZNoneZ_OK(null, ptr); + } else { + return new Result_CVec_BlindedPaymentPathZNoneZ_Err(null, ptr); + } + } + public static final class Result_CVec_BlindedPaymentPathZNoneZ_OK extends Result_CVec_BlindedPaymentPathZNoneZ { + public final BlindedPaymentPath[] res; + private Result_CVec_BlindedPaymentPathZNoneZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long[] res = bindings.CResult_CVec_BlindedPaymentPathZNoneZ_get_ok(ptr); + int res_conv_20_len = res.length; + BlindedPaymentPath[] res_conv_20_arr = new BlindedPaymentPath[res_conv_20_len]; + for (int u = 0; u < res_conv_20_len; u++) { + long res_conv_20 = res[u]; + org.ldk.structs.BlindedPaymentPath res_conv_20_hu_conv = null; if (res_conv_20 < 0 || res_conv_20 > 4096) { res_conv_20_hu_conv = new org.ldk.structs.BlindedPaymentPath(null, res_conv_20); } + if (res_conv_20_hu_conv != null) { res_conv_20_hu_conv.ptrs_to.add(this); }; + res_conv_20_arr[u] = res_conv_20_hu_conv; + } + this.res = res_conv_20_arr; + } + } + + public static final class Result_CVec_BlindedPaymentPathZNoneZ_Err extends Result_CVec_BlindedPaymentPathZNoneZ { + private Result_CVec_BlindedPaymentPathZNoneZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + } + } + + /** + * Creates a new CResult_CVec_BlindedPaymentPathZNoneZ in the success state. + */ + public static Result_CVec_BlindedPaymentPathZNoneZ ok(BlindedPaymentPath[] o) { + long ret = bindings.CResult_CVec_BlindedPaymentPathZNoneZ_ok(o != null ? Arrays.stream(o).mapToLong(o_conv_20 -> o_conv_20.ptr).toArray() : null); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_CVec_BlindedPaymentPathZNoneZ ret_hu_conv = Result_CVec_BlindedPaymentPathZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_CVec_BlindedPaymentPathZNoneZ in the error state. + */ + public static Result_CVec_BlindedPaymentPathZNoneZ err() { + long ret = bindings.CResult_CVec_BlindedPaymentPathZNoneZ_err(); + if (ret >= 0 && ret <= 4096) { return null; } + Result_CVec_BlindedPaymentPathZNoneZ ret_hu_conv = Result_CVec_BlindedPaymentPathZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_CVec_BlindedPaymentPathZNoneZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_CVec_BlindedPaymentPathZNoneZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_CVec_BlindedPaymentPathZNoneZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_CVec_BlindedPaymentPathZNoneZ clone() { + long ret = bindings.CResult_CVec_BlindedPaymentPathZNoneZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_CVec_BlindedPaymentPathZNoneZ ret_hu_conv = Result_CVec_BlindedPaymentPathZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ.java b/src/main/java/org/ldk/structs/Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ.java deleted file mode 100644 index 665ca480..00000000 --- a/src/main/java/org/ldk/structs/Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ.java +++ /dev/null @@ -1,98 +0,0 @@ -package org.ldk.structs; - -import org.ldk.impl.bindings; -import org.ldk.enums.*; -import org.ldk.util.*; -import java.util.Arrays; -import java.lang.ref.Reference; -import javax.annotation.Nullable; - -public class Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ extends CommonBase { - private Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ(Object _dummy, long ptr) { super(ptr); } - protected void finalize() throws Throwable { - if (ptr != 0) { bindings.CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_free(ptr); } super.finalize(); - } - - protected void force_free() { - if (ptr != 0) { bindings.CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_free(ptr); ptr = 0; } - } - - static Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ constr_from_ptr(long ptr) { - if (bindings.CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_is_ok(ptr)) { - return new Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_OK(null, ptr); - } else { - return new Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_Err(null, ptr); - } - } - public static final class Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_OK extends Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ { - public final TwoTuple_BlindedPayInfoBlindedPathZ[] res; - private Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_OK(Object _dummy, long ptr) { - super(_dummy, ptr); - long[] res = bindings.CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_ok(ptr); - int res_conv_37_len = res.length; - TwoTuple_BlindedPayInfoBlindedPathZ[] res_conv_37_arr = new TwoTuple_BlindedPayInfoBlindedPathZ[res_conv_37_len]; - for (int l = 0; l < res_conv_37_len; l++) { - long res_conv_37 = res[l]; - TwoTuple_BlindedPayInfoBlindedPathZ res_conv_37_hu_conv = new TwoTuple_BlindedPayInfoBlindedPathZ(null, res_conv_37); - if (res_conv_37_hu_conv != null) { res_conv_37_hu_conv.ptrs_to.add(this); }; - res_conv_37_arr[l] = res_conv_37_hu_conv; - } - this.res = res_conv_37_arr; - } - } - - public static final class Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_Err extends Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ { - private Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_Err(Object _dummy, long ptr) { - super(_dummy, ptr); - } - } - - /** - * Creates a new CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ in the success state. - */ - public static Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ ok(TwoTuple_BlindedPayInfoBlindedPathZ[] o) { - long ret = bindings.CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_ok(o != null ? Arrays.stream(o).mapToLong(o_conv_37 -> o_conv_37.ptr).toArray() : null); - Reference.reachabilityFence(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ ret_hu_conv = Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Creates a new CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ in the error state. - */ - public static Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ err() { - long ret = bindings.CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_err(); - if (ret >= 0 && ret <= 4096) { return null; } - Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ ret_hu_conv = Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Checks if the given object is currently in the success state - */ - public boolean is_ok() { - boolean ret = bindings.CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_is_ok(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - long clone_ptr() { - long ret = bindings.CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Creates a new CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ clone() { - long ret = bindings.CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ ret_hu_conv = Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} diff --git a/src/main/java/org/ldk/structs/Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ.java b/src/main/java/org/ldk/structs/Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ.java index a762cddc..0022a2f8 100644 --- a/src/main/java/org/ldk/structs/Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ.java +++ b/src/main/java/org/ldk/structs/Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ.java @@ -71,7 +71,6 @@ public class Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ ret_hu_conv = Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_CVec_UtxoZNoneZ.java b/src/main/java/org/ldk/structs/Result_CVec_UtxoZNoneZ.java index 5d655e53..715430dd 100644 --- a/src/main/java/org/ldk/structs/Result_CVec_UtxoZNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_CVec_UtxoZNoneZ.java @@ -55,7 +55,6 @@ public class Result_CVec_UtxoZNoneZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_CVec_UtxoZNoneZ ret_hu_conv = Result_CVec_UtxoZNoneZ.constr_from_ptr(ret); - for (Utxo o_conv_6: o) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o_conv_6); }; }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_CVec_u8ZPeerHandleErrorZ.java b/src/main/java/org/ldk/structs/Result_CVec_u8ZPeerHandleErrorZ.java index d1bbc791..d03ad886 100644 --- a/src/main/java/org/ldk/structs/Result_CVec_u8ZPeerHandleErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_CVec_u8ZPeerHandleErrorZ.java @@ -62,7 +62,6 @@ public class Result_CVec_u8ZPeerHandleErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_CVec_u8ZPeerHandleErrorZ ret_hu_conv = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelAnnouncementDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelAnnouncementDecodeErrorZ.java index 61313ceb..af3811b3 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelAnnouncementDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelAnnouncementDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_ChannelAnnouncementDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_ChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_ChannelAnnouncementDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_ChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelConfigDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelConfigDecodeErrorZ.java index ad213054..09dd40e2 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelConfigDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelConfigDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_ChannelConfigDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelConfigDecodeErrorZ ret_hu_conv = Result_ChannelConfigDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_ChannelConfigDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelConfigDecodeErrorZ ret_hu_conv = Result_ChannelConfigDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelCounterpartyDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelCounterpartyDecodeErrorZ.java index 974986ca..42c64c59 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelCounterpartyDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelCounterpartyDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_ChannelCounterpartyDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelCounterpartyDecodeErrorZ ret_hu_conv = Result_ChannelCounterpartyDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_ChannelCounterpartyDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelCounterpartyDecodeErrorZ ret_hu_conv = Result_ChannelCounterpartyDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelDerivationParametersDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelDerivationParametersDecodeErrorZ.java index a43619aa..d9b57888 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelDerivationParametersDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelDerivationParametersDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_ChannelDerivationParametersDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelDerivationParametersDecodeErrorZ ret_hu_conv = Result_ChannelDerivationParametersDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_ChannelDerivationParametersDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelDerivationParametersDecodeErrorZ ret_hu_conv = Result_ChannelDerivationParametersDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelDetailsDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelDetailsDecodeErrorZ.java index d552e370..2c10ce68 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelDetailsDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelDetailsDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_ChannelDetailsDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelDetailsDecodeErrorZ ret_hu_conv = Result_ChannelDetailsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_ChannelDetailsDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelDetailsDecodeErrorZ ret_hu_conv = Result_ChannelDetailsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelFeaturesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelFeaturesDecodeErrorZ.java index 5f89bd74..158c10d4 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelFeaturesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelFeaturesDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_ChannelFeaturesDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelFeaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_ChannelFeaturesDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelFeaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelIdAPIErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelIdAPIErrorZ.java index f07bda69..347be853 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelIdAPIErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelIdAPIErrorZ.java @@ -54,7 +54,6 @@ public class Result_ChannelIdAPIErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelIdAPIErrorZ ret_hu_conv = Result_ChannelIdAPIErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_ChannelIdAPIErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelIdAPIErrorZ ret_hu_conv = Result_ChannelIdAPIErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelIdDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelIdDecodeErrorZ.java index 2859b766..9ae35321 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelIdDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelIdDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_ChannelIdDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelIdDecodeErrorZ ret_hu_conv = Result_ChannelIdDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_ChannelIdDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelIdDecodeErrorZ ret_hu_conv = Result_ChannelIdDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelInfoDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelInfoDecodeErrorZ.java index 8ac44525..a9d81fea 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelInfoDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelInfoDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_ChannelInfoDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelInfoDecodeErrorZ ret_hu_conv = Result_ChannelInfoDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_ChannelInfoDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelInfoDecodeErrorZ ret_hu_conv = Result_ChannelInfoDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.java index 08374261..85aefcf3 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_ChannelMonitorUpdateDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelMonitorUpdateDecodeErrorZ ret_hu_conv = Result_ChannelMonitorUpdateDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_ChannelMonitorUpdateDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelMonitorUpdateDecodeErrorZ ret_hu_conv = Result_ChannelMonitorUpdateDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelPublicKeysDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelPublicKeysDecodeErrorZ.java index cad6c6d1..9f10c42b 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelPublicKeysDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelPublicKeysDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_ChannelPublicKeysDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelPublicKeysDecodeErrorZ ret_hu_conv = Result_ChannelPublicKeysDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_ChannelPublicKeysDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelPublicKeysDecodeErrorZ ret_hu_conv = Result_ChannelPublicKeysDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelReadyDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelReadyDecodeErrorZ.java index 6924ba76..2d2dc4e4 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelReadyDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelReadyDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_ChannelReadyDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelReadyDecodeErrorZ ret_hu_conv = Result_ChannelReadyDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_ChannelReadyDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelReadyDecodeErrorZ ret_hu_conv = Result_ChannelReadyDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.java index 19a55604..1e17af58 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_ChannelReestablishDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelReestablishDecodeErrorZ ret_hu_conv = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_ChannelReestablishDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelReestablishDecodeErrorZ ret_hu_conv = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelShutdownStateDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelShutdownStateDecodeErrorZ.java index a2bc6c33..54e15a23 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelShutdownStateDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelShutdownStateDecodeErrorZ.java @@ -62,7 +62,6 @@ public class Result_ChannelShutdownStateDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelShutdownStateDecodeErrorZ ret_hu_conv = Result_ChannelShutdownStateDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelTransactionParametersDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelTransactionParametersDecodeErrorZ.java index 8e1b0a5f..3497d5d1 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelTransactionParametersDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelTransactionParametersDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_ChannelTransactionParametersDecodeErrorZ extends CommonBase Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_ChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_ChannelTransactionParametersDecodeErrorZ extends CommonBase Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_ChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelTypeFeaturesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelTypeFeaturesDecodeErrorZ.java index e485a360..8793264c 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelTypeFeaturesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelTypeFeaturesDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_ChannelTypeFeaturesDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelTypeFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelTypeFeaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_ChannelTypeFeaturesDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelTypeFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelTypeFeaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelUpdateDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelUpdateDecodeErrorZ.java index ce7b2f30..091716f6 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelUpdateDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelUpdateDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_ChannelUpdateDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelUpdateDecodeErrorZ ret_hu_conv = Result_ChannelUpdateDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_ChannelUpdateDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelUpdateDecodeErrorZ ret_hu_conv = Result_ChannelUpdateDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelUpdateInfoDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelUpdateInfoDecodeErrorZ.java index f80e32ba..7e2dd5fc 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelUpdateInfoDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelUpdateInfoDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_ChannelUpdateInfoDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelUpdateInfoDecodeErrorZ ret_hu_conv = Result_ChannelUpdateInfoDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_ChannelUpdateInfoDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelUpdateInfoDecodeErrorZ ret_hu_conv = Result_ChannelUpdateInfoDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ClaimedHTLCDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ClaimedHTLCDecodeErrorZ.java index b565a2c5..5c861fa5 100644 --- a/src/main/java/org/ldk/structs/Result_ClaimedHTLCDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ClaimedHTLCDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_ClaimedHTLCDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ClaimedHTLCDecodeErrorZ ret_hu_conv = Result_ClaimedHTLCDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_ClaimedHTLCDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ClaimedHTLCDecodeErrorZ ret_hu_conv = Result_ClaimedHTLCDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ClosingSignedDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ClosingSignedDecodeErrorZ.java index 9bcfa2df..8a7f9239 100644 --- a/src/main/java/org/ldk/structs/Result_ClosingSignedDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ClosingSignedDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_ClosingSignedDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ClosingSignedDecodeErrorZ ret_hu_conv = Result_ClosingSignedDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_ClosingSignedDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ClosingSignedDecodeErrorZ ret_hu_conv = Result_ClosingSignedDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ClosingSignedFeeRangeDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ClosingSignedFeeRangeDecodeErrorZ.java index 9f8bfbef..c64d80be 100644 --- a/src/main/java/org/ldk/structs/Result_ClosingSignedFeeRangeDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ClosingSignedFeeRangeDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_ClosingSignedFeeRangeDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ClosingSignedFeeRangeDecodeErrorZ ret_hu_conv = Result_ClosingSignedFeeRangeDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_ClosingSignedFeeRangeDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ClosingSignedFeeRangeDecodeErrorZ ret_hu_conv = Result_ClosingSignedFeeRangeDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_CoinSelectionNoneZ.java b/src/main/java/org/ldk/structs/Result_CoinSelectionNoneZ.java index d8d6ca93..62e3cde0 100644 --- a/src/main/java/org/ldk/structs/Result_CoinSelectionNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_CoinSelectionNoneZ.java @@ -49,7 +49,6 @@ public class Result_CoinSelectionNoneZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_CoinSelectionNoneZ ret_hu_conv = Result_CoinSelectionNoneZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_CommitmentSignedBatchDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_CommitmentSignedBatchDecodeErrorZ.java new file mode 100644 index 00000000..30200ca3 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_CommitmentSignedBatchDecodeErrorZ.java @@ -0,0 +1,98 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + +public class Result_CommitmentSignedBatchDecodeErrorZ extends CommonBase { + private Result_CommitmentSignedBatchDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_CommitmentSignedBatchDecodeErrorZ_free(ptr); } super.finalize(); + } + + protected void force_free() { + if (ptr != 0) { bindings.CResult_CommitmentSignedBatchDecodeErrorZ_free(ptr); ptr = 0; } + } + + static Result_CommitmentSignedBatchDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_CommitmentSignedBatchDecodeErrorZ_is_ok(ptr)) { + return new Result_CommitmentSignedBatchDecodeErrorZ_OK(null, ptr); + } else { + return new Result_CommitmentSignedBatchDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_CommitmentSignedBatchDecodeErrorZ_OK extends Result_CommitmentSignedBatchDecodeErrorZ { + public final CommitmentSignedBatch res; + private Result_CommitmentSignedBatchDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.CResult_CommitmentSignedBatchDecodeErrorZ_get_ok(ptr); + org.ldk.structs.CommitmentSignedBatch res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.CommitmentSignedBatch(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; + this.res = res_hu_conv; + } + } + + public static final class Result_CommitmentSignedBatchDecodeErrorZ_Err extends Result_CommitmentSignedBatchDecodeErrorZ { + public final DecodeError err; + private Result_CommitmentSignedBatchDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.CResult_CommitmentSignedBatchDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_CommitmentSignedBatchDecodeErrorZ in the success state. + */ + public static Result_CommitmentSignedBatchDecodeErrorZ ok(org.ldk.structs.CommitmentSignedBatch o) { + long ret = bindings.CResult_CommitmentSignedBatchDecodeErrorZ_ok(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_CommitmentSignedBatchDecodeErrorZ ret_hu_conv = Result_CommitmentSignedBatchDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_CommitmentSignedBatchDecodeErrorZ in the error state. + */ + public static Result_CommitmentSignedBatchDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_CommitmentSignedBatchDecodeErrorZ_err(e.ptr); + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_CommitmentSignedBatchDecodeErrorZ ret_hu_conv = Result_CommitmentSignedBatchDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_CommitmentSignedBatchDecodeErrorZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_CommitmentSignedBatchDecodeErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_CommitmentSignedBatchDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_CommitmentSignedBatchDecodeErrorZ clone() { + long ret = bindings.CResult_CommitmentSignedBatchDecodeErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_CommitmentSignedBatchDecodeErrorZ ret_hu_conv = Result_CommitmentSignedBatchDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_CommitmentSignedDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_CommitmentSignedDecodeErrorZ.java index 081b57c8..02ac0c87 100644 --- a/src/main/java/org/ldk/structs/Result_CommitmentSignedDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_CommitmentSignedDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_CommitmentSignedDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_CommitmentSignedDecodeErrorZ ret_hu_conv = Result_CommitmentSignedDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_CommitmentSignedDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_CommitmentSignedDecodeErrorZ ret_hu_conv = Result_CommitmentSignedDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_CommitmentTransactionDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_CommitmentTransactionDecodeErrorZ.java index 2f2a2627..4215f3fc 100644 --- a/src/main/java/org/ldk/structs/Result_CommitmentTransactionDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_CommitmentTransactionDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_CommitmentTransactionDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_CommitmentTransactionDecodeErrorZ ret_hu_conv = Result_CommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_CommitmentTransactionDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_CommitmentTransactionDecodeErrorZ ret_hu_conv = Result_CommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.java index 2dbd8abf..0196ade2 100644 --- a/src/main/java/org/ldk/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_CounterpartyChannelTransactionParametersDecodeErrorZ extends Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_CounterpartyChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_CounterpartyChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_CounterpartyChannelTransactionParametersDecodeErrorZ extends Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_CounterpartyChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_CounterpartyChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_CounterpartyCommitmentSecretsDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_CounterpartyCommitmentSecretsDecodeErrorZ.java index e5d22b14..15285194 100644 --- a/src/main/java/org/ldk/structs/Result_CounterpartyCommitmentSecretsDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_CounterpartyCommitmentSecretsDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_CounterpartyCommitmentSecretsDecodeErrorZ extends CommonBase Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_CounterpartyCommitmentSecretsDecodeErrorZ ret_hu_conv = Result_CounterpartyCommitmentSecretsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_CounterpartyCommitmentSecretsDecodeErrorZ extends CommonBase Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_CounterpartyCommitmentSecretsDecodeErrorZ ret_hu_conv = Result_CounterpartyCommitmentSecretsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_CounterpartyForwardingInfoDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_CounterpartyForwardingInfoDecodeErrorZ.java index fc5f8f59..e15b5087 100644 --- a/src/main/java/org/ldk/structs/Result_CounterpartyForwardingInfoDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_CounterpartyForwardingInfoDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_CounterpartyForwardingInfoDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_CounterpartyForwardingInfoDecodeErrorZ ret_hu_conv = Result_CounterpartyForwardingInfoDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_CounterpartyForwardingInfoDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_CounterpartyForwardingInfoDecodeErrorZ ret_hu_conv = Result_CounterpartyForwardingInfoDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_DelayedPaymentBasepointDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_DelayedPaymentBasepointDecodeErrorZ.java index 860921c3..fdbb5fe0 100644 --- a/src/main/java/org/ldk/structs/Result_DelayedPaymentBasepointDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_DelayedPaymentBasepointDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_DelayedPaymentBasepointDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_DelayedPaymentBasepointDecodeErrorZ ret_hu_conv = Result_DelayedPaymentBasepointDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_DelayedPaymentBasepointDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_DelayedPaymentBasepointDecodeErrorZ ret_hu_conv = Result_DelayedPaymentBasepointDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_DelayedPaymentKeyDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_DelayedPaymentKeyDecodeErrorZ.java index ba4a1548..8ba0a672 100644 --- a/src/main/java/org/ldk/structs/Result_DelayedPaymentKeyDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_DelayedPaymentKeyDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_DelayedPaymentKeyDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_DelayedPaymentKeyDecodeErrorZ ret_hu_conv = Result_DelayedPaymentKeyDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_DelayedPaymentKeyDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_DelayedPaymentKeyDecodeErrorZ ret_hu_conv = Result_DelayedPaymentKeyDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.java index a5dbe2de..2c4fb0d7 100644 --- a/src/main/java/org/ldk/structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_DelayedPaymentOutputDescriptorDecodeErrorZ extends CommonBas Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_DelayedPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_DelayedPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_DelayedPaymentOutputDescriptorDecodeErrorZ extends CommonBas Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_DelayedPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_DelayedPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_DescriptionCreationErrorZ.java b/src/main/java/org/ldk/structs/Result_DescriptionCreationErrorZ.java index 86aaf524..ec420926 100644 --- a/src/main/java/org/ldk/structs/Result_DescriptionCreationErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_DescriptionCreationErrorZ.java @@ -51,7 +51,6 @@ public class Result_DescriptionCreationErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_DescriptionCreationErrorZ ret_hu_conv = Result_DescriptionCreationErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_EcdsaChannelSignerDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_EcdsaChannelSignerDecodeErrorZ.java new file mode 100644 index 00000000..c659c7fd --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_EcdsaChannelSignerDecodeErrorZ.java @@ -0,0 +1,99 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + +public class Result_EcdsaChannelSignerDecodeErrorZ extends CommonBase { + private Result_EcdsaChannelSignerDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_EcdsaChannelSignerDecodeErrorZ_free(ptr); } super.finalize(); + } + + protected void force_free() { + if (ptr != 0) { bindings.CResult_EcdsaChannelSignerDecodeErrorZ_free(ptr); ptr = 0; } + } + + static Result_EcdsaChannelSignerDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_EcdsaChannelSignerDecodeErrorZ_is_ok(ptr)) { + return new Result_EcdsaChannelSignerDecodeErrorZ_OK(null, ptr); + } else { + return new Result_EcdsaChannelSignerDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_EcdsaChannelSignerDecodeErrorZ_OK extends Result_EcdsaChannelSignerDecodeErrorZ { + public final EcdsaChannelSigner res; + private Result_EcdsaChannelSignerDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.CResult_EcdsaChannelSignerDecodeErrorZ_get_ok(ptr); + EcdsaChannelSigner ret_hu_conv = new EcdsaChannelSigner(null, res); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + this.res = ret_hu_conv; + } + } + + public static final class Result_EcdsaChannelSignerDecodeErrorZ_Err extends Result_EcdsaChannelSignerDecodeErrorZ { + public final DecodeError err; + private Result_EcdsaChannelSignerDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.CResult_EcdsaChannelSignerDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_EcdsaChannelSignerDecodeErrorZ in the success state. + */ + public static Result_EcdsaChannelSignerDecodeErrorZ ok(org.ldk.structs.EcdsaChannelSigner o) { + long ret = bindings.CResult_EcdsaChannelSignerDecodeErrorZ_ok(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_EcdsaChannelSignerDecodeErrorZ ret_hu_conv = Result_EcdsaChannelSignerDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_EcdsaChannelSignerDecodeErrorZ in the error state. + */ + public static Result_EcdsaChannelSignerDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_EcdsaChannelSignerDecodeErrorZ_err(e.ptr); + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_EcdsaChannelSignerDecodeErrorZ ret_hu_conv = Result_EcdsaChannelSignerDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_EcdsaChannelSignerDecodeErrorZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_EcdsaChannelSignerDecodeErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_EcdsaChannelSignerDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_EcdsaChannelSignerDecodeErrorZ clone() { + long ret = bindings.CResult_EcdsaChannelSignerDecodeErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_EcdsaChannelSignerDecodeErrorZ ret_hu_conv = Result_EcdsaChannelSignerDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.java index ff8ca532..d0a40b18 100644 --- a/src/main/java/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_ErrorMessageDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ErrorMessageDecodeErrorZ ret_hu_conv = Result_ErrorMessageDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_ErrorMessageDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ErrorMessageDecodeErrorZ ret_hu_conv = Result_ErrorMessageDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_FinalOnionHopDataDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_FinalOnionHopDataDecodeErrorZ.java index 7933c85f..8ee38d06 100644 --- a/src/main/java/org/ldk/structs/Result_FinalOnionHopDataDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_FinalOnionHopDataDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_FinalOnionHopDataDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_FinalOnionHopDataDecodeErrorZ ret_hu_conv = Result_FinalOnionHopDataDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_FinalOnionHopDataDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_FinalOnionHopDataDecodeErrorZ ret_hu_conv = Result_FinalOnionHopDataDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_FixedPenaltyScorerDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_FixedPenaltyScorerDecodeErrorZ.java index 8b5079be..5fa27a39 100644 --- a/src/main/java/org/ldk/structs/Result_FixedPenaltyScorerDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_FixedPenaltyScorerDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_FixedPenaltyScorerDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_FixedPenaltyScorerDecodeErrorZ ret_hu_conv = Result_FixedPenaltyScorerDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_FixedPenaltyScorerDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_FixedPenaltyScorerDecodeErrorZ ret_hu_conv = Result_FixedPenaltyScorerDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_FundingCreatedDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_FundingCreatedDecodeErrorZ.java index bbff99a0..1317000b 100644 --- a/src/main/java/org/ldk/structs/Result_FundingCreatedDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_FundingCreatedDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_FundingCreatedDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_FundingCreatedDecodeErrorZ ret_hu_conv = Result_FundingCreatedDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_FundingCreatedDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_FundingCreatedDecodeErrorZ ret_hu_conv = Result_FundingCreatedDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_FundingInfoDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_FundingInfoDecodeErrorZ.java new file mode 100644 index 00000000..8ae9c59d --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_FundingInfoDecodeErrorZ.java @@ -0,0 +1,98 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + +public class Result_FundingInfoDecodeErrorZ extends CommonBase { + private Result_FundingInfoDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_FundingInfoDecodeErrorZ_free(ptr); } super.finalize(); + } + + protected void force_free() { + if (ptr != 0) { bindings.CResult_FundingInfoDecodeErrorZ_free(ptr); ptr = 0; } + } + + static Result_FundingInfoDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_FundingInfoDecodeErrorZ_is_ok(ptr)) { + return new Result_FundingInfoDecodeErrorZ_OK(null, ptr); + } else { + return new Result_FundingInfoDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_FundingInfoDecodeErrorZ_OK extends Result_FundingInfoDecodeErrorZ { + public final FundingInfo res; + private Result_FundingInfoDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.CResult_FundingInfoDecodeErrorZ_get_ok(ptr); + org.ldk.structs.FundingInfo res_hu_conv = org.ldk.structs.FundingInfo.constr_from_ptr(res); + if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; + this.res = res_hu_conv; + } + } + + public static final class Result_FundingInfoDecodeErrorZ_Err extends Result_FundingInfoDecodeErrorZ { + public final DecodeError err; + private Result_FundingInfoDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.CResult_FundingInfoDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_FundingInfoDecodeErrorZ in the success state. + */ + public static Result_FundingInfoDecodeErrorZ ok(org.ldk.structs.FundingInfo o) { + long ret = bindings.CResult_FundingInfoDecodeErrorZ_ok(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_FundingInfoDecodeErrorZ ret_hu_conv = Result_FundingInfoDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_FundingInfoDecodeErrorZ in the error state. + */ + public static Result_FundingInfoDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_FundingInfoDecodeErrorZ_err(e.ptr); + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_FundingInfoDecodeErrorZ ret_hu_conv = Result_FundingInfoDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_FundingInfoDecodeErrorZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_FundingInfoDecodeErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_FundingInfoDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_FundingInfoDecodeErrorZ clone() { + long ret = bindings.CResult_FundingInfoDecodeErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_FundingInfoDecodeErrorZ ret_hu_conv = Result_FundingInfoDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_FundingSignedDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_FundingSignedDecodeErrorZ.java index b7dd6681..a76cb57b 100644 --- a/src/main/java/org/ldk/structs/Result_FundingSignedDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_FundingSignedDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_FundingSignedDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_FundingSignedDecodeErrorZ ret_hu_conv = Result_FundingSignedDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_FundingSignedDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_FundingSignedDecodeErrorZ ret_hu_conv = Result_FundingSignedDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.java index 803eadef..9f156403 100644 --- a/src/main/java/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_GossipTimestampFilterDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_GossipTimestampFilterDecodeErrorZ ret_hu_conv = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_GossipTimestampFilterDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_GossipTimestampFilterDecodeErrorZ ret_hu_conv = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_HTLCDescriptorDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_HTLCDescriptorDecodeErrorZ.java index 2086027a..7bd5b9ed 100644 --- a/src/main/java/org/ldk/structs/Result_HTLCDescriptorDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_HTLCDescriptorDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_HTLCDescriptorDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_HTLCDescriptorDecodeErrorZ ret_hu_conv = Result_HTLCDescriptorDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_HTLCDescriptorDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_HTLCDescriptorDecodeErrorZ ret_hu_conv = Result_HTLCDescriptorDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.java index 2b4b5f9d..423d24bc 100644 --- a/src/main/java/org/ldk/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_HTLCOutputInCommitmentDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_HTLCOutputInCommitmentDecodeErrorZ ret_hu_conv = Result_HTLCOutputInCommitmentDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_HTLCOutputInCommitmentDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_HTLCOutputInCommitmentDecodeErrorZ ret_hu_conv = Result_HTLCOutputInCommitmentDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_HTLCUpdateDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_HTLCUpdateDecodeErrorZ.java index 40514adb..44432797 100644 --- a/src/main/java/org/ldk/structs/Result_HTLCUpdateDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_HTLCUpdateDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_HTLCUpdateDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_HTLCUpdateDecodeErrorZ ret_hu_conv = Result_HTLCUpdateDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_HTLCUpdateDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_HTLCUpdateDecodeErrorZ ret_hu_conv = Result_HTLCUpdateDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_HeldHtlcAvailableDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_HeldHtlcAvailableDecodeErrorZ.java new file mode 100644 index 00000000..17763244 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_HeldHtlcAvailableDecodeErrorZ.java @@ -0,0 +1,98 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + +public class Result_HeldHtlcAvailableDecodeErrorZ extends CommonBase { + private Result_HeldHtlcAvailableDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_HeldHtlcAvailableDecodeErrorZ_free(ptr); } super.finalize(); + } + + protected void force_free() { + if (ptr != 0) { bindings.CResult_HeldHtlcAvailableDecodeErrorZ_free(ptr); ptr = 0; } + } + + static Result_HeldHtlcAvailableDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_HeldHtlcAvailableDecodeErrorZ_is_ok(ptr)) { + return new Result_HeldHtlcAvailableDecodeErrorZ_OK(null, ptr); + } else { + return new Result_HeldHtlcAvailableDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_HeldHtlcAvailableDecodeErrorZ_OK extends Result_HeldHtlcAvailableDecodeErrorZ { + public final HeldHtlcAvailable res; + private Result_HeldHtlcAvailableDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.CResult_HeldHtlcAvailableDecodeErrorZ_get_ok(ptr); + org.ldk.structs.HeldHtlcAvailable res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.HeldHtlcAvailable(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; + this.res = res_hu_conv; + } + } + + public static final class Result_HeldHtlcAvailableDecodeErrorZ_Err extends Result_HeldHtlcAvailableDecodeErrorZ { + public final DecodeError err; + private Result_HeldHtlcAvailableDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.CResult_HeldHtlcAvailableDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_HeldHtlcAvailableDecodeErrorZ in the success state. + */ + public static Result_HeldHtlcAvailableDecodeErrorZ ok(org.ldk.structs.HeldHtlcAvailable o) { + long ret = bindings.CResult_HeldHtlcAvailableDecodeErrorZ_ok(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_HeldHtlcAvailableDecodeErrorZ ret_hu_conv = Result_HeldHtlcAvailableDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_HeldHtlcAvailableDecodeErrorZ in the error state. + */ + public static Result_HeldHtlcAvailableDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_HeldHtlcAvailableDecodeErrorZ_err(e.ptr); + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_HeldHtlcAvailableDecodeErrorZ ret_hu_conv = Result_HeldHtlcAvailableDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_HeldHtlcAvailableDecodeErrorZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_HeldHtlcAvailableDecodeErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_HeldHtlcAvailableDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_HeldHtlcAvailableDecodeErrorZ clone() { + long ret = bindings.CResult_HeldHtlcAvailableDecodeErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_HeldHtlcAvailableDecodeErrorZ ret_hu_conv = Result_HeldHtlcAvailableDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_HolderCommitmentTransactionDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_HolderCommitmentTransactionDecodeErrorZ.java index f5402c87..e30068d9 100644 --- a/src/main/java/org/ldk/structs/Result_HolderCommitmentTransactionDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_HolderCommitmentTransactionDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_HolderCommitmentTransactionDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_HolderCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_HolderCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_HolderCommitmentTransactionDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_HolderCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_HolderCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_HostnameDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_HostnameDecodeErrorZ.java index e970bab3..fa02d9af 100644 --- a/src/main/java/org/ldk/structs/Result_HostnameDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_HostnameDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_HostnameDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_HostnameDecodeErrorZ ret_hu_conv = Result_HostnameDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_HostnameDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_HostnameDecodeErrorZ ret_hu_conv = Result_HostnameDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_HtlcBasepointDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_HtlcBasepointDecodeErrorZ.java index b0e92b03..6410a760 100644 --- a/src/main/java/org/ldk/structs/Result_HtlcBasepointDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_HtlcBasepointDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_HtlcBasepointDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_HtlcBasepointDecodeErrorZ ret_hu_conv = Result_HtlcBasepointDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_HtlcBasepointDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_HtlcBasepointDecodeErrorZ ret_hu_conv = Result_HtlcBasepointDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_HtlcKeyDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_HtlcKeyDecodeErrorZ.java index 171cdb14..535d4779 100644 --- a/src/main/java/org/ldk/structs/Result_HtlcKeyDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_HtlcKeyDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_HtlcKeyDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_HtlcKeyDecodeErrorZ ret_hu_conv = Result_HtlcKeyDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_HtlcKeyDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_HtlcKeyDecodeErrorZ ret_hu_conv = Result_HtlcKeyDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_InFlightHtlcsDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_InFlightHtlcsDecodeErrorZ.java index ef6b85cb..09575742 100644 --- a/src/main/java/org/ldk/structs/Result_InFlightHtlcsDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_InFlightHtlcsDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_InFlightHtlcsDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_InFlightHtlcsDecodeErrorZ ret_hu_conv = Result_InFlightHtlcsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_InFlightHtlcsDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_InFlightHtlcsDecodeErrorZ ret_hu_conv = Result_InFlightHtlcsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_InMemorySignerDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_InMemorySignerDecodeErrorZ.java index 8b17bc02..72500bcd 100644 --- a/src/main/java/org/ldk/structs/Result_InMemorySignerDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_InMemorySignerDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_InMemorySignerDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_InMemorySignerDecodeErrorZ ret_hu_conv = Result_InMemorySignerDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_InMemorySignerDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_InMemorySignerDecodeErrorZ ret_hu_conv = Result_InMemorySignerDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_InboundHTLCDetailsDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_InboundHTLCDetailsDecodeErrorZ.java index ea92dfeb..fe0dbf5c 100644 --- a/src/main/java/org/ldk/structs/Result_InboundHTLCDetailsDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_InboundHTLCDetailsDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_InboundHTLCDetailsDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_InboundHTLCDetailsDecodeErrorZ ret_hu_conv = Result_InboundHTLCDetailsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_InboundHTLCDetailsDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_InboundHTLCDetailsDecodeErrorZ ret_hu_conv = Result_InboundHTLCDetailsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_InitDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_InitDecodeErrorZ.java index 6dea0a02..f7d2c211 100644 --- a/src/main/java/org/ldk/structs/Result_InitDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_InitDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_InitDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_InitDecodeErrorZ ret_hu_conv = Result_InitDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_InitDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_InitDecodeErrorZ ret_hu_conv = Result_InitDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_InitFeaturesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_InitFeaturesDecodeErrorZ.java index a9f7bbd5..b5f23998 100644 --- a/src/main/java/org/ldk/structs/Result_InitFeaturesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_InitFeaturesDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_InitFeaturesDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_InitFeaturesDecodeErrorZ ret_hu_conv = Result_InitFeaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_InitFeaturesDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_InitFeaturesDecodeErrorZ ret_hu_conv = Result_InitFeaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_InvoiceErrorDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_InvoiceErrorDecodeErrorZ.java index b8cf9d29..9678eb27 100644 --- a/src/main/java/org/ldk/structs/Result_InvoiceErrorDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_InvoiceErrorDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_InvoiceErrorDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_InvoiceErrorDecodeErrorZ ret_hu_conv = Result_InvoiceErrorDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_InvoiceErrorDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_InvoiceErrorDecodeErrorZ ret_hu_conv = Result_InvoiceErrorDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_InvoiceRequestBolt12SemanticErrorZ.java b/src/main/java/org/ldk/structs/Result_InvoiceRequestBolt12SemanticErrorZ.java index 8d2ebb5b..41fc92e0 100644 --- a/src/main/java/org/ldk/structs/Result_InvoiceRequestBolt12SemanticErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_InvoiceRequestBolt12SemanticErrorZ.java @@ -51,7 +51,6 @@ public class Result_InvoiceRequestBolt12SemanticErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_InvoiceRequestBolt12SemanticErrorZ ret_hu_conv = Result_InvoiceRequestBolt12SemanticErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_InvoiceRequestFieldsDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_InvoiceRequestFieldsDecodeErrorZ.java index 246e990a..e2a9cd72 100644 --- a/src/main/java/org/ldk/structs/Result_InvoiceRequestFieldsDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_InvoiceRequestFieldsDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_InvoiceRequestFieldsDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_InvoiceRequestFieldsDecodeErrorZ ret_hu_conv = Result_InvoiceRequestFieldsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_InvoiceRequestFieldsDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_InvoiceRequestFieldsDecodeErrorZ ret_hu_conv = Result_InvoiceRequestFieldsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_MaxDustHTLCExposureDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_MaxDustHTLCExposureDecodeErrorZ.java index 6bcb58ff..c2d26ed1 100644 --- a/src/main/java/org/ldk/structs/Result_MaxDustHTLCExposureDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_MaxDustHTLCExposureDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_MaxDustHTLCExposureDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_MaxDustHTLCExposureDecodeErrorZ ret_hu_conv = Result_MaxDustHTLCExposureDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_MaxDustHTLCExposureDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_MaxDustHTLCExposureDecodeErrorZ ret_hu_conv = Result_MaxDustHTLCExposureDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_MessageContextDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_MessageContextDecodeErrorZ.java new file mode 100644 index 00000000..2d96f790 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_MessageContextDecodeErrorZ.java @@ -0,0 +1,98 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + +public class Result_MessageContextDecodeErrorZ extends CommonBase { + private Result_MessageContextDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_MessageContextDecodeErrorZ_free(ptr); } super.finalize(); + } + + protected void force_free() { + if (ptr != 0) { bindings.CResult_MessageContextDecodeErrorZ_free(ptr); ptr = 0; } + } + + static Result_MessageContextDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_MessageContextDecodeErrorZ_is_ok(ptr)) { + return new Result_MessageContextDecodeErrorZ_OK(null, ptr); + } else { + return new Result_MessageContextDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_MessageContextDecodeErrorZ_OK extends Result_MessageContextDecodeErrorZ { + public final MessageContext res; + private Result_MessageContextDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.CResult_MessageContextDecodeErrorZ_get_ok(ptr); + org.ldk.structs.MessageContext res_hu_conv = org.ldk.structs.MessageContext.constr_from_ptr(res); + if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; + this.res = res_hu_conv; + } + } + + public static final class Result_MessageContextDecodeErrorZ_Err extends Result_MessageContextDecodeErrorZ { + public final DecodeError err; + private Result_MessageContextDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.CResult_MessageContextDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_MessageContextDecodeErrorZ in the success state. + */ + public static Result_MessageContextDecodeErrorZ ok(org.ldk.structs.MessageContext o) { + long ret = bindings.CResult_MessageContextDecodeErrorZ_ok(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_MessageContextDecodeErrorZ ret_hu_conv = Result_MessageContextDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_MessageContextDecodeErrorZ in the error state. + */ + public static Result_MessageContextDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_MessageContextDecodeErrorZ_err(e.ptr); + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_MessageContextDecodeErrorZ ret_hu_conv = Result_MessageContextDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_MessageContextDecodeErrorZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_MessageContextDecodeErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_MessageContextDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_MessageContextDecodeErrorZ clone() { + long ret = bindings.CResult_MessageContextDecodeErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_MessageContextDecodeErrorZ ret_hu_conv = Result_MessageContextDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_NetworkGraphDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NetworkGraphDecodeErrorZ.java index 6cac05e0..d8e2c8cb 100644 --- a/src/main/java/org/ldk/structs/Result_NetworkGraphDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NetworkGraphDecodeErrorZ.java @@ -67,7 +67,6 @@ public class Result_NetworkGraphDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_NetworkGraphDecodeErrorZ ret_hu_conv = Result_NetworkGraphDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_NodeAliasDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NodeAliasDecodeErrorZ.java index 8c39b8c4..eb2bc3e2 100644 --- a/src/main/java/org/ldk/structs/Result_NodeAliasDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NodeAliasDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_NodeAliasDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_NodeAliasDecodeErrorZ ret_hu_conv = Result_NodeAliasDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_NodeAliasDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_NodeAliasDecodeErrorZ ret_hu_conv = Result_NodeAliasDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_NodeAnnouncementDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NodeAnnouncementDecodeErrorZ.java index b016b264..2e8b4bd1 100644 --- a/src/main/java/org/ldk/structs/Result_NodeAnnouncementDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NodeAnnouncementDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_NodeAnnouncementDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_NodeAnnouncementDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_NodeAnnouncementDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_NodeAnnouncementDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.java index 414412b8..0ffc1e3a 100644 --- a/src/main/java/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.java @@ -29,7 +29,7 @@ public class Result_NodeAnnouncementInfoDecodeErrorZ extends CommonBase { private Result_NodeAnnouncementInfoDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(ptr); - org.ldk.structs.NodeAnnouncementInfo res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.NodeAnnouncementInfo(null, res); } + org.ldk.structs.NodeAnnouncementInfo res_hu_conv = org.ldk.structs.NodeAnnouncementInfo.constr_from_ptr(res); if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; this.res = res_hu_conv; } @@ -54,7 +54,6 @@ public class Result_NodeAnnouncementInfoDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_NodeAnnouncementInfoDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_NodeAnnouncementInfoDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_NodeAnnouncementInfoDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_NodeFeaturesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NodeFeaturesDecodeErrorZ.java index 4de5c15d..141b3a5a 100644 --- a/src/main/java/org/ldk/structs/Result_NodeFeaturesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NodeFeaturesDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_NodeFeaturesDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_NodeFeaturesDecodeErrorZ ret_hu_conv = Result_NodeFeaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_NodeFeaturesDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_NodeFeaturesDecodeErrorZ ret_hu_conv = Result_NodeFeaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_NodeIdDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NodeIdDecodeErrorZ.java index 30f71e9f..2878ea92 100644 --- a/src/main/java/org/ldk/structs/Result_NodeIdDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NodeIdDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_NodeIdDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_NodeIdDecodeErrorZ ret_hu_conv = Result_NodeIdDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_NodeIdDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_NodeIdDecodeErrorZ ret_hu_conv = Result_NodeIdDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_NodeInfoDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NodeInfoDecodeErrorZ.java index d5acc85a..11e99b3c 100644 --- a/src/main/java/org/ldk/structs/Result_NodeInfoDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NodeInfoDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_NodeInfoDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_NodeInfoDecodeErrorZ ret_hu_conv = Result_NodeInfoDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_NodeInfoDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_NodeInfoDecodeErrorZ ret_hu_conv = Result_NodeInfoDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_NonceDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NonceDecodeErrorZ.java new file mode 100644 index 00000000..d02fb633 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_NonceDecodeErrorZ.java @@ -0,0 +1,98 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + +public class Result_NonceDecodeErrorZ extends CommonBase { + private Result_NonceDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_NonceDecodeErrorZ_free(ptr); } super.finalize(); + } + + protected void force_free() { + if (ptr != 0) { bindings.CResult_NonceDecodeErrorZ_free(ptr); ptr = 0; } + } + + static Result_NonceDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_NonceDecodeErrorZ_is_ok(ptr)) { + return new Result_NonceDecodeErrorZ_OK(null, ptr); + } else { + return new Result_NonceDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_NonceDecodeErrorZ_OK extends Result_NonceDecodeErrorZ { + public final Nonce res; + private Result_NonceDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.CResult_NonceDecodeErrorZ_get_ok(ptr); + org.ldk.structs.Nonce res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.Nonce(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; + this.res = res_hu_conv; + } + } + + public static final class Result_NonceDecodeErrorZ_Err extends Result_NonceDecodeErrorZ { + public final DecodeError err; + private Result_NonceDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.CResult_NonceDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_NonceDecodeErrorZ in the success state. + */ + public static Result_NonceDecodeErrorZ ok(org.ldk.structs.Nonce o) { + long ret = bindings.CResult_NonceDecodeErrorZ_ok(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NonceDecodeErrorZ ret_hu_conv = Result_NonceDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_NonceDecodeErrorZ in the error state. + */ + public static Result_NonceDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_NonceDecodeErrorZ_err(e.ptr); + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NonceDecodeErrorZ ret_hu_conv = Result_NonceDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_NonceDecodeErrorZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_NonceDecodeErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_NonceDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_NonceDecodeErrorZ clone() { + long ret = bindings.CResult_NonceDecodeErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NonceDecodeErrorZ ret_hu_conv = Result_NonceDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_NoneAPIErrorZ.java b/src/main/java/org/ldk/structs/Result_NoneAPIErrorZ.java index 9fa3dc42..e33289e9 100644 --- a/src/main/java/org/ldk/structs/Result_NoneAPIErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NoneAPIErrorZ.java @@ -59,7 +59,6 @@ public class Result_NoneAPIErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_NoneLightningErrorZ.java b/src/main/java/org/ldk/structs/Result_NoneLightningErrorZ.java index ee0d03f4..ba27cc9b 100644 --- a/src/main/java/org/ldk/structs/Result_NoneLightningErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NoneLightningErrorZ.java @@ -59,7 +59,6 @@ public class Result_NoneLightningErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_NonePaymentSendFailureZ.java b/src/main/java/org/ldk/structs/Result_NonePaymentSendFailureZ.java index 7a07c131..a6903026 100644 --- a/src/main/java/org/ldk/structs/Result_NonePaymentSendFailureZ.java +++ b/src/main/java/org/ldk/structs/Result_NonePaymentSendFailureZ.java @@ -59,7 +59,6 @@ public class Result_NonePaymentSendFailureZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_NonePeerHandleErrorZ.java b/src/main/java/org/ldk/structs/Result_NonePeerHandleErrorZ.java index 30987513..fe8250bc 100644 --- a/src/main/java/org/ldk/structs/Result_NonePeerHandleErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NonePeerHandleErrorZ.java @@ -59,7 +59,6 @@ public class Result_NonePeerHandleErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_NonePeerHandleErrorZ ret_hu_conv = Result_NonePeerHandleErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_NoneReplayEventZ.java b/src/main/java/org/ldk/structs/Result_NoneReplayEventZ.java new file mode 100644 index 00000000..135f8731 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_NoneReplayEventZ.java @@ -0,0 +1,92 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + +public class Result_NoneReplayEventZ extends CommonBase { + private Result_NoneReplayEventZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_NoneReplayEventZ_free(ptr); } super.finalize(); + } + + protected void force_free() { + if (ptr != 0) { bindings.CResult_NoneReplayEventZ_free(ptr); ptr = 0; } + } + + static Result_NoneReplayEventZ constr_from_ptr(long ptr) { + if (bindings.CResult_NoneReplayEventZ_is_ok(ptr)) { + return new Result_NoneReplayEventZ_OK(null, ptr); + } else { + return new Result_NoneReplayEventZ_Err(null, ptr); + } + } + public static final class Result_NoneReplayEventZ_OK extends Result_NoneReplayEventZ { + private Result_NoneReplayEventZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + } + } + + public static final class Result_NoneReplayEventZ_Err extends Result_NoneReplayEventZ { + public final ReplayEvent err; + private Result_NoneReplayEventZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.CResult_NoneReplayEventZ_get_err(ptr); + org.ldk.structs.ReplayEvent err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.ReplayEvent(null, err); } + if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_NoneReplayEventZ in the success state. + */ + public static Result_NoneReplayEventZ ok() { + long ret = bindings.CResult_NoneReplayEventZ_ok(); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneReplayEventZ ret_hu_conv = Result_NoneReplayEventZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_NoneReplayEventZ in the error state. + */ + public static Result_NoneReplayEventZ err(org.ldk.structs.ReplayEvent e) { + long ret = bindings.CResult_NoneReplayEventZ_err(e.ptr); + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneReplayEventZ ret_hu_conv = Result_NoneReplayEventZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_NoneReplayEventZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_NoneReplayEventZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_NoneReplayEventZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_NoneReplayEventZ clone() { + long ret = bindings.CResult_NoneReplayEventZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneReplayEventZ ret_hu_conv = Result_NoneReplayEventZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_NoneSendErrorZ.java b/src/main/java/org/ldk/structs/Result_NoneSendErrorZ.java new file mode 100644 index 00000000..1783a0aa --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_NoneSendErrorZ.java @@ -0,0 +1,92 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + +public class Result_NoneSendErrorZ extends CommonBase { + private Result_NoneSendErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_NoneSendErrorZ_free(ptr); } super.finalize(); + } + + protected void force_free() { + if (ptr != 0) { bindings.CResult_NoneSendErrorZ_free(ptr); ptr = 0; } + } + + static Result_NoneSendErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_NoneSendErrorZ_is_ok(ptr)) { + return new Result_NoneSendErrorZ_OK(null, ptr); + } else { + return new Result_NoneSendErrorZ_Err(null, ptr); + } + } + public static final class Result_NoneSendErrorZ_OK extends Result_NoneSendErrorZ { + private Result_NoneSendErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + } + } + + public static final class Result_NoneSendErrorZ_Err extends Result_NoneSendErrorZ { + public final SendError err; + private Result_NoneSendErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.CResult_NoneSendErrorZ_get_err(ptr); + org.ldk.structs.SendError err_hu_conv = org.ldk.structs.SendError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_NoneSendErrorZ in the success state. + */ + public static Result_NoneSendErrorZ ok() { + long ret = bindings.CResult_NoneSendErrorZ_ok(); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneSendErrorZ ret_hu_conv = Result_NoneSendErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_NoneSendErrorZ in the error state. + */ + public static Result_NoneSendErrorZ err(org.ldk.structs.SendError e) { + long ret = bindings.CResult_NoneSendErrorZ_err(e.ptr); + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneSendErrorZ ret_hu_conv = Result_NoneSendErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_NoneSendErrorZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_NoneSendErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_NoneSendErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_NoneSendErrorZ clone() { + long ret = bindings.CResult_NoneSendErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneSendErrorZ ret_hu_conv = Result_NoneSendErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_OfferBolt12ParseErrorZ.java b/src/main/java/org/ldk/structs/Result_OfferBolt12ParseErrorZ.java index 1727c94f..59a9e74c 100644 --- a/src/main/java/org/ldk/structs/Result_OfferBolt12ParseErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_OfferBolt12ParseErrorZ.java @@ -54,7 +54,6 @@ public class Result_OfferBolt12ParseErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_OfferBolt12ParseErrorZ ret_hu_conv = Result_OfferBolt12ParseErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_OfferBolt12ParseErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_OfferBolt12ParseErrorZ ret_hu_conv = Result_OfferBolt12ParseErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_OfferBolt12SemanticErrorZ.java b/src/main/java/org/ldk/structs/Result_OfferBolt12SemanticErrorZ.java index a4d28603..75a2f34e 100644 --- a/src/main/java/org/ldk/structs/Result_OfferBolt12SemanticErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_OfferBolt12SemanticErrorZ.java @@ -51,7 +51,6 @@ public class Result_OfferBolt12SemanticErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_OfferBolt12SemanticErrorZ ret_hu_conv = Result_OfferBolt12SemanticErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_OfferDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_OfferDecodeErrorZ.java new file mode 100644 index 00000000..21742d27 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_OfferDecodeErrorZ.java @@ -0,0 +1,98 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + +public class Result_OfferDecodeErrorZ extends CommonBase { + private Result_OfferDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_OfferDecodeErrorZ_free(ptr); } super.finalize(); + } + + protected void force_free() { + if (ptr != 0) { bindings.CResult_OfferDecodeErrorZ_free(ptr); ptr = 0; } + } + + static Result_OfferDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_OfferDecodeErrorZ_is_ok(ptr)) { + return new Result_OfferDecodeErrorZ_OK(null, ptr); + } else { + return new Result_OfferDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_OfferDecodeErrorZ_OK extends Result_OfferDecodeErrorZ { + public final Offer res; + private Result_OfferDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.CResult_OfferDecodeErrorZ_get_ok(ptr); + org.ldk.structs.Offer res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.Offer(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; + this.res = res_hu_conv; + } + } + + public static final class Result_OfferDecodeErrorZ_Err extends Result_OfferDecodeErrorZ { + public final DecodeError err; + private Result_OfferDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.CResult_OfferDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_OfferDecodeErrorZ in the success state. + */ + public static Result_OfferDecodeErrorZ ok(org.ldk.structs.Offer o) { + long ret = bindings.CResult_OfferDecodeErrorZ_ok(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OfferDecodeErrorZ ret_hu_conv = Result_OfferDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_OfferDecodeErrorZ in the error state. + */ + public static Result_OfferDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_OfferDecodeErrorZ_err(e.ptr); + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OfferDecodeErrorZ ret_hu_conv = Result_OfferDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_OfferDecodeErrorZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_OfferDecodeErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_OfferDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_OfferDecodeErrorZ clone() { + long ret = bindings.CResult_OfferDecodeErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OfferDecodeErrorZ ret_hu_conv = Result_OfferDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_OfferIdDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_OfferIdDecodeErrorZ.java index 863fa6df..9628a81f 100644 --- a/src/main/java/org/ldk/structs/Result_OfferIdDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_OfferIdDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_OfferIdDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_OfferIdDecodeErrorZ ret_hu_conv = Result_OfferIdDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_OfferIdDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_OfferIdDecodeErrorZ ret_hu_conv = Result_OfferIdDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ.java b/src/main/java/org/ldk/structs/Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ.java index 714a9d5f..4a123a5d 100644 --- a/src/main/java/org/ldk/structs/Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ.java @@ -51,7 +51,6 @@ public class Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ extends Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ ret_hu_conv = Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_OffersContextDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_OffersContextDecodeErrorZ.java new file mode 100644 index 00000000..658e556c --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_OffersContextDecodeErrorZ.java @@ -0,0 +1,98 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + +public class Result_OffersContextDecodeErrorZ extends CommonBase { + private Result_OffersContextDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_OffersContextDecodeErrorZ_free(ptr); } super.finalize(); + } + + protected void force_free() { + if (ptr != 0) { bindings.CResult_OffersContextDecodeErrorZ_free(ptr); ptr = 0; } + } + + static Result_OffersContextDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_OffersContextDecodeErrorZ_is_ok(ptr)) { + return new Result_OffersContextDecodeErrorZ_OK(null, ptr); + } else { + return new Result_OffersContextDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_OffersContextDecodeErrorZ_OK extends Result_OffersContextDecodeErrorZ { + public final OffersContext res; + private Result_OffersContextDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.CResult_OffersContextDecodeErrorZ_get_ok(ptr); + org.ldk.structs.OffersContext res_hu_conv = org.ldk.structs.OffersContext.constr_from_ptr(res); + if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; + this.res = res_hu_conv; + } + } + + public static final class Result_OffersContextDecodeErrorZ_Err extends Result_OffersContextDecodeErrorZ { + public final DecodeError err; + private Result_OffersContextDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.CResult_OffersContextDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_OffersContextDecodeErrorZ in the success state. + */ + public static Result_OffersContextDecodeErrorZ ok(org.ldk.structs.OffersContext o) { + long ret = bindings.CResult_OffersContextDecodeErrorZ_ok(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OffersContextDecodeErrorZ ret_hu_conv = Result_OffersContextDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_OffersContextDecodeErrorZ in the error state. + */ + public static Result_OffersContextDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_OffersContextDecodeErrorZ_err(e.ptr); + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OffersContextDecodeErrorZ ret_hu_conv = Result_OffersContextDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_OffersContextDecodeErrorZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_OffersContextDecodeErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_OffersContextDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_OffersContextDecodeErrorZ clone() { + long ret = bindings.CResult_OffersContextDecodeErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OffersContextDecodeErrorZ ret_hu_conv = Result_OffersContextDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_OffersMessageDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_OffersMessageDecodeErrorZ.java index 498447ad..2ca4b762 100644 --- a/src/main/java/org/ldk/structs/Result_OffersMessageDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_OffersMessageDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_OffersMessageDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_OffersMessageDecodeErrorZ ret_hu_conv = Result_OffersMessageDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_OffersMessageDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_OffersMessageDecodeErrorZ ret_hu_conv = Result_OffersMessageDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_OnionMessageDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_OnionMessageDecodeErrorZ.java index 597160e8..e639f663 100644 --- a/src/main/java/org/ldk/structs/Result_OnionMessageDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_OnionMessageDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_OnionMessageDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_OnionMessageDecodeErrorZ ret_hu_conv = Result_OnionMessageDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_OnionMessageDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_OnionMessageDecodeErrorZ ret_hu_conv = Result_OnionMessageDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_OnionMessagePathNoneZ.java b/src/main/java/org/ldk/structs/Result_OnionMessagePathNoneZ.java index 3e5d72fd..d0c7672a 100644 --- a/src/main/java/org/ldk/structs/Result_OnionMessagePathNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_OnionMessagePathNoneZ.java @@ -49,7 +49,6 @@ public class Result_OnionMessagePathNoneZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_OnionMessagePathNoneZ ret_hu_conv = Result_OnionMessagePathNoneZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_OnionPacketDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_OnionPacketDecodeErrorZ.java index c352b0b5..e16995ba 100644 --- a/src/main/java/org/ldk/structs/Result_OnionPacketDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_OnionPacketDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_OnionPacketDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_OnionPacketDecodeErrorZ ret_hu_conv = Result_OnionPacketDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_OnionPacketDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_OnionPacketDecodeErrorZ ret_hu_conv = Result_OnionPacketDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_OpenChannelDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_OpenChannelDecodeErrorZ.java index 78ffd06a..f2881b4b 100644 --- a/src/main/java/org/ldk/structs/Result_OpenChannelDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_OpenChannelDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_OpenChannelDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_OpenChannelDecodeErrorZ ret_hu_conv = Result_OpenChannelDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_OpenChannelDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_OpenChannelDecodeErrorZ ret_hu_conv = Result_OpenChannelDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_OpenChannelV2DecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_OpenChannelV2DecodeErrorZ.java index 44b428d5..48fd971d 100644 --- a/src/main/java/org/ldk/structs/Result_OpenChannelV2DecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_OpenChannelV2DecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_OpenChannelV2DecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_OpenChannelV2DecodeErrorZ ret_hu_conv = Result_OpenChannelV2DecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_OpenChannelV2DecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_OpenChannelV2DecodeErrorZ ret_hu_conv = Result_OpenChannelV2DecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_OutPointDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_OutPointDecodeErrorZ.java index ec68f22c..4d75b3e5 100644 --- a/src/main/java/org/ldk/structs/Result_OutPointDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_OutPointDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_OutPointDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_OutPointDecodeErrorZ ret_hu_conv = Result_OutPointDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_OutPointDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_OutPointDecodeErrorZ ret_hu_conv = Result_OutPointDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_OutboundHTLCDetailsDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_OutboundHTLCDetailsDecodeErrorZ.java index bc4ff218..da64ca2b 100644 --- a/src/main/java/org/ldk/structs/Result_OutboundHTLCDetailsDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_OutboundHTLCDetailsDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_OutboundHTLCDetailsDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_OutboundHTLCDetailsDecodeErrorZ ret_hu_conv = Result_OutboundHTLCDetailsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_OutboundHTLCDetailsDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_OutboundHTLCDetailsDecodeErrorZ ret_hu_conv = Result_OutboundHTLCDetailsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_OutputSpendStatusDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_OutputSpendStatusDecodeErrorZ.java index 8a1f1974..2d252a6a 100644 --- a/src/main/java/org/ldk/structs/Result_OutputSpendStatusDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_OutputSpendStatusDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_OutputSpendStatusDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_OutputSpendStatusDecodeErrorZ ret_hu_conv = Result_OutputSpendStatusDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_OutputSpendStatusDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_OutputSpendStatusDecodeErrorZ ret_hu_conv = Result_OutputSpendStatusDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_OutputSweeperDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_OutputSweeperDecodeErrorZ.java index a1ebaa4b..a653cee9 100644 --- a/src/main/java/org/ldk/structs/Result_OutputSweeperDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_OutputSweeperDecodeErrorZ.java @@ -61,7 +61,7 @@ public class Result_OutputSweeperDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o_logger); if (ret >= 0 && ret <= 4096) { return null; } Result_OutputSweeperDecodeErrorZ ret_hu_conv = Result_OutputSweeperDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o_best_block); }; + ; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o_broadcaster); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o_fee_estimator); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o_chain_data_source); }; @@ -80,7 +80,6 @@ public class Result_OutputSweeperDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_OutputSweeperDecodeErrorZ ret_hu_conv = Result_OutputSweeperDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_PayeePubKeySecp256k1ErrorZ.java b/src/main/java/org/ldk/structs/Result_PayeePubKeySecp256k1ErrorZ.java index ab4f5434..5f22f97e 100644 --- a/src/main/java/org/ldk/structs/Result_PayeePubKeySecp256k1ErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PayeePubKeySecp256k1ErrorZ.java @@ -51,7 +51,6 @@ public class Result_PayeePubKeySecp256k1ErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PayeePubKeySecp256k1ErrorZ ret_hu_conv = Result_PayeePubKeySecp256k1ErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_PaymentConstraintsDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_PaymentConstraintsDecodeErrorZ.java index b7558b76..a36bae62 100644 --- a/src/main/java/org/ldk/structs/Result_PaymentConstraintsDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PaymentConstraintsDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_PaymentConstraintsDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentConstraintsDecodeErrorZ ret_hu_conv = Result_PaymentConstraintsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_PaymentConstraintsDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentConstraintsDecodeErrorZ ret_hu_conv = Result_PaymentConstraintsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_PaymentContextDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_PaymentContextDecodeErrorZ.java index 6d52c315..c5927dc6 100644 --- a/src/main/java/org/ldk/structs/Result_PaymentContextDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PaymentContextDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_PaymentContextDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentContextDecodeErrorZ ret_hu_conv = Result_PaymentContextDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_PaymentContextDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentContextDecodeErrorZ ret_hu_conv = Result_PaymentContextDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_PaymentFailureReasonDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_PaymentFailureReasonDecodeErrorZ.java deleted file mode 100644 index e46a155b..00000000 --- a/src/main/java/org/ldk/structs/Result_PaymentFailureReasonDecodeErrorZ.java +++ /dev/null @@ -1,96 +0,0 @@ -package org.ldk.structs; - -import org.ldk.impl.bindings; -import org.ldk.enums.*; -import org.ldk.util.*; -import java.util.Arrays; -import java.lang.ref.Reference; -import javax.annotation.Nullable; - -public class Result_PaymentFailureReasonDecodeErrorZ extends CommonBase { - private Result_PaymentFailureReasonDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } - protected void finalize() throws Throwable { - if (ptr != 0) { bindings.CResult_PaymentFailureReasonDecodeErrorZ_free(ptr); } super.finalize(); - } - - protected void force_free() { - if (ptr != 0) { bindings.CResult_PaymentFailureReasonDecodeErrorZ_free(ptr); ptr = 0; } - } - - static Result_PaymentFailureReasonDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.CResult_PaymentFailureReasonDecodeErrorZ_is_ok(ptr)) { - return new Result_PaymentFailureReasonDecodeErrorZ_OK(null, ptr); - } else { - return new Result_PaymentFailureReasonDecodeErrorZ_Err(null, ptr); - } - } - public static final class Result_PaymentFailureReasonDecodeErrorZ_OK extends Result_PaymentFailureReasonDecodeErrorZ { - public final PaymentFailureReason res; - private Result_PaymentFailureReasonDecodeErrorZ_OK(Object _dummy, long ptr) { - super(_dummy, ptr); - this.res = bindings.CResult_PaymentFailureReasonDecodeErrorZ_get_ok(ptr); - } - } - - public static final class Result_PaymentFailureReasonDecodeErrorZ_Err extends Result_PaymentFailureReasonDecodeErrorZ { - public final DecodeError err; - private Result_PaymentFailureReasonDecodeErrorZ_Err(Object _dummy, long ptr) { - super(_dummy, ptr); - long err = bindings.CResult_PaymentFailureReasonDecodeErrorZ_get_err(ptr); - org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); - if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); }; - this.err = err_hu_conv; - } - } - - /** - * Creates a new CResult_PaymentFailureReasonDecodeErrorZ in the success state. - */ - public static Result_PaymentFailureReasonDecodeErrorZ ok(org.ldk.enums.PaymentFailureReason o) { - long ret = bindings.CResult_PaymentFailureReasonDecodeErrorZ_ok(o); - Reference.reachabilityFence(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_PaymentFailureReasonDecodeErrorZ ret_hu_conv = Result_PaymentFailureReasonDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Creates a new CResult_PaymentFailureReasonDecodeErrorZ in the error state. - */ - public static Result_PaymentFailureReasonDecodeErrorZ err(org.ldk.structs.DecodeError e) { - long ret = bindings.CResult_PaymentFailureReasonDecodeErrorZ_err(e.ptr); - Reference.reachabilityFence(e); - if (ret >= 0 && ret <= 4096) { return null; } - Result_PaymentFailureReasonDecodeErrorZ ret_hu_conv = Result_PaymentFailureReasonDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; - return ret_hu_conv; - } - - /** - * Checks if the given object is currently in the success state - */ - public boolean is_ok() { - boolean ret = bindings.CResult_PaymentFailureReasonDecodeErrorZ_is_ok(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - long clone_ptr() { - long ret = bindings.CResult_PaymentFailureReasonDecodeErrorZ_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Creates a new CResult_PaymentFailureReasonDecodeErrorZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_PaymentFailureReasonDecodeErrorZ clone() { - long ret = bindings.CResult_PaymentFailureReasonDecodeErrorZ_clone(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_PaymentFailureReasonDecodeErrorZ ret_hu_conv = Result_PaymentFailureReasonDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} diff --git a/src/main/java/org/ldk/structs/Result_PaymentParametersDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_PaymentParametersDecodeErrorZ.java index 014eb046..6cb921cb 100644 --- a/src/main/java/org/ldk/structs/Result_PaymentParametersDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PaymentParametersDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_PaymentParametersDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentParametersDecodeErrorZ ret_hu_conv = Result_PaymentParametersDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_PaymentParametersDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentParametersDecodeErrorZ ret_hu_conv = Result_PaymentParametersDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_PaymentPurposeDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_PaymentPurposeDecodeErrorZ.java index 36905ddf..fa370332 100644 --- a/src/main/java/org/ldk/structs/Result_PaymentPurposeDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PaymentPurposeDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_PaymentPurposeDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentPurposeDecodeErrorZ ret_hu_conv = Result_PaymentPurposeDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_PaymentPurposeDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentPurposeDecodeErrorZ ret_hu_conv = Result_PaymentPurposeDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_PaymentRelayDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_PaymentRelayDecodeErrorZ.java index 482c209c..2a6d442c 100644 --- a/src/main/java/org/ldk/structs/Result_PaymentRelayDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PaymentRelayDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_PaymentRelayDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentRelayDecodeErrorZ ret_hu_conv = Result_PaymentRelayDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_PaymentRelayDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentRelayDecodeErrorZ ret_hu_conv = Result_PaymentRelayDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_PendingHTLCInfoDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_PendingHTLCInfoDecodeErrorZ.java index 6e100392..61a7b0f7 100644 --- a/src/main/java/org/ldk/structs/Result_PendingHTLCInfoDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PendingHTLCInfoDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_PendingHTLCInfoDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PendingHTLCInfoDecodeErrorZ ret_hu_conv = Result_PendingHTLCInfoDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_PendingHTLCInfoDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_PendingHTLCInfoDecodeErrorZ ret_hu_conv = Result_PendingHTLCInfoDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_PendingHTLCInfoInboundHTLCErrZ.java b/src/main/java/org/ldk/structs/Result_PendingHTLCInfoInboundHTLCErrZ.java index 77402cb3..1972f6e3 100644 --- a/src/main/java/org/ldk/structs/Result_PendingHTLCInfoInboundHTLCErrZ.java +++ b/src/main/java/org/ldk/structs/Result_PendingHTLCInfoInboundHTLCErrZ.java @@ -54,7 +54,6 @@ public class Result_PendingHTLCInfoInboundHTLCErrZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PendingHTLCInfoInboundHTLCErrZ ret_hu_conv = Result_PendingHTLCInfoInboundHTLCErrZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_PendingHTLCInfoInboundHTLCErrZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_PendingHTLCInfoInboundHTLCErrZ ret_hu_conv = Result_PendingHTLCInfoInboundHTLCErrZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_PendingHTLCRoutingDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_PendingHTLCRoutingDecodeErrorZ.java index fab60787..66c4ab99 100644 --- a/src/main/java/org/ldk/structs/Result_PendingHTLCRoutingDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PendingHTLCRoutingDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_PendingHTLCRoutingDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PendingHTLCRoutingDecodeErrorZ ret_hu_conv = Result_PendingHTLCRoutingDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_PendingHTLCRoutingDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_PendingHTLCRoutingDecodeErrorZ ret_hu_conv = Result_PendingHTLCRoutingDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_PhantomRouteHintsDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_PhantomRouteHintsDecodeErrorZ.java index 6f3910e6..c629578f 100644 --- a/src/main/java/org/ldk/structs/Result_PhantomRouteHintsDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PhantomRouteHintsDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_PhantomRouteHintsDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PhantomRouteHintsDecodeErrorZ ret_hu_conv = Result_PhantomRouteHintsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_PhantomRouteHintsDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_PhantomRouteHintsDecodeErrorZ ret_hu_conv = Result_PhantomRouteHintsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_PingDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_PingDecodeErrorZ.java index f175e020..79792a5d 100644 --- a/src/main/java/org/ldk/structs/Result_PingDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PingDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_PingDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PingDecodeErrorZ ret_hu_conv = Result_PingDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_PingDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_PingDecodeErrorZ ret_hu_conv = Result_PingDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_PongDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_PongDecodeErrorZ.java index a25d8560..e22e627a 100644 --- a/src/main/java/org/ldk/structs/Result_PongDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PongDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_PongDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PongDecodeErrorZ ret_hu_conv = Result_PongDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_PongDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_PongDecodeErrorZ ret_hu_conv = Result_PongDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_PositiveTimestampCreationErrorZ.java b/src/main/java/org/ldk/structs/Result_PositiveTimestampCreationErrorZ.java index d52ed203..cb5c98d8 100644 --- a/src/main/java/org/ldk/structs/Result_PositiveTimestampCreationErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PositiveTimestampCreationErrorZ.java @@ -51,7 +51,6 @@ public class Result_PositiveTimestampCreationErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PositiveTimestampCreationErrorZ ret_hu_conv = Result_PositiveTimestampCreationErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_PrivateRouteCreationErrorZ.java b/src/main/java/org/ldk/structs/Result_PrivateRouteCreationErrorZ.java index 40d19ab1..2b8563f7 100644 --- a/src/main/java/org/ldk/structs/Result_PrivateRouteCreationErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PrivateRouteCreationErrorZ.java @@ -51,7 +51,6 @@ public class Result_PrivateRouteCreationErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PrivateRouteCreationErrorZ ret_hu_conv = Result_PrivateRouteCreationErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ProbabilisticScorerDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ProbabilisticScorerDecodeErrorZ.java index 8ec63d24..deb27a2f 100644 --- a/src/main/java/org/ldk/structs/Result_ProbabilisticScorerDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ProbabilisticScorerDecodeErrorZ.java @@ -56,7 +56,7 @@ public class Result_ProbabilisticScorerDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o_logger); if (ret >= 0 && ret <= 4096) { return null; } Result_ProbabilisticScorerDecodeErrorZ ret_hu_conv = Result_ProbabilisticScorerDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o_decay_params); }; + ; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o_network_graph); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o_logger); }; return ret_hu_conv; @@ -70,7 +70,6 @@ public class Result_ProbabilisticScorerDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ProbabilisticScorerDecodeErrorZ ret_hu_conv = Result_ProbabilisticScorerDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.java index e2032c15..ba0c8d14 100644 --- a/src/main/java/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_QueryChannelRangeDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_QueryChannelRangeDecodeErrorZ ret_hu_conv = Result_QueryChannelRangeDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_QueryChannelRangeDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_QueryChannelRangeDecodeErrorZ ret_hu_conv = Result_QueryChannelRangeDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.java index 6096c479..48a7762a 100644 --- a/src/main/java/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_QueryShortChannelIdsDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_QueryShortChannelIdsDecodeErrorZ ret_hu_conv = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_QueryShortChannelIdsDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_QueryShortChannelIdsDecodeErrorZ ret_hu_conv = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_RecipientOnionFieldsDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RecipientOnionFieldsDecodeErrorZ.java index 078ef6d5..1368b9e1 100644 --- a/src/main/java/org/ldk/structs/Result_RecipientOnionFieldsDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RecipientOnionFieldsDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_RecipientOnionFieldsDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RecipientOnionFieldsDecodeErrorZ ret_hu_conv = Result_RecipientOnionFieldsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_RecipientOnionFieldsDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_RecipientOnionFieldsDecodeErrorZ ret_hu_conv = Result_RecipientOnionFieldsDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_RecipientOnionFieldsNoneZ.java b/src/main/java/org/ldk/structs/Result_RecipientOnionFieldsNoneZ.java index 9320d6a0..3febfce0 100644 --- a/src/main/java/org/ldk/structs/Result_RecipientOnionFieldsNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_RecipientOnionFieldsNoneZ.java @@ -49,7 +49,6 @@ public class Result_RecipientOnionFieldsNoneZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RecipientOnionFieldsNoneZ ret_hu_conv = Result_RecipientOnionFieldsNoneZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_RefundBolt12ParseErrorZ.java b/src/main/java/org/ldk/structs/Result_RefundBolt12ParseErrorZ.java index 5f63d024..2aa4a413 100644 --- a/src/main/java/org/ldk/structs/Result_RefundBolt12ParseErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RefundBolt12ParseErrorZ.java @@ -54,7 +54,6 @@ public class Result_RefundBolt12ParseErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RefundBolt12ParseErrorZ ret_hu_conv = Result_RefundBolt12ParseErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_RefundBolt12ParseErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_RefundBolt12ParseErrorZ ret_hu_conv = Result_RefundBolt12ParseErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_RefundBolt12SemanticErrorZ.java b/src/main/java/org/ldk/structs/Result_RefundBolt12SemanticErrorZ.java index 731608dc..8f5c073b 100644 --- a/src/main/java/org/ldk/structs/Result_RefundBolt12SemanticErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RefundBolt12SemanticErrorZ.java @@ -51,7 +51,6 @@ public class Result_RefundBolt12SemanticErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RefundBolt12SemanticErrorZ ret_hu_conv = Result_RefundBolt12SemanticErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_RefundDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RefundDecodeErrorZ.java new file mode 100644 index 00000000..b419a01f --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_RefundDecodeErrorZ.java @@ -0,0 +1,98 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + +public class Result_RefundDecodeErrorZ extends CommonBase { + private Result_RefundDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_RefundDecodeErrorZ_free(ptr); } super.finalize(); + } + + protected void force_free() { + if (ptr != 0) { bindings.CResult_RefundDecodeErrorZ_free(ptr); ptr = 0; } + } + + static Result_RefundDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_RefundDecodeErrorZ_is_ok(ptr)) { + return new Result_RefundDecodeErrorZ_OK(null, ptr); + } else { + return new Result_RefundDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_RefundDecodeErrorZ_OK extends Result_RefundDecodeErrorZ { + public final Refund res; + private Result_RefundDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.CResult_RefundDecodeErrorZ_get_ok(ptr); + org.ldk.structs.Refund res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.Refund(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; + this.res = res_hu_conv; + } + } + + public static final class Result_RefundDecodeErrorZ_Err extends Result_RefundDecodeErrorZ { + public final DecodeError err; + private Result_RefundDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.CResult_RefundDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_RefundDecodeErrorZ in the success state. + */ + public static Result_RefundDecodeErrorZ ok(org.ldk.structs.Refund o) { + long ret = bindings.CResult_RefundDecodeErrorZ_ok(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_RefundDecodeErrorZ ret_hu_conv = Result_RefundDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_RefundDecodeErrorZ in the error state. + */ + public static Result_RefundDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_RefundDecodeErrorZ_err(e.ptr); + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_RefundDecodeErrorZ ret_hu_conv = Result_RefundDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_RefundDecodeErrorZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_RefundDecodeErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_RefundDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_RefundDecodeErrorZ clone() { + long ret = bindings.CResult_RefundDecodeErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_RefundDecodeErrorZ ret_hu_conv = Result_RefundDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ.java b/src/main/java/org/ldk/structs/Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ.java index 21cb7681..ccd4f9fd 100644 --- a/src/main/java/org/ldk/structs/Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ.java @@ -51,7 +51,6 @@ public class Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ ex Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ ret_hu_conv = Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ReleaseHeldHtlcDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ReleaseHeldHtlcDecodeErrorZ.java new file mode 100644 index 00000000..6b4b676c --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_ReleaseHeldHtlcDecodeErrorZ.java @@ -0,0 +1,98 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + +public class Result_ReleaseHeldHtlcDecodeErrorZ extends CommonBase { + private Result_ReleaseHeldHtlcDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_ReleaseHeldHtlcDecodeErrorZ_free(ptr); } super.finalize(); + } + + protected void force_free() { + if (ptr != 0) { bindings.CResult_ReleaseHeldHtlcDecodeErrorZ_free(ptr); ptr = 0; } + } + + static Result_ReleaseHeldHtlcDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_ReleaseHeldHtlcDecodeErrorZ_is_ok(ptr)) { + return new Result_ReleaseHeldHtlcDecodeErrorZ_OK(null, ptr); + } else { + return new Result_ReleaseHeldHtlcDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_ReleaseHeldHtlcDecodeErrorZ_OK extends Result_ReleaseHeldHtlcDecodeErrorZ { + public final ReleaseHeldHtlc res; + private Result_ReleaseHeldHtlcDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.CResult_ReleaseHeldHtlcDecodeErrorZ_get_ok(ptr); + org.ldk.structs.ReleaseHeldHtlc res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.ReleaseHeldHtlc(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; + this.res = res_hu_conv; + } + } + + public static final class Result_ReleaseHeldHtlcDecodeErrorZ_Err extends Result_ReleaseHeldHtlcDecodeErrorZ { + public final DecodeError err; + private Result_ReleaseHeldHtlcDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.CResult_ReleaseHeldHtlcDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_ReleaseHeldHtlcDecodeErrorZ in the success state. + */ + public static Result_ReleaseHeldHtlcDecodeErrorZ ok(org.ldk.structs.ReleaseHeldHtlc o) { + long ret = bindings.CResult_ReleaseHeldHtlcDecodeErrorZ_ok(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ReleaseHeldHtlcDecodeErrorZ ret_hu_conv = Result_ReleaseHeldHtlcDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_ReleaseHeldHtlcDecodeErrorZ in the error state. + */ + public static Result_ReleaseHeldHtlcDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_ReleaseHeldHtlcDecodeErrorZ_err(e.ptr); + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ReleaseHeldHtlcDecodeErrorZ ret_hu_conv = Result_ReleaseHeldHtlcDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_ReleaseHeldHtlcDecodeErrorZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_ReleaseHeldHtlcDecodeErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_ReleaseHeldHtlcDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_ReleaseHeldHtlcDecodeErrorZ clone() { + long ret = bindings.CResult_ReleaseHeldHtlcDecodeErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ReleaseHeldHtlcDecodeErrorZ ret_hu_conv = Result_ReleaseHeldHtlcDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.java index cd3309cc..4e2651f7 100644 --- a/src/main/java/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_ReplyChannelRangeDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ReplyChannelRangeDecodeErrorZ ret_hu_conv = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_ReplyChannelRangeDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ReplyChannelRangeDecodeErrorZ ret_hu_conv = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.java index 9fb1474e..c94949a2 100644 --- a/src/main/java/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_ReplyShortChannelIdsEndDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ReplyShortChannelIdsEndDecodeErrorZ ret_hu_conv = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_ReplyShortChannelIdsEndDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ReplyShortChannelIdsEndDecodeErrorZ ret_hu_conv = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ResponderDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ResponderDecodeErrorZ.java new file mode 100644 index 00000000..cffed561 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_ResponderDecodeErrorZ.java @@ -0,0 +1,98 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + +public class Result_ResponderDecodeErrorZ extends CommonBase { + private Result_ResponderDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_ResponderDecodeErrorZ_free(ptr); } super.finalize(); + } + + protected void force_free() { + if (ptr != 0) { bindings.CResult_ResponderDecodeErrorZ_free(ptr); ptr = 0; } + } + + static Result_ResponderDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_ResponderDecodeErrorZ_is_ok(ptr)) { + return new Result_ResponderDecodeErrorZ_OK(null, ptr); + } else { + return new Result_ResponderDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_ResponderDecodeErrorZ_OK extends Result_ResponderDecodeErrorZ { + public final Responder res; + private Result_ResponderDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.CResult_ResponderDecodeErrorZ_get_ok(ptr); + org.ldk.structs.Responder res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.Responder(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; + this.res = res_hu_conv; + } + } + + public static final class Result_ResponderDecodeErrorZ_Err extends Result_ResponderDecodeErrorZ { + public final DecodeError err; + private Result_ResponderDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.CResult_ResponderDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_ResponderDecodeErrorZ in the success state. + */ + public static Result_ResponderDecodeErrorZ ok(org.ldk.structs.Responder o) { + long ret = bindings.CResult_ResponderDecodeErrorZ_ok(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ResponderDecodeErrorZ ret_hu_conv = Result_ResponderDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_ResponderDecodeErrorZ in the error state. + */ + public static Result_ResponderDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_ResponderDecodeErrorZ_err(e.ptr); + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ResponderDecodeErrorZ ret_hu_conv = Result_ResponderDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_ResponderDecodeErrorZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_ResponderDecodeErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_ResponderDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_ResponderDecodeErrorZ clone() { + long ret = bindings.CResult_ResponderDecodeErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ResponderDecodeErrorZ ret_hu_conv = Result_ResponderDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_RetryDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RetryDecodeErrorZ.java index e1d233bc..44b7c8a9 100644 --- a/src/main/java/org/ldk/structs/Result_RetryDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RetryDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_RetryDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RetryDecodeErrorZ ret_hu_conv = Result_RetryDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_RetryDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_RetryDecodeErrorZ ret_hu_conv = Result_RetryDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_RevocationBasepointDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RevocationBasepointDecodeErrorZ.java index 6ec454a9..0e4c444b 100644 --- a/src/main/java/org/ldk/structs/Result_RevocationBasepointDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RevocationBasepointDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_RevocationBasepointDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RevocationBasepointDecodeErrorZ ret_hu_conv = Result_RevocationBasepointDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_RevocationBasepointDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_RevocationBasepointDecodeErrorZ ret_hu_conv = Result_RevocationBasepointDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_RevocationKeyDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RevocationKeyDecodeErrorZ.java index 6bcda022..04306f51 100644 --- a/src/main/java/org/ldk/structs/Result_RevocationKeyDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RevocationKeyDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_RevocationKeyDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RevocationKeyDecodeErrorZ ret_hu_conv = Result_RevocationKeyDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_RevocationKeyDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_RevocationKeyDecodeErrorZ ret_hu_conv = Result_RevocationKeyDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_RevokeAndACKDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RevokeAndACKDecodeErrorZ.java index c4beddd7..4c30e392 100644 --- a/src/main/java/org/ldk/structs/Result_RevokeAndACKDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RevokeAndACKDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_RevokeAndACKDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RevokeAndACKDecodeErrorZ ret_hu_conv = Result_RevokeAndACKDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_RevokeAndACKDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_RevokeAndACKDecodeErrorZ ret_hu_conv = Result_RevokeAndACKDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_RouteDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RouteDecodeErrorZ.java index fdf4b95d..8ec745b4 100644 --- a/src/main/java/org/ldk/structs/Result_RouteDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RouteDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_RouteDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteDecodeErrorZ ret_hu_conv = Result_RouteDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_RouteDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteDecodeErrorZ ret_hu_conv = Result_RouteDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_RouteHintDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RouteHintDecodeErrorZ.java index 8791ca35..15a29471 100644 --- a/src/main/java/org/ldk/structs/Result_RouteHintDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RouteHintDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_RouteHintDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteHintDecodeErrorZ ret_hu_conv = Result_RouteHintDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_RouteHintDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteHintDecodeErrorZ ret_hu_conv = Result_RouteHintDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_RouteHintHopDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RouteHintHopDecodeErrorZ.java index 26a07c94..ae71c0ee 100644 --- a/src/main/java/org/ldk/structs/Result_RouteHintHopDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RouteHintHopDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_RouteHintHopDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteHintHopDecodeErrorZ ret_hu_conv = Result_RouteHintHopDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_RouteHintHopDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteHintHopDecodeErrorZ ret_hu_conv = Result_RouteHintHopDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_RouteHopDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RouteHopDecodeErrorZ.java index 83bca000..4f74c75a 100644 --- a/src/main/java/org/ldk/structs/Result_RouteHopDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RouteHopDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_RouteHopDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteHopDecodeErrorZ ret_hu_conv = Result_RouteHopDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_RouteHopDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteHopDecodeErrorZ ret_hu_conv = Result_RouteHopDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_RouteLightningErrorZ.java b/src/main/java/org/ldk/structs/Result_RouteLightningErrorZ.java index 8d0baba4..72761eb4 100644 --- a/src/main/java/org/ldk/structs/Result_RouteLightningErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RouteLightningErrorZ.java @@ -54,7 +54,6 @@ public class Result_RouteLightningErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_RouteLightningErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_RouteParametersDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RouteParametersDecodeErrorZ.java index 11c5fae1..568d47b5 100644 --- a/src/main/java/org/ldk/structs/Result_RouteParametersDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RouteParametersDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_RouteParametersDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteParametersDecodeErrorZ ret_hu_conv = Result_RouteParametersDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_RouteParametersDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteParametersDecodeErrorZ ret_hu_conv = Result_RouteParametersDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.java index 5b7e94ee..133637ab 100644 --- a/src/main/java/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_RoutingFeesDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RoutingFeesDecodeErrorZ ret_hu_conv = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_RoutingFeesDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_RoutingFeesDecodeErrorZ ret_hu_conv = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_SendSuccessSendErrorZ.java b/src/main/java/org/ldk/structs/Result_SendSuccessSendErrorZ.java index cd7260d5..d2853979 100644 --- a/src/main/java/org/ldk/structs/Result_SendSuccessSendErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_SendSuccessSendErrorZ.java @@ -54,7 +54,6 @@ public class Result_SendSuccessSendErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_SendSuccessSendErrorZ ret_hu_conv = Result_SendSuccessSendErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_SendSuccessSendErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_SendSuccessSendErrorZ ret_hu_conv = Result_SendSuccessSendErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ShutdownDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ShutdownDecodeErrorZ.java index 403a2002..4bc3308f 100644 --- a/src/main/java/org/ldk/structs/Result_ShutdownDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ShutdownDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_ShutdownDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ShutdownDecodeErrorZ ret_hu_conv = Result_ShutdownDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_ShutdownDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ShutdownDecodeErrorZ ret_hu_conv = Result_ShutdownDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ShutdownScriptDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ShutdownScriptDecodeErrorZ.java index 45ca0059..5b2222f9 100644 --- a/src/main/java/org/ldk/structs/Result_ShutdownScriptDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ShutdownScriptDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_ShutdownScriptDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ShutdownScriptDecodeErrorZ ret_hu_conv = Result_ShutdownScriptDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_ShutdownScriptDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ShutdownScriptDecodeErrorZ ret_hu_conv = Result_ShutdownScriptDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ShutdownScriptInvalidShutdownScriptZ.java b/src/main/java/org/ldk/structs/Result_ShutdownScriptInvalidShutdownScriptZ.java index dbaa23b4..07a562b6 100644 --- a/src/main/java/org/ldk/structs/Result_ShutdownScriptInvalidShutdownScriptZ.java +++ b/src/main/java/org/ldk/structs/Result_ShutdownScriptInvalidShutdownScriptZ.java @@ -54,7 +54,6 @@ public class Result_ShutdownScriptInvalidShutdownScriptZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ShutdownScriptInvalidShutdownScriptZ ret_hu_conv = Result_ShutdownScriptInvalidShutdownScriptZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_ShutdownScriptInvalidShutdownScriptZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ShutdownScriptInvalidShutdownScriptZ ret_hu_conv = Result_ShutdownScriptInvalidShutdownScriptZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ShutdownScriptNoneZ.java b/src/main/java/org/ldk/structs/Result_ShutdownScriptNoneZ.java index 6db73945..07e83156 100644 --- a/src/main/java/org/ldk/structs/Result_ShutdownScriptNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_ShutdownScriptNoneZ.java @@ -49,7 +49,6 @@ public class Result_ShutdownScriptNoneZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ShutdownScriptNoneZ ret_hu_conv = Result_ShutdownScriptNoneZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_SiPrefixBolt11ParseErrorZ.java b/src/main/java/org/ldk/structs/Result_SiPrefixBolt11ParseErrorZ.java index 3aea9dc9..312b71d0 100644 --- a/src/main/java/org/ldk/structs/Result_SiPrefixBolt11ParseErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_SiPrefixBolt11ParseErrorZ.java @@ -62,7 +62,6 @@ public class Result_SiPrefixBolt11ParseErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_SiPrefixBolt11ParseErrorZ ret_hu_conv = Result_SiPrefixBolt11ParseErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_SignedRawBolt11InvoiceBolt11ParseErrorZ.java b/src/main/java/org/ldk/structs/Result_SignedRawBolt11InvoiceBolt11ParseErrorZ.java index 4adaa1af..3c875773 100644 --- a/src/main/java/org/ldk/structs/Result_SignedRawBolt11InvoiceBolt11ParseErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_SignedRawBolt11InvoiceBolt11ParseErrorZ.java @@ -54,7 +54,6 @@ public class Result_SignedRawBolt11InvoiceBolt11ParseErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_SignedRawBolt11InvoiceBolt11ParseErrorZ ret_hu_conv = Result_SignedRawBolt11InvoiceBolt11ParseErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_SignedRawBolt11InvoiceBolt11ParseErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_SignedRawBolt11InvoiceBolt11ParseErrorZ ret_hu_conv = Result_SignedRawBolt11InvoiceBolt11ParseErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_SocketAddressDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_SocketAddressDecodeErrorZ.java index 271d4608..c84cb114 100644 --- a/src/main/java/org/ldk/structs/Result_SocketAddressDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_SocketAddressDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_SocketAddressDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_SocketAddressDecodeErrorZ ret_hu_conv = Result_SocketAddressDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_SocketAddressDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_SocketAddressDecodeErrorZ ret_hu_conv = Result_SocketAddressDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_SocketAddressSocketAddressParseErrorZ.java b/src/main/java/org/ldk/structs/Result_SocketAddressSocketAddressParseErrorZ.java index 99138640..1ca1084b 100644 --- a/src/main/java/org/ldk/structs/Result_SocketAddressSocketAddressParseErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_SocketAddressSocketAddressParseErrorZ.java @@ -51,7 +51,6 @@ public class Result_SocketAddressSocketAddressParseErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_SocketAddressSocketAddressParseErrorZ ret_hu_conv = Result_SocketAddressSocketAddressParseErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_SpendableOutputDescriptorDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_SpendableOutputDescriptorDecodeErrorZ.java index b352ab51..f658c939 100644 --- a/src/main/java/org/ldk/structs/Result_SpendableOutputDescriptorDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_SpendableOutputDescriptorDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_SpendableOutputDescriptorDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_SpendableOutputDescriptorDecodeErrorZ ret_hu_conv = Result_SpendableOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_SpendableOutputDescriptorDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_SpendableOutputDescriptorDecodeErrorZ ret_hu_conv = Result_SpendableOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_SpliceAckDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_SpliceAckDecodeErrorZ.java index 6ed42cc1..15d16604 100644 --- a/src/main/java/org/ldk/structs/Result_SpliceAckDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_SpliceAckDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_SpliceAckDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_SpliceAckDecodeErrorZ ret_hu_conv = Result_SpliceAckDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_SpliceAckDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_SpliceAckDecodeErrorZ ret_hu_conv = Result_SpliceAckDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_SpliceDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_SpliceDecodeErrorZ.java deleted file mode 100644 index 19bd2401..00000000 --- a/src/main/java/org/ldk/structs/Result_SpliceDecodeErrorZ.java +++ /dev/null @@ -1,100 +0,0 @@ -package org.ldk.structs; - -import org.ldk.impl.bindings; -import org.ldk.enums.*; -import org.ldk.util.*; -import java.util.Arrays; -import java.lang.ref.Reference; -import javax.annotation.Nullable; - -public class Result_SpliceDecodeErrorZ extends CommonBase { - private Result_SpliceDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } - protected void finalize() throws Throwable { - if (ptr != 0) { bindings.CResult_SpliceDecodeErrorZ_free(ptr); } super.finalize(); - } - - protected void force_free() { - if (ptr != 0) { bindings.CResult_SpliceDecodeErrorZ_free(ptr); ptr = 0; } - } - - static Result_SpliceDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.CResult_SpliceDecodeErrorZ_is_ok(ptr)) { - return new Result_SpliceDecodeErrorZ_OK(null, ptr); - } else { - return new Result_SpliceDecodeErrorZ_Err(null, ptr); - } - } - public static final class Result_SpliceDecodeErrorZ_OK extends Result_SpliceDecodeErrorZ { - public final Splice res; - private Result_SpliceDecodeErrorZ_OK(Object _dummy, long ptr) { - super(_dummy, ptr); - long res = bindings.CResult_SpliceDecodeErrorZ_get_ok(ptr); - org.ldk.structs.Splice res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.Splice(null, res); } - if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; - this.res = res_hu_conv; - } - } - - public static final class Result_SpliceDecodeErrorZ_Err extends Result_SpliceDecodeErrorZ { - public final DecodeError err; - private Result_SpliceDecodeErrorZ_Err(Object _dummy, long ptr) { - super(_dummy, ptr); - long err = bindings.CResult_SpliceDecodeErrorZ_get_err(ptr); - org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); - if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); }; - this.err = err_hu_conv; - } - } - - /** - * Creates a new CResult_SpliceDecodeErrorZ in the success state. - */ - public static Result_SpliceDecodeErrorZ ok(org.ldk.structs.Splice o) { - long ret = bindings.CResult_SpliceDecodeErrorZ_ok(o.ptr); - Reference.reachabilityFence(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_SpliceDecodeErrorZ ret_hu_conv = Result_SpliceDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; - return ret_hu_conv; - } - - /** - * Creates a new CResult_SpliceDecodeErrorZ in the error state. - */ - public static Result_SpliceDecodeErrorZ err(org.ldk.structs.DecodeError e) { - long ret = bindings.CResult_SpliceDecodeErrorZ_err(e.ptr); - Reference.reachabilityFence(e); - if (ret >= 0 && ret <= 4096) { return null; } - Result_SpliceDecodeErrorZ ret_hu_conv = Result_SpliceDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; - return ret_hu_conv; - } - - /** - * Checks if the given object is currently in the success state - */ - public boolean is_ok() { - boolean ret = bindings.CResult_SpliceDecodeErrorZ_is_ok(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - long clone_ptr() { - long ret = bindings.CResult_SpliceDecodeErrorZ_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Creates a new CResult_SpliceDecodeErrorZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_SpliceDecodeErrorZ clone() { - long ret = bindings.CResult_SpliceDecodeErrorZ_clone(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_SpliceDecodeErrorZ ret_hu_conv = Result_SpliceDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} diff --git a/src/main/java/org/ldk/structs/Result_SpliceInitDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_SpliceInitDecodeErrorZ.java new file mode 100644 index 00000000..8c21dae1 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_SpliceInitDecodeErrorZ.java @@ -0,0 +1,98 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + +public class Result_SpliceInitDecodeErrorZ extends CommonBase { + private Result_SpliceInitDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_SpliceInitDecodeErrorZ_free(ptr); } super.finalize(); + } + + protected void force_free() { + if (ptr != 0) { bindings.CResult_SpliceInitDecodeErrorZ_free(ptr); ptr = 0; } + } + + static Result_SpliceInitDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_SpliceInitDecodeErrorZ_is_ok(ptr)) { + return new Result_SpliceInitDecodeErrorZ_OK(null, ptr); + } else { + return new Result_SpliceInitDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_SpliceInitDecodeErrorZ_OK extends Result_SpliceInitDecodeErrorZ { + public final SpliceInit res; + private Result_SpliceInitDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.CResult_SpliceInitDecodeErrorZ_get_ok(ptr); + org.ldk.structs.SpliceInit res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.SpliceInit(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; + this.res = res_hu_conv; + } + } + + public static final class Result_SpliceInitDecodeErrorZ_Err extends Result_SpliceInitDecodeErrorZ { + public final DecodeError err; + private Result_SpliceInitDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.CResult_SpliceInitDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_SpliceInitDecodeErrorZ in the success state. + */ + public static Result_SpliceInitDecodeErrorZ ok(org.ldk.structs.SpliceInit o) { + long ret = bindings.CResult_SpliceInitDecodeErrorZ_ok(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_SpliceInitDecodeErrorZ ret_hu_conv = Result_SpliceInitDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_SpliceInitDecodeErrorZ in the error state. + */ + public static Result_SpliceInitDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_SpliceInitDecodeErrorZ_err(e.ptr); + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_SpliceInitDecodeErrorZ ret_hu_conv = Result_SpliceInitDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_SpliceInitDecodeErrorZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_SpliceInitDecodeErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_SpliceInitDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_SpliceInitDecodeErrorZ clone() { + long ret = bindings.CResult_SpliceInitDecodeErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_SpliceInitDecodeErrorZ ret_hu_conv = Result_SpliceInitDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_SpliceLockedDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_SpliceLockedDecodeErrorZ.java index 312c4241..938b4d7d 100644 --- a/src/main/java/org/ldk/structs/Result_SpliceLockedDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_SpliceLockedDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_SpliceLockedDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_SpliceLockedDecodeErrorZ ret_hu_conv = Result_SpliceLockedDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_SpliceLockedDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_SpliceLockedDecodeErrorZ ret_hu_conv = Result_SpliceLockedDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.java index 656c4a9a..9769d520 100644 --- a/src/main/java/org/ldk/structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_StaticPaymentOutputDescriptorDecodeErrorZ extends CommonBase Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_StaticPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_StaticPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_StaticPaymentOutputDescriptorDecodeErrorZ extends CommonBase Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_StaticPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_StaticPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_StfuDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_StfuDecodeErrorZ.java index 2fb2f029..43bc82f9 100644 --- a/src/main/java/org/ldk/structs/Result_StfuDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_StfuDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_StfuDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_StfuDecodeErrorZ ret_hu_conv = Result_StfuDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_StfuDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_StfuDecodeErrorZ ret_hu_conv = Result_StfuDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_StrSecp256k1ErrorZ.java b/src/main/java/org/ldk/structs/Result_StrSecp256k1ErrorZ.java deleted file mode 100644 index 2e61bb8f..00000000 --- a/src/main/java/org/ldk/structs/Result_StrSecp256k1ErrorZ.java +++ /dev/null @@ -1,92 +0,0 @@ -package org.ldk.structs; - -import org.ldk.impl.bindings; -import org.ldk.enums.*; -import org.ldk.util.*; -import java.util.Arrays; -import java.lang.ref.Reference; -import javax.annotation.Nullable; - -public class Result_StrSecp256k1ErrorZ extends CommonBase { - private Result_StrSecp256k1ErrorZ(Object _dummy, long ptr) { super(ptr); } - protected void finalize() throws Throwable { - if (ptr != 0) { bindings.CResult_StrSecp256k1ErrorZ_free(ptr); } super.finalize(); - } - - protected void force_free() { - if (ptr != 0) { bindings.CResult_StrSecp256k1ErrorZ_free(ptr); ptr = 0; } - } - - static Result_StrSecp256k1ErrorZ constr_from_ptr(long ptr) { - if (bindings.CResult_StrSecp256k1ErrorZ_is_ok(ptr)) { - return new Result_StrSecp256k1ErrorZ_OK(null, ptr); - } else { - return new Result_StrSecp256k1ErrorZ_Err(null, ptr); - } - } - public static final class Result_StrSecp256k1ErrorZ_OK extends Result_StrSecp256k1ErrorZ { - public final String res; - private Result_StrSecp256k1ErrorZ_OK(Object _dummy, long ptr) { - super(_dummy, ptr); - this.res = bindings.CResult_StrSecp256k1ErrorZ_get_ok(ptr); - } - } - - public static final class Result_StrSecp256k1ErrorZ_Err extends Result_StrSecp256k1ErrorZ { - public final Secp256k1Error err; - private Result_StrSecp256k1ErrorZ_Err(Object _dummy, long ptr) { - super(_dummy, ptr); - this.err = bindings.CResult_StrSecp256k1ErrorZ_get_err(ptr); - } - } - - /** - * Creates a new CResult_StrSecp256k1ErrorZ in the success state. - */ - public static Result_StrSecp256k1ErrorZ ok(java.lang.String o) { - long ret = bindings.CResult_StrSecp256k1ErrorZ_ok(o); - Reference.reachabilityFence(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_StrSecp256k1ErrorZ ret_hu_conv = Result_StrSecp256k1ErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Creates a new CResult_StrSecp256k1ErrorZ in the error state. - */ - public static Result_StrSecp256k1ErrorZ err(org.ldk.enums.Secp256k1Error e) { - long ret = bindings.CResult_StrSecp256k1ErrorZ_err(e); - Reference.reachabilityFence(e); - if (ret >= 0 && ret <= 4096) { return null; } - Result_StrSecp256k1ErrorZ ret_hu_conv = Result_StrSecp256k1ErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Checks if the given object is currently in the success state - */ - public boolean is_ok() { - boolean ret = bindings.CResult_StrSecp256k1ErrorZ_is_ok(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - long clone_ptr() { - long ret = bindings.CResult_StrSecp256k1ErrorZ_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Creates a new CResult_StrSecp256k1ErrorZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_StrSecp256k1ErrorZ clone() { - long ret = bindings.CResult_StrSecp256k1ErrorZ_clone(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_StrSecp256k1ErrorZ ret_hu_conv = Result_StrSecp256k1ErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} diff --git a/src/main/java/org/ldk/structs/Result_ThirtyTwoBytesAPIErrorZ.java b/src/main/java/org/ldk/structs/Result_ThirtyTwoBytesAPIErrorZ.java index 09425d63..5f6bb89c 100644 --- a/src/main/java/org/ldk/structs/Result_ThirtyTwoBytesAPIErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ThirtyTwoBytesAPIErrorZ.java @@ -62,7 +62,6 @@ public class Result_ThirtyTwoBytesAPIErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ThirtyTwoBytesAPIErrorZ ret_hu_conv = Result_ThirtyTwoBytesAPIErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ThirtyTwoBytesPaymentSendFailureZ.java b/src/main/java/org/ldk/structs/Result_ThirtyTwoBytesPaymentSendFailureZ.java index 034f62a3..0ae09cd1 100644 --- a/src/main/java/org/ldk/structs/Result_ThirtyTwoBytesPaymentSendFailureZ.java +++ b/src/main/java/org/ldk/structs/Result_ThirtyTwoBytesPaymentSendFailureZ.java @@ -62,7 +62,6 @@ public class Result_ThirtyTwoBytesPaymentSendFailureZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ThirtyTwoBytesPaymentSendFailureZ ret_hu_conv = Result_ThirtyTwoBytesPaymentSendFailureZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_TrackedSpendableOutputDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_TrackedSpendableOutputDecodeErrorZ.java index e430f2be..c2dc2a70 100644 --- a/src/main/java/org/ldk/structs/Result_TrackedSpendableOutputDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_TrackedSpendableOutputDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_TrackedSpendableOutputDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TrackedSpendableOutputDecodeErrorZ ret_hu_conv = Result_TrackedSpendableOutputDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_TrackedSpendableOutputDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_TrackedSpendableOutputDecodeErrorZ ret_hu_conv = Result_TrackedSpendableOutputDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_TransactionU16LenLimitedDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_TransactionU16LenLimitedDecodeErrorZ.java index 538e7b7e..55586535 100644 --- a/src/main/java/org/ldk/structs/Result_TransactionU16LenLimitedDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_TransactionU16LenLimitedDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_TransactionU16LenLimitedDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TransactionU16LenLimitedDecodeErrorZ ret_hu_conv = Result_TransactionU16LenLimitedDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_TransactionU16LenLimitedDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_TransactionU16LenLimitedDecodeErrorZ ret_hu_conv = Result_TransactionU16LenLimitedDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_TransactionU16LenLimitedNoneZ.java b/src/main/java/org/ldk/structs/Result_TransactionU16LenLimitedNoneZ.java index 39e9f8e3..e9402c72 100644 --- a/src/main/java/org/ldk/structs/Result_TransactionU16LenLimitedNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_TransactionU16LenLimitedNoneZ.java @@ -49,7 +49,6 @@ public class Result_TransactionU16LenLimitedNoneZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TransactionU16LenLimitedNoneZ ret_hu_conv = Result_TransactionU16LenLimitedNoneZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_TxAbortDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_TxAbortDecodeErrorZ.java index 333892d2..b76558f5 100644 --- a/src/main/java/org/ldk/structs/Result_TxAbortDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_TxAbortDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_TxAbortDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TxAbortDecodeErrorZ ret_hu_conv = Result_TxAbortDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_TxAbortDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_TxAbortDecodeErrorZ ret_hu_conv = Result_TxAbortDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_TxAckRbfDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_TxAckRbfDecodeErrorZ.java index 32f4a363..852754f6 100644 --- a/src/main/java/org/ldk/structs/Result_TxAckRbfDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_TxAckRbfDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_TxAckRbfDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TxAckRbfDecodeErrorZ ret_hu_conv = Result_TxAckRbfDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_TxAckRbfDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_TxAckRbfDecodeErrorZ ret_hu_conv = Result_TxAckRbfDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_TxAddInputDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_TxAddInputDecodeErrorZ.java index c77173b6..86baa20d 100644 --- a/src/main/java/org/ldk/structs/Result_TxAddInputDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_TxAddInputDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_TxAddInputDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TxAddInputDecodeErrorZ ret_hu_conv = Result_TxAddInputDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_TxAddInputDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_TxAddInputDecodeErrorZ ret_hu_conv = Result_TxAddInputDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_TxAddOutputDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_TxAddOutputDecodeErrorZ.java index 1f2df8a3..15f4d28a 100644 --- a/src/main/java/org/ldk/structs/Result_TxAddOutputDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_TxAddOutputDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_TxAddOutputDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TxAddOutputDecodeErrorZ ret_hu_conv = Result_TxAddOutputDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_TxAddOutputDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_TxAddOutputDecodeErrorZ ret_hu_conv = Result_TxAddOutputDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_TxCompleteDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_TxCompleteDecodeErrorZ.java index c4ab9114..b504d7fc 100644 --- a/src/main/java/org/ldk/structs/Result_TxCompleteDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_TxCompleteDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_TxCompleteDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TxCompleteDecodeErrorZ ret_hu_conv = Result_TxCompleteDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_TxCompleteDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_TxCompleteDecodeErrorZ ret_hu_conv = Result_TxCompleteDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_TxCreationKeysDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_TxCreationKeysDecodeErrorZ.java index 925c8e6e..acbb8ed6 100644 --- a/src/main/java/org/ldk/structs/Result_TxCreationKeysDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_TxCreationKeysDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_TxCreationKeysDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TxCreationKeysDecodeErrorZ ret_hu_conv = Result_TxCreationKeysDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_TxCreationKeysDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_TxCreationKeysDecodeErrorZ ret_hu_conv = Result_TxCreationKeysDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_TxInitRbfDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_TxInitRbfDecodeErrorZ.java index 7884c626..398d1844 100644 --- a/src/main/java/org/ldk/structs/Result_TxInitRbfDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_TxInitRbfDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_TxInitRbfDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TxInitRbfDecodeErrorZ ret_hu_conv = Result_TxInitRbfDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_TxInitRbfDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_TxInitRbfDecodeErrorZ ret_hu_conv = Result_TxInitRbfDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_TxRemoveInputDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_TxRemoveInputDecodeErrorZ.java index 198929cf..abb085eb 100644 --- a/src/main/java/org/ldk/structs/Result_TxRemoveInputDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_TxRemoveInputDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_TxRemoveInputDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TxRemoveInputDecodeErrorZ ret_hu_conv = Result_TxRemoveInputDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_TxRemoveInputDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_TxRemoveInputDecodeErrorZ ret_hu_conv = Result_TxRemoveInputDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_TxRemoveOutputDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_TxRemoveOutputDecodeErrorZ.java index fc63045e..326e5ca0 100644 --- a/src/main/java/org/ldk/structs/Result_TxRemoveOutputDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_TxRemoveOutputDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_TxRemoveOutputDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TxRemoveOutputDecodeErrorZ ret_hu_conv = Result_TxRemoveOutputDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_TxRemoveOutputDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_TxRemoveOutputDecodeErrorZ ret_hu_conv = Result_TxRemoveOutputDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_TxSignaturesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_TxSignaturesDecodeErrorZ.java index 012c0e51..78b61ed5 100644 --- a/src/main/java/org/ldk/structs/Result_TxSignaturesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_TxSignaturesDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_TxSignaturesDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TxSignaturesDecodeErrorZ ret_hu_conv = Result_TxSignaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_TxSignaturesDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_TxSignaturesDecodeErrorZ ret_hu_conv = Result_TxSignaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_UnknownPaymentContextDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UnknownPaymentContextDecodeErrorZ.java index 4355bce6..a019c3ad 100644 --- a/src/main/java/org/ldk/structs/Result_UnknownPaymentContextDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UnknownPaymentContextDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_UnknownPaymentContextDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_UnknownPaymentContextDecodeErrorZ ret_hu_conv = Result_UnknownPaymentContextDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_UnknownPaymentContextDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_UnknownPaymentContextDecodeErrorZ ret_hu_conv = Result_UnknownPaymentContextDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ.java b/src/main/java/org/ldk/structs/Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ.java index 7bdf559b..6bef749d 100644 --- a/src/main/java/org/ldk/structs/Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ.java @@ -51,7 +51,6 @@ public class Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ extends CommonBase Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ ret_hu_conv = Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.java index 01203170..e342af84 100644 --- a/src/main/java/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_UnsignedChannelAnnouncementDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_UnsignedChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_UnsignedChannelAnnouncementDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_UnsignedChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.java index d8dba7b9..f6f44c93 100644 --- a/src/main/java/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_UnsignedChannelUpdateDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_UnsignedChannelUpdateDecodeErrorZ ret_hu_conv = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_UnsignedChannelUpdateDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_UnsignedChannelUpdateDecodeErrorZ ret_hu_conv = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_UnsignedInvoiceRequestBolt12SemanticErrorZ.java b/src/main/java/org/ldk/structs/Result_UnsignedInvoiceRequestBolt12SemanticErrorZ.java index 4054d932..9d55da81 100644 --- a/src/main/java/org/ldk/structs/Result_UnsignedInvoiceRequestBolt12SemanticErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UnsignedInvoiceRequestBolt12SemanticErrorZ.java @@ -51,7 +51,6 @@ public class Result_UnsignedInvoiceRequestBolt12SemanticErrorZ extends CommonBas Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_UnsignedInvoiceRequestBolt12SemanticErrorZ ret_hu_conv = Result_UnsignedInvoiceRequestBolt12SemanticErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.java index 5578fbc1..f090c0af 100644 --- a/src/main/java/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_UnsignedNodeAnnouncementDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_UnsignedNodeAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedNodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_UnsignedNodeAnnouncementDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_UnsignedNodeAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedNodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_UntrustedStringDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UntrustedStringDecodeErrorZ.java index c55f0eda..97ddee48 100644 --- a/src/main/java/org/ldk/structs/Result_UntrustedStringDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UntrustedStringDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_UntrustedStringDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_UntrustedStringDecodeErrorZ ret_hu_conv = Result_UntrustedStringDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_UntrustedStringDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_UntrustedStringDecodeErrorZ ret_hu_conv = Result_UntrustedStringDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_UpdateAddHTLCDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UpdateAddHTLCDecodeErrorZ.java index 57541e91..a12fc86f 100644 --- a/src/main/java/org/ldk/structs/Result_UpdateAddHTLCDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UpdateAddHTLCDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_UpdateAddHTLCDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_UpdateAddHTLCDecodeErrorZ ret_hu_conv = Result_UpdateAddHTLCDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_UpdateAddHTLCDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_UpdateAddHTLCDecodeErrorZ ret_hu_conv = Result_UpdateAddHTLCDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_UpdateFailHTLCDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UpdateFailHTLCDecodeErrorZ.java index 720d482a..012f9eb1 100644 --- a/src/main/java/org/ldk/structs/Result_UpdateFailHTLCDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UpdateFailHTLCDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_UpdateFailHTLCDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_UpdateFailHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailHTLCDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_UpdateFailHTLCDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_UpdateFailHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailHTLCDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.java index 0047423d..133d45d0 100644 --- a/src/main/java/org/ldk/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_UpdateFailMalformedHTLCDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_UpdateFailMalformedHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailMalformedHTLCDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_UpdateFailMalformedHTLCDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_UpdateFailMalformedHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailMalformedHTLCDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_UpdateFeeDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UpdateFeeDecodeErrorZ.java index 73b2f9eb..88914fdd 100644 --- a/src/main/java/org/ldk/structs/Result_UpdateFeeDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UpdateFeeDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_UpdateFeeDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_UpdateFeeDecodeErrorZ ret_hu_conv = Result_UpdateFeeDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_UpdateFeeDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_UpdateFeeDecodeErrorZ ret_hu_conv = Result_UpdateFeeDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.java index 14d410a9..117491cb 100644 --- a/src/main/java/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_UpdateFulfillHTLCDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_UpdateFulfillHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFulfillHTLCDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_UpdateFulfillHTLCDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_UpdateFulfillHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFulfillHTLCDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_VerifiedInvoiceRequestNoneZ.java b/src/main/java/org/ldk/structs/Result_VerifiedInvoiceRequestNoneZ.java index dd0c91dc..b65dff35 100644 --- a/src/main/java/org/ldk/structs/Result_VerifiedInvoiceRequestNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_VerifiedInvoiceRequestNoneZ.java @@ -49,7 +49,6 @@ public class Result_VerifiedInvoiceRequestNoneZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_VerifiedInvoiceRequestNoneZ ret_hu_conv = Result_VerifiedInvoiceRequestNoneZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_WarningMessageDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_WarningMessageDecodeErrorZ.java index b8520f01..4d4259e4 100644 --- a/src/main/java/org/ldk/structs/Result_WarningMessageDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_WarningMessageDecodeErrorZ.java @@ -54,7 +54,6 @@ public class Result_WarningMessageDecodeErrorZ extends CommonBase { Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_WarningMessageDecodeErrorZ ret_hu_conv = Result_WarningMessageDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; return ret_hu_conv; } @@ -66,7 +65,6 @@ public class Result_WarningMessageDecodeErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_WarningMessageDecodeErrorZ ret_hu_conv = Result_WarningMessageDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_WriteableEcdsaChannelSignerDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_WriteableEcdsaChannelSignerDecodeErrorZ.java deleted file mode 100644 index b877b344..00000000 --- a/src/main/java/org/ldk/structs/Result_WriteableEcdsaChannelSignerDecodeErrorZ.java +++ /dev/null @@ -1,100 +0,0 @@ -package org.ldk.structs; - -import org.ldk.impl.bindings; -import org.ldk.enums.*; -import org.ldk.util.*; -import java.util.Arrays; -import java.lang.ref.Reference; -import javax.annotation.Nullable; - -public class Result_WriteableEcdsaChannelSignerDecodeErrorZ extends CommonBase { - private Result_WriteableEcdsaChannelSignerDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } - protected void finalize() throws Throwable { - if (ptr != 0) { bindings.CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free(ptr); } super.finalize(); - } - - protected void force_free() { - if (ptr != 0) { bindings.CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free(ptr); ptr = 0; } - } - - static Result_WriteableEcdsaChannelSignerDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok(ptr)) { - return new Result_WriteableEcdsaChannelSignerDecodeErrorZ_OK(null, ptr); - } else { - return new Result_WriteableEcdsaChannelSignerDecodeErrorZ_Err(null, ptr); - } - } - public static final class Result_WriteableEcdsaChannelSignerDecodeErrorZ_OK extends Result_WriteableEcdsaChannelSignerDecodeErrorZ { - public final WriteableEcdsaChannelSigner res; - private Result_WriteableEcdsaChannelSignerDecodeErrorZ_OK(Object _dummy, long ptr) { - super(_dummy, ptr); - long res = bindings.CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_ok(ptr); - WriteableEcdsaChannelSigner ret_hu_conv = new WriteableEcdsaChannelSigner(null, res); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - this.res = ret_hu_conv; - } - } - - public static final class Result_WriteableEcdsaChannelSignerDecodeErrorZ_Err extends Result_WriteableEcdsaChannelSignerDecodeErrorZ { - public final DecodeError err; - private Result_WriteableEcdsaChannelSignerDecodeErrorZ_Err(Object _dummy, long ptr) { - super(_dummy, ptr); - long err = bindings.CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_err(ptr); - org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); - if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); }; - this.err = err_hu_conv; - } - } - - /** - * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the success state. - */ - public static Result_WriteableEcdsaChannelSignerDecodeErrorZ ok(org.ldk.structs.WriteableEcdsaChannelSigner o) { - long ret = bindings.CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(o.ptr); - Reference.reachabilityFence(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_WriteableEcdsaChannelSignerDecodeErrorZ ret_hu_conv = Result_WriteableEcdsaChannelSignerDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; - return ret_hu_conv; - } - - /** - * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the error state. - */ - public static Result_WriteableEcdsaChannelSignerDecodeErrorZ err(org.ldk.structs.DecodeError e) { - long ret = bindings.CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err(e.ptr); - Reference.reachabilityFence(e); - if (ret >= 0 && ret <= 4096) { return null; } - Result_WriteableEcdsaChannelSignerDecodeErrorZ ret_hu_conv = Result_WriteableEcdsaChannelSignerDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; - return ret_hu_conv; - } - - /** - * Checks if the given object is currently in the success state - */ - public boolean is_ok() { - boolean ret = bindings.CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - long clone_ptr() { - long ret = bindings.CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_WriteableEcdsaChannelSignerDecodeErrorZ clone() { - long ret = bindings.CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_WriteableEcdsaChannelSignerDecodeErrorZ ret_hu_conv = Result_WriteableEcdsaChannelSignerDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} diff --git a/src/main/java/org/ldk/structs/Result__u832NoneZ.java b/src/main/java/org/ldk/structs/Result__u832NoneZ.java new file mode 100644 index 00000000..d197c9e1 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result__u832NoneZ.java @@ -0,0 +1,89 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + +public class Result__u832NoneZ extends CommonBase { + private Result__u832NoneZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult__u832NoneZ_free(ptr); } super.finalize(); + } + + protected void force_free() { + if (ptr != 0) { bindings.CResult__u832NoneZ_free(ptr); ptr = 0; } + } + + static Result__u832NoneZ constr_from_ptr(long ptr) { + if (bindings.CResult__u832NoneZ_is_ok(ptr)) { + return new Result__u832NoneZ_OK(null, ptr); + } else { + return new Result__u832NoneZ_Err(null, ptr); + } + } + public static final class Result__u832NoneZ_OK extends Result__u832NoneZ { + public final byte[] res; + private Result__u832NoneZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + this.res = bindings.CResult__u832NoneZ_get_ok(ptr); + } + } + + public static final class Result__u832NoneZ_Err extends Result__u832NoneZ { + private Result__u832NoneZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + } + } + + /** + * Creates a new CResult__u832NoneZ in the success state. + */ + public static Result__u832NoneZ ok(byte[] o) { + long ret = bindings.CResult__u832NoneZ_ok(InternalUtils.check_arr_len(o, 32)); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result__u832NoneZ ret_hu_conv = Result__u832NoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult__u832NoneZ in the error state. + */ + public static Result__u832NoneZ err() { + long ret = bindings.CResult__u832NoneZ_err(); + if (ret >= 0 && ret <= 4096) { return null; } + Result__u832NoneZ ret_hu_conv = Result__u832NoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult__u832NoneZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult__u832NoneZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult__u832NoneZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result__u832NoneZ clone() { + long ret = bindings.CResult__u832NoneZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result__u832NoneZ ret_hu_conv = Result__u832NoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_boolLightningErrorZ.java b/src/main/java/org/ldk/structs/Result_boolLightningErrorZ.java index f57d7c5f..2b58cbac 100644 --- a/src/main/java/org/ldk/structs/Result_boolLightningErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_boolLightningErrorZ.java @@ -62,7 +62,6 @@ public class Result_boolLightningErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_boolPeerHandleErrorZ.java b/src/main/java/org/ldk/structs/Result_boolPeerHandleErrorZ.java index 8d6e37b2..ed161e01 100644 --- a/src/main/java/org/ldk/structs/Result_boolPeerHandleErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_boolPeerHandleErrorZ.java @@ -62,7 +62,6 @@ public class Result_boolPeerHandleErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_boolPeerHandleErrorZ ret_hu_conv = Result_boolPeerHandleErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_u32GraphSyncErrorZ.java b/src/main/java/org/ldk/structs/Result_u32GraphSyncErrorZ.java index ae52bee8..452ac93a 100644 --- a/src/main/java/org/ldk/structs/Result_u32GraphSyncErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_u32GraphSyncErrorZ.java @@ -62,7 +62,6 @@ public class Result_u32GraphSyncErrorZ extends CommonBase { Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } Result_u32GraphSyncErrorZ ret_hu_conv = Result_u32GraphSyncErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/RevocationKey.java b/src/main/java/org/ldk/structs/RevocationKey.java index a749e1c0..49a28c93 100644 --- a/src/main/java/org/ldk/structs/RevocationKey.java +++ b/src/main/java/org/ldk/structs/RevocationKey.java @@ -16,7 +16,7 @@ import javax.annotation.Nullable; * per_commitment_point which is used in both commitment and HTLC transactions. * * See [the BOLT spec for derivation details] - * (https://github.com/lightning/bolts/blob/master/03-transactions.md#revocationpubkey-derivation) + * */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class RevocationKey extends CommonBase { diff --git a/src/main/java/org/ldk/structs/RevokeAndACK.java b/src/main/java/org/ldk/structs/RevokeAndACK.java index 102afadd..15a99aca 100644 --- a/src/main/java/org/ldk/structs/RevokeAndACK.java +++ b/src/main/java/org/ldk/structs/RevokeAndACK.java @@ -41,7 +41,6 @@ public class RevokeAndACK extends CommonBase { bindings.RevokeAndACK_set_channel_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -91,7 +90,6 @@ public class RevokeAndACK extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.RevokeAndACK ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RevokeAndACK(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Route.java b/src/main/java/org/ldk/structs/Route.java index 1bb1e0c2..06216361 100644 --- a/src/main/java/org/ldk/structs/Route.java +++ b/src/main/java/org/ldk/structs/Route.java @@ -49,7 +49,6 @@ public class Route extends CommonBase { bindings.Route_set_paths(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_6 -> val_conv_6.ptr).toArray() : null); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - for (Path val_conv_6: val) { if (this != null) { this.ptrs_to.add(val_conv_6); }; }; } /** @@ -84,7 +83,6 @@ public class Route extends CommonBase { bindings.Route_set_route_params(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -99,8 +97,6 @@ public class Route extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Route ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Route(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - for (Path paths_arg_conv_6: paths_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(paths_arg_conv_6); }; }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(route_params_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/RouteHint.java b/src/main/java/org/ldk/structs/RouteHint.java index a966ea7b..0cb99cac 100644 --- a/src/main/java/org/ldk/structs/RouteHint.java +++ b/src/main/java/org/ldk/structs/RouteHint.java @@ -20,6 +20,26 @@ public class RouteHint extends CommonBase { if (ptr != 0) { bindings.RouteHint_free(ptr); } } + /** + * Serialize the RouteHint object into a byte array which can be read by RouteHint_read + */ + public byte[] write() { + byte[] ret = bindings.RouteHint_write(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Read a RouteHint from a byte array, created by RouteHint_write + */ + public static Result_RouteHintDecodeErrorZ read(byte[] ser) { + long ret = bindings.RouteHint_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_RouteHintDecodeErrorZ ret_hu_conv = Result_RouteHintDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + public RouteHintHop[] get_a() { long[] ret = bindings.RouteHint_get_a(this.ptr); Reference.reachabilityFence(this); @@ -38,7 +58,6 @@ public class RouteHint extends CommonBase { bindings.RouteHint_set_a(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_14 -> val_conv_14.ptr).toArray() : null); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - for (RouteHintHop val_conv_14: val) { if (this != null) { this.ptrs_to.add(val_conv_14); }; }; } /** @@ -50,7 +69,6 @@ public class RouteHint extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.RouteHint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RouteHint(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - for (RouteHintHop a_arg_conv_14: a_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a_arg_conv_14); }; }; return ret_hu_conv; } @@ -101,24 +119,4 @@ public class RouteHint extends CommonBase { if (!(o instanceof RouteHint)) return false; return this.eq((RouteHint)o); } - /** - * Serialize the RouteHint object into a byte array which can be read by RouteHint_read - */ - public byte[] write() { - byte[] ret = bindings.RouteHint_write(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Read a RouteHint from a byte array, created by RouteHint_write - */ - public static Result_RouteHintDecodeErrorZ read(byte[] ser) { - long ret = bindings.RouteHint_read(ser); - Reference.reachabilityFence(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_RouteHintDecodeErrorZ ret_hu_conv = Result_RouteHintDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - } diff --git a/src/main/java/org/ldk/structs/RouteHintHop.java b/src/main/java/org/ldk/structs/RouteHintHop.java index 4177a858..2c6a3e5b 100644 --- a/src/main/java/org/ldk/structs/RouteHintHop.java +++ b/src/main/java/org/ldk/structs/RouteHintHop.java @@ -24,6 +24,26 @@ public class RouteHintHop extends CommonBase { if (ptr != 0) { bindings.RouteHintHop_free(ptr); } } + /** + * Serialize the RouteHintHop object into a byte array which can be read by RouteHintHop_read + */ + public byte[] write() { + byte[] ret = bindings.RouteHintHop_write(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Read a RouteHintHop from a byte array, created by RouteHintHop_write + */ + public static Result_RouteHintHopDecodeErrorZ read(byte[] ser) { + long ret = bindings.RouteHintHop_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_RouteHintHopDecodeErrorZ ret_hu_conv = Result_RouteHintHopDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + /** * The node_id of the non-target end of the route */ @@ -79,7 +99,6 @@ public class RouteHintHop extends CommonBase { bindings.RouteHintHop_set_fees(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -119,7 +138,6 @@ public class RouteHintHop extends CommonBase { bindings.RouteHintHop_set_htlc_minimum_msat(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -141,7 +159,6 @@ public class RouteHintHop extends CommonBase { bindings.RouteHintHop_set_htlc_maximum_msat(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -158,9 +175,6 @@ public class RouteHintHop extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.RouteHintHop ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RouteHintHop(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(fees_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(htlc_minimum_msat_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(htlc_maximum_msat_arg); }; return ret_hu_conv; } @@ -211,24 +225,4 @@ public class RouteHintHop extends CommonBase { if (!(o instanceof RouteHintHop)) return false; return this.eq((RouteHintHop)o); } - /** - * Serialize the RouteHintHop object into a byte array which can be read by RouteHintHop_read - */ - public byte[] write() { - byte[] ret = bindings.RouteHintHop_write(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Read a RouteHintHop from a byte array, created by RouteHintHop_write - */ - public static Result_RouteHintHopDecodeErrorZ read(byte[] ser) { - long ret = bindings.RouteHintHop_read(ser); - Reference.reachabilityFence(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_RouteHintHopDecodeErrorZ ret_hu_conv = Result_RouteHintHopDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - } diff --git a/src/main/java/org/ldk/structs/RouteHop.java b/src/main/java/org/ldk/structs/RouteHop.java index 4b9efdb5..d3b59a0c 100644 --- a/src/main/java/org/ldk/structs/RouteHop.java +++ b/src/main/java/org/ldk/structs/RouteHop.java @@ -60,7 +60,6 @@ public class RouteHop extends CommonBase { bindings.RouteHop_set_node_features(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -102,16 +101,14 @@ public class RouteHop extends CommonBase { bindings.RouteHop_set_channel_features(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** * The fee taken on this hop (for paying for the use of the *next* channel in the path). * If this is the last hop in [`Path::hops`]: - * if we're sending to a [`BlindedPath`], this is the fee paid for use of the entire blinded path + * if we're sending to a [`BlindedPaymentPath`], this is the fee paid for use of the entire + * blinded path * otherwise, this is the full value of this [`Path`]'s part of the payment - * - * [`BlindedPath`]: crate::blinded_path::BlindedPath */ public long get_fee_msat() { long ret = bindings.RouteHop_get_fee_msat(this.ptr); @@ -122,10 +119,9 @@ public class RouteHop extends CommonBase { /** * The fee taken on this hop (for paying for the use of the *next* channel in the path). * If this is the last hop in [`Path::hops`]: - * if we're sending to a [`BlindedPath`], this is the fee paid for use of the entire blinded path + * if we're sending to a [`BlindedPaymentPath`], this is the fee paid for use of the entire + * blinded path * otherwise, this is the full value of this [`Path`]'s part of the payment - * - * [`BlindedPath`]: crate::blinded_path::BlindedPath */ public void set_fee_msat(long val) { bindings.RouteHop_set_fee_msat(this.ptr, val); @@ -136,10 +132,9 @@ public class RouteHop extends CommonBase { /** * The CLTV delta added for this hop. * If this is the last hop in [`Path::hops`]: - * if we're sending to a [`BlindedPath`], this is the CLTV delta for the entire blinded path + * if we're sending to a [`BlindedPaymentPath`], this is the CLTV delta for the entire blinded + * path * otherwise, this is the CLTV delta expected at the destination - * - * [`BlindedPath`]: crate::blinded_path::BlindedPath */ public int get_cltv_expiry_delta() { int ret = bindings.RouteHop_get_cltv_expiry_delta(this.ptr); @@ -150,10 +145,9 @@ public class RouteHop extends CommonBase { /** * The CLTV delta added for this hop. * If this is the last hop in [`Path::hops`]: - * if we're sending to a [`BlindedPath`], this is the CLTV delta for the entire blinded path + * if we're sending to a [`BlindedPaymentPath`], this is the CLTV delta for the entire blinded + * path * otherwise, this is the CLTV delta expected at the destination - * - * [`BlindedPath`]: crate::blinded_path::BlindedPath */ public void set_cltv_expiry_delta(int val) { bindings.RouteHop_set_cltv_expiry_delta(this.ptr, val); @@ -208,8 +202,6 @@ public class RouteHop extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.RouteHop ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RouteHop(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(node_features_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_features_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/RouteParameters.java b/src/main/java/org/ldk/structs/RouteParameters.java index f81e9b7b..601a631b 100644 --- a/src/main/java/org/ldk/structs/RouteParameters.java +++ b/src/main/java/org/ldk/structs/RouteParameters.java @@ -41,7 +41,6 @@ public class RouteParameters extends CommonBase { bindings.RouteParameters_set_payment_params(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -91,7 +90,6 @@ public class RouteParameters extends CommonBase { bindings.RouteParameters_set_max_total_routing_fee_msat(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -105,8 +103,6 @@ public class RouteParameters extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.RouteParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RouteParameters(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(payment_params_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(max_total_routing_fee_msat_arg); }; return ret_hu_conv; } @@ -169,7 +165,22 @@ public class RouteParameters extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.RouteParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RouteParameters(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(payment_params); }; + return ret_hu_conv; + } + + /** + * Sets the maximum number of hops that can be included in a payment path, based on the provided + * [`RecipientOnionFields`] and blinded paths. + */ + public Result_NoneNoneZ set_max_path_length(org.ldk.structs.RecipientOnionFields recipient_onion, boolean is_keysend, int best_block_height) { + long ret = bindings.RouteParameters_set_max_path_length(this.ptr, recipient_onion.ptr, is_keysend, best_block_height); + Reference.reachabilityFence(this); + Reference.reachabilityFence(recipient_onion); + Reference.reachabilityFence(is_keysend); + Reference.reachabilityFence(best_block_height); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.add(recipient_onion); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Router.java b/src/main/java/org/ldk/structs/Router.java index ca667d23..c629e4a6 100644 --- a/src/main/java/org/ldk/structs/Router.java +++ b/src/main/java/org/ldk/structs/Router.java @@ -60,11 +60,11 @@ public class Router extends CommonBase { */ Result_RouteLightningErrorZ find_route_with_id(byte[] payer, RouteParameters route_params, ChannelDetails[] first_hops, InFlightHtlcs inflight_htlcs, byte[] _payment_hash, byte[] _payment_id); /** - * Creates [`BlindedPath`]s for payment to the `recipient` node. The channels in `first_hops` + * Creates [`BlindedPaymentPath`]s for payment to the `recipient` node. The channels in `first_hops` * are assumed to be with the `recipient`'s peers. The payment secret and any constraints are * given in `tlvs`. */ - Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ create_blinded_payment_paths(byte[] recipient, ChannelDetails[] first_hops, ReceiveTlvs tlvs, long amount_msats); + Result_CVec_BlindedPaymentPathZNoneZ create_blinded_payment_paths(byte[] recipient, ChannelDetails[] first_hops, ReceiveTlvs tlvs, long amount_msats); } private static class LDKRouterHolder { Router held; } public static Router new_impl(RouterInterface arg, MessageRouter.MessageRouterInterface MessageRouter_impl) { @@ -119,7 +119,7 @@ public class Router extends CommonBase { } org.ldk.structs.ReceiveTlvs tlvs_hu_conv = null; if (tlvs < 0 || tlvs > 4096) { tlvs_hu_conv = new org.ldk.structs.ReceiveTlvs(null, tlvs); } if (tlvs_hu_conv != null) { tlvs_hu_conv.ptrs_to.add(this); }; - Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ ret = arg.create_blinded_payment_paths(recipient, first_hops_conv_16_arr, tlvs_hu_conv, amount_msats); + Result_CVec_BlindedPaymentPathZNoneZ ret = arg.create_blinded_payment_paths(recipient, first_hops_conv_16_arr, tlvs_hu_conv, amount_msats); Reference.reachabilityFence(arg); long result = ret.clone_ptr(); return result; @@ -156,7 +156,6 @@ public class Router extends CommonBase { Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.add(route_params); }; if (first_hops != null) { for (ChannelDetails first_hops_conv_16: first_hops) { if (this != null) { this.ptrs_to.add(first_hops_conv_16); }; } }; - if (this != null) { this.ptrs_to.add(inflight_htlcs); }; return ret_hu_conv; } @@ -184,16 +183,15 @@ public class Router extends CommonBase { Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.add(route_params); }; if (first_hops != null) { for (ChannelDetails first_hops_conv_16: first_hops) { if (this != null) { this.ptrs_to.add(first_hops_conv_16); }; } }; - if (this != null) { this.ptrs_to.add(inflight_htlcs); }; return ret_hu_conv; } /** - * Creates [`BlindedPath`]s for payment to the `recipient` node. The channels in `first_hops` + * Creates [`BlindedPaymentPath`]s for payment to the `recipient` node. The channels in `first_hops` * are assumed to be with the `recipient`'s peers. The payment secret and any constraints are * given in `tlvs`. */ - public Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ create_blinded_payment_paths(byte[] recipient, ChannelDetails[] first_hops, org.ldk.structs.ReceiveTlvs tlvs, long amount_msats) { + public Result_CVec_BlindedPaymentPathZNoneZ create_blinded_payment_paths(byte[] recipient, ChannelDetails[] first_hops, org.ldk.structs.ReceiveTlvs tlvs, long amount_msats) { long ret = bindings.Router_create_blinded_payment_paths(this.ptr, InternalUtils.check_arr_len(recipient, 33), first_hops != null ? Arrays.stream(first_hops).mapToLong(first_hops_conv_16 -> first_hops_conv_16.ptr).toArray() : null, tlvs.ptr, amount_msats); Reference.reachabilityFence(this); Reference.reachabilityFence(recipient); @@ -201,9 +199,7 @@ public class Router extends CommonBase { Reference.reachabilityFence(tlvs); Reference.reachabilityFence(amount_msats); if (ret >= 0 && ret <= 4096) { return null; } - Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ ret_hu_conv = Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ.constr_from_ptr(ret); - for (ChannelDetails first_hops_conv_16: first_hops) { if (this != null) { this.ptrs_to.add(first_hops_conv_16); }; }; - if (this != null) { this.ptrs_to.add(tlvs); }; + Result_CVec_BlindedPaymentPathZNoneZ ret_hu_conv = Result_CVec_BlindedPaymentPathZNoneZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/RoutingFees.java b/src/main/java/org/ldk/structs/RoutingFees.java index bbb610f7..6da78759 100644 --- a/src/main/java/org/ldk/structs/RoutingFees.java +++ b/src/main/java/org/ldk/structs/RoutingFees.java @@ -20,6 +20,26 @@ public class RoutingFees extends CommonBase { if (ptr != 0) { bindings.RoutingFees_free(ptr); } } + /** + * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read + */ + public byte[] write() { + byte[] ret = bindings.RoutingFees_write(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Read a RoutingFees from a byte array, created by RoutingFees_write + */ + public static Result_RoutingFeesDecodeErrorZ read(byte[] ser) { + long ret = bindings.RoutingFees_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_RoutingFeesDecodeErrorZ ret_hu_conv = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + /** * Flat routing fee in millisatoshis. */ @@ -118,24 +138,4 @@ public class RoutingFees extends CommonBase { @Override public int hashCode() { return (int)this.hash(); } - /** - * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read - */ - public byte[] write() { - byte[] ret = bindings.RoutingFees_write(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Read a RoutingFees from a byte array, created by RoutingFees_write - */ - public static Result_RoutingFeesDecodeErrorZ read(byte[] ser) { - long ret = bindings.RoutingFees_read(ser); - Reference.reachabilityFence(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_RoutingFeesDecodeErrorZ ret_hu_conv = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - } diff --git a/src/main/java/org/ldk/structs/RoutingMessageHandler.java b/src/main/java/org/ldk/structs/RoutingMessageHandler.java index 9c5ac5af..8d21fcbf 100644 --- a/src/main/java/org/ldk/structs/RoutingMessageHandler.java +++ b/src/main/java/org/ldk/structs/RoutingMessageHandler.java @@ -159,7 +159,6 @@ public class RoutingMessageHandler extends CommonBase { Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret = arg.get_next_channel_announcement(starting_point); Reference.reachabilityFence(arg); long result = ret.clone_ptr(); - if (impl_holder.held != null) { impl_holder.held.ptrs_to.add(ret); }; return result; } @Override public long get_next_node_announcement(long starting_point) { @@ -313,7 +312,6 @@ public class RoutingMessageHandler extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.NodeAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAnnouncement(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - if (this != null) { this.ptrs_to.add(starting_point); }; return ret_hu_conv; } @@ -350,7 +348,6 @@ public class RoutingMessageHandler extends CommonBase { Reference.reachabilityFence(msg); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.add(msg); }; return ret_hu_conv; } @@ -367,7 +364,6 @@ public class RoutingMessageHandler extends CommonBase { Reference.reachabilityFence(msg); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.add(msg); }; return ret_hu_conv; } @@ -382,7 +378,6 @@ public class RoutingMessageHandler extends CommonBase { Reference.reachabilityFence(msg); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.add(msg); }; return ret_hu_conv; } @@ -397,7 +392,6 @@ public class RoutingMessageHandler extends CommonBase { Reference.reachabilityFence(msg); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.add(msg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ScoreLookUp.java b/src/main/java/org/ldk/structs/ScoreLookUp.java index 961f554b..4cd67bf2 100644 --- a/src/main/java/org/ldk/structs/ScoreLookUp.java +++ b/src/main/java/org/ldk/structs/ScoreLookUp.java @@ -85,7 +85,6 @@ public class ScoreLookUp extends CommonBase { Reference.reachabilityFence(candidate); Reference.reachabilityFence(usage); Reference.reachabilityFence(score_params); - if (this != null) { this.ptrs_to.add(usage); }; if (this != null) { this.ptrs_to.add(score_params); }; return ret; } diff --git a/src/main/java/org/ldk/structs/SendError.java b/src/main/java/org/ldk/structs/SendError.java index 295b29cb..34aa7b0e 100644 --- a/src/main/java/org/ldk/structs/SendError.java +++ b/src/main/java/org/ldk/structs/SendError.java @@ -76,8 +76,8 @@ public class SendError extends CommonBase { } } /** - * The provided [`Destination`] was an invalid [`BlindedPath`] due to not having any blinded - * hops. + * The provided [`Destination`] was an invalid [`BlindedMessagePath`] due to not having any + * blinded hops. */ public final static class TooFewBlindedHops extends SendError { private TooFewBlindedHops(long ptr, bindings.LDKSendError.TooFewBlindedHops obj) { @@ -95,7 +95,11 @@ public class SendError extends CommonBase { } } /** - * A path from the sender to the destination could not be found by the [`MessageRouter`]. + * Indicates that a path could not be found by the [`MessageRouter`]. + * + * This occurs when either: + * - No path from the sender to the destination was found to send the onion message + * - No reply path to the sender could be created when responding to an onion message */ public final static class PathNotFound extends SendError { private PathNotFound(long ptr, bindings.LDKSendError.PathNotFound obj) { diff --git a/src/main/java/org/ldk/structs/Shutdown.java b/src/main/java/org/ldk/structs/Shutdown.java index 08b4aada..66f5c9ed 100644 --- a/src/main/java/org/ldk/structs/Shutdown.java +++ b/src/main/java/org/ldk/structs/Shutdown.java @@ -41,7 +41,6 @@ public class Shutdown extends CommonBase { bindings.Shutdown_set_channel_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -76,7 +75,6 @@ public class Shutdown extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Shutdown ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Shutdown(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ShutdownScript.java b/src/main/java/org/ldk/structs/ShutdownScript.java index a23d26b7..cf7c5f74 100644 --- a/src/main/java/org/ldk/structs/ShutdownScript.java +++ b/src/main/java/org/ldk/structs/ShutdownScript.java @@ -125,7 +125,7 @@ public class ShutdownScript extends CommonBase { public byte[] into_inner() { byte[] ret = bindings.ShutdownScript_into_inner(this.ptr); Reference.reachabilityFence(this); - if (this != null) { this.ptrs_to.add(this); }; + ; return ret; } diff --git a/src/main/java/org/ldk/structs/SignedRawBolt11Invoice.java b/src/main/java/org/ldk/structs/SignedRawBolt11Invoice.java index 6bc7ce23..fbdea4d5 100644 --- a/src/main/java/org/ldk/structs/SignedRawBolt11Invoice.java +++ b/src/main/java/org/ldk/structs/SignedRawBolt11Invoice.java @@ -83,7 +83,7 @@ public class SignedRawBolt11Invoice extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ ret_hu_conv = new ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ(null, ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - if (this != null) { this.ptrs_to.add(this); }; + ; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/SignerProvider.java b/src/main/java/org/ldk/structs/SignerProvider.java index 9a4cac9e..ba060209 100644 --- a/src/main/java/org/ldk/structs/SignerProvider.java +++ b/src/main/java/org/ldk/structs/SignerProvider.java @@ -54,11 +54,11 @@ public class SignerProvider extends CommonBase { * re-derived from its `channel_keys_id`, which can be obtained through its trait method * [`ChannelSigner::channel_keys_id`]. */ - WriteableEcdsaChannelSigner derive_channel_signer(long channel_value_satoshis, byte[] channel_keys_id); + EcdsaChannelSigner derive_channel_signer(long channel_value_satoshis, byte[] channel_keys_id); /** * Reads a [`Signer`] for this [`SignerProvider`] from the given input stream. * This is only called during deserialization of other objects which contain - * [`WriteableEcdsaChannelSigner`]-implementing objects (i.e., [`ChannelMonitor`]s and [`ChannelManager`]s). + * [`EcdsaChannelSigner`]-implementing objects (i.e., [`ChannelMonitor`]s and [`ChannelManager`]s). * The bytes are exactly those which `::write()` writes, and * contain no versioning scheme. You may wish to include your own version prefix and ensure * you've read all of the provided bytes to ensure no corruption occurred. @@ -70,7 +70,7 @@ public class SignerProvider extends CommonBase { * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager */ - Result_WriteableEcdsaChannelSignerDecodeErrorZ read_chan_signer(byte[] reader); + Result_EcdsaChannelSignerDecodeErrorZ read_chan_signer(byte[] reader); /** * Get a script pubkey which we send funds to when claiming on-chain contestable outputs. * @@ -105,14 +105,14 @@ public class SignerProvider extends CommonBase { return result; } @Override public long derive_channel_signer(long channel_value_satoshis, byte[] channel_keys_id) { - WriteableEcdsaChannelSigner ret = arg.derive_channel_signer(channel_value_satoshis, channel_keys_id); + EcdsaChannelSigner ret = arg.derive_channel_signer(channel_value_satoshis, channel_keys_id); Reference.reachabilityFence(arg); long result = ret.clone_ptr(); if (impl_holder.held != null) { impl_holder.held.ptrs_to.add(ret); }; return result; } @Override public long read_chan_signer(byte[] reader) { - Result_WriteableEcdsaChannelSignerDecodeErrorZ ret = arg.read_chan_signer(reader); + Result_EcdsaChannelSignerDecodeErrorZ ret = arg.read_chan_signer(reader); Reference.reachabilityFence(arg); long result = ret.clone_ptr(); return result; @@ -157,13 +157,13 @@ public class SignerProvider extends CommonBase { * re-derived from its `channel_keys_id`, which can be obtained through its trait method * [`ChannelSigner::channel_keys_id`]. */ - public WriteableEcdsaChannelSigner derive_channel_signer(long channel_value_satoshis, byte[] channel_keys_id) { + public EcdsaChannelSigner derive_channel_signer(long channel_value_satoshis, byte[] channel_keys_id) { long ret = bindings.SignerProvider_derive_channel_signer(this.ptr, channel_value_satoshis, InternalUtils.check_arr_len(channel_keys_id, 32)); Reference.reachabilityFence(this); Reference.reachabilityFence(channel_value_satoshis); Reference.reachabilityFence(channel_keys_id); if (ret >= 0 && ret <= 4096) { return null; } - WriteableEcdsaChannelSigner ret_hu_conv = new WriteableEcdsaChannelSigner(null, ret); + EcdsaChannelSigner ret_hu_conv = new EcdsaChannelSigner(null, ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; return ret_hu_conv; } @@ -171,7 +171,7 @@ public class SignerProvider extends CommonBase { /** * Reads a [`Signer`] for this [`SignerProvider`] from the given input stream. * This is only called during deserialization of other objects which contain - * [`WriteableEcdsaChannelSigner`]-implementing objects (i.e., [`ChannelMonitor`]s and [`ChannelManager`]s). + * [`EcdsaChannelSigner`]-implementing objects (i.e., [`ChannelMonitor`]s and [`ChannelManager`]s). * The bytes are exactly those which `::write()` writes, and * contain no versioning scheme. You may wish to include your own version prefix and ensure * you've read all of the provided bytes to ensure no corruption occurred. @@ -183,12 +183,12 @@ public class SignerProvider extends CommonBase { * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager */ - public Result_WriteableEcdsaChannelSignerDecodeErrorZ read_chan_signer(byte[] reader) { + public Result_EcdsaChannelSignerDecodeErrorZ read_chan_signer(byte[] reader) { long ret = bindings.SignerProvider_read_chan_signer(this.ptr, reader); Reference.reachabilityFence(this); Reference.reachabilityFence(reader); if (ret >= 0 && ret <= 4096) { return null; } - Result_WriteableEcdsaChannelSignerDecodeErrorZ ret_hu_conv = Result_WriteableEcdsaChannelSignerDecodeErrorZ.constr_from_ptr(ret); + Result_EcdsaChannelSignerDecodeErrorZ ret_hu_conv = Result_EcdsaChannelSignerDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Sleeper.java b/src/main/java/org/ldk/structs/Sleeper.java index 189e2bb0..5a12ca15 100644 --- a/src/main/java/org/ldk/structs/Sleeper.java +++ b/src/main/java/org/ldk/structs/Sleeper.java @@ -49,6 +49,23 @@ public class Sleeper extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new sleeper from three futures, allowing blocking on all three at once. + */ + public static Sleeper from_three_futures(org.ldk.structs.Future fut_a, org.ldk.structs.Future fut_b, org.ldk.structs.Future fut_c) { + long ret = bindings.Sleeper_from_three_futures(fut_a.ptr, fut_b.ptr, fut_c.ptr); + Reference.reachabilityFence(fut_a); + Reference.reachabilityFence(fut_b); + Reference.reachabilityFence(fut_c); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Sleeper ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Sleeper(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(fut_a); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(fut_b); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(fut_c); }; + return ret_hu_conv; + } + /** * Constructs a new sleeper on many futures, allowing blocking on all at once. */ diff --git a/src/main/java/org/ldk/structs/SocketAddress.java b/src/main/java/org/ldk/structs/SocketAddress.java index 0582f9ff..5e1e2310 100644 --- a/src/main/java/org/ldk/structs/SocketAddress.java +++ b/src/main/java/org/ldk/structs/SocketAddress.java @@ -221,7 +221,6 @@ public class SocketAddress extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.SocketAddress ret_hu_conv = org.ldk.structs.SocketAddress.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(hostname); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/SpendableOutputDescriptor.java b/src/main/java/org/ldk/structs/SpendableOutputDescriptor.java index 31f48461..97aebe4e 100644 --- a/src/main/java/org/ldk/structs/SpendableOutputDescriptor.java +++ b/src/main/java/org/ldk/structs/SpendableOutputDescriptor.java @@ -193,7 +193,6 @@ public class SpendableOutputDescriptor extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.SpendableOutputDescriptor ret_hu_conv = org.ldk.structs.SpendableOutputDescriptor.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(outpoint); }; return ret_hu_conv; } @@ -206,7 +205,6 @@ public class SpendableOutputDescriptor extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.SpendableOutputDescriptor ret_hu_conv = org.ldk.structs.SpendableOutputDescriptor.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; return ret_hu_conv; } @@ -219,7 +217,6 @@ public class SpendableOutputDescriptor extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.SpendableOutputDescriptor ret_hu_conv = org.ldk.structs.SpendableOutputDescriptor.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Splice.java b/src/main/java/org/ldk/structs/Splice.java deleted file mode 100644 index 5dae71a7..00000000 --- a/src/main/java/org/ldk/structs/Splice.java +++ /dev/null @@ -1,210 +0,0 @@ -package org.ldk.structs; - -import org.ldk.impl.bindings; -import org.ldk.enums.*; -import org.ldk.util.*; -import java.util.Arrays; -import java.lang.ref.Reference; -import javax.annotation.Nullable; - - -/** - * A splice message to be sent by or received from the stfu initiator (splice initiator). - */ -@SuppressWarnings("unchecked") // We correctly assign various generic arrays -public class Splice extends CommonBase { - Splice(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.Splice_free(ptr); } - } - - /** - * The channel ID where splicing is intended - */ - public ChannelId get_channel_id() { - long ret = bindings.Splice_get_channel_id(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - return ret_hu_conv; - } - - /** - * The channel ID where splicing is intended - */ - public void set_channel_id(org.ldk.structs.ChannelId val) { - bindings.Splice_set_channel_id(this.ptr, val.ptr); - Reference.reachabilityFence(this); - Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; - } - - /** - * The genesis hash of the blockchain where the channel is intended to be spliced - */ - public byte[] get_chain_hash() { - byte[] ret = bindings.Splice_get_chain_hash(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * The genesis hash of the blockchain where the channel is intended to be spliced - */ - public void set_chain_hash(byte[] val) { - bindings.Splice_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32)); - Reference.reachabilityFence(this); - Reference.reachabilityFence(val); - } - - /** - * The intended change in channel capacity: the amount to be added (positive value) - * or removed (negative value) by the sender (splice initiator) by splicing into/from the channel. - */ - public long get_relative_satoshis() { - long ret = bindings.Splice_get_relative_satoshis(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * The intended change in channel capacity: the amount to be added (positive value) - * or removed (negative value) by the sender (splice initiator) by splicing into/from the channel. - */ - public void set_relative_satoshis(long val) { - bindings.Splice_set_relative_satoshis(this.ptr, val); - Reference.reachabilityFence(this); - Reference.reachabilityFence(val); - } - - /** - * The feerate for the new funding transaction, set by the splice initiator - */ - public int get_funding_feerate_perkw() { - int ret = bindings.Splice_get_funding_feerate_perkw(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * The feerate for the new funding transaction, set by the splice initiator - */ - public void set_funding_feerate_perkw(int val) { - bindings.Splice_set_funding_feerate_perkw(this.ptr, val); - Reference.reachabilityFence(this); - Reference.reachabilityFence(val); - } - - /** - * The locktime for the new funding transaction - */ - public int get_locktime() { - int ret = bindings.Splice_get_locktime(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * The locktime for the new funding transaction - */ - public void set_locktime(int val) { - bindings.Splice_set_locktime(this.ptr, val); - Reference.reachabilityFence(this); - Reference.reachabilityFence(val); - } - - /** - * The key of the sender (splice initiator) controlling the new funding transaction - */ - public byte[] get_funding_pubkey() { - byte[] ret = bindings.Splice_get_funding_pubkey(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * The key of the sender (splice initiator) controlling the new funding transaction - */ - public void set_funding_pubkey(byte[] val) { - bindings.Splice_set_funding_pubkey(this.ptr, InternalUtils.check_arr_len(val, 33)); - Reference.reachabilityFence(this); - Reference.reachabilityFence(val); - } - - /** - * Constructs a new Splice given each field - */ - public static Splice of(org.ldk.structs.ChannelId channel_id_arg, byte[] chain_hash_arg, long relative_satoshis_arg, int funding_feerate_perkw_arg, int locktime_arg, byte[] funding_pubkey_arg) { - long ret = bindings.Splice_new(channel_id_arg.ptr, InternalUtils.check_arr_len(chain_hash_arg, 32), relative_satoshis_arg, funding_feerate_perkw_arg, locktime_arg, InternalUtils.check_arr_len(funding_pubkey_arg, 33)); - Reference.reachabilityFence(channel_id_arg); - Reference.reachabilityFence(chain_hash_arg); - Reference.reachabilityFence(relative_satoshis_arg); - Reference.reachabilityFence(funding_feerate_perkw_arg); - Reference.reachabilityFence(locktime_arg); - Reference.reachabilityFence(funding_pubkey_arg); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Splice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Splice(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id_arg); }; - return ret_hu_conv; - } - - long clone_ptr() { - long ret = bindings.Splice_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Creates a copy of the Splice - */ - public Splice clone() { - long ret = bindings.Splice_clone(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Splice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Splice(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - return ret_hu_conv; - } - - /** - * Checks if two Splices contain equal inner contents. - * This ignores pointers and is_owned flags and looks at the values in fields. - * Two objects with NULL inner values will be considered "equal" here. - */ - public boolean eq(org.ldk.structs.Splice b) { - boolean ret = bindings.Splice_eq(this.ptr, b.ptr); - Reference.reachabilityFence(this); - Reference.reachabilityFence(b); - if (this != null) { this.ptrs_to.add(b); }; - return ret; - } - - @Override public boolean equals(Object o) { - if (!(o instanceof Splice)) return false; - return this.eq((Splice)o); - } - /** - * Serialize the Splice object into a byte array which can be read by Splice_read - */ - public byte[] write() { - byte[] ret = bindings.Splice_write(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Read a Splice from a byte array, created by Splice_write - */ - public static Result_SpliceDecodeErrorZ read(byte[] ser) { - long ret = bindings.Splice_read(ser); - Reference.reachabilityFence(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_SpliceDecodeErrorZ ret_hu_conv = Result_SpliceDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} diff --git a/src/main/java/org/ldk/structs/SpliceAck.java b/src/main/java/org/ldk/structs/SpliceAck.java index 5de9488e..722473cb 100644 --- a/src/main/java/org/ldk/structs/SpliceAck.java +++ b/src/main/java/org/ldk/structs/SpliceAck.java @@ -9,7 +9,7 @@ import javax.annotation.Nullable; /** - * A splice_ack message to be received by or sent to the splice initiator. + * A `splice_ack` message to be received by or sent to the splice initiator. */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class SpliceAck extends CommonBase { @@ -39,61 +39,60 @@ public class SpliceAck extends CommonBase { bindings.SpliceAck_set_channel_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** - * The genesis hash of the blockchain where the channel is intended to be spliced + * The amount the splice acceptor is intending to add to its channel balance (splice-in) + * or remove from its channel balance (splice-out). */ - public byte[] get_chain_hash() { - byte[] ret = bindings.SpliceAck_get_chain_hash(this.ptr); + public long get_funding_contribution_satoshis() { + long ret = bindings.SpliceAck_get_funding_contribution_satoshis(this.ptr); Reference.reachabilityFence(this); return ret; } /** - * The genesis hash of the blockchain where the channel is intended to be spliced + * The amount the splice acceptor is intending to add to its channel balance (splice-in) + * or remove from its channel balance (splice-out). */ - public void set_chain_hash(byte[] val) { - bindings.SpliceAck_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32)); + public void set_funding_contribution_satoshis(long val) { + bindings.SpliceAck_set_funding_contribution_satoshis(this.ptr, val); Reference.reachabilityFence(this); Reference.reachabilityFence(val); } /** - * The intended change in channel capacity: the amount to be added (positive value) - * or removed (negative value) by the sender (splice acceptor) by splicing into/from the channel. + * The key of the sender (splice acceptor) controlling the new funding transaction */ - public long get_relative_satoshis() { - long ret = bindings.SpliceAck_get_relative_satoshis(this.ptr); + public byte[] get_funding_pubkey() { + byte[] ret = bindings.SpliceAck_get_funding_pubkey(this.ptr); Reference.reachabilityFence(this); return ret; } /** - * The intended change in channel capacity: the amount to be added (positive value) - * or removed (negative value) by the sender (splice acceptor) by splicing into/from the channel. + * The key of the sender (splice acceptor) controlling the new funding transaction */ - public void set_relative_satoshis(long val) { - bindings.SpliceAck_set_relative_satoshis(this.ptr, val); + public void set_funding_pubkey(byte[] val) { + bindings.SpliceAck_set_funding_pubkey(this.ptr, InternalUtils.check_arr_len(val, 33)); Reference.reachabilityFence(this); Reference.reachabilityFence(val); } /** - * The key of the sender (splice acceptor) controlling the new funding transaction + * If set, only confirmed inputs added (by the splice initiator) will be accepted */ - public byte[] get_funding_pubkey() { - byte[] ret = bindings.SpliceAck_get_funding_pubkey(this.ptr); + public COption_NoneZ get_require_confirmed_inputs() { + COption_NoneZ ret = bindings.SpliceAck_get_require_confirmed_inputs(this.ptr); Reference.reachabilityFence(this); return ret; } /** - * The key of the sender (splice acceptor) controlling the new funding transaction + * If set, only confirmed inputs added (by the splice initiator) will be accepted */ - public void set_funding_pubkey(byte[] val) { - bindings.SpliceAck_set_funding_pubkey(this.ptr, InternalUtils.check_arr_len(val, 33)); + public void set_require_confirmed_inputs(org.ldk.enums.COption_NoneZ val) { + bindings.SpliceAck_set_require_confirmed_inputs(this.ptr, val); Reference.reachabilityFence(this); Reference.reachabilityFence(val); } @@ -101,16 +100,15 @@ public class SpliceAck extends CommonBase { /** * Constructs a new SpliceAck given each field */ - public static SpliceAck of(org.ldk.structs.ChannelId channel_id_arg, byte[] chain_hash_arg, long relative_satoshis_arg, byte[] funding_pubkey_arg) { - long ret = bindings.SpliceAck_new(channel_id_arg.ptr, InternalUtils.check_arr_len(chain_hash_arg, 32), relative_satoshis_arg, InternalUtils.check_arr_len(funding_pubkey_arg, 33)); + public static SpliceAck of(org.ldk.structs.ChannelId channel_id_arg, long funding_contribution_satoshis_arg, byte[] funding_pubkey_arg, org.ldk.enums.COption_NoneZ require_confirmed_inputs_arg) { + long ret = bindings.SpliceAck_new(channel_id_arg.ptr, funding_contribution_satoshis_arg, InternalUtils.check_arr_len(funding_pubkey_arg, 33), require_confirmed_inputs_arg); Reference.reachabilityFence(channel_id_arg); - Reference.reachabilityFence(chain_hash_arg); - Reference.reachabilityFence(relative_satoshis_arg); + Reference.reachabilityFence(funding_contribution_satoshis_arg); Reference.reachabilityFence(funding_pubkey_arg); + Reference.reachabilityFence(require_confirmed_inputs_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.SpliceAck ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.SpliceAck(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/SpliceInit.java b/src/main/java/org/ldk/structs/SpliceInit.java new file mode 100644 index 00000000..91ca6f68 --- /dev/null +++ b/src/main/java/org/ldk/structs/SpliceInit.java @@ -0,0 +1,208 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * A `splice_init` message to be sent by or received from the stfu initiator (splice initiator). + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class SpliceInit extends CommonBase { + SpliceInit(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.SpliceInit_free(ptr); } + } + + /** + * The channel ID where splicing is intended + */ + public ChannelId get_channel_id() { + long ret = bindings.SpliceInit_get_channel_id(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * The channel ID where splicing is intended + */ + public void set_channel_id(org.ldk.structs.ChannelId val) { + bindings.SpliceInit_set_channel_id(this.ptr, val.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * The amount the splice initiator is intending to add to its channel balance (splice-in) + * or remove from its channel balance (splice-out). + */ + public long get_funding_contribution_satoshis() { + long ret = bindings.SpliceInit_get_funding_contribution_satoshis(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * The amount the splice initiator is intending to add to its channel balance (splice-in) + * or remove from its channel balance (splice-out). + */ + public void set_funding_contribution_satoshis(long val) { + bindings.SpliceInit_set_funding_contribution_satoshis(this.ptr, val); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * The feerate for the new funding transaction, set by the splice initiator + */ + public int get_funding_feerate_perkw() { + int ret = bindings.SpliceInit_get_funding_feerate_perkw(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * The feerate for the new funding transaction, set by the splice initiator + */ + public void set_funding_feerate_perkw(int val) { + bindings.SpliceInit_set_funding_feerate_perkw(this.ptr, val); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * The locktime for the new funding transaction + */ + public int get_locktime() { + int ret = bindings.SpliceInit_get_locktime(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * The locktime for the new funding transaction + */ + public void set_locktime(int val) { + bindings.SpliceInit_set_locktime(this.ptr, val); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * The key of the sender (splice initiator) controlling the new funding transaction + */ + public byte[] get_funding_pubkey() { + byte[] ret = bindings.SpliceInit_get_funding_pubkey(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * The key of the sender (splice initiator) controlling the new funding transaction + */ + public void set_funding_pubkey(byte[] val) { + bindings.SpliceInit_set_funding_pubkey(this.ptr, InternalUtils.check_arr_len(val, 33)); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * If set, only confirmed inputs added (by the splice acceptor) will be accepted + */ + public COption_NoneZ get_require_confirmed_inputs() { + COption_NoneZ ret = bindings.SpliceInit_get_require_confirmed_inputs(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * If set, only confirmed inputs added (by the splice acceptor) will be accepted + */ + public void set_require_confirmed_inputs(org.ldk.enums.COption_NoneZ val) { + bindings.SpliceInit_set_require_confirmed_inputs(this.ptr, val); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * Constructs a new SpliceInit given each field + */ + public static SpliceInit of(org.ldk.structs.ChannelId channel_id_arg, long funding_contribution_satoshis_arg, int funding_feerate_perkw_arg, int locktime_arg, byte[] funding_pubkey_arg, org.ldk.enums.COption_NoneZ require_confirmed_inputs_arg) { + long ret = bindings.SpliceInit_new(channel_id_arg.ptr, funding_contribution_satoshis_arg, funding_feerate_perkw_arg, locktime_arg, InternalUtils.check_arr_len(funding_pubkey_arg, 33), require_confirmed_inputs_arg); + Reference.reachabilityFence(channel_id_arg); + Reference.reachabilityFence(funding_contribution_satoshis_arg); + Reference.reachabilityFence(funding_feerate_perkw_arg); + Reference.reachabilityFence(locktime_arg); + Reference.reachabilityFence(funding_pubkey_arg); + Reference.reachabilityFence(require_confirmed_inputs_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.SpliceInit ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.SpliceInit(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + long clone_ptr() { + long ret = bindings.SpliceInit_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the SpliceInit + */ + public SpliceInit clone() { + long ret = bindings.SpliceInit_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.SpliceInit ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.SpliceInit(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Checks if two SpliceInits contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public boolean eq(org.ldk.structs.SpliceInit b) { + boolean ret = bindings.SpliceInit_eq(this.ptr, b.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(b); + if (this != null) { this.ptrs_to.add(b); }; + return ret; + } + + @Override public boolean equals(Object o) { + if (!(o instanceof SpliceInit)) return false; + return this.eq((SpliceInit)o); + } + /** + * Serialize the SpliceInit object into a byte array which can be read by SpliceInit_read + */ + public byte[] write() { + byte[] ret = bindings.SpliceInit_write(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Read a SpliceInit from a byte array, created by SpliceInit_write + */ + public static Result_SpliceInitDecodeErrorZ read(byte[] ser) { + long ret = bindings.SpliceInit_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_SpliceInitDecodeErrorZ ret_hu_conv = Result_SpliceInitDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/SpliceLocked.java b/src/main/java/org/ldk/structs/SpliceLocked.java index 84233bc5..b2dff839 100644 --- a/src/main/java/org/ldk/structs/SpliceLocked.java +++ b/src/main/java/org/ldk/structs/SpliceLocked.java @@ -9,7 +9,7 @@ import javax.annotation.Nullable; /** - * A splice_locked message to be sent to or received from a peer. + * A `splice_locked` message to be sent to or received from a peer. */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class SpliceLocked extends CommonBase { @@ -39,19 +39,36 @@ public class SpliceLocked extends CommonBase { bindings.SpliceLocked_set_channel_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; + } + + /** + * The ID of the new funding transaction that has been locked + */ + public byte[] get_splice_txid() { + byte[] ret = bindings.SpliceLocked_get_splice_txid(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * The ID of the new funding transaction that has been locked + */ + public void set_splice_txid(byte[] val) { + bindings.SpliceLocked_set_splice_txid(this.ptr, InternalUtils.check_arr_len(val, 32)); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); } /** * Constructs a new SpliceLocked given each field */ - public static SpliceLocked of(org.ldk.structs.ChannelId channel_id_arg) { - long ret = bindings.SpliceLocked_new(channel_id_arg.ptr); + public static SpliceLocked of(org.ldk.structs.ChannelId channel_id_arg, byte[] splice_txid_arg) { + long ret = bindings.SpliceLocked_new(channel_id_arg.ptr, InternalUtils.check_arr_len(splice_txid_arg, 32)); Reference.reachabilityFence(channel_id_arg); + Reference.reachabilityFence(splice_txid_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.SpliceLocked ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.SpliceLocked(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/StaticPaymentOutputDescriptor.java b/src/main/java/org/ldk/structs/StaticPaymentOutputDescriptor.java index 4a82daa9..992deb65 100644 --- a/src/main/java/org/ldk/structs/StaticPaymentOutputDescriptor.java +++ b/src/main/java/org/ldk/structs/StaticPaymentOutputDescriptor.java @@ -41,7 +41,6 @@ public class StaticPaymentOutputDescriptor extends CommonBase { bindings.StaticPaymentOutputDescriptor_set_outpoint(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -132,7 +131,6 @@ public class StaticPaymentOutputDescriptor extends CommonBase { bindings.StaticPaymentOutputDescriptor_set_channel_transaction_parameters(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -150,8 +148,6 @@ public class StaticPaymentOutputDescriptor extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.StaticPaymentOutputDescriptor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.StaticPaymentOutputDescriptor(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(outpoint_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_transaction_parameters_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Stfu.java b/src/main/java/org/ldk/structs/Stfu.java index 2fd33917..304ce49b 100644 --- a/src/main/java/org/ldk/structs/Stfu.java +++ b/src/main/java/org/ldk/structs/Stfu.java @@ -9,7 +9,7 @@ import javax.annotation.Nullable; /** - * An stfu (quiescence) message to be sent by or received from the stfu initiator. + * An `stfu` (quiescence) message to be sent by or received from the stfu initiator. */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Stfu extends CommonBase { @@ -39,7 +39,6 @@ public class Stfu extends CommonBase { bindings.Stfu_set_channel_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -70,7 +69,6 @@ public class Stfu extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Stfu ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Stfu(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.java b/src/main/java/org/ldk/structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.java index 1af008aa..c56c2aa9 100644 --- a/src/main/java/org/ldk/structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.java +++ b/src/main/java/org/ldk/structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.java @@ -86,9 +86,6 @@ public class ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ extends C if (ret >= 0 && ret <= 4096) { return null; } ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ ret_hu_conv = new ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ(null, ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(c); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ThreeTuple_OffersMessageDestinationBlindedPathZ.java b/src/main/java/org/ldk/structs/ThreeTuple_OffersMessageDestinationBlindedPathZ.java deleted file mode 100644 index 5249a09c..00000000 --- a/src/main/java/org/ldk/structs/ThreeTuple_OffersMessageDestinationBlindedPathZ.java +++ /dev/null @@ -1,95 +0,0 @@ -package org.ldk.structs; - -import org.ldk.impl.bindings; -import org.ldk.enums.*; -import org.ldk.util.*; -import java.util.Arrays; -import java.lang.ref.Reference; -import javax.annotation.Nullable; - - -/** - * A Tuple - */ -@SuppressWarnings("unchecked") // We correctly assign various generic arrays -public class ThreeTuple_OffersMessageDestinationBlindedPathZ extends CommonBase { - ThreeTuple_OffersMessageDestinationBlindedPathZ(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.C3Tuple_OffersMessageDestinationBlindedPathZ_free(ptr); } - } - - /** - * - */ - public OffersMessage get_a() { - long ret = bindings.C3Tuple_OffersMessageDestinationBlindedPathZ_get_a(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.OffersMessage ret_hu_conv = org.ldk.structs.OffersMessage.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - return ret_hu_conv; - } - - /** - * - */ - public Destination get_b() { - long ret = bindings.C3Tuple_OffersMessageDestinationBlindedPathZ_get_b(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Destination ret_hu_conv = org.ldk.structs.Destination.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - return ret_hu_conv; - } - - /** - * - */ - public BlindedPath get_c() { - long ret = bindings.C3Tuple_OffersMessageDestinationBlindedPathZ_get_c(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.BlindedPath ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedPath(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - return ret_hu_conv; - } - - long clone_ptr() { - long ret = bindings.C3Tuple_OffersMessageDestinationBlindedPathZ_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Creates a new tuple which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public ThreeTuple_OffersMessageDestinationBlindedPathZ clone() { - long ret = bindings.C3Tuple_OffersMessageDestinationBlindedPathZ_clone(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - ThreeTuple_OffersMessageDestinationBlindedPathZ ret_hu_conv = new ThreeTuple_OffersMessageDestinationBlindedPathZ(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - return ret_hu_conv; - } - - /** - * Creates a new C3Tuple_OffersMessageDestinationBlindedPathZ from the contained elements. - */ - public static ThreeTuple_OffersMessageDestinationBlindedPathZ of(org.ldk.structs.OffersMessage a, org.ldk.structs.Destination b, org.ldk.structs.BlindedPath c) { - long ret = bindings.C3Tuple_OffersMessageDestinationBlindedPathZ_new(a.ptr, b.ptr, c.ptr); - Reference.reachabilityFence(a); - Reference.reachabilityFence(b); - Reference.reachabilityFence(c); - if (ret >= 0 && ret <= 4096) { return null; } - ThreeTuple_OffersMessageDestinationBlindedPathZ ret_hu_conv = new ThreeTuple_OffersMessageDestinationBlindedPathZ(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(c); }; - return ret_hu_conv; - } - -} diff --git a/src/main/java/org/ldk/structs/ThreeTuple_OnionMessageContentsDestinationBlindedPathZ.java b/src/main/java/org/ldk/structs/ThreeTuple_OnionMessageContentsDestinationBlindedPathZ.java deleted file mode 100644 index fb0341ec..00000000 --- a/src/main/java/org/ldk/structs/ThreeTuple_OnionMessageContentsDestinationBlindedPathZ.java +++ /dev/null @@ -1,95 +0,0 @@ -package org.ldk.structs; - -import org.ldk.impl.bindings; -import org.ldk.enums.*; -import org.ldk.util.*; -import java.util.Arrays; -import java.lang.ref.Reference; -import javax.annotation.Nullable; - - -/** - * A Tuple - */ -@SuppressWarnings("unchecked") // We correctly assign various generic arrays -public class ThreeTuple_OnionMessageContentsDestinationBlindedPathZ extends CommonBase { - ThreeTuple_OnionMessageContentsDestinationBlindedPathZ(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.C3Tuple_OnionMessageContentsDestinationBlindedPathZ_free(ptr); } - } - - /** - * - */ - public OnionMessageContents get_a() { - long ret = bindings.C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_a(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - OnionMessageContents ret_hu_conv = new OnionMessageContents(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - return ret_hu_conv; - } - - /** - * - */ - public Destination get_b() { - long ret = bindings.C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_b(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Destination ret_hu_conv = org.ldk.structs.Destination.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - return ret_hu_conv; - } - - /** - * - */ - public BlindedPath get_c() { - long ret = bindings.C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_c(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.BlindedPath ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedPath(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - return ret_hu_conv; - } - - long clone_ptr() { - long ret = bindings.C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Creates a new tuple which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public ThreeTuple_OnionMessageContentsDestinationBlindedPathZ clone() { - long ret = bindings.C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - ThreeTuple_OnionMessageContentsDestinationBlindedPathZ ret_hu_conv = new ThreeTuple_OnionMessageContentsDestinationBlindedPathZ(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - return ret_hu_conv; - } - - /** - * Creates a new C3Tuple_OnionMessageContentsDestinationBlindedPathZ from the contained elements. - */ - public static ThreeTuple_OnionMessageContentsDestinationBlindedPathZ of(org.ldk.structs.OnionMessageContents a, org.ldk.structs.Destination b, org.ldk.structs.BlindedPath c) { - long ret = bindings.C3Tuple_OnionMessageContentsDestinationBlindedPathZ_new(a.ptr, b.ptr, c.ptr); - Reference.reachabilityFence(a); - Reference.reachabilityFence(b); - Reference.reachabilityFence(c); - if (ret >= 0 && ret <= 4096) { return null; } - ThreeTuple_OnionMessageContentsDestinationBlindedPathZ ret_hu_conv = new ThreeTuple_OnionMessageContentsDestinationBlindedPathZ(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(c); }; - return ret_hu_conv; - } - -} diff --git a/src/main/java/org/ldk/structs/ThreeTuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ.java b/src/main/java/org/ldk/structs/ThreeTuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ.java index 16877fcc..48fa59b7 100644 --- a/src/main/java/org/ldk/structs/ThreeTuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ.java +++ b/src/main/java/org/ldk/structs/ThreeTuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ.java @@ -83,8 +83,6 @@ public class ThreeTuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ exten if (ret >= 0 && ret <= 4096) { return null; } ThreeTuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ ret_hu_conv = new ThreeTuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ(null, ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(c); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ.java b/src/main/java/org/ldk/structs/ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ.java index b90d91e1..5524307c 100644 --- a/src/main/java/org/ldk/structs/ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ.java +++ b/src/main/java/org/ldk/structs/ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ.java @@ -83,8 +83,6 @@ public class ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ extends Com if (ret >= 0 && ret <= 4096) { return null; } ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ ret_hu_conv = new ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ(null, ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(c); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ThreeTuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ.java b/src/main/java/org/ldk/structs/ThreeTuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ.java index 936d75ae..3ab2b246 100644 --- a/src/main/java/org/ldk/structs/ThreeTuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ.java +++ b/src/main/java/org/ldk/structs/ThreeTuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ.java @@ -83,8 +83,6 @@ public class ThreeTuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ exten if (ret >= 0 && ret <= 4096) { return null; } ThreeTuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ ret_hu_conv = new ThreeTuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ(null, ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(c); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ThreeTuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ.java b/src/main/java/org/ldk/structs/ThreeTuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ.java index 7b38d3fc..0f873d8e 100644 --- a/src/main/java/org/ldk/structs/ThreeTuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ.java +++ b/src/main/java/org/ldk/structs/ThreeTuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ.java @@ -80,7 +80,6 @@ public class ThreeTuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ extends Common if (ret >= 0 && ret <= 4096) { return null; } ThreeTuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ ret_hu_conv = new ThreeTuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ(null, ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(c); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/TrackedSpendableOutput.java b/src/main/java/org/ldk/structs/TrackedSpendableOutput.java index 5cd542a2..2eab8d90 100644 --- a/src/main/java/org/ldk/structs/TrackedSpendableOutput.java +++ b/src/main/java/org/ldk/structs/TrackedSpendableOutput.java @@ -39,7 +39,6 @@ public class TrackedSpendableOutput extends CommonBase { bindings.TrackedSpendableOutput_set_descriptor(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -70,7 +69,6 @@ public class TrackedSpendableOutput extends CommonBase { bindings.TrackedSpendableOutput_set_channel_id(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -92,7 +90,6 @@ public class TrackedSpendableOutput extends CommonBase { bindings.TrackedSpendableOutput_set_status(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -108,9 +105,6 @@ public class TrackedSpendableOutput extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.TrackedSpendableOutput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TrackedSpendableOutput(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(descriptor_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(status_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/TransactionU16LenLimited.java b/src/main/java/org/ldk/structs/TransactionU16LenLimited.java index 67fac554..3b4a804e 100644 --- a/src/main/java/org/ldk/structs/TransactionU16LenLimited.java +++ b/src/main/java/org/ldk/structs/TransactionU16LenLimited.java @@ -88,7 +88,7 @@ public class TransactionU16LenLimited extends CommonBase { public byte[] into_transaction() { byte[] ret = bindings.TransactionU16LenLimited_into_transaction(this.ptr); Reference.reachabilityFence(this); - if (this != null) { this.ptrs_to.add(this); }; + ; return ret; } diff --git a/src/main/java/org/ldk/structs/TwoTuple_AsyncPaymentsMessageMessageSendInstructionsZ.java b/src/main/java/org/ldk/structs/TwoTuple_AsyncPaymentsMessageMessageSendInstructionsZ.java new file mode 100644 index 00000000..4a07f44e --- /dev/null +++ b/src/main/java/org/ldk/structs/TwoTuple_AsyncPaymentsMessageMessageSendInstructionsZ.java @@ -0,0 +1,79 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * A Tuple + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class TwoTuple_AsyncPaymentsMessageMessageSendInstructionsZ extends CommonBase { + TwoTuple_AsyncPaymentsMessageMessageSendInstructionsZ(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_free(ptr); } + } + + /** + * + */ + public AsyncPaymentsMessage get_a() { + long ret = bindings.C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_get_a(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.AsyncPaymentsMessage ret_hu_conv = org.ldk.structs.AsyncPaymentsMessage.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * + */ + public MessageSendInstructions get_b() { + long ret = bindings.C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_get_b(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageSendInstructions ret_hu_conv = org.ldk.structs.MessageSendInstructions.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + long clone_ptr() { + long ret = bindings.C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new tuple which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public TwoTuple_AsyncPaymentsMessageMessageSendInstructionsZ clone() { + long ret = bindings.C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_AsyncPaymentsMessageMessageSendInstructionsZ ret_hu_conv = new TwoTuple_AsyncPaymentsMessageMessageSendInstructionsZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Creates a new C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ from the contained elements. + */ + public static TwoTuple_AsyncPaymentsMessageMessageSendInstructionsZ of(org.ldk.structs.AsyncPaymentsMessage a, org.ldk.structs.MessageSendInstructions b) { + long ret = bindings.C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_new(a.ptr, b.ptr); + Reference.reachabilityFence(a); + Reference.reachabilityFence(b); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_AsyncPaymentsMessageMessageSendInstructionsZ ret_hu_conv = new TwoTuple_AsyncPaymentsMessageMessageSendInstructionsZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/TwoTuple_BestBlockOutputSweeperZ.java b/src/main/java/org/ldk/structs/TwoTuple_BestBlockOutputSweeperZ.java index d145884d..7ce924d7 100644 --- a/src/main/java/org/ldk/structs/TwoTuple_BestBlockOutputSweeperZ.java +++ b/src/main/java/org/ldk/structs/TwoTuple_BestBlockOutputSweeperZ.java @@ -61,8 +61,7 @@ public class TwoTuple_BestBlockOutputSweeperZ extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } TwoTuple_BestBlockOutputSweeperZ ret_hu_conv = new TwoTuple_BestBlockOutputSweeperZ(null, ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b_best_block); }; + ; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b_broadcaster); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b_fee_estimator); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b_chain_data_source); }; diff --git a/src/main/java/org/ldk/structs/TwoTuple_BlindedPayInfoBlindedPathZ.java b/src/main/java/org/ldk/structs/TwoTuple_BlindedPayInfoBlindedPathZ.java deleted file mode 100644 index ff721e1a..00000000 --- a/src/main/java/org/ldk/structs/TwoTuple_BlindedPayInfoBlindedPathZ.java +++ /dev/null @@ -1,81 +0,0 @@ -package org.ldk.structs; - -import org.ldk.impl.bindings; -import org.ldk.enums.*; -import org.ldk.util.*; -import java.util.Arrays; -import java.lang.ref.Reference; -import javax.annotation.Nullable; - - -/** - * A Tuple - */ -@SuppressWarnings("unchecked") // We correctly assign various generic arrays -public class TwoTuple_BlindedPayInfoBlindedPathZ extends CommonBase { - TwoTuple_BlindedPayInfoBlindedPathZ(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.C2Tuple_BlindedPayInfoBlindedPathZ_free(ptr); } - } - - /** - * - */ - public BlindedPayInfo get_a() { - long ret = bindings.C2Tuple_BlindedPayInfoBlindedPathZ_get_a(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.BlindedPayInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedPayInfo(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - return ret_hu_conv; - } - - /** - * - */ - public BlindedPath get_b() { - long ret = bindings.C2Tuple_BlindedPayInfoBlindedPathZ_get_b(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.BlindedPath ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedPath(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - return ret_hu_conv; - } - - long clone_ptr() { - long ret = bindings.C2Tuple_BlindedPayInfoBlindedPathZ_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Creates a new tuple which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public TwoTuple_BlindedPayInfoBlindedPathZ clone() { - long ret = bindings.C2Tuple_BlindedPayInfoBlindedPathZ_clone(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - TwoTuple_BlindedPayInfoBlindedPathZ ret_hu_conv = new TwoTuple_BlindedPayInfoBlindedPathZ(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - return ret_hu_conv; - } - - /** - * Creates a new C2Tuple_BlindedPayInfoBlindedPathZ from the contained elements. - */ - public static TwoTuple_BlindedPayInfoBlindedPathZ of(org.ldk.structs.BlindedPayInfo a, org.ldk.structs.BlindedPath b) { - long ret = bindings.C2Tuple_BlindedPayInfoBlindedPathZ_new(a.ptr, b.ptr); - Reference.reachabilityFence(a); - Reference.reachabilityFence(b); - if (ret >= 0 && ret <= 4096) { return null; } - TwoTuple_BlindedPayInfoBlindedPathZ ret_hu_conv = new TwoTuple_BlindedPayInfoBlindedPathZ(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b); }; - return ret_hu_conv; - } - -} diff --git a/src/main/java/org/ldk/structs/TwoTuple_ChannelIdPublicKeyZ.java b/src/main/java/org/ldk/structs/TwoTuple_ChannelIdPublicKeyZ.java index c65fa928..19f51b40 100644 --- a/src/main/java/org/ldk/structs/TwoTuple_ChannelIdPublicKeyZ.java +++ b/src/main/java/org/ldk/structs/TwoTuple_ChannelIdPublicKeyZ.java @@ -70,7 +70,6 @@ public class TwoTuple_ChannelIdPublicKeyZ extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } TwoTuple_ChannelIdPublicKeyZ ret_hu_conv = new TwoTuple_ChannelIdPublicKeyZ(null, ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/TwoTuple_OffersMessageMessageSendInstructionsZ.java b/src/main/java/org/ldk/structs/TwoTuple_OffersMessageMessageSendInstructionsZ.java new file mode 100644 index 00000000..c3b5117f --- /dev/null +++ b/src/main/java/org/ldk/structs/TwoTuple_OffersMessageMessageSendInstructionsZ.java @@ -0,0 +1,79 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * A Tuple + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class TwoTuple_OffersMessageMessageSendInstructionsZ extends CommonBase { + TwoTuple_OffersMessageMessageSendInstructionsZ(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.C2Tuple_OffersMessageMessageSendInstructionsZ_free(ptr); } + } + + /** + * + */ + public OffersMessage get_a() { + long ret = bindings.C2Tuple_OffersMessageMessageSendInstructionsZ_get_a(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OffersMessage ret_hu_conv = org.ldk.structs.OffersMessage.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * + */ + public MessageSendInstructions get_b() { + long ret = bindings.C2Tuple_OffersMessageMessageSendInstructionsZ_get_b(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageSendInstructions ret_hu_conv = org.ldk.structs.MessageSendInstructions.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + long clone_ptr() { + long ret = bindings.C2Tuple_OffersMessageMessageSendInstructionsZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new tuple which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public TwoTuple_OffersMessageMessageSendInstructionsZ clone() { + long ret = bindings.C2Tuple_OffersMessageMessageSendInstructionsZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_OffersMessageMessageSendInstructionsZ ret_hu_conv = new TwoTuple_OffersMessageMessageSendInstructionsZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Creates a new C2Tuple_OffersMessageMessageSendInstructionsZ from the contained elements. + */ + public static TwoTuple_OffersMessageMessageSendInstructionsZ of(org.ldk.structs.OffersMessage a, org.ldk.structs.MessageSendInstructions b) { + long ret = bindings.C2Tuple_OffersMessageMessageSendInstructionsZ_new(a.ptr, b.ptr); + Reference.reachabilityFence(a); + Reference.reachabilityFence(b); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_OffersMessageMessageSendInstructionsZ ret_hu_conv = new TwoTuple_OffersMessageMessageSendInstructionsZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/TwoTuple_OffersMessageResponseInstructionZ.java b/src/main/java/org/ldk/structs/TwoTuple_OffersMessageResponseInstructionZ.java new file mode 100644 index 00000000..233a67e3 --- /dev/null +++ b/src/main/java/org/ldk/structs/TwoTuple_OffersMessageResponseInstructionZ.java @@ -0,0 +1,79 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * A Tuple + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class TwoTuple_OffersMessageResponseInstructionZ extends CommonBase { + TwoTuple_OffersMessageResponseInstructionZ(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.C2Tuple_OffersMessageResponseInstructionZ_free(ptr); } + } + + /** + * + */ + public OffersMessage get_a() { + long ret = bindings.C2Tuple_OffersMessageResponseInstructionZ_get_a(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OffersMessage ret_hu_conv = org.ldk.structs.OffersMessage.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * + */ + public ResponseInstruction get_b() { + long ret = bindings.C2Tuple_OffersMessageResponseInstructionZ_get_b(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ResponseInstruction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ResponseInstruction(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + long clone_ptr() { + long ret = bindings.C2Tuple_OffersMessageResponseInstructionZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new tuple which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public TwoTuple_OffersMessageResponseInstructionZ clone() { + long ret = bindings.C2Tuple_OffersMessageResponseInstructionZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_OffersMessageResponseInstructionZ ret_hu_conv = new TwoTuple_OffersMessageResponseInstructionZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Creates a new C2Tuple_OffersMessageResponseInstructionZ from the contained elements. + */ + public static TwoTuple_OffersMessageResponseInstructionZ of(org.ldk.structs.OffersMessage a, org.ldk.structs.ResponseInstruction b) { + long ret = bindings.C2Tuple_OffersMessageResponseInstructionZ_new(a.ptr, b.ptr); + Reference.reachabilityFence(a); + Reference.reachabilityFence(b); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_OffersMessageResponseInstructionZ ret_hu_conv = new TwoTuple_OffersMessageResponseInstructionZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/TwoTuple_OnionMessageContentsMessageSendInstructionsZ.java b/src/main/java/org/ldk/structs/TwoTuple_OnionMessageContentsMessageSendInstructionsZ.java new file mode 100644 index 00000000..f83ede85 --- /dev/null +++ b/src/main/java/org/ldk/structs/TwoTuple_OnionMessageContentsMessageSendInstructionsZ.java @@ -0,0 +1,80 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * A Tuple + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class TwoTuple_OnionMessageContentsMessageSendInstructionsZ extends CommonBase { + TwoTuple_OnionMessageContentsMessageSendInstructionsZ(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.C2Tuple_OnionMessageContentsMessageSendInstructionsZ_free(ptr); } + } + + /** + * + */ + public OnionMessageContents get_a() { + long ret = bindings.C2Tuple_OnionMessageContentsMessageSendInstructionsZ_get_a(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + OnionMessageContents ret_hu_conv = new OnionMessageContents(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * + */ + public MessageSendInstructions get_b() { + long ret = bindings.C2Tuple_OnionMessageContentsMessageSendInstructionsZ_get_b(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageSendInstructions ret_hu_conv = org.ldk.structs.MessageSendInstructions.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + long clone_ptr() { + long ret = bindings.C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new tuple which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public TwoTuple_OnionMessageContentsMessageSendInstructionsZ clone() { + long ret = bindings.C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_OnionMessageContentsMessageSendInstructionsZ ret_hu_conv = new TwoTuple_OnionMessageContentsMessageSendInstructionsZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Creates a new C2Tuple_OnionMessageContentsMessageSendInstructionsZ from the contained elements. + */ + public static TwoTuple_OnionMessageContentsMessageSendInstructionsZ of(org.ldk.structs.OnionMessageContents a, org.ldk.structs.MessageSendInstructions b) { + long ret = bindings.C2Tuple_OnionMessageContentsMessageSendInstructionsZ_new(a.ptr, b.ptr); + Reference.reachabilityFence(a); + Reference.reachabilityFence(b); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_OnionMessageContentsMessageSendInstructionsZ ret_hu_conv = new TwoTuple_OnionMessageContentsMessageSendInstructionsZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/TwoTuple_OnionMessageContentsResponseInstructionZ.java b/src/main/java/org/ldk/structs/TwoTuple_OnionMessageContentsResponseInstructionZ.java new file mode 100644 index 00000000..e45fd697 --- /dev/null +++ b/src/main/java/org/ldk/structs/TwoTuple_OnionMessageContentsResponseInstructionZ.java @@ -0,0 +1,80 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * A Tuple + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class TwoTuple_OnionMessageContentsResponseInstructionZ extends CommonBase { + TwoTuple_OnionMessageContentsResponseInstructionZ(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.C2Tuple_OnionMessageContentsResponseInstructionZ_free(ptr); } + } + + /** + * + */ + public OnionMessageContents get_a() { + long ret = bindings.C2Tuple_OnionMessageContentsResponseInstructionZ_get_a(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + OnionMessageContents ret_hu_conv = new OnionMessageContents(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * + */ + public ResponseInstruction get_b() { + long ret = bindings.C2Tuple_OnionMessageContentsResponseInstructionZ_get_b(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ResponseInstruction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ResponseInstruction(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + long clone_ptr() { + long ret = bindings.C2Tuple_OnionMessageContentsResponseInstructionZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new tuple which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public TwoTuple_OnionMessageContentsResponseInstructionZ clone() { + long ret = bindings.C2Tuple_OnionMessageContentsResponseInstructionZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_OnionMessageContentsResponseInstructionZ ret_hu_conv = new TwoTuple_OnionMessageContentsResponseInstructionZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Creates a new C2Tuple_OnionMessageContentsResponseInstructionZ from the contained elements. + */ + public static TwoTuple_OnionMessageContentsResponseInstructionZ of(org.ldk.structs.OnionMessageContents a, org.ldk.structs.ResponseInstruction b) { + long ret = bindings.C2Tuple_OnionMessageContentsResponseInstructionZ_new(a.ptr, b.ptr); + Reference.reachabilityFence(a); + Reference.reachabilityFence(b); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_OnionMessageContentsResponseInstructionZ ret_hu_conv = new TwoTuple_OnionMessageContentsResponseInstructionZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/TwoTuple_OutPointCVec_MonitorUpdateIdZZ.java b/src/main/java/org/ldk/structs/TwoTuple_OutPointCVec_MonitorUpdateIdZZ.java deleted file mode 100644 index 4dffe524..00000000 --- a/src/main/java/org/ldk/structs/TwoTuple_OutPointCVec_MonitorUpdateIdZZ.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.ldk.structs; - -import org.ldk.impl.bindings; -import org.ldk.enums.*; -import org.ldk.util.*; -import java.util.Arrays; -import java.lang.ref.Reference; -import javax.annotation.Nullable; - - -/** - * A Tuple - */ -@SuppressWarnings("unchecked") // We correctly assign various generic arrays -public class TwoTuple_OutPointCVec_MonitorUpdateIdZZ extends CommonBase { - TwoTuple_OutPointCVec_MonitorUpdateIdZZ(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(ptr); } - } - - /** - * - */ - public OutPoint get_a() { - long ret = bindings.C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutPoint(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - return ret_hu_conv; - } - - /** - * - */ - public MonitorUpdateId[] get_b() { - long[] ret = bindings.C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(this.ptr); - Reference.reachabilityFence(this); - int ret_conv_17_len = ret.length; - MonitorUpdateId[] ret_conv_17_arr = new MonitorUpdateId[ret_conv_17_len]; - for (int r = 0; r < ret_conv_17_len; r++) { - long ret_conv_17 = ret[r]; - org.ldk.structs.MonitorUpdateId ret_conv_17_hu_conv = null; if (ret_conv_17 < 0 || ret_conv_17 > 4096) { ret_conv_17_hu_conv = new org.ldk.structs.MonitorUpdateId(null, ret_conv_17); } - if (ret_conv_17_hu_conv != null) { ret_conv_17_hu_conv.ptrs_to.add(this); }; - ret_conv_17_arr[r] = ret_conv_17_hu_conv; - } - return ret_conv_17_arr; - } - - long clone_ptr() { - long ret = bindings.C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Creates a new tuple which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public TwoTuple_OutPointCVec_MonitorUpdateIdZZ clone() { - long ret = bindings.C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - TwoTuple_OutPointCVec_MonitorUpdateIdZZ ret_hu_conv = new TwoTuple_OutPointCVec_MonitorUpdateIdZZ(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - return ret_hu_conv; - } - - /** - * Creates a new C2Tuple_OutPointCVec_MonitorUpdateIdZZ from the contained elements. - */ - public static TwoTuple_OutPointCVec_MonitorUpdateIdZZ of(org.ldk.structs.OutPoint a, MonitorUpdateId[] b) { - long ret = bindings.C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(a.ptr, b != null ? Arrays.stream(b).mapToLong(b_conv_17 -> b_conv_17.ptr).toArray() : null); - Reference.reachabilityFence(a); - Reference.reachabilityFence(b); - if (ret >= 0 && ret <= 4096) { return null; } - TwoTuple_OutPointCVec_MonitorUpdateIdZZ ret_hu_conv = new TwoTuple_OutPointCVec_MonitorUpdateIdZZ(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; - for (MonitorUpdateId b_conv_17: b) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b_conv_17); }; }; - return ret_hu_conv; - } - -} diff --git a/src/main/java/org/ldk/structs/TwoTuple_OutPointCVec_u64ZZ.java b/src/main/java/org/ldk/structs/TwoTuple_OutPointCVec_u64ZZ.java new file mode 100644 index 00000000..38e410b1 --- /dev/null +++ b/src/main/java/org/ldk/structs/TwoTuple_OutPointCVec_u64ZZ.java @@ -0,0 +1,76 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * A Tuple + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class TwoTuple_OutPointCVec_u64ZZ extends CommonBase { + TwoTuple_OutPointCVec_u64ZZ(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.C2Tuple_OutPointCVec_u64ZZ_free(ptr); } + } + + /** + * + */ + public OutPoint get_a() { + long ret = bindings.C2Tuple_OutPointCVec_u64ZZ_get_a(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutPoint(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * + */ + public long[] get_b() { + long[] ret = bindings.C2Tuple_OutPointCVec_u64ZZ_get_b(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.C2Tuple_OutPointCVec_u64ZZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new tuple which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public TwoTuple_OutPointCVec_u64ZZ clone() { + long ret = bindings.C2Tuple_OutPointCVec_u64ZZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_OutPointCVec_u64ZZ ret_hu_conv = new TwoTuple_OutPointCVec_u64ZZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Creates a new C2Tuple_OutPointCVec_u64ZZ from the contained elements. + */ + public static TwoTuple_OutPointCVec_u64ZZ of(org.ldk.structs.OutPoint a, long[] b) { + long ret = bindings.C2Tuple_OutPointCVec_u64ZZ_new(a.ptr, b); + Reference.reachabilityFence(a); + Reference.reachabilityFence(b); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_OutPointCVec_u64ZZ ret_hu_conv = new TwoTuple_OutPointCVec_u64ZZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/TwoTuple_OutPointCVec_u8ZZ.java b/src/main/java/org/ldk/structs/TwoTuple_OutPointCVec_u8ZZ.java index ed0db076..c772fbad 100644 --- a/src/main/java/org/ldk/structs/TwoTuple_OutPointCVec_u8ZZ.java +++ b/src/main/java/org/ldk/structs/TwoTuple_OutPointCVec_u8ZZ.java @@ -70,7 +70,6 @@ public class TwoTuple_OutPointCVec_u8ZZ extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } TwoTuple_OutPointCVec_u8ZZ ret_hu_conv = new TwoTuple_OutPointCVec_u8ZZ(null, ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/TwoTuple_OutPointChannelIdZ.java b/src/main/java/org/ldk/structs/TwoTuple_OutPointChannelIdZ.java index 04e38fc0..2ee6165f 100644 --- a/src/main/java/org/ldk/structs/TwoTuple_OutPointChannelIdZ.java +++ b/src/main/java/org/ldk/structs/TwoTuple_OutPointChannelIdZ.java @@ -73,8 +73,6 @@ public class TwoTuple_OutPointChannelIdZ extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } TwoTuple_OutPointChannelIdZ ret_hu_conv = new TwoTuple_OutPointChannelIdZ(null, ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/TwoTuple_PublicKeyCVec_SocketAddressZZ.java b/src/main/java/org/ldk/structs/TwoTuple_PublicKeyCVec_SocketAddressZZ.java deleted file mode 100644 index 4a085a75..00000000 --- a/src/main/java/org/ldk/structs/TwoTuple_PublicKeyCVec_SocketAddressZZ.java +++ /dev/null @@ -1,82 +0,0 @@ -package org.ldk.structs; - -import org.ldk.impl.bindings; -import org.ldk.enums.*; -import org.ldk.util.*; -import java.util.Arrays; -import java.lang.ref.Reference; -import javax.annotation.Nullable; - - -/** - * A Tuple - */ -@SuppressWarnings("unchecked") // We correctly assign various generic arrays -public class TwoTuple_PublicKeyCVec_SocketAddressZZ extends CommonBase { - TwoTuple_PublicKeyCVec_SocketAddressZZ(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.C2Tuple_PublicKeyCVec_SocketAddressZZ_free(ptr); } - } - - /** - * - */ - public byte[] get_a() { - byte[] ret = bindings.C2Tuple_PublicKeyCVec_SocketAddressZZ_get_a(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * - */ - public SocketAddress[] get_b() { - long[] ret = bindings.C2Tuple_PublicKeyCVec_SocketAddressZZ_get_b(this.ptr); - Reference.reachabilityFence(this); - int ret_conv_15_len = ret.length; - SocketAddress[] ret_conv_15_arr = new SocketAddress[ret_conv_15_len]; - for (int p = 0; p < ret_conv_15_len; p++) { - long ret_conv_15 = ret[p]; - org.ldk.structs.SocketAddress ret_conv_15_hu_conv = org.ldk.structs.SocketAddress.constr_from_ptr(ret_conv_15); - if (ret_conv_15_hu_conv != null) { ret_conv_15_hu_conv.ptrs_to.add(this); }; - ret_conv_15_arr[p] = ret_conv_15_hu_conv; - } - return ret_conv_15_arr; - } - - long clone_ptr() { - long ret = bindings.C2Tuple_PublicKeyCVec_SocketAddressZZ_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Creates a new tuple which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public TwoTuple_PublicKeyCVec_SocketAddressZZ clone() { - long ret = bindings.C2Tuple_PublicKeyCVec_SocketAddressZZ_clone(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - TwoTuple_PublicKeyCVec_SocketAddressZZ ret_hu_conv = new TwoTuple_PublicKeyCVec_SocketAddressZZ(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - return ret_hu_conv; - } - - /** - * Creates a new C2Tuple_PublicKeyCVec_SocketAddressZZ from the contained elements. - */ - public static TwoTuple_PublicKeyCVec_SocketAddressZZ of(byte[] a, SocketAddress[] b) { - long ret = bindings.C2Tuple_PublicKeyCVec_SocketAddressZZ_new(InternalUtils.check_arr_len(a, 33), b != null ? Arrays.stream(b).mapToLong(b_conv_15 -> b_conv_15.ptr).toArray() : null); - Reference.reachabilityFence(a); - Reference.reachabilityFence(b); - if (ret >= 0 && ret <= 4096) { return null; } - TwoTuple_PublicKeyCVec_SocketAddressZZ ret_hu_conv = new TwoTuple_PublicKeyCVec_SocketAddressZZ(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - for (SocketAddress b_conv_15: b) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b_conv_15); }; }; - return ret_hu_conv; - } - -} diff --git a/src/main/java/org/ldk/structs/TwoTuple_ReleaseHeldHtlcResponseInstructionZ.java b/src/main/java/org/ldk/structs/TwoTuple_ReleaseHeldHtlcResponseInstructionZ.java new file mode 100644 index 00000000..c7ae8f0b --- /dev/null +++ b/src/main/java/org/ldk/structs/TwoTuple_ReleaseHeldHtlcResponseInstructionZ.java @@ -0,0 +1,79 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * A Tuple + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class TwoTuple_ReleaseHeldHtlcResponseInstructionZ extends CommonBase { + TwoTuple_ReleaseHeldHtlcResponseInstructionZ(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.C2Tuple_ReleaseHeldHtlcResponseInstructionZ_free(ptr); } + } + + /** + * + */ + public ReleaseHeldHtlc get_a() { + long ret = bindings.C2Tuple_ReleaseHeldHtlcResponseInstructionZ_get_a(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ReleaseHeldHtlc ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ReleaseHeldHtlc(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * + */ + public ResponseInstruction get_b() { + long ret = bindings.C2Tuple_ReleaseHeldHtlcResponseInstructionZ_get_b(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ResponseInstruction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ResponseInstruction(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + long clone_ptr() { + long ret = bindings.C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new tuple which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public TwoTuple_ReleaseHeldHtlcResponseInstructionZ clone() { + long ret = bindings.C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_ReleaseHeldHtlcResponseInstructionZ ret_hu_conv = new TwoTuple_ReleaseHeldHtlcResponseInstructionZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Creates a new C2Tuple_ReleaseHeldHtlcResponseInstructionZ from the contained elements. + */ + public static TwoTuple_ReleaseHeldHtlcResponseInstructionZ of(org.ldk.structs.ReleaseHeldHtlc a, org.ldk.structs.ResponseInstruction b) { + long ret = bindings.C2Tuple_ReleaseHeldHtlcResponseInstructionZ_new(a.ptr, b.ptr); + Reference.reachabilityFence(a); + Reference.reachabilityFence(b); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_ReleaseHeldHtlcResponseInstructionZ ret_hu_conv = new TwoTuple_ReleaseHeldHtlcResponseInstructionZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/TwoTuple_ThirtyTwoBytesChannelManagerZ.java b/src/main/java/org/ldk/structs/TwoTuple_ThirtyTwoBytesChannelManagerZ.java index 843865b2..72d3c21d 100644 --- a/src/main/java/org/ldk/structs/TwoTuple_ThirtyTwoBytesChannelManagerZ.java +++ b/src/main/java/org/ldk/structs/TwoTuple_ThirtyTwoBytesChannelManagerZ.java @@ -69,8 +69,8 @@ public class TwoTuple_ThirtyTwoBytesChannelManagerZ extends CommonBase { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b_entropy_source); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b_node_signer); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b_signer_provider); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b_config); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b_params); }; + ; + ; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/TwoTuple_ThirtyTwoBytesChannelMonitorZ.java b/src/main/java/org/ldk/structs/TwoTuple_ThirtyTwoBytesChannelMonitorZ.java index 78f73055..71e67b37 100644 --- a/src/main/java/org/ldk/structs/TwoTuple_ThirtyTwoBytesChannelMonitorZ.java +++ b/src/main/java/org/ldk/structs/TwoTuple_ThirtyTwoBytesChannelMonitorZ.java @@ -70,7 +70,6 @@ public class TwoTuple_ThirtyTwoBytesChannelMonitorZ extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } TwoTuple_ThirtyTwoBytesChannelMonitorZ ret_hu_conv = new TwoTuple_ThirtyTwoBytesChannelMonitorZ(null, ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/TxAbort.java b/src/main/java/org/ldk/structs/TxAbort.java index db50da5c..ef1c1b8c 100644 --- a/src/main/java/org/ldk/structs/TxAbort.java +++ b/src/main/java/org/ldk/structs/TxAbort.java @@ -39,7 +39,6 @@ public class TxAbort extends CommonBase { bindings.TxAbort_set_channel_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -72,7 +71,6 @@ public class TxAbort extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.TxAbort ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxAbort(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/TxAckRbf.java b/src/main/java/org/ldk/structs/TxAckRbf.java index 2f70fbf3..844840ab 100644 --- a/src/main/java/org/ldk/structs/TxAckRbf.java +++ b/src/main/java/org/ldk/structs/TxAckRbf.java @@ -40,7 +40,6 @@ public class TxAckRbf extends CommonBase { bindings.TxAckRbf_set_channel_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -64,7 +63,6 @@ public class TxAckRbf extends CommonBase { bindings.TxAckRbf_set_funding_output_contribution(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -77,8 +75,6 @@ public class TxAckRbf extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.TxAckRbf ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxAckRbf(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(funding_output_contribution_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/TxAddInput.java b/src/main/java/org/ldk/structs/TxAddInput.java index dbe72f9c..c88ce847 100644 --- a/src/main/java/org/ldk/structs/TxAddInput.java +++ b/src/main/java/org/ldk/structs/TxAddInput.java @@ -39,7 +39,6 @@ public class TxAddInput extends CommonBase { bindings.TxAddInput_set_channel_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -83,7 +82,6 @@ public class TxAddInput extends CommonBase { bindings.TxAddInput_set_prevtx(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -122,21 +120,41 @@ public class TxAddInput extends CommonBase { Reference.reachabilityFence(val); } + /** + * The ID of the previous funding transaction, when it is being added as an input during splicing + */ + public Option_ThirtyTwoBytesZ get_shared_input_txid() { + long ret = bindings.TxAddInput_get_shared_input_txid(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_ThirtyTwoBytesZ ret_hu_conv = org.ldk.structs.Option_ThirtyTwoBytesZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * The ID of the previous funding transaction, when it is being added as an input during splicing + */ + public void set_shared_input_txid(org.ldk.structs.Option_ThirtyTwoBytesZ val) { + bindings.TxAddInput_set_shared_input_txid(this.ptr, val.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + /** * Constructs a new TxAddInput given each field */ - public static TxAddInput of(org.ldk.structs.ChannelId channel_id_arg, long serial_id_arg, org.ldk.structs.TransactionU16LenLimited prevtx_arg, int prevtx_out_arg, int sequence_arg) { - long ret = bindings.TxAddInput_new(channel_id_arg.ptr, serial_id_arg, prevtx_arg.ptr, prevtx_out_arg, sequence_arg); + public static TxAddInput of(org.ldk.structs.ChannelId channel_id_arg, long serial_id_arg, org.ldk.structs.TransactionU16LenLimited prevtx_arg, int prevtx_out_arg, int sequence_arg, org.ldk.structs.Option_ThirtyTwoBytesZ shared_input_txid_arg) { + long ret = bindings.TxAddInput_new(channel_id_arg.ptr, serial_id_arg, prevtx_arg.ptr, prevtx_out_arg, sequence_arg, shared_input_txid_arg.ptr); Reference.reachabilityFence(channel_id_arg); Reference.reachabilityFence(serial_id_arg); Reference.reachabilityFence(prevtx_arg); Reference.reachabilityFence(prevtx_out_arg); Reference.reachabilityFence(sequence_arg); + Reference.reachabilityFence(shared_input_txid_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.TxAddInput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxAddInput(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(prevtx_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/TxAddOutput.java b/src/main/java/org/ldk/structs/TxAddOutput.java index 2bd09e25..c8e2ad42 100644 --- a/src/main/java/org/ldk/structs/TxAddOutput.java +++ b/src/main/java/org/ldk/structs/TxAddOutput.java @@ -39,7 +39,6 @@ public class TxAddOutput extends CommonBase { bindings.TxAddOutput_set_channel_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -110,7 +109,6 @@ public class TxAddOutput extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.TxAddOutput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxAddOutput(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/TxComplete.java b/src/main/java/org/ldk/structs/TxComplete.java index 46cf83a0..4fd20d7e 100644 --- a/src/main/java/org/ldk/structs/TxComplete.java +++ b/src/main/java/org/ldk/structs/TxComplete.java @@ -40,7 +40,6 @@ public class TxComplete extends CommonBase { bindings.TxComplete_set_channel_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -52,7 +51,6 @@ public class TxComplete extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.TxComplete ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxComplete(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/TxCreationKeys.java b/src/main/java/org/ldk/structs/TxCreationKeys.java index 634a8eba..fb3383ea 100644 --- a/src/main/java/org/ldk/structs/TxCreationKeys.java +++ b/src/main/java/org/ldk/structs/TxCreationKeys.java @@ -71,7 +71,6 @@ public class TxCreationKeys extends CommonBase { bindings.TxCreationKeys_set_revocation_key(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -93,7 +92,6 @@ public class TxCreationKeys extends CommonBase { bindings.TxCreationKeys_set_broadcaster_htlc_key(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -115,7 +113,6 @@ public class TxCreationKeys extends CommonBase { bindings.TxCreationKeys_set_countersignatory_htlc_key(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -137,7 +134,6 @@ public class TxCreationKeys extends CommonBase { bindings.TxCreationKeys_set_broadcaster_delayed_payment_key(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -153,10 +149,6 @@ public class TxCreationKeys extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.TxCreationKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxCreationKeys(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(revocation_key_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(broadcaster_htlc_key_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(countersignatory_htlc_key_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(broadcaster_delayed_payment_key_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/TxInitRbf.java b/src/main/java/org/ldk/structs/TxInitRbf.java index 59f956d6..e1366cca 100644 --- a/src/main/java/org/ldk/structs/TxInitRbf.java +++ b/src/main/java/org/ldk/structs/TxInitRbf.java @@ -40,7 +40,6 @@ public class TxInitRbf extends CommonBase { bindings.TxInitRbf_set_channel_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -100,7 +99,6 @@ public class TxInitRbf extends CommonBase { bindings.TxInitRbf_set_funding_output_contribution(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -115,8 +113,6 @@ public class TxInitRbf extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.TxInitRbf ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxInitRbf(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(funding_output_contribution_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/TxRemoveInput.java b/src/main/java/org/ldk/structs/TxRemoveInput.java index f2abf19c..0c6ed906 100644 --- a/src/main/java/org/ldk/structs/TxRemoveInput.java +++ b/src/main/java/org/ldk/structs/TxRemoveInput.java @@ -39,7 +39,6 @@ public class TxRemoveInput extends CommonBase { bindings.TxRemoveInput_set_channel_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -70,7 +69,6 @@ public class TxRemoveInput extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.TxRemoveInput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxRemoveInput(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/TxRemoveOutput.java b/src/main/java/org/ldk/structs/TxRemoveOutput.java index fd6e00da..3924b1e0 100644 --- a/src/main/java/org/ldk/structs/TxRemoveOutput.java +++ b/src/main/java/org/ldk/structs/TxRemoveOutput.java @@ -39,7 +39,6 @@ public class TxRemoveOutput extends CommonBase { bindings.TxRemoveOutput_set_channel_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -70,7 +69,6 @@ public class TxRemoveOutput extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.TxRemoveOutput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxRemoveOutput(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/TxSignatures.java b/src/main/java/org/ldk/structs/TxSignatures.java index dd1eb95b..91881c0d 100644 --- a/src/main/java/org/ldk/structs/TxSignatures.java +++ b/src/main/java/org/ldk/structs/TxSignatures.java @@ -40,7 +40,6 @@ public class TxSignatures extends CommonBase { bindings.TxSignatures_set_channel_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -84,8 +83,8 @@ public class TxSignatures extends CommonBase { /** * Optional signature for the shared input -- the previous funding outpoint -- signed by both peers */ - public Option_ECDSASignatureZ get_funding_outpoint_sig() { - long ret = bindings.TxSignatures_get_funding_outpoint_sig(this.ptr); + public Option_ECDSASignatureZ get_shared_input_signature() { + long ret = bindings.TxSignatures_get_shared_input_signature(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_ECDSASignatureZ ret_hu_conv = org.ldk.structs.Option_ECDSASignatureZ.constr_from_ptr(ret); @@ -96,27 +95,24 @@ public class TxSignatures extends CommonBase { /** * Optional signature for the shared input -- the previous funding outpoint -- signed by both peers */ - public void set_funding_outpoint_sig(org.ldk.structs.Option_ECDSASignatureZ val) { - bindings.TxSignatures_set_funding_outpoint_sig(this.ptr, val.ptr); + public void set_shared_input_signature(org.ldk.structs.Option_ECDSASignatureZ val) { + bindings.TxSignatures_set_shared_input_signature(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** * Constructs a new TxSignatures given each field */ - public static TxSignatures of(org.ldk.structs.ChannelId channel_id_arg, byte[] tx_hash_arg, byte[][] witnesses_arg, org.ldk.structs.Option_ECDSASignatureZ funding_outpoint_sig_arg) { - long ret = bindings.TxSignatures_new(channel_id_arg.ptr, InternalUtils.check_arr_len(tx_hash_arg, 32), witnesses_arg, funding_outpoint_sig_arg.ptr); + public static TxSignatures of(org.ldk.structs.ChannelId channel_id_arg, byte[] tx_hash_arg, byte[][] witnesses_arg, org.ldk.structs.Option_ECDSASignatureZ shared_input_signature_arg) { + long ret = bindings.TxSignatures_new(channel_id_arg.ptr, InternalUtils.check_arr_len(tx_hash_arg, 32), witnesses_arg, shared_input_signature_arg.ptr); Reference.reachabilityFence(channel_id_arg); Reference.reachabilityFence(tx_hash_arg); Reference.reachabilityFence(witnesses_arg); - Reference.reachabilityFence(funding_outpoint_sig_arg); + Reference.reachabilityFence(shared_input_signature_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.TxSignatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxSignatures(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(funding_outpoint_sig_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/UnsignedBolt12Invoice.java b/src/main/java/org/ldk/structs/UnsignedBolt12Invoice.java index 0fcbbe03..e329865b 100644 --- a/src/main/java/org/ldk/structs/UnsignedBolt12Invoice.java +++ b/src/main/java/org/ldk/structs/UnsignedBolt12Invoice.java @@ -55,6 +55,66 @@ public class UnsignedBolt12Invoice extends CommonBase { return ret_hu_conv; } + /** + * Duration since the Unix epoch when the invoice was created. + */ + public long created_at() { + long ret = bindings.UnsignedBolt12Invoice_created_at(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Duration since + * [`Bolt12Invoice::created_at`] + * when the invoice has expired and therefore should no longer be paid. + */ + public long relative_expiry() { + long ret = bindings.UnsignedBolt12Invoice_relative_expiry(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Whether the invoice has expired. + */ + public boolean is_expired() { + boolean ret = bindings.UnsignedBolt12Invoice_is_expired(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Fallback addresses for paying the invoice on-chain, in order of most-preferred to + * least-preferred. + */ + public String[] fallbacks() { + String[] ret = bindings.UnsignedBolt12Invoice_fallbacks(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Features pertaining to paying an invoice. + */ + public Bolt12InvoiceFeatures invoice_features() { + long ret = bindings.UnsignedBolt12Invoice_invoice_features(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt12InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Bolt12InvoiceFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * The public key corresponding to the key used to sign the invoice. + */ + public byte[] signing_pubkey() { + byte[] ret = bindings.UnsignedBolt12Invoice_signing_pubkey(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * The chains that may be used when paying a requested invoice. * @@ -204,18 +264,18 @@ public class UnsignedBolt12Invoice extends CommonBase { * * [`Offer::paths`]: crate::offers::offer::Offer::paths */ - public BlindedPath[] message_paths() { + public BlindedMessagePath[] message_paths() { long[] ret = bindings.UnsignedBolt12Invoice_message_paths(this.ptr); Reference.reachabilityFence(this); - int ret_conv_13_len = ret.length; - BlindedPath[] ret_conv_13_arr = new BlindedPath[ret_conv_13_len]; - for (int n = 0; n < ret_conv_13_len; n++) { - long ret_conv_13 = ret[n]; - org.ldk.structs.BlindedPath ret_conv_13_hu_conv = null; if (ret_conv_13 < 0 || ret_conv_13 > 4096) { ret_conv_13_hu_conv = new org.ldk.structs.BlindedPath(null, ret_conv_13); } - if (ret_conv_13_hu_conv != null) { ret_conv_13_hu_conv.ptrs_to.add(this); }; - ret_conv_13_arr[n] = ret_conv_13_hu_conv; + int ret_conv_20_len = ret.length; + BlindedMessagePath[] ret_conv_20_arr = new BlindedMessagePath[ret_conv_20_len]; + for (int u = 0; u < ret_conv_20_len; u++) { + long ret_conv_20 = ret[u]; + org.ldk.structs.BlindedMessagePath ret_conv_20_hu_conv = null; if (ret_conv_20 < 0 || ret_conv_20 > 4096) { ret_conv_20_hu_conv = new org.ldk.structs.BlindedMessagePath(null, ret_conv_20); } + if (ret_conv_20_hu_conv != null) { ret_conv_20_hu_conv.ptrs_to.add(this); }; + ret_conv_20_arr[u] = ret_conv_20_hu_conv; } - return ret_conv_13_arr; + return ret_conv_20_arr; } /** @@ -303,34 +363,6 @@ public class UnsignedBolt12Invoice extends CommonBase { return ret_hu_conv; } - /** - * Duration since the Unix epoch when the invoice was created. - */ - public long created_at() { - long ret = bindings.UnsignedBolt12Invoice_created_at(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Duration since [`Bolt12Invoice::created_at`] when the invoice has expired and therefore - * should no longer be paid. - */ - public long relative_expiry() { - long ret = bindings.UnsignedBolt12Invoice_relative_expiry(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Whether the invoice has expired. - */ - public boolean is_expired() { - boolean ret = bindings.UnsignedBolt12Invoice_is_expired(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - /** * SHA256 hash of the payment preimage that will be given in return for paying the invoice. */ @@ -349,27 +381,6 @@ public class UnsignedBolt12Invoice extends CommonBase { return ret; } - /** - * Features pertaining to paying an invoice. - */ - public Bolt12InvoiceFeatures invoice_features() { - long ret = bindings.UnsignedBolt12Invoice_invoice_features(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Bolt12InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Bolt12InvoiceFeatures(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - return ret_hu_conv; - } - - /** - * The public key corresponding to the key used to sign the invoice. - */ - public byte[] signing_pubkey() { - byte[] ret = bindings.UnsignedBolt12Invoice_signing_pubkey(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - /** * Serialize the UnsignedBolt12Invoice object into a byte array which can be read by UnsignedBolt12Invoice_read */ diff --git a/src/main/java/org/ldk/structs/UnsignedChannelAnnouncement.java b/src/main/java/org/ldk/structs/UnsignedChannelAnnouncement.java index ebf3bc6e..aa41f1d8 100644 --- a/src/main/java/org/ldk/structs/UnsignedChannelAnnouncement.java +++ b/src/main/java/org/ldk/structs/UnsignedChannelAnnouncement.java @@ -41,7 +41,6 @@ public class UnsignedChannelAnnouncement extends CommonBase { bindings.UnsignedChannelAnnouncement_set_features(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -99,7 +98,6 @@ public class UnsignedChannelAnnouncement extends CommonBase { bindings.UnsignedChannelAnnouncement_set_node_id_1(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -121,7 +119,6 @@ public class UnsignedChannelAnnouncement extends CommonBase { bindings.UnsignedChannelAnnouncement_set_node_id_2(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -143,7 +140,6 @@ public class UnsignedChannelAnnouncement extends CommonBase { bindings.UnsignedChannelAnnouncement_set_bitcoin_key_1(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -165,7 +161,6 @@ public class UnsignedChannelAnnouncement extends CommonBase { bindings.UnsignedChannelAnnouncement_set_bitcoin_key_2(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -210,11 +205,6 @@ public class UnsignedChannelAnnouncement extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.UnsignedChannelAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UnsignedChannelAnnouncement(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(features_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(node_id_1_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(node_id_2_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(bitcoin_key_1_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(bitcoin_key_2_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/UnsignedChannelUpdate.java b/src/main/java/org/ldk/structs/UnsignedChannelUpdate.java index ba8dfd22..d9153a76 100644 --- a/src/main/java/org/ldk/structs/UnsignedChannelUpdate.java +++ b/src/main/java/org/ldk/structs/UnsignedChannelUpdate.java @@ -77,19 +77,39 @@ public class UnsignedChannelUpdate extends CommonBase { } /** - * Channel flags + * Flags pertaining to this message. */ - public byte get_flags() { - byte ret = bindings.UnsignedChannelUpdate_get_flags(this.ptr); + public byte get_message_flags() { + byte ret = bindings.UnsignedChannelUpdate_get_message_flags(this.ptr); Reference.reachabilityFence(this); return ret; } /** - * Channel flags + * Flags pertaining to this message. */ - public void set_flags(byte val) { - bindings.UnsignedChannelUpdate_set_flags(this.ptr, val); + public void set_message_flags(byte val) { + bindings.UnsignedChannelUpdate_set_message_flags(this.ptr, val); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * Flags pertaining to the channel, including to which direction in the channel this update + * applies and whether the direction is currently able to forward HTLCs. + */ + public byte get_channel_flags() { + byte ret = bindings.UnsignedChannelUpdate_get_channel_flags(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Flags pertaining to the channel, including to which direction in the channel this update + * applies and whether the direction is currently able to forward HTLCs. + */ + public void set_channel_flags(byte val) { + bindings.UnsignedChannelUpdate_set_channel_flags(this.ptr, val); Reference.reachabilityFence(this); Reference.reachabilityFence(val); } @@ -231,12 +251,13 @@ public class UnsignedChannelUpdate extends CommonBase { /** * Constructs a new UnsignedChannelUpdate given each field */ - public static UnsignedChannelUpdate of(byte[] chain_hash_arg, long short_channel_id_arg, int timestamp_arg, byte flags_arg, short cltv_expiry_delta_arg, long htlc_minimum_msat_arg, long htlc_maximum_msat_arg, int fee_base_msat_arg, int fee_proportional_millionths_arg, byte[] excess_data_arg) { - long ret = bindings.UnsignedChannelUpdate_new(InternalUtils.check_arr_len(chain_hash_arg, 32), short_channel_id_arg, timestamp_arg, flags_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, fee_base_msat_arg, fee_proportional_millionths_arg, excess_data_arg); + public static UnsignedChannelUpdate of(byte[] chain_hash_arg, long short_channel_id_arg, int timestamp_arg, byte message_flags_arg, byte channel_flags_arg, short cltv_expiry_delta_arg, long htlc_minimum_msat_arg, long htlc_maximum_msat_arg, int fee_base_msat_arg, int fee_proportional_millionths_arg, byte[] excess_data_arg) { + long ret = bindings.UnsignedChannelUpdate_new(InternalUtils.check_arr_len(chain_hash_arg, 32), short_channel_id_arg, timestamp_arg, message_flags_arg, channel_flags_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, fee_base_msat_arg, fee_proportional_millionths_arg, excess_data_arg); Reference.reachabilityFence(chain_hash_arg); Reference.reachabilityFence(short_channel_id_arg); Reference.reachabilityFence(timestamp_arg); - Reference.reachabilityFence(flags_arg); + Reference.reachabilityFence(message_flags_arg); + Reference.reachabilityFence(channel_flags_arg); Reference.reachabilityFence(cltv_expiry_delta_arg); Reference.reachabilityFence(htlc_minimum_msat_arg); Reference.reachabilityFence(htlc_maximum_msat_arg); diff --git a/src/main/java/org/ldk/structs/UnsignedGossipMessage.java b/src/main/java/org/ldk/structs/UnsignedGossipMessage.java index 6789b185..401513c5 100644 --- a/src/main/java/org/ldk/structs/UnsignedGossipMessage.java +++ b/src/main/java/org/ldk/structs/UnsignedGossipMessage.java @@ -99,7 +99,6 @@ public class UnsignedGossipMessage extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.UnsignedGossipMessage ret_hu_conv = org.ldk.structs.UnsignedGossipMessage.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; return ret_hu_conv; } @@ -112,7 +111,6 @@ public class UnsignedGossipMessage extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.UnsignedGossipMessage ret_hu_conv = org.ldk.structs.UnsignedGossipMessage.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; return ret_hu_conv; } @@ -125,7 +123,6 @@ public class UnsignedGossipMessage extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.UnsignedGossipMessage ret_hu_conv = org.ldk.structs.UnsignedGossipMessage.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/UnsignedInvoiceRequest.java b/src/main/java/org/ldk/structs/UnsignedInvoiceRequest.java index 8034c154..b5334cf0 100644 --- a/src/main/java/org/ldk/structs/UnsignedInvoiceRequest.java +++ b/src/main/java/org/ldk/structs/UnsignedInvoiceRequest.java @@ -153,18 +153,18 @@ public class UnsignedInvoiceRequest extends CommonBase { * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide * recipient privacy by obfuscating its node id. */ - public BlindedPath[] paths() { + public BlindedMessagePath[] paths() { long[] ret = bindings.UnsignedInvoiceRequest_paths(this.ptr); Reference.reachabilityFence(this); - int ret_conv_13_len = ret.length; - BlindedPath[] ret_conv_13_arr = new BlindedPath[ret_conv_13_len]; - for (int n = 0; n < ret_conv_13_len; n++) { - long ret_conv_13 = ret[n]; - org.ldk.structs.BlindedPath ret_conv_13_hu_conv = null; if (ret_conv_13 < 0 || ret_conv_13 > 4096) { ret_conv_13_hu_conv = new org.ldk.structs.BlindedPath(null, ret_conv_13); } - if (ret_conv_13_hu_conv != null) { ret_conv_13_hu_conv.ptrs_to.add(this); }; - ret_conv_13_arr[n] = ret_conv_13_hu_conv; + int ret_conv_20_len = ret.length; + BlindedMessagePath[] ret_conv_20_arr = new BlindedMessagePath[ret_conv_20_len]; + for (int u = 0; u < ret_conv_20_len; u++) { + long ret_conv_20 = ret[u]; + org.ldk.structs.BlindedMessagePath ret_conv_20_hu_conv = null; if (ret_conv_20 < 0 || ret_conv_20 > 4096) { ret_conv_20_hu_conv = new org.ldk.structs.BlindedMessagePath(null, ret_conv_20); } + if (ret_conv_20_hu_conv != null) { ret_conv_20_hu_conv.ptrs_to.add(this); }; + ret_conv_20_arr[u] = ret_conv_20_hu_conv; } - return ret_conv_13_arr; + return ret_conv_20_arr; } /** diff --git a/src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java b/src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java index 99d4420d..249955f7 100644 --- a/src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java +++ b/src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java @@ -41,7 +41,6 @@ public class UnsignedNodeAnnouncement extends CommonBase { bindings.UnsignedNodeAnnouncement_set_features(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -83,7 +82,6 @@ public class UnsignedNodeAnnouncement extends CommonBase { bindings.UnsignedNodeAnnouncement_set_node_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -127,7 +125,6 @@ public class UnsignedNodeAnnouncement extends CommonBase { bindings.UnsignedNodeAnnouncement_set_alias(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -156,7 +153,6 @@ public class UnsignedNodeAnnouncement extends CommonBase { bindings.UnsignedNodeAnnouncement_set_addresses(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_15 -> val_conv_15.ptr).toArray() : null); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - for (SocketAddress val_conv_15: val) { if (this != null) { this.ptrs_to.add(val_conv_15); }; }; } /** @@ -227,10 +223,6 @@ public class UnsignedNodeAnnouncement extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.UnsignedNodeAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UnsignedNodeAnnouncement(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(features_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(node_id_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(alias_arg); }; - for (SocketAddress addresses_arg_conv_15: addresses_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(addresses_arg_conv_15); }; }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/UntrustedString.java b/src/main/java/org/ldk/structs/UntrustedString.java index 318a245a..3ef07e15 100644 --- a/src/main/java/org/ldk/structs/UntrustedString.java +++ b/src/main/java/org/ldk/structs/UntrustedString.java @@ -20,6 +20,26 @@ public class UntrustedString extends CommonBase { if (ptr != 0) { bindings.UntrustedString_free(ptr); } } + /** + * Serialize the UntrustedString object into a byte array which can be read by UntrustedString_read + */ + public byte[] write() { + byte[] ret = bindings.UntrustedString_write(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Read a UntrustedString from a byte array, created by UntrustedString_write + */ + public static Result_UntrustedStringDecodeErrorZ read(byte[] ser) { + long ret = bindings.UntrustedString_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_UntrustedStringDecodeErrorZ ret_hu_conv = Result_UntrustedStringDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + public String get_a() { String ret = bindings.UntrustedString_get_a(this.ptr); Reference.reachabilityFence(this); @@ -91,26 +111,6 @@ public class UntrustedString extends CommonBase { @Override public int hashCode() { return (int)this.hash(); } - /** - * Serialize the UntrustedString object into a byte array which can be read by UntrustedString_read - */ - public byte[] write() { - byte[] ret = bindings.UntrustedString_write(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Read a UntrustedString from a byte array, created by UntrustedString_write - */ - public static Result_UntrustedStringDecodeErrorZ read(byte[] ser) { - long ret = bindings.UntrustedString_read(ser); - Reference.reachabilityFence(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_UntrustedStringDecodeErrorZ ret_hu_conv = Result_UntrustedStringDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - /** * Get the string representation of a UntrustedString object */ diff --git a/src/main/java/org/ldk/structs/UpdateAddHTLC.java b/src/main/java/org/ldk/structs/UpdateAddHTLC.java index b6986b98..470e8880 100644 --- a/src/main/java/org/ldk/structs/UpdateAddHTLC.java +++ b/src/main/java/org/ldk/structs/UpdateAddHTLC.java @@ -41,7 +41,6 @@ public class UpdateAddHTLC extends CommonBase { bindings.UpdateAddHTLC_set_channel_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -141,7 +140,6 @@ public class UpdateAddHTLC extends CommonBase { bindings.UpdateAddHTLC_set_skimmed_fee_msat(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -163,7 +161,6 @@ public class UpdateAddHTLC extends CommonBase { bindings.UpdateAddHTLC_set_onion_routing_packet(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -209,9 +206,6 @@ public class UpdateAddHTLC extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.UpdateAddHTLC ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UpdateAddHTLC(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(skimmed_fee_msat_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(onion_routing_packet_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/UpdateFailHTLC.java b/src/main/java/org/ldk/structs/UpdateFailHTLC.java index 004c1a89..8d938cf3 100644 --- a/src/main/java/org/ldk/structs/UpdateFailHTLC.java +++ b/src/main/java/org/ldk/structs/UpdateFailHTLC.java @@ -41,7 +41,6 @@ public class UpdateFailHTLC extends CommonBase { bindings.UpdateFailHTLC_set_channel_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** diff --git a/src/main/java/org/ldk/structs/UpdateFailMalformedHTLC.java b/src/main/java/org/ldk/structs/UpdateFailMalformedHTLC.java index 03767ddd..f0df8109 100644 --- a/src/main/java/org/ldk/structs/UpdateFailMalformedHTLC.java +++ b/src/main/java/org/ldk/structs/UpdateFailMalformedHTLC.java @@ -41,7 +41,6 @@ public class UpdateFailMalformedHTLC extends CommonBase { bindings.UpdateFailMalformedHTLC_set_channel_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** diff --git a/src/main/java/org/ldk/structs/UpdateFee.java b/src/main/java/org/ldk/structs/UpdateFee.java index 0a8c588a..98af388f 100644 --- a/src/main/java/org/ldk/structs/UpdateFee.java +++ b/src/main/java/org/ldk/structs/UpdateFee.java @@ -41,7 +41,6 @@ public class UpdateFee extends CommonBase { bindings.UpdateFee_set_channel_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -72,7 +71,6 @@ public class UpdateFee extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.UpdateFee ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UpdateFee(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/UpdateFulfillHTLC.java b/src/main/java/org/ldk/structs/UpdateFulfillHTLC.java index 1f9efc65..5d209339 100644 --- a/src/main/java/org/ldk/structs/UpdateFulfillHTLC.java +++ b/src/main/java/org/ldk/structs/UpdateFulfillHTLC.java @@ -41,7 +41,6 @@ public class UpdateFulfillHTLC extends CommonBase { bindings.UpdateFulfillHTLC_set_channel_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -91,7 +90,6 @@ public class UpdateFulfillHTLC extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.UpdateFulfillHTLC ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UpdateFulfillHTLC(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/UserConfig.java b/src/main/java/org/ldk/structs/UserConfig.java index c995f6e4..2a1481ee 100644 --- a/src/main/java/org/ldk/structs/UserConfig.java +++ b/src/main/java/org/ldk/structs/UserConfig.java @@ -11,8 +11,8 @@ import javax.annotation.Nullable; /** * Top-level config which holds ChannelHandshakeLimits and ChannelConfig. * - * Default::default() provides sane defaults for most configurations - * (but currently with 0 relay fees!) + * `Default::default()` provides sane defaults for most configurations + * (but currently with zero relay fees!) */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class UserConfig extends CommonBase { @@ -42,7 +42,6 @@ public class UserConfig extends CommonBase { bindings.UserConfig_set_channel_handshake_config(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -64,7 +63,6 @@ public class UserConfig extends CommonBase { bindings.UserConfig_set_channel_handshake_limits(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -86,17 +84,16 @@ public class UserConfig extends CommonBase { bindings.UserConfig_set_channel_config(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** - * If this is set to false, we will reject any HTLCs which were to be forwarded over private + * If this is set to `false`, we will reject any HTLCs which were to be forwarded over private * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a * node which is not online reliably. * * For nodes which are not online reliably, you should set all channels to *not* be announced - * (using [`ChannelHandshakeConfig::announced_channel`] and - * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to + * (using [`ChannelHandshakeConfig::announce_for_forwarding`] and + * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to `false` to * ensure you are not exposed to any forwarding risk. * * Note that because you cannot change a channel's announced state after creation, there is no @@ -105,7 +102,7 @@ public class UserConfig extends CommonBase { * all your channels and open new ones. For privacy, you should also change your node_id * (swapping all private and public key material for new ones) at that time. * - * Default value: false. + * Default value: `false` */ public boolean get_accept_forwards_to_priv_channels() { boolean ret = bindings.UserConfig_get_accept_forwards_to_priv_channels(this.ptr); @@ -114,13 +111,13 @@ public class UserConfig extends CommonBase { } /** - * If this is set to false, we will reject any HTLCs which were to be forwarded over private + * If this is set to `false`, we will reject any HTLCs which were to be forwarded over private * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a * node which is not online reliably. * * For nodes which are not online reliably, you should set all channels to *not* be announced - * (using [`ChannelHandshakeConfig::announced_channel`] and - * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to + * (using [`ChannelHandshakeConfig::announce_for_forwarding`] and + * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to `false` to * ensure you are not exposed to any forwarding risk. * * Note that because you cannot change a channel's announced state after creation, there is no @@ -129,7 +126,7 @@ public class UserConfig extends CommonBase { * all your channels and open new ones. For privacy, you should also change your node_id * (swapping all private and public key material for new ones) at that time. * - * Default value: false. + * Default value: `false` */ public void set_accept_forwards_to_priv_channels(boolean val) { bindings.UserConfig_set_accept_forwards_to_priv_channels(this.ptr, val); @@ -138,8 +135,9 @@ public class UserConfig extends CommonBase { } /** - * If this is set to false, we do not accept inbound requests to open a new channel. - * Default value: true. + * If this is set to `false`, we do not accept inbound requests to open a new channel. + * + * Default value: `true` */ public boolean get_accept_inbound_channels() { boolean ret = bindings.UserConfig_get_accept_inbound_channels(this.ptr); @@ -148,8 +146,9 @@ public class UserConfig extends CommonBase { } /** - * If this is set to false, we do not accept inbound requests to open a new channel. - * Default value: true. + * If this is set to `false`, we do not accept inbound requests to open a new channel. + * + * Default value: `true` */ public void set_accept_inbound_channels(boolean val) { bindings.UserConfig_set_accept_inbound_channels(this.ptr, val); @@ -158,15 +157,15 @@ public class UserConfig extends CommonBase { } /** - * If this is set to true, the user needs to manually accept inbound requests to open a new + * If this is set to `true`, the user needs to manually accept inbound requests to open a new * channel. * - * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a + * When set to `true`, [`Event::OpenChannelRequest`] will be triggered once a request to open a * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the * user explicitly chooses to accept the request. * - * Default value: false. + * Default value: `false` * * [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel @@ -179,15 +178,15 @@ public class UserConfig extends CommonBase { } /** - * If this is set to true, the user needs to manually accept inbound requests to open a new + * If this is set to `true`, the user needs to manually accept inbound requests to open a new * channel. * - * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a + * When set to `true`, [`Event::OpenChannelRequest`] will be triggered once a request to open a * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the * user explicitly chooses to accept the request. * - * Default value: false. + * Default value: `false` * * [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel @@ -200,13 +199,13 @@ public class UserConfig extends CommonBase { } /** - * If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over + * If this is set to `true`, LDK will intercept HTLCs that are attempting to be forwarded over * fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC * intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user. * - * Setting this to true may break backwards compatibility with LDK versions < 0.0.113. + * Setting this to `true` may break backwards compatibility with LDK versions < 0.0.113. * - * Default value: false. + * Default value: `false` * * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid * [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted @@ -218,13 +217,13 @@ public class UserConfig extends CommonBase { } /** - * If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over + * If this is set to `true`, LDK will intercept HTLCs that are attempting to be forwarded over * fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC * intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user. * - * Setting this to true may break backwards compatibility with LDK versions < 0.0.113. + * Setting this to `true` may break backwards compatibility with LDK versions < 0.0.113. * - * Default value: false. + * Default value: `false` * * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid * [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted @@ -236,14 +235,14 @@ public class UserConfig extends CommonBase { } /** - * If this is set to false, when receiving a keysend payment we'll fail it if it has multiple - * parts. If this is set to true, we'll accept the payment. + * If this is set to `false`, when receiving a keysend payment we'll fail it if it has multiple + * parts. If this is set to `true`, we'll accept the payment. * - * Setting this to true will break backwards compatibility upon downgrading to an LDK - * version < 0.0.116 while receiving an MPP keysend. If we have already received an MPP + * Setting this to `true` will break backwards compatibility upon downgrading to an LDK + * version prior to 0.0.116 while receiving an MPP keysend. If we have already received an MPP * keysend, downgrading will cause us to fail to deserialize [`ChannelManager`]. * - * Default value: false. + * Default value: `false` * * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager */ @@ -254,14 +253,14 @@ public class UserConfig extends CommonBase { } /** - * If this is set to false, when receiving a keysend payment we'll fail it if it has multiple - * parts. If this is set to true, we'll accept the payment. + * If this is set to `false`, when receiving a keysend payment we'll fail it if it has multiple + * parts. If this is set to `true`, we'll accept the payment. * - * Setting this to true will break backwards compatibility upon downgrading to an LDK - * version < 0.0.116 while receiving an MPP keysend. If we have already received an MPP + * Setting this to `true` will break backwards compatibility upon downgrading to an LDK + * version prior to 0.0.116 while receiving an MPP keysend. If we have already received an MPP * keysend, downgrading will cause us to fail to deserialize [`ChannelManager`]. * - * Default value: false. + * Default value: `false` * * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager */ @@ -271,11 +270,53 @@ public class UserConfig extends CommonBase { Reference.reachabilityFence(val); } + /** + * If this is set to `true`, the user needs to manually pay [`Bolt12Invoice`]s when received. + * + * When set to `true`, [`Event::InvoiceReceived`] will be generated for each received + * [`Bolt12Invoice`] instead of being automatically paid after verification. Use + * [`ChannelManager::send_payment_for_bolt12_invoice`] to pay the invoice or + * [`ChannelManager::abandon_payment`] to abandon the associated payment. + * + * Default value: `false` + * + * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice + * [`Event::InvoiceReceived`]: crate::events::Event::InvoiceReceived + * [`ChannelManager::send_payment_for_bolt12_invoice`]: crate::ln::channelmanager::ChannelManager::send_payment_for_bolt12_invoice + * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment + */ + public boolean get_manually_handle_bolt12_invoices() { + boolean ret = bindings.UserConfig_get_manually_handle_bolt12_invoices(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * If this is set to `true`, the user needs to manually pay [`Bolt12Invoice`]s when received. + * + * When set to `true`, [`Event::InvoiceReceived`] will be generated for each received + * [`Bolt12Invoice`] instead of being automatically paid after verification. Use + * [`ChannelManager::send_payment_for_bolt12_invoice`] to pay the invoice or + * [`ChannelManager::abandon_payment`] to abandon the associated payment. + * + * Default value: `false` + * + * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice + * [`Event::InvoiceReceived`]: crate::events::Event::InvoiceReceived + * [`ChannelManager::send_payment_for_bolt12_invoice`]: crate::ln::channelmanager::ChannelManager::send_payment_for_bolt12_invoice + * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment + */ + public void set_manually_handle_bolt12_invoices(boolean val) { + bindings.UserConfig_set_manually_handle_bolt12_invoices(this.ptr, val); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + /** * Constructs a new UserConfig given each field */ - public static UserConfig of(org.ldk.structs.ChannelHandshakeConfig channel_handshake_config_arg, org.ldk.structs.ChannelHandshakeLimits channel_handshake_limits_arg, org.ldk.structs.ChannelConfig channel_config_arg, boolean accept_forwards_to_priv_channels_arg, boolean accept_inbound_channels_arg, boolean manually_accept_inbound_channels_arg, boolean accept_intercept_htlcs_arg, boolean accept_mpp_keysend_arg) { - long ret = bindings.UserConfig_new(channel_handshake_config_arg.ptr, channel_handshake_limits_arg.ptr, channel_config_arg.ptr, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg, manually_accept_inbound_channels_arg, accept_intercept_htlcs_arg, accept_mpp_keysend_arg); + public static UserConfig of(org.ldk.structs.ChannelHandshakeConfig channel_handshake_config_arg, org.ldk.structs.ChannelHandshakeLimits channel_handshake_limits_arg, org.ldk.structs.ChannelConfig channel_config_arg, boolean accept_forwards_to_priv_channels_arg, boolean accept_inbound_channels_arg, boolean manually_accept_inbound_channels_arg, boolean accept_intercept_htlcs_arg, boolean accept_mpp_keysend_arg, boolean manually_handle_bolt12_invoices_arg) { + long ret = bindings.UserConfig_new(channel_handshake_config_arg.ptr, channel_handshake_limits_arg.ptr, channel_config_arg.ptr, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg, manually_accept_inbound_channels_arg, accept_intercept_htlcs_arg, accept_mpp_keysend_arg, manually_handle_bolt12_invoices_arg); Reference.reachabilityFence(channel_handshake_config_arg); Reference.reachabilityFence(channel_handshake_limits_arg); Reference.reachabilityFence(channel_config_arg); @@ -284,12 +325,10 @@ public class UserConfig extends CommonBase { Reference.reachabilityFence(manually_accept_inbound_channels_arg); Reference.reachabilityFence(accept_intercept_htlcs_arg); Reference.reachabilityFence(accept_mpp_keysend_arg); + Reference.reachabilityFence(manually_handle_bolt12_invoices_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.UserConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UserConfig(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_handshake_config_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_handshake_limits_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_config_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/UtilMethods.java b/src/main/java/org/ldk/structs/UtilMethods.java index 5d4e3cd3..a55948d0 100644 --- a/src/main/java/org/ldk/structs/UtilMethods.java +++ b/src/main/java/org/ldk/structs/UtilMethods.java @@ -58,13 +58,11 @@ public class UtilMethods { * 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. * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted. */ - public static Result_StrSecp256k1ErrorZ sign(byte[] msg, byte[] sk) { - long ret = bindings.sign(msg, InternalUtils.check_arr_len(sk, 32)); + public static String sign(byte[] msg, byte[] sk) { + String ret = bindings.sign(msg, InternalUtils.check_arr_len(sk, 32)); Reference.reachabilityFence(msg); Reference.reachabilityFence(sk); - if (ret >= 0 && ret <= 4096) { return null; } - Result_StrSecp256k1ErrorZ ret_hu_conv = Result_StrSecp256k1ErrorZ.constr_from_ptr(ret); - return ret_hu_conv; + return ret; } /** @@ -91,16 +89,6 @@ public class UtilMethods { return ret; } - /** - * Construct the invoice's HRP and signatureless data into a preimage to be hashed. - */ - public static byte[] construct_invoice_preimage(byte[] hrp_bytes, UInt5[] data_without_signature) { - byte[] ret = bindings.construct_invoice_preimage(hrp_bytes, data_without_signature != null ? InternalUtils.convUInt5Array(data_without_signature) : null); - Reference.reachabilityFence(hrp_bytes); - Reference.reachabilityFence(data_without_signature); - return ret; - } - /** * Read previously persisted [`ChannelMonitor`]s from the store. */ @@ -276,7 +264,7 @@ public class UtilMethods { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(arg_tx_broadcaster); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(arg_router); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(arg_logger); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(arg_default_config); }; + ; for (ChannelMonitor arg_channel_monitors_conv_16: arg_channel_monitors) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(arg_channel_monitors_conv_16); }; }; return ret_hu_conv; } @@ -343,9 +331,7 @@ public class UtilMethods { if (ret >= 0 && ret <= 4096) { return null; } Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ ret_hu_conv = Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(keys); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(min_value_msat); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(entropy_source); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(min_final_cltv_expiry_delta); }; return ret_hu_conv; } @@ -372,8 +358,6 @@ public class UtilMethods { if (ret >= 0 && ret <= 4096) { return null; } Result_ThirtyTwoBytesNoneZ ret_hu_conv = Result_ThirtyTwoBytesNoneZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(keys); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(min_value_msat); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(min_final_cltv_expiry_delta); }; return ret_hu_conv; } @@ -601,326 +585,271 @@ public class UtilMethods { } /** - * Read a NetworkUpdate from a byte array, created by NetworkUpdate_write - */ - public static Result_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(byte[] ser) { - long ret = bindings.NetworkUpdate_read(ser); - Reference.reachabilityFence(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_COption_NetworkUpdateZDecodeErrorZ ret_hu_conv = Result_COption_NetworkUpdateZDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Verifies the signature of a [`NodeAnnouncement`]. + * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\" + * See [`PhantomKeysManager`] for more information on phantom node payments. * - * Returns an error if it is invalid. - */ - public static Result_NoneLightningErrorZ verify_node_announcement(org.ldk.structs.NodeAnnouncement msg) { - long ret = bindings.verify_node_announcement(msg.ptr); - Reference.reachabilityFence(msg); - if (ret >= 0 && ret <= 4096) { return null; } - Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; - return ret_hu_conv; - } - - /** - * Verifies all signatures included in a [`ChannelAnnouncement`]. + * `phantom_route_hints` parameter: + * Contains channel info for all nodes participating in the phantom invoice + * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each + * participating node + * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is + * updated when a channel becomes disabled or closes + * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice + * may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared + * down * - * Returns an error if one of the signatures is invalid. + * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference + * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]). + * If `None` is provided for `payment_hash`, then one will be created. + * + * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for + * in excess of the current time. + * + * `duration_since_epoch` is the current time since epoch in seconds. + * + * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to + * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`] - 3. + * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block + * confirmations during routing. + * + * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom + * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this + * requirement). + * + * [`PhantomKeysManager`]: crate::sign::PhantomKeysManager + * [`ChannelManager::get_phantom_route_hints`]: crate::ln::channelmanager::ChannelManager::get_phantom_route_hints + * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment + * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash + * [`PhantomRouteHints::channels`]: crate::ln::channelmanager::PhantomRouteHints::channels + * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: crate::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA + * + * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not + * available and the current time is supplied by the caller. */ - public static Result_NoneLightningErrorZ verify_channel_announcement(org.ldk.structs.ChannelAnnouncement msg) { - long ret = bindings.verify_channel_announcement(msg.ptr); - Reference.reachabilityFence(msg); + public static Result_Bolt11InvoiceSignOrCreationErrorZ create_phantom_invoice(org.ldk.structs.Option_u64Z amt_msat, org.ldk.structs.Option_ThirtyTwoBytesZ payment_hash, java.lang.String description, int invoice_expiry_delta_secs, PhantomRouteHints[] phantom_route_hints, org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.enums.Currency network, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta, long duration_since_epoch) { + long ret = bindings.create_phantom_invoice(amt_msat.ptr, payment_hash.ptr, description, invoice_expiry_delta_secs, phantom_route_hints != null ? Arrays.stream(phantom_route_hints).mapToLong(phantom_route_hints_conv_19 -> phantom_route_hints_conv_19.ptr).toArray() : null, entropy_source.ptr, node_signer.ptr, logger.ptr, network, min_final_cltv_expiry_delta.ptr, duration_since_epoch); + Reference.reachabilityFence(amt_msat); + Reference.reachabilityFence(payment_hash); + Reference.reachabilityFence(description); + Reference.reachabilityFence(invoice_expiry_delta_secs); + Reference.reachabilityFence(phantom_route_hints); + Reference.reachabilityFence(entropy_source); + Reference.reachabilityFence(node_signer); + Reference.reachabilityFence(logger); + Reference.reachabilityFence(network); + Reference.reachabilityFence(min_final_cltv_expiry_delta); + Reference.reachabilityFence(duration_since_epoch); if (ret >= 0 && ret <= 4096) { return null; } - Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; + Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(entropy_source); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(node_signer); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(logger); }; return ret_hu_conv; } /** - * Finds a route from us (payer) to the given target node (payee). + * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\" + * See [`PhantomKeysManager`] for more information on phantom node payments. * - * If the payee provided features in their invoice, they should be provided via the `payee` field - * in the given [`RouteParameters::payment_params`]. - * Without this, MPP will only be used if the payee's features are available in the network graph. + * `phantom_route_hints` parameter: + * Contains channel info for all nodes participating in the phantom invoice + * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each + * participating node + * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is + * updated when a channel becomes disabled or closes + * Note that the route hints generated from `phantom_route_hints` will be limited to a maximum + * of 3 hints to ensure that the invoice can be scanned in a QR code. These hints are selected + * in the order that the nodes in `PhantomRouteHints` are specified, selecting one hint per node + * until the maximum is hit. Callers may provide as many `PhantomRouteHints::channels` as + * desired, but note that some nodes will be trimmed if more than 3 nodes are provided. * - * Private routing paths between a public node and the target may be included in the `payee` field - * of [`RouteParameters::payment_params`]. + * `description_hash` is a SHA-256 hash of the description text * - * If some channels aren't announced, it may be useful to fill in `first_hops` with the results - * from [`ChannelManager::list_usable_channels`]. If it is filled in, the view of these channels - * from `network_graph` will be ignored, and only those in `first_hops` will be used. + * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference + * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]). + * If `None` is provided for `payment_hash`, then one will be created. * - * The fees on channels from us to the next hop are ignored as they are assumed to all be equal. - * However, the enabled/disabled bit on such channels as well as the `htlc_minimum_msat` / - * `htlc_maximum_msat` *are* checked as they may change based on the receiving node. + * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for + * in excess of the current time. * - * # Panics + * `duration_since_epoch` is the current time since epoch in seconds. * - * Panics if first_hops contains channels without `short_channel_id`s; - * [`ChannelManager::list_usable_channels`] will never include such channels. + * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom + * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this + * requirement). * - * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels - * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed - * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph + * [`PhantomKeysManager`]: crate::sign::PhantomKeysManager + * [`ChannelManager::get_phantom_route_hints`]: crate::ln::channelmanager::ChannelManager::get_phantom_route_hints + * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment + * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash + * [`PhantomRouteHints::channels`]: crate::ln::channelmanager::PhantomRouteHints::channels * - * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None + * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not + * available and the current time is supplied by the caller. */ - public static Result_RouteLightningErrorZ find_route(byte[] our_node_pubkey, org.ldk.structs.RouteParameters route_params, org.ldk.structs.NetworkGraph network_graph, @Nullable ChannelDetails[] first_hops, org.ldk.structs.Logger logger, org.ldk.structs.ScoreLookUp scorer, org.ldk.structs.ProbabilisticScoringFeeParameters score_params, byte[] random_seed_bytes) { - long ret = bindings.find_route(InternalUtils.check_arr_len(our_node_pubkey, 33), route_params.ptr, network_graph.ptr, first_hops != null ? Arrays.stream(first_hops).mapToLong(first_hops_conv_16 -> first_hops_conv_16.ptr).toArray() : null, logger.ptr, scorer.ptr, score_params.ptr, InternalUtils.check_arr_len(random_seed_bytes, 32)); - Reference.reachabilityFence(our_node_pubkey); - Reference.reachabilityFence(route_params); - Reference.reachabilityFence(network_graph); - Reference.reachabilityFence(first_hops); + public static Result_Bolt11InvoiceSignOrCreationErrorZ create_phantom_invoice_with_description_hash(org.ldk.structs.Option_u64Z amt_msat, org.ldk.structs.Option_ThirtyTwoBytesZ payment_hash, int invoice_expiry_delta_secs, org.ldk.structs.Sha256 description_hash, PhantomRouteHints[] phantom_route_hints, org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.enums.Currency network, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta, long duration_since_epoch) { + long ret = bindings.create_phantom_invoice_with_description_hash(amt_msat.ptr, payment_hash.ptr, invoice_expiry_delta_secs, description_hash.ptr, phantom_route_hints != null ? Arrays.stream(phantom_route_hints).mapToLong(phantom_route_hints_conv_19 -> phantom_route_hints_conv_19.ptr).toArray() : null, entropy_source.ptr, node_signer.ptr, logger.ptr, network, min_final_cltv_expiry_delta.ptr, duration_since_epoch); + Reference.reachabilityFence(amt_msat); + Reference.reachabilityFence(payment_hash); + Reference.reachabilityFence(invoice_expiry_delta_secs); + Reference.reachabilityFence(description_hash); + Reference.reachabilityFence(phantom_route_hints); + Reference.reachabilityFence(entropy_source); + Reference.reachabilityFence(node_signer); Reference.reachabilityFence(logger); - Reference.reachabilityFence(scorer); - Reference.reachabilityFence(score_params); - Reference.reachabilityFence(random_seed_bytes); + Reference.reachabilityFence(network); + Reference.reachabilityFence(min_final_cltv_expiry_delta); + Reference.reachabilityFence(duration_since_epoch); if (ret >= 0 && ret <= 4096) { return null; } - Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(route_params); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(network_graph); }; - if (first_hops != null) { for (ChannelDetails first_hops_conv_16: first_hops) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(first_hops_conv_16); }; } }; + Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(entropy_source); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(node_signer); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(logger); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(scorer); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(score_params); }; return ret_hu_conv; } /** - * Construct a route from us (payer) to the target node (payee) via the given hops (which should - * exclude the payer, but include the payee). This may be useful, e.g., for probing the chosen path. + * Utility to construct an invoice. Generally, unless you want to do something like a custom + * cltv_expiry, this is what you should be using to create an invoice. The reason being, this + * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user + * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify + * that the payment secret is valid when the invoice is paid. * - * Re-uses logic from `find_route`, so the restrictions described there also apply here. + * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for + * in excess of the current time. + * + * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to + * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. + * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block + * confirmations during routing. + * + * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: crate::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA */ - public static Result_RouteLightningErrorZ build_route_from_hops(byte[] our_node_pubkey, byte[][] hops, org.ldk.structs.RouteParameters route_params, org.ldk.structs.NetworkGraph network_graph, org.ldk.structs.Logger logger, byte[] random_seed_bytes) { - long ret = bindings.build_route_from_hops(InternalUtils.check_arr_len(our_node_pubkey, 33), hops != null ? Arrays.stream(hops).map(hops_conv_8 -> InternalUtils.check_arr_len(hops_conv_8, 33)).toArray(byte[][]::new) : null, route_params.ptr, network_graph.ptr, logger.ptr, InternalUtils.check_arr_len(random_seed_bytes, 32)); - Reference.reachabilityFence(our_node_pubkey); - Reference.reachabilityFence(hops); - Reference.reachabilityFence(route_params); - Reference.reachabilityFence(network_graph); + public static Result_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.enums.Currency network, org.ldk.structs.Option_u64Z amt_msat, java.lang.String description, int invoice_expiry_delta_secs, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) { + long ret = bindings.create_invoice_from_channelmanager(channelmanager.ptr, node_signer.ptr, logger.ptr, network, amt_msat.ptr, description, invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr); + Reference.reachabilityFence(channelmanager); + Reference.reachabilityFence(node_signer); Reference.reachabilityFence(logger); - Reference.reachabilityFence(random_seed_bytes); + Reference.reachabilityFence(network); + Reference.reachabilityFence(amt_msat); + Reference.reachabilityFence(description); + Reference.reachabilityFence(invoice_expiry_delta_secs); + Reference.reachabilityFence(min_final_cltv_expiry_delta); if (ret >= 0 && ret <= 4096) { return null; } - Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(route_params); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(network_graph); }; + Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channelmanager); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(node_signer); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(logger); }; return ret_hu_conv; } /** - * Creates an unsigned [`PartiallySignedTransaction`] which spends the given descriptors to - * the given outputs, plus an output to the given change destination (if sufficient - * change value remains). The PSBT will have a feerate, at least, of the given value. - * - * The `locktime` argument is used to set the transaction's locktime. If `None`, the - * transaction will have a locktime of 0. It it recommended to set this to the current block - * height to avoid fee sniping, unless you have some specific reason to use a different - * locktime. + * Utility to construct an invoice. Generally, unless you want to do something like a custom + * cltv_expiry, this is what you should be using to create an invoice. The reason being, this + * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user + * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify + * that the payment secret is valid when the invoice is paid. + * Use this variant if you want to pass the `description_hash` to the invoice. * - * Returns the PSBT and expected max transaction weight. + * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for + * in excess of the current time. * - * Returns `Err(())` if the output value is greater than the input value minus required fee, - * if a descriptor was duplicated, or if an output descriptor `script_pubkey` - * does not match the one we can spend. + * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to + * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. + * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block + * confirmations during routing. * - * We do not enforce that outputs meet the dust limit or that any output scripts are standard. + * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: crate::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA */ - public static Result_C2Tuple_CVec_u8Zu64ZNoneZ SpendableOutputDescriptor_create_spendable_outputs_psbt(SpendableOutputDescriptor[] descriptors, TxOut[] outputs, byte[] change_destination_script, int feerate_sat_per_1000_weight, org.ldk.structs.Option_u32Z locktime) { - long ret = bindings.SpendableOutputDescriptor_create_spendable_outputs_psbt(descriptors != null ? Arrays.stream(descriptors).mapToLong(descriptors_conv_27 -> descriptors_conv_27.ptr).toArray() : null, outputs != null ? Arrays.stream(outputs).mapToLong(outputs_conv_7 -> outputs_conv_7.ptr).toArray() : null, change_destination_script, feerate_sat_per_1000_weight, locktime.ptr); - Reference.reachabilityFence(descriptors); - Reference.reachabilityFence(outputs); - Reference.reachabilityFence(change_destination_script); - Reference.reachabilityFence(feerate_sat_per_1000_weight); - Reference.reachabilityFence(locktime); + public static Result_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.enums.Currency network, org.ldk.structs.Option_u64Z amt_msat, org.ldk.structs.Sha256 description_hash, int invoice_expiry_delta_secs, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) { + long ret = bindings.create_invoice_from_channelmanager_with_description_hash(channelmanager.ptr, node_signer.ptr, logger.ptr, network, amt_msat.ptr, description_hash.ptr, invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr); + Reference.reachabilityFence(channelmanager); + Reference.reachabilityFence(node_signer); + Reference.reachabilityFence(logger); + Reference.reachabilityFence(network); + Reference.reachabilityFence(amt_msat); + Reference.reachabilityFence(description_hash); + Reference.reachabilityFence(invoice_expiry_delta_secs); + Reference.reachabilityFence(min_final_cltv_expiry_delta); if (ret >= 0 && ret <= 4096) { return null; } - Result_C2Tuple_CVec_u8Zu64ZNoneZ ret_hu_conv = Result_C2Tuple_CVec_u8Zu64ZNoneZ.constr_from_ptr(ret); - for (SpendableOutputDescriptor descriptors_conv_27: descriptors) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(descriptors_conv_27); }; }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(locktime); }; + Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channelmanager); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(node_signer); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(logger); }; return ret_hu_conv; } /** - * Creates an [`OnionMessage`] with the given `contents` for sending to the destination of - * `path`, first calling [`Destination::resolve`] on `path.destination` with the given - * [`ReadOnlyNetworkGraph`]. - * - * Returns the node id of the peer to send the message to, the message itself, and any addresses - * needed to connect to the first node. - * - * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None - */ - public static Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ create_onion_message_resolving_destination(org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.NodeIdLookUp node_id_lookup, org.ldk.structs.ReadOnlyNetworkGraph network_graph, org.ldk.structs.OnionMessagePath path, org.ldk.structs.OnionMessageContents contents, @Nullable org.ldk.structs.BlindedPath reply_path) { - long ret = bindings.create_onion_message_resolving_destination(entropy_source.ptr, node_signer.ptr, node_id_lookup.ptr, network_graph.ptr, path.ptr, contents.ptr, reply_path == null ? 0 : reply_path.ptr); - Reference.reachabilityFence(entropy_source); - Reference.reachabilityFence(node_signer); - Reference.reachabilityFence(node_id_lookup); - Reference.reachabilityFence(network_graph); - Reference.reachabilityFence(path); - Reference.reachabilityFence(contents); - Reference.reachabilityFence(reply_path); - if (ret >= 0 && ret <= 4096) { return null; } - Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ ret_hu_conv = Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(entropy_source); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(node_signer); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(node_id_lookup); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(network_graph); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(path); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(contents); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(reply_path); }; - return ret_hu_conv; - } - - /** - * Creates an [`OnionMessage`] with the given `contents` for sending to the destination of - * `path`. - * - * Returns the node id of the peer to send the message to, the message itself, and any addresses - * needed to connect to the first node. - * - * Returns [`SendError::UnresolvedIntroductionNode`] if: - * - `destination` contains a blinded path with an [`IntroductionNode::DirectedShortChannelId`], - * - unless it can be resolved by [`NodeIdLookUp::next_node_id`]. - * Use [`create_onion_message_resolving_destination`] instead to resolve the introduction node - * first with a [`ReadOnlyNetworkGraph`]. - * - * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None + * See [`create_invoice_from_channelmanager_with_description_hash`] + * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not + * available and the current time is supplied by the caller. */ - public static Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ create_onion_message(org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.NodeIdLookUp node_id_lookup, org.ldk.structs.OnionMessagePath path, org.ldk.structs.OnionMessageContents contents, @Nullable org.ldk.structs.BlindedPath reply_path) { - long ret = bindings.create_onion_message(entropy_source.ptr, node_signer.ptr, node_id_lookup.ptr, path.ptr, contents.ptr, reply_path == null ? 0 : reply_path.ptr); - Reference.reachabilityFence(entropy_source); + public static Result_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.enums.Currency network, org.ldk.structs.Option_u64Z amt_msat, org.ldk.structs.Sha256 description_hash, long duration_since_epoch, int invoice_expiry_delta_secs, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) { + long ret = bindings.create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(channelmanager.ptr, node_signer.ptr, logger.ptr, network, amt_msat.ptr, description_hash.ptr, duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr); + Reference.reachabilityFence(channelmanager); Reference.reachabilityFence(node_signer); - Reference.reachabilityFence(node_id_lookup); - Reference.reachabilityFence(path); - Reference.reachabilityFence(contents); - Reference.reachabilityFence(reply_path); + Reference.reachabilityFence(logger); + Reference.reachabilityFence(network); + Reference.reachabilityFence(amt_msat); + Reference.reachabilityFence(description_hash); + Reference.reachabilityFence(duration_since_epoch); + Reference.reachabilityFence(invoice_expiry_delta_secs); + Reference.reachabilityFence(min_final_cltv_expiry_delta); if (ret >= 0 && ret <= 4096) { return null; } - Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ ret_hu_conv = Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(entropy_source); }; + Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channelmanager); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(node_signer); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(node_id_lookup); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(path); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(contents); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(reply_path); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(logger); }; return ret_hu_conv; } /** - * Decode one layer of an incoming [`OnionMessage`]. - * - * Returns either the next layer of the onion for forwarding or the decrypted content for the - * receiver. + * See [`create_invoice_from_channelmanager`] + * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not + * available and the current time is supplied by the caller. */ - public static Result_PeeledOnionNoneZ peel_onion_message(org.ldk.structs.OnionMessage msg, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.structs.CustomOnionMessageHandler custom_handler) { - long ret = bindings.peel_onion_message(msg.ptr, node_signer.ptr, logger.ptr, custom_handler.ptr); - Reference.reachabilityFence(msg); + public static Result_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.enums.Currency network, org.ldk.structs.Option_u64Z amt_msat, java.lang.String description, long duration_since_epoch, int invoice_expiry_delta_secs, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) { + long ret = bindings.create_invoice_from_channelmanager_and_duration_since_epoch(channelmanager.ptr, node_signer.ptr, logger.ptr, network, amt_msat.ptr, description, duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr); + Reference.reachabilityFence(channelmanager); Reference.reachabilityFence(node_signer); Reference.reachabilityFence(logger); - Reference.reachabilityFence(custom_handler); + Reference.reachabilityFence(network); + Reference.reachabilityFence(amt_msat); + Reference.reachabilityFence(description); + Reference.reachabilityFence(duration_since_epoch); + Reference.reachabilityFence(invoice_expiry_delta_secs); + Reference.reachabilityFence(min_final_cltv_expiry_delta); if (ret >= 0 && ret <= 4096) { return null; } - Result_PeeledOnionNoneZ ret_hu_conv = Result_PeeledOnionNoneZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; + Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channelmanager); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(node_signer); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(logger); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(custom_handler); }; return ret_hu_conv; } /** - * Returns whether `tlv_type` corresponds to a TLV record for Offers. - */ - public static boolean OffersMessage_is_known_type(long tlv_type) { - boolean ret = bindings.OffersMessage_is_known_type(tlv_type); - Reference.reachabilityFence(tlv_type); - return ret; - } - - /** - * Create a one-hop blinded path for a payment. + * See [`create_invoice_from_channelmanager_and_duration_since_epoch`] + * This version allows for providing a custom [`PaymentHash`] for the invoice. + * This may be useful if you're building an on-chain swap or involving another protocol where + * the payment hash is also involved outside the scope of lightning. */ - public static Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ BlindedPath_one_hop_for_payment(byte[] payee_node_id, org.ldk.structs.ReceiveTlvs payee_tlvs, short min_final_cltv_expiry_delta, org.ldk.structs.EntropySource entropy_source) { - long ret = bindings.BlindedPath_one_hop_for_payment(InternalUtils.check_arr_len(payee_node_id, 33), payee_tlvs.ptr, min_final_cltv_expiry_delta, entropy_source.ptr); - Reference.reachabilityFence(payee_node_id); - Reference.reachabilityFence(payee_tlvs); - Reference.reachabilityFence(min_final_cltv_expiry_delta); - Reference.reachabilityFence(entropy_source); - if (ret >= 0 && ret <= 4096) { return null; } - Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ ret_hu_conv = Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(payee_tlvs); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(entropy_source); }; - return ret_hu_conv; - } - - /** - * Create a blinded path for a payment, to be forwarded along `intermediate_nodes`. - * - * Errors if: - * a provided node id is invalid - * [`BlindedPayInfo`] calculation results in an integer overflow - * any unknown features are required in the provided [`ForwardTlvs`] - * - * [`ForwardTlvs`]: crate::blinded_path::payment::ForwardTlvs - */ - public static Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ BlindedPath_new_for_payment(ForwardNode[] intermediate_nodes, byte[] payee_node_id, org.ldk.structs.ReceiveTlvs payee_tlvs, long htlc_maximum_msat, short min_final_cltv_expiry_delta, org.ldk.structs.EntropySource entropy_source) { - long ret = bindings.BlindedPath_new_for_payment(intermediate_nodes != null ? Arrays.stream(intermediate_nodes).mapToLong(intermediate_nodes_conv_13 -> intermediate_nodes_conv_13.ptr).toArray() : null, InternalUtils.check_arr_len(payee_node_id, 33), payee_tlvs.ptr, htlc_maximum_msat, min_final_cltv_expiry_delta, entropy_source.ptr); - Reference.reachabilityFence(intermediate_nodes); - Reference.reachabilityFence(payee_node_id); - Reference.reachabilityFence(payee_tlvs); - Reference.reachabilityFence(htlc_maximum_msat); + public static Result_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.enums.Currency network, org.ldk.structs.Option_u64Z amt_msat, java.lang.String description, long duration_since_epoch, int invoice_expiry_delta_secs, byte[] payment_hash, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) { + long ret = bindings.create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(channelmanager.ptr, node_signer.ptr, logger.ptr, network, amt_msat.ptr, description, duration_since_epoch, invoice_expiry_delta_secs, InternalUtils.check_arr_len(payment_hash, 32), min_final_cltv_expiry_delta.ptr); + Reference.reachabilityFence(channelmanager); + Reference.reachabilityFence(node_signer); + Reference.reachabilityFence(logger); + Reference.reachabilityFence(network); + Reference.reachabilityFence(amt_msat); + Reference.reachabilityFence(description); + Reference.reachabilityFence(duration_since_epoch); + Reference.reachabilityFence(invoice_expiry_delta_secs); + Reference.reachabilityFence(payment_hash); Reference.reachabilityFence(min_final_cltv_expiry_delta); - Reference.reachabilityFence(entropy_source); - if (ret >= 0 && ret <= 4096) { return null; } - Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ ret_hu_conv = Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.constr_from_ptr(ret); - for (ForwardNode intermediate_nodes_conv_13: intermediate_nodes) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(intermediate_nodes_conv_13); }; }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(payee_tlvs); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(entropy_source); }; - return ret_hu_conv; - } - - /** - * Read a PathFailure from a byte array, created by PathFailure_write - */ - public static Result_COption_PathFailureZDecodeErrorZ PathFailure_read(byte[] ser) { - long ret = bindings.PathFailure_read(ser); - Reference.reachabilityFence(ser); if (ret >= 0 && ret <= 4096) { return null; } - Result_COption_PathFailureZDecodeErrorZ ret_hu_conv = Result_COption_PathFailureZDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Read a ClosureReason from a byte array, created by ClosureReason_write - */ - public static Result_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(byte[] ser) { - long ret = bindings.ClosureReason_read(ser); - Reference.reachabilityFence(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_COption_ClosureReasonZDecodeErrorZ ret_hu_conv = Result_COption_ClosureReasonZDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Read a HTLCDestination from a byte array, created by HTLCDestination_write - */ - public static Result_COption_HTLCDestinationZDecodeErrorZ HTLCDestination_read(byte[] ser) { - long ret = bindings.HTLCDestination_read(ser); - Reference.reachabilityFence(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_COption_HTLCDestinationZDecodeErrorZ ret_hu_conv = Result_COption_HTLCDestinationZDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Read a Event from a byte array, created by Event_write - */ - public static Result_COption_EventZDecodeErrorZ Event_read(byte[] ser) { - long ret = bindings.Event_read(ser); - Reference.reachabilityFence(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_COption_EventZDecodeErrorZ ret_hu_conv = Result_COption_EventZDecodeErrorZ.constr_from_ptr(ret); + Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channelmanager); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(node_signer); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(logger); }; return ret_hu_conv; } @@ -935,8 +864,8 @@ public class UtilMethods { * Will always succeed unless the invoice has an amount specified, in which case * [`payment_parameters_from_invoice`] should be used. * - * [`ChannelManager::send_payment`]: lightning::ln::channelmanager::ChannelManager::send_payment - * [`ChannelManager::send_preflight_probes`]: lightning::ln::channelmanager::ChannelManager::send_preflight_probes + * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment + * [`ChannelManager::send_preflight_probes`]: crate::ln::channelmanager::ChannelManager::send_preflight_probes */ public static Result_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ payment_parameters_from_zero_amount_invoice(org.ldk.structs.Bolt11Invoice invoice, long amount_msat) { long ret = bindings.payment_parameters_from_zero_amount_invoice(invoice.ptr, amount_msat); @@ -958,8 +887,8 @@ public class UtilMethods { * Will always succeed unless the invoice has no amount specified, in which case * [`payment_parameters_from_zero_amount_invoice`] should be used. * - * [`ChannelManager::send_payment`]: lightning::ln::channelmanager::ChannelManager::send_payment - * [`ChannelManager::send_preflight_probes`]: lightning::ln::channelmanager::ChannelManager::send_preflight_probes + * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment + * [`ChannelManager::send_preflight_probes`]: crate::ln::channelmanager::ChannelManager::send_preflight_probes */ public static Result_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ payment_parameters_from_invoice(org.ldk.structs.Bolt11Invoice invoice) { long ret = bindings.payment_parameters_from_invoice(invoice.ptr); @@ -971,292 +900,298 @@ public class UtilMethods { } /** - * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\" - * See [`PhantomKeysManager`] for more information on phantom node payments. - * - * `phantom_route_hints` parameter: - * Contains channel info for all nodes participating in the phantom invoice - * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each - * participating node - * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is - * updated when a channel becomes disabled or closes - * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice - * may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared - * down - * - * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference - * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]). - * If `None` is provided for `payment_hash`, then one will be created. - * - * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for - * in excess of the current time. - * - * `duration_since_epoch` is the current time since epoch in seconds. - * - * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to - * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`] - 3. - * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block - * confirmations during routing. - * - * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom - * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this - * requirement). + * Read a NetworkUpdate from a byte array, created by NetworkUpdate_write + */ + public static Result_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(byte[] ser) { + long ret = bindings.NetworkUpdate_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_NetworkUpdateZDecodeErrorZ ret_hu_conv = Result_COption_NetworkUpdateZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Verifies the signature of a [`NodeAnnouncement`]. * - * [`PhantomKeysManager`]: lightning::sign::PhantomKeysManager - * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints - * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment - * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash - * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels - * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA + * Returns an error if it is invalid. + */ + public static Result_NoneLightningErrorZ verify_node_announcement(org.ldk.structs.NodeAnnouncement msg) { + long ret = bindings.verify_node_announcement(msg.ptr); + Reference.reachabilityFence(msg); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; + return ret_hu_conv; + } + + /** + * Verifies all signatures included in a [`ChannelAnnouncement`]. * - * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not - * available and the current time is supplied by the caller. + * Returns an error if one of the signatures is invalid. */ - public static Result_Bolt11InvoiceSignOrCreationErrorZ create_phantom_invoice(org.ldk.structs.Option_u64Z amt_msat, org.ldk.structs.Option_ThirtyTwoBytesZ payment_hash, java.lang.String description, int invoice_expiry_delta_secs, PhantomRouteHints[] phantom_route_hints, org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.enums.Currency network, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta, long duration_since_epoch) { - long ret = bindings.create_phantom_invoice(amt_msat.ptr, payment_hash.ptr, description, invoice_expiry_delta_secs, phantom_route_hints != null ? Arrays.stream(phantom_route_hints).mapToLong(phantom_route_hints_conv_19 -> phantom_route_hints_conv_19.ptr).toArray() : null, entropy_source.ptr, node_signer.ptr, logger.ptr, network, min_final_cltv_expiry_delta.ptr, duration_since_epoch); - Reference.reachabilityFence(amt_msat); - Reference.reachabilityFence(payment_hash); - Reference.reachabilityFence(description); - Reference.reachabilityFence(invoice_expiry_delta_secs); - Reference.reachabilityFence(phantom_route_hints); - Reference.reachabilityFence(entropy_source); - Reference.reachabilityFence(node_signer); - Reference.reachabilityFence(logger); - Reference.reachabilityFence(network); - Reference.reachabilityFence(min_final_cltv_expiry_delta); - Reference.reachabilityFence(duration_since_epoch); + public static Result_NoneLightningErrorZ verify_channel_announcement(org.ldk.structs.ChannelAnnouncement msg) { + long ret = bindings.verify_channel_announcement(msg.ptr); + Reference.reachabilityFence(msg); if (ret >= 0 && ret <= 4096) { return null; } - Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(amt_msat); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(payment_hash); }; - for (PhantomRouteHints phantom_route_hints_conv_19: phantom_route_hints) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(phantom_route_hints_conv_19); }; }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(entropy_source); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(node_signer); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(logger); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(min_final_cltv_expiry_delta); }; + Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; return ret_hu_conv; } /** - * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\" - * See [`PhantomKeysManager`] for more information on phantom node payments. + * Finds a route from us (payer) to the given target node (payee). * - * `phantom_route_hints` parameter: - * Contains channel info for all nodes participating in the phantom invoice - * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each - * participating node - * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is - * updated when a channel becomes disabled or closes - * Note that the route hints generated from `phantom_route_hints` will be limited to a maximum - * of 3 hints to ensure that the invoice can be scanned in a QR code. These hints are selected - * in the order that the nodes in `PhantomRouteHints` are specified, selecting one hint per node - * until the maximum is hit. Callers may provide as many `PhantomRouteHints::channels` as - * desired, but note that some nodes will be trimmed if more than 3 nodes are provided. + * If the payee provided features in their invoice, they should be provided via the `payee` field + * in the given [`RouteParameters::payment_params`]. + * Without this, MPP will only be used if the payee's features are available in the network graph. * - * `description_hash` is a SHA-256 hash of the description text + * Private routing paths between a public node and the target may be included in the `payee` field + * of [`RouteParameters::payment_params`]. * - * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference - * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]). - * If `None` is provided for `payment_hash`, then one will be created. + * If some channels aren't announced, it may be useful to fill in `first_hops` with the results + * from [`ChannelManager::list_usable_channels`]. If it is filled in, the view of these channels + * from `network_graph` will be ignored, and only those in `first_hops` will be used. * - * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for - * in excess of the current time. + * The fees on channels from us to the next hop are ignored as they are assumed to all be equal. + * However, the enabled/disabled bit on such channels as well as the `htlc_minimum_msat` / + * `htlc_maximum_msat` *are* checked as they may change based on the receiving node. * - * `duration_since_epoch` is the current time since epoch in seconds. + * # Panics * - * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom - * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this - * requirement). + * Panics if first_hops contains channels without `short_channel_id`s; + * [`ChannelManager::list_usable_channels`] will never include such channels. * - * [`PhantomKeysManager`]: lightning::sign::PhantomKeysManager - * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints - * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment - * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash - * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels + * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels + * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed + * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph * - * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not - * available and the current time is supplied by the caller. + * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public static Result_Bolt11InvoiceSignOrCreationErrorZ create_phantom_invoice_with_description_hash(org.ldk.structs.Option_u64Z amt_msat, org.ldk.structs.Option_ThirtyTwoBytesZ payment_hash, int invoice_expiry_delta_secs, org.ldk.structs.Sha256 description_hash, PhantomRouteHints[] phantom_route_hints, org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.enums.Currency network, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta, long duration_since_epoch) { - long ret = bindings.create_phantom_invoice_with_description_hash(amt_msat.ptr, payment_hash.ptr, invoice_expiry_delta_secs, description_hash.ptr, phantom_route_hints != null ? Arrays.stream(phantom_route_hints).mapToLong(phantom_route_hints_conv_19 -> phantom_route_hints_conv_19.ptr).toArray() : null, entropy_source.ptr, node_signer.ptr, logger.ptr, network, min_final_cltv_expiry_delta.ptr, duration_since_epoch); - Reference.reachabilityFence(amt_msat); - Reference.reachabilityFence(payment_hash); - Reference.reachabilityFence(invoice_expiry_delta_secs); - Reference.reachabilityFence(description_hash); - Reference.reachabilityFence(phantom_route_hints); - Reference.reachabilityFence(entropy_source); - Reference.reachabilityFence(node_signer); + public static Result_RouteLightningErrorZ find_route(byte[] our_node_pubkey, org.ldk.structs.RouteParameters route_params, org.ldk.structs.NetworkGraph network_graph, @Nullable ChannelDetails[] first_hops, org.ldk.structs.Logger logger, org.ldk.structs.ScoreLookUp scorer, org.ldk.structs.ProbabilisticScoringFeeParameters score_params, byte[] random_seed_bytes) { + long ret = bindings.find_route(InternalUtils.check_arr_len(our_node_pubkey, 33), route_params.ptr, network_graph.ptr, first_hops != null ? Arrays.stream(first_hops).mapToLong(first_hops_conv_16 -> first_hops_conv_16.ptr).toArray() : null, logger.ptr, scorer.ptr, score_params.ptr, InternalUtils.check_arr_len(random_seed_bytes, 32)); + Reference.reachabilityFence(our_node_pubkey); + Reference.reachabilityFence(route_params); + Reference.reachabilityFence(network_graph); + Reference.reachabilityFence(first_hops); Reference.reachabilityFence(logger); - Reference.reachabilityFence(network); - Reference.reachabilityFence(min_final_cltv_expiry_delta); - Reference.reachabilityFence(duration_since_epoch); + Reference.reachabilityFence(scorer); + Reference.reachabilityFence(score_params); + Reference.reachabilityFence(random_seed_bytes); if (ret >= 0 && ret <= 4096) { return null; } - Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(amt_msat); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(payment_hash); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(description_hash); }; - for (PhantomRouteHints phantom_route_hints_conv_19: phantom_route_hints) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(phantom_route_hints_conv_19); }; }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(entropy_source); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(node_signer); }; + Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(route_params); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(network_graph); }; + if (first_hops != null) { for (ChannelDetails first_hops_conv_16: first_hops) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(first_hops_conv_16); }; } }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(logger); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(min_final_cltv_expiry_delta); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(scorer); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(score_params); }; return ret_hu_conv; } /** - * Utility to construct an invoice. Generally, unless you want to do something like a custom - * cltv_expiry, this is what you should be using to create an invoice. The reason being, this - * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user - * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify - * that the payment secret is valid when the invoice is paid. - * - * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for - * in excess of the current time. - * - * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to - * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. - * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block - * confirmations during routing. + * Construct a route from us (payer) to the target node (payee) via the given hops (which should + * exclude the payer, but include the payee). This may be useful, e.g., for probing the chosen path. * - * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA + * Re-uses logic from `find_route`, so the restrictions described there also apply here. */ - public static Result_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.enums.Currency network, org.ldk.structs.Option_u64Z amt_msat, java.lang.String description, int invoice_expiry_delta_secs, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) { - long ret = bindings.create_invoice_from_channelmanager(channelmanager.ptr, node_signer.ptr, logger.ptr, network, amt_msat.ptr, description, invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr); - Reference.reachabilityFence(channelmanager); - Reference.reachabilityFence(node_signer); + public static Result_RouteLightningErrorZ build_route_from_hops(byte[] our_node_pubkey, byte[][] hops, org.ldk.structs.RouteParameters route_params, org.ldk.structs.NetworkGraph network_graph, org.ldk.structs.Logger logger, byte[] random_seed_bytes) { + long ret = bindings.build_route_from_hops(InternalUtils.check_arr_len(our_node_pubkey, 33), hops != null ? Arrays.stream(hops).map(hops_conv_8 -> InternalUtils.check_arr_len(hops_conv_8, 33)).toArray(byte[][]::new) : null, route_params.ptr, network_graph.ptr, logger.ptr, InternalUtils.check_arr_len(random_seed_bytes, 32)); + Reference.reachabilityFence(our_node_pubkey); + Reference.reachabilityFence(hops); + Reference.reachabilityFence(route_params); + Reference.reachabilityFence(network_graph); Reference.reachabilityFence(logger); - Reference.reachabilityFence(network); - Reference.reachabilityFence(amt_msat); - Reference.reachabilityFence(description); - Reference.reachabilityFence(invoice_expiry_delta_secs); - Reference.reachabilityFence(min_final_cltv_expiry_delta); + Reference.reachabilityFence(random_seed_bytes); if (ret >= 0 && ret <= 4096) { return null; } - Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channelmanager); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(node_signer); }; + Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(route_params); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(network_graph); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(logger); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(amt_msat); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(min_final_cltv_expiry_delta); }; return ret_hu_conv; } /** - * Utility to construct an invoice. Generally, unless you want to do something like a custom - * cltv_expiry, this is what you should be using to create an invoice. The reason being, this - * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user - * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify - * that the payment secret is valid when the invoice is paid. - * Use this variant if you want to pass the `description_hash` to the invoice. + * Creates an unsigned [`Psbt`] which spends the given descriptors to + * the given outputs, plus an output to the given change destination (if sufficient + * change value remains). The PSBT will have a feerate, at least, of the given value. * - * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for - * in excess of the current time. + * The `locktime` argument is used to set the transaction's locktime. If `None`, the + * transaction will have a locktime of 0. It it recommended to set this to the current block + * height to avoid fee sniping, unless you have some specific reason to use a different + * locktime. * - * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to - * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. - * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block - * confirmations during routing. + * Returns the PSBT and expected max transaction weight. + * + * Returns `Err(())` if the output value is greater than the input value minus required fee, + * if a descriptor was duplicated, or if an output descriptor `script_pubkey` + * does not match the one we can spend. * - * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA + * We do not enforce that outputs meet the dust limit or that any output scripts are standard. */ - public static Result_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.enums.Currency network, org.ldk.structs.Option_u64Z amt_msat, org.ldk.structs.Sha256 description_hash, int invoice_expiry_delta_secs, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) { - long ret = bindings.create_invoice_from_channelmanager_with_description_hash(channelmanager.ptr, node_signer.ptr, logger.ptr, network, amt_msat.ptr, description_hash.ptr, invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr); - Reference.reachabilityFence(channelmanager); - Reference.reachabilityFence(node_signer); - Reference.reachabilityFence(logger); - Reference.reachabilityFence(network); - Reference.reachabilityFence(amt_msat); - Reference.reachabilityFence(description_hash); - Reference.reachabilityFence(invoice_expiry_delta_secs); - Reference.reachabilityFence(min_final_cltv_expiry_delta); + public static Result_C2Tuple_CVec_u8Zu64ZNoneZ SpendableOutputDescriptor_create_spendable_outputs_psbt(SpendableOutputDescriptor[] descriptors, TxOut[] outputs, byte[] change_destination_script, int feerate_sat_per_1000_weight, org.ldk.structs.Option_u32Z locktime) { + long ret = bindings.SpendableOutputDescriptor_create_spendable_outputs_psbt(descriptors != null ? Arrays.stream(descriptors).mapToLong(descriptors_conv_27 -> descriptors_conv_27.ptr).toArray() : null, outputs != null ? Arrays.stream(outputs).mapToLong(outputs_conv_7 -> outputs_conv_7.ptr).toArray() : null, change_destination_script, feerate_sat_per_1000_weight, locktime.ptr); + Reference.reachabilityFence(descriptors); + Reference.reachabilityFence(outputs); + Reference.reachabilityFence(change_destination_script); + Reference.reachabilityFence(feerate_sat_per_1000_weight); + Reference.reachabilityFence(locktime); if (ret >= 0 && ret <= 4096) { return null; } - Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channelmanager); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(node_signer); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(logger); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(amt_msat); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(description_hash); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(min_final_cltv_expiry_delta); }; + Result_C2Tuple_CVec_u8Zu64ZNoneZ ret_hu_conv = Result_C2Tuple_CVec_u8Zu64ZNoneZ.constr_from_ptr(ret); return ret_hu_conv; } /** - * See [`create_invoice_from_channelmanager_with_description_hash`] - * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not - * available and the current time is supplied by the caller. + * Returns whether `tlv_type` corresponds to a TLV record for async payment messages. */ - public static Result_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.enums.Currency network, org.ldk.structs.Option_u64Z amt_msat, org.ldk.structs.Sha256 description_hash, long duration_since_epoch, int invoice_expiry_delta_secs, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) { - long ret = bindings.create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(channelmanager.ptr, node_signer.ptr, logger.ptr, network, amt_msat.ptr, description_hash.ptr, duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr); - Reference.reachabilityFence(channelmanager); + public static boolean AsyncPaymentsMessage_is_known_type(long tlv_type) { + boolean ret = bindings.AsyncPaymentsMessage_is_known_type(tlv_type); + Reference.reachabilityFence(tlv_type); + return ret; + } + + /** + * Creates an [`OnionMessage`] with the given `contents` for sending to the destination of + * `path`, first calling [`Destination::resolve`] on `path.destination` with the given + * [`ReadOnlyNetworkGraph`]. + * + * Returns the node id of the peer to send the message to, the message itself, and any addresses + * needed to connect to the first node. + * + * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public static Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ create_onion_message_resolving_destination(org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.NodeIdLookUp node_id_lookup, org.ldk.structs.ReadOnlyNetworkGraph network_graph, org.ldk.structs.OnionMessagePath path, org.ldk.structs.OnionMessageContents contents, @Nullable org.ldk.structs.BlindedMessagePath reply_path) { + long ret = bindings.create_onion_message_resolving_destination(entropy_source.ptr, node_signer.ptr, node_id_lookup.ptr, network_graph.ptr, path.ptr, contents.ptr, reply_path == null ? 0 : reply_path.ptr); + Reference.reachabilityFence(entropy_source); Reference.reachabilityFence(node_signer); - Reference.reachabilityFence(logger); - Reference.reachabilityFence(network); - Reference.reachabilityFence(amt_msat); - Reference.reachabilityFence(description_hash); - Reference.reachabilityFence(duration_since_epoch); - Reference.reachabilityFence(invoice_expiry_delta_secs); - Reference.reachabilityFence(min_final_cltv_expiry_delta); + Reference.reachabilityFence(node_id_lookup); + Reference.reachabilityFence(network_graph); + Reference.reachabilityFence(path); + Reference.reachabilityFence(contents); + Reference.reachabilityFence(reply_path); if (ret >= 0 && ret <= 4096) { return null; } - Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channelmanager); }; + Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ ret_hu_conv = Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(entropy_source); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(node_signer); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(logger); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(amt_msat); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(description_hash); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(min_final_cltv_expiry_delta); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(node_id_lookup); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(network_graph); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(contents); }; return ret_hu_conv; } /** - * See [`create_invoice_from_channelmanager`] - * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not - * available and the current time is supplied by the caller. + * Creates an [`OnionMessage`] with the given `contents` for sending to the destination of + * `path`. + * + * Returns the node id of the peer to send the message to, the message itself, and any addresses + * needed to connect to the first node. + * + * Returns [`SendError::UnresolvedIntroductionNode`] if: + * - `destination` contains a blinded path with an [`IntroductionNode::DirectedShortChannelId`], + * - unless it can be resolved by [`NodeIdLookUp::next_node_id`]. + * Use [`create_onion_message_resolving_destination`] instead to resolve the introduction node + * first with a [`ReadOnlyNetworkGraph`]. + * + * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public static Result_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.enums.Currency network, org.ldk.structs.Option_u64Z amt_msat, java.lang.String description, long duration_since_epoch, int invoice_expiry_delta_secs, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) { - long ret = bindings.create_invoice_from_channelmanager_and_duration_since_epoch(channelmanager.ptr, node_signer.ptr, logger.ptr, network, amt_msat.ptr, description, duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr); - Reference.reachabilityFence(channelmanager); + public static Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ create_onion_message(org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.NodeIdLookUp node_id_lookup, org.ldk.structs.OnionMessagePath path, org.ldk.structs.OnionMessageContents contents, @Nullable org.ldk.structs.BlindedMessagePath reply_path) { + long ret = bindings.create_onion_message(entropy_source.ptr, node_signer.ptr, node_id_lookup.ptr, path.ptr, contents.ptr, reply_path == null ? 0 : reply_path.ptr); + Reference.reachabilityFence(entropy_source); Reference.reachabilityFence(node_signer); - Reference.reachabilityFence(logger); - Reference.reachabilityFence(network); - Reference.reachabilityFence(amt_msat); - Reference.reachabilityFence(description); - Reference.reachabilityFence(duration_since_epoch); - Reference.reachabilityFence(invoice_expiry_delta_secs); - Reference.reachabilityFence(min_final_cltv_expiry_delta); + Reference.reachabilityFence(node_id_lookup); + Reference.reachabilityFence(path); + Reference.reachabilityFence(contents); + Reference.reachabilityFence(reply_path); if (ret >= 0 && ret <= 4096) { return null; } - Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channelmanager); }; + Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ ret_hu_conv = Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(entropy_source); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(node_signer); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(logger); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(amt_msat); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(min_final_cltv_expiry_delta); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(node_id_lookup); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(contents); }; return ret_hu_conv; } /** - * See [`create_invoice_from_channelmanager_and_duration_since_epoch`] - * This version allows for providing a custom [`PaymentHash`] for the invoice. - * This may be useful if you're building an on-chain swap or involving another protocol where - * the payment hash is also involved outside the scope of lightning. + * Decode one layer of an incoming [`OnionMessage`]. + * + * Returns either the next layer of the onion for forwarding or the decrypted content for the + * receiver. */ - public static Result_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.enums.Currency network, org.ldk.structs.Option_u64Z amt_msat, java.lang.String description, long duration_since_epoch, int invoice_expiry_delta_secs, byte[] payment_hash, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) { - long ret = bindings.create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(channelmanager.ptr, node_signer.ptr, logger.ptr, network, amt_msat.ptr, description, duration_since_epoch, invoice_expiry_delta_secs, InternalUtils.check_arr_len(payment_hash, 32), min_final_cltv_expiry_delta.ptr); - Reference.reachabilityFence(channelmanager); + public static Result_PeeledOnionNoneZ peel_onion_message(org.ldk.structs.OnionMessage msg, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.structs.CustomOnionMessageHandler custom_handler) { + long ret = bindings.peel_onion_message(msg.ptr, node_signer.ptr, logger.ptr, custom_handler.ptr); + Reference.reachabilityFence(msg); Reference.reachabilityFence(node_signer); Reference.reachabilityFence(logger); - Reference.reachabilityFence(network); - Reference.reachabilityFence(amt_msat); - Reference.reachabilityFence(description); - Reference.reachabilityFence(duration_since_epoch); - Reference.reachabilityFence(invoice_expiry_delta_secs); - Reference.reachabilityFence(payment_hash); - Reference.reachabilityFence(min_final_cltv_expiry_delta); + Reference.reachabilityFence(custom_handler); if (ret >= 0 && ret <= 4096) { return null; } - Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channelmanager); }; + Result_PeeledOnionNoneZ ret_hu_conv = Result_PeeledOnionNoneZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(node_signer); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(logger); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(amt_msat); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(min_final_cltv_expiry_delta); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(custom_handler); }; + return ret_hu_conv; + } + + /** + * Returns whether `tlv_type` corresponds to a TLV record for Offers. + */ + public static boolean OffersMessage_is_known_type(long tlv_type) { + boolean ret = bindings.OffersMessage_is_known_type(tlv_type); + Reference.reachabilityFence(tlv_type); + return ret; + } + + /** + * Read a PathFailure from a byte array, created by PathFailure_write + */ + public static Result_COption_PathFailureZDecodeErrorZ PathFailure_read(byte[] ser) { + long ret = bindings.PathFailure_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_PathFailureZDecodeErrorZ ret_hu_conv = Result_COption_PathFailureZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Read a ClosureReason from a byte array, created by ClosureReason_write + */ + public static Result_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(byte[] ser) { + long ret = bindings.ClosureReason_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_ClosureReasonZDecodeErrorZ ret_hu_conv = Result_COption_ClosureReasonZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Read a HTLCDestination from a byte array, created by HTLCDestination_write + */ + public static Result_COption_HTLCDestinationZDecodeErrorZ HTLCDestination_read(byte[] ser) { + long ret = bindings.HTLCDestination_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_HTLCDestinationZDecodeErrorZ ret_hu_conv = Result_COption_HTLCDestinationZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Read a PaymentFailureReason from a byte array, created by PaymentFailureReason_write + */ + public static Result_COption_PaymentFailureReasonZDecodeErrorZ PaymentFailureReason_read(byte[] ser) { + long ret = bindings.PaymentFailureReason_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_PaymentFailureReasonZDecodeErrorZ ret_hu_conv = Result_COption_PaymentFailureReasonZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Read a Event from a byte array, created by Event_write + */ + public static Result_COption_EventZDecodeErrorZ Event_read(byte[] ser) { + long ret = bindings.Event_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_EventZDecodeErrorZ ret_hu_conv = Result_COption_EventZDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Utxo.java b/src/main/java/org/ldk/structs/Utxo.java index 0787f349..97229295 100644 --- a/src/main/java/org/ldk/structs/Utxo.java +++ b/src/main/java/org/ldk/structs/Utxo.java @@ -40,7 +40,6 @@ public class Utxo extends CommonBase { bindings.Utxo_set_outpoint(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -96,7 +95,6 @@ public class Utxo extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Utxo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Utxo(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(outpoint_arg); }; return ret_hu_conv; } @@ -158,7 +156,6 @@ public class Utxo extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Utxo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Utxo(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(outpoint); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/UtxoLookup.java b/src/main/java/org/ldk/structs/UtxoLookup.java index 776ff806..3bce6687 100644 --- a/src/main/java/org/ldk/structs/UtxoLookup.java +++ b/src/main/java/org/ldk/structs/UtxoLookup.java @@ -54,7 +54,6 @@ public class UtxoLookup extends CommonBase { UtxoResult ret = arg.get_utxo(chain_hash, short_channel_id); Reference.reachabilityFence(arg); long result = ret.clone_ptr(); - if (impl_holder.held != null) { impl_holder.held.ptrs_to.add(ret); }; return result; } }); diff --git a/src/main/java/org/ldk/structs/UtxoResult.java b/src/main/java/org/ldk/structs/UtxoResult.java index c9abe3c3..a224d860 100644 --- a/src/main/java/org/ldk/structs/UtxoResult.java +++ b/src/main/java/org/ldk/structs/UtxoResult.java @@ -103,7 +103,6 @@ public class UtxoResult extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.UtxoResult ret_hu_conv = org.ldk.structs.UtxoResult.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/VerifiedInvoiceRequest.java b/src/main/java/org/ldk/structs/VerifiedInvoiceRequest.java index 902fd3b5..1e1a12fe 100644 --- a/src/main/java/org/ldk/structs/VerifiedInvoiceRequest.java +++ b/src/main/java/org/ldk/structs/VerifiedInvoiceRequest.java @@ -9,8 +9,9 @@ import javax.annotation.Nullable; /** - * An [`InvoiceRequest`] that has been verified by [`InvoiceRequest::verify`] and exposes different - * ways to respond depending on whether the signing keys were derived. + * An [`InvoiceRequest`] that has been verified by [`InvoiceRequest::verify_using_metadata`] or + * [`InvoiceRequest::verify_using_recipient_data`] and exposes different ways to respond depending + * on whether the signing keys were derived. */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class VerifiedInvoiceRequest extends CommonBase { @@ -40,43 +41,6 @@ public class VerifiedInvoiceRequest extends CommonBase { bindings.VerifiedInvoiceRequest_set_offer_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; - } - - /** - * Keys used for signing a [`Bolt12Invoice`] if they can be derived. - * - * If `Some`, must call [`respond_using_derived_keys`] when responding. Otherwise, call - * [`respond_with`]. - * - * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice - * [`respond_using_derived_keys`]: Self::respond_using_derived_keys - * [`respond_with`]: Self::respond_with - */ - public Option_SecretKeyZ get_keys() { - long ret = bindings.VerifiedInvoiceRequest_get_keys(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Option_SecretKeyZ ret_hu_conv = org.ldk.structs.Option_SecretKeyZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - return ret_hu_conv; - } - - /** - * Keys used for signing a [`Bolt12Invoice`] if they can be derived. - * - * If `Some`, must call [`respond_using_derived_keys`] when responding. Otherwise, call - * [`respond_with`]. - * - * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice - * [`respond_using_derived_keys`]: Self::respond_using_derived_keys - * [`respond_with`]: Self::respond_with - */ - public void set_keys(org.ldk.structs.Option_SecretKeyZ val) { - bindings.VerifiedInvoiceRequest_set_keys(this.ptr, val.ptr); - Reference.reachabilityFence(this); - Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } long clone_ptr() { @@ -195,18 +159,18 @@ public class VerifiedInvoiceRequest extends CommonBase { * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide * recipient privacy by obfuscating its node id. */ - public BlindedPath[] paths() { + public BlindedMessagePath[] paths() { long[] ret = bindings.VerifiedInvoiceRequest_paths(this.ptr); Reference.reachabilityFence(this); - int ret_conv_13_len = ret.length; - BlindedPath[] ret_conv_13_arr = new BlindedPath[ret_conv_13_len]; - for (int n = 0; n < ret_conv_13_len; n++) { - long ret_conv_13 = ret[n]; - org.ldk.structs.BlindedPath ret_conv_13_hu_conv = null; if (ret_conv_13 < 0 || ret_conv_13 > 4096) { ret_conv_13_hu_conv = new org.ldk.structs.BlindedPath(null, ret_conv_13); } - if (ret_conv_13_hu_conv != null) { ret_conv_13_hu_conv.ptrs_to.add(this); }; - ret_conv_13_arr[n] = ret_conv_13_hu_conv; + int ret_conv_20_len = ret.length; + BlindedMessagePath[] ret_conv_20_arr = new BlindedMessagePath[ret_conv_20_len]; + for (int u = 0; u < ret_conv_20_len; u++) { + long ret_conv_20 = ret[u]; + org.ldk.structs.BlindedMessagePath ret_conv_20_hu_conv = null; if (ret_conv_20 < 0 || ret_conv_20 > 4096) { ret_conv_20_hu_conv = new org.ldk.structs.BlindedMessagePath(null, ret_conv_20); } + if (ret_conv_20_hu_conv != null) { ret_conv_20_hu_conv.ptrs_to.add(this); }; + ret_conv_20_arr[u] = ret_conv_20_hu_conv; } - return ret_conv_13_arr; + return ret_conv_20_arr; } /** @@ -327,8 +291,8 @@ public class VerifiedInvoiceRequest extends CommonBase { * * [`Duration`]: core::time::Duration */ - public Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ respond_with(TwoTuple_BlindedPayInfoBlindedPathZ[] payment_paths, byte[] payment_hash) { - long ret = bindings.VerifiedInvoiceRequest_respond_with(this.ptr, payment_paths != null ? Arrays.stream(payment_paths).mapToLong(payment_paths_conv_37 -> payment_paths_conv_37.ptr).toArray() : null, InternalUtils.check_arr_len(payment_hash, 32)); + public Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ respond_with(BlindedPaymentPath[] payment_paths, byte[] payment_hash) { + long ret = bindings.VerifiedInvoiceRequest_respond_with(this.ptr, payment_paths != null ? Arrays.stream(payment_paths).mapToLong(payment_paths_conv_20 -> payment_paths_conv_20.ptr).toArray() : null, InternalUtils.check_arr_len(payment_hash, 32)); Reference.reachabilityFence(this); Reference.reachabilityFence(payment_paths); Reference.reachabilityFence(payment_hash); @@ -357,13 +321,15 @@ public class VerifiedInvoiceRequest extends CommonBase { * # Note * * If the originating [`Offer`] was created using [`OfferBuilder::deriving_signing_pubkey`], - * then use [`InvoiceRequest::verify`] and [`VerifiedInvoiceRequest`] methods instead. + * then first use [`InvoiceRequest::verify_using_metadata`] or + * [`InvoiceRequest::verify_using_recipient_data`] and then [`VerifiedInvoiceRequest`] methods + * instead. * * [`Bolt12Invoice::created_at`]: crate::offers::invoice::Bolt12Invoice::created_at * [`OfferBuilder::deriving_signing_pubkey`]: crate::offers::offer::OfferBuilder::deriving_signing_pubkey */ - public Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ respond_with_no_std(TwoTuple_BlindedPayInfoBlindedPathZ[] payment_paths, byte[] payment_hash, long created_at) { - long ret = bindings.VerifiedInvoiceRequest_respond_with_no_std(this.ptr, payment_paths != null ? Arrays.stream(payment_paths).mapToLong(payment_paths_conv_37 -> payment_paths_conv_37.ptr).toArray() : null, InternalUtils.check_arr_len(payment_hash, 32), created_at); + public Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ respond_with_no_std(BlindedPaymentPath[] payment_paths, byte[] payment_hash, long created_at) { + long ret = bindings.VerifiedInvoiceRequest_respond_with_no_std(this.ptr, payment_paths != null ? Arrays.stream(payment_paths).mapToLong(payment_paths_conv_20 -> payment_paths_conv_20.ptr).toArray() : null, InternalUtils.check_arr_len(payment_hash, 32), created_at); Reference.reachabilityFence(this); Reference.reachabilityFence(payment_paths); Reference.reachabilityFence(payment_hash); @@ -382,8 +348,8 @@ public class VerifiedInvoiceRequest extends CommonBase { * * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice */ - public Result_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ respond_using_derived_keys(TwoTuple_BlindedPayInfoBlindedPathZ[] payment_paths, byte[] payment_hash) { - long ret = bindings.VerifiedInvoiceRequest_respond_using_derived_keys(this.ptr, payment_paths != null ? Arrays.stream(payment_paths).mapToLong(payment_paths_conv_37 -> payment_paths_conv_37.ptr).toArray() : null, InternalUtils.check_arr_len(payment_hash, 32)); + public Result_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ respond_using_derived_keys(BlindedPaymentPath[] payment_paths, byte[] payment_hash) { + long ret = bindings.VerifiedInvoiceRequest_respond_using_derived_keys(this.ptr, payment_paths != null ? Arrays.stream(payment_paths).mapToLong(payment_paths_conv_20 -> payment_paths_conv_20.ptr).toArray() : null, InternalUtils.check_arr_len(payment_hash, 32)); Reference.reachabilityFence(this); Reference.reachabilityFence(payment_paths); Reference.reachabilityFence(payment_hash); @@ -401,8 +367,8 @@ public class VerifiedInvoiceRequest extends CommonBase { * * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice */ - public Result_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ respond_using_derived_keys_no_std(TwoTuple_BlindedPayInfoBlindedPathZ[] payment_paths, byte[] payment_hash, long created_at) { - long ret = bindings.VerifiedInvoiceRequest_respond_using_derived_keys_no_std(this.ptr, payment_paths != null ? Arrays.stream(payment_paths).mapToLong(payment_paths_conv_37 -> payment_paths_conv_37.ptr).toArray() : null, InternalUtils.check_arr_len(payment_hash, 32), created_at); + public Result_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ respond_using_derived_keys_no_std(BlindedPaymentPath[] payment_paths, byte[] payment_hash, long created_at) { + long ret = bindings.VerifiedInvoiceRequest_respond_using_derived_keys_no_std(this.ptr, payment_paths != null ? Arrays.stream(payment_paths).mapToLong(payment_paths_conv_20 -> payment_paths_conv_20.ptr).toArray() : null, InternalUtils.check_arr_len(payment_hash, 32), created_at); Reference.reachabilityFence(this); Reference.reachabilityFence(payment_paths); Reference.reachabilityFence(payment_hash); diff --git a/src/main/java/org/ldk/structs/WarningMessage.java b/src/main/java/org/ldk/structs/WarningMessage.java index 5b5197da..75573232 100644 --- a/src/main/java/org/ldk/structs/WarningMessage.java +++ b/src/main/java/org/ldk/structs/WarningMessage.java @@ -45,7 +45,6 @@ public class WarningMessage extends CommonBase { bindings.WarningMessage_set_channel_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -84,7 +83,6 @@ public class WarningMessage extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.WarningMessage ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.WarningMessage(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Watch.java b/src/main/java/org/ldk/structs/Watch.java index 6cf9760c..59f25294 100644 --- a/src/main/java/org/ldk/structs/Watch.java +++ b/src/main/java/org/ldk/structs/Watch.java @@ -150,8 +150,6 @@ public class Watch extends CommonBase { Reference.reachabilityFence(monitor); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelMonitorUpdateStatusNoneZ ret_hu_conv = Result_ChannelMonitorUpdateStatusNoneZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.add(funding_txo); }; - if (this != null) { this.ptrs_to.add(monitor); }; return ret_hu_conv; } @@ -177,7 +175,6 @@ public class Watch extends CommonBase { Reference.reachabilityFence(this); Reference.reachabilityFence(funding_txo); Reference.reachabilityFence(update); - if (this != null) { this.ptrs_to.add(funding_txo); }; if (this != null) { this.ptrs_to.add(update); }; return ret; } diff --git a/src/main/java/org/ldk/structs/WatchedOutput.java b/src/main/java/org/ldk/structs/WatchedOutput.java index 0f5a607e..18c7b3f5 100644 --- a/src/main/java/org/ldk/structs/WatchedOutput.java +++ b/src/main/java/org/ldk/structs/WatchedOutput.java @@ -18,6 +18,9 @@ import javax.annotation.Nullable; * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and * may have been spent there. See [`Filter::register_output`] for details. * + * Depending on your block source, you may need one or both of either [`Self::outpoint`] or + * [`Self::script_pubkey`]. + * * [`ChannelMonitor`]: channelmonitor::ChannelMonitor * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected */ @@ -49,7 +52,6 @@ public class WatchedOutput extends CommonBase { bindings.WatchedOutput_set_block_hash(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -71,7 +73,6 @@ public class WatchedOutput extends CommonBase { bindings.WatchedOutput_set_outpoint(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); - if (this != null) { this.ptrs_to.add(val); }; } /** @@ -103,8 +104,6 @@ public class WatchedOutput extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.WatchedOutput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.WatchedOutput(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(block_hash_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(outpoint_arg); }; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/WriteableEcdsaChannelSigner.java b/src/main/java/org/ldk/structs/WriteableEcdsaChannelSigner.java deleted file mode 100644 index 8509f831..00000000 --- a/src/main/java/org/ldk/structs/WriteableEcdsaChannelSigner.java +++ /dev/null @@ -1,112 +0,0 @@ -package org.ldk.structs; - -import org.ldk.impl.bindings; -import org.ldk.enums.*; -import org.ldk.util.*; -import java.util.Arrays; -import java.lang.ref.Reference; -import javax.annotation.Nullable; - -/** - * A writeable signer. - * - * There will always be two instances of a signer per channel, one occupied by the - * [`ChannelManager`] and another by the channel's [`ChannelMonitor`]. - * - * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager - * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor - */ -@SuppressWarnings("unchecked") // We correctly assign various generic arrays -public class WriteableEcdsaChannelSigner extends CommonBase { - final bindings.LDKWriteableEcdsaChannelSigner bindings_instance; - WriteableEcdsaChannelSigner(Object _dummy, long ptr) { super(ptr); bindings_instance = null; } - private WriteableEcdsaChannelSigner(bindings.LDKWriteableEcdsaChannelSigner arg, bindings.LDKEcdsaChannelSigner EcdsaChannelSigner, bindings.LDKChannelSigner ChannelSigner, ChannelPublicKeys pubkeys) { - super(bindings.LDKWriteableEcdsaChannelSigner_new(arg, EcdsaChannelSigner, ChannelSigner, pubkeys.clone_ptr())); - this.ptrs_to.add(arg); - this.ptrs_to.add(EcdsaChannelSigner); - this.ptrs_to.add(ChannelSigner); - this.bindings_instance = arg; - } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - if (ptr != 0) { bindings.WriteableEcdsaChannelSigner_free(ptr); } super.finalize(); - } - /** - * Destroys the object, freeing associated resources. After this call, any access - * to this object may result in a SEGFAULT or worse. - * - * You should generally NEVER call this method. You should let the garbage collector - * do this for you when it finalizes objects. However, it may be useful for types - * which represent locks and should be closed immediately to avoid holding locks - * until the GC runs. - */ - public void destroy() { - if (ptr != 0) { bindings.WriteableEcdsaChannelSigner_free(ptr); } - ptr = 0; - } - public static interface WriteableEcdsaChannelSignerInterface { - /** - * Serialize the object into a byte array - */ - byte[] write(); - } - private static class LDKWriteableEcdsaChannelSignerHolder { WriteableEcdsaChannelSigner held; } - public static WriteableEcdsaChannelSigner new_impl(WriteableEcdsaChannelSignerInterface arg, EcdsaChannelSigner.EcdsaChannelSignerInterface EcdsaChannelSigner_impl, ChannelSigner.ChannelSignerInterface ChannelSigner_impl, ChannelPublicKeys pubkeys) { - final LDKWriteableEcdsaChannelSignerHolder impl_holder = new LDKWriteableEcdsaChannelSignerHolder(); - impl_holder.held = new WriteableEcdsaChannelSigner(new bindings.LDKWriteableEcdsaChannelSigner() { - @Override public byte[] write() { - byte[] ret = arg.write(); - Reference.reachabilityFence(arg); - return ret; - } - }, EcdsaChannelSigner.new_impl(EcdsaChannelSigner_impl, ChannelSigner_impl, pubkeys).bindings_instance, ChannelSigner.new_impl(ChannelSigner_impl, pubkeys).bindings_instance, pubkeys); - return impl_holder.held; - } - - /** - * Gets the underlying EcdsaChannelSigner. - */ - public EcdsaChannelSigner get_ecdsa_channel_signer() { - EcdsaChannelSigner res = new EcdsaChannelSigner(null, bindings.LDKWriteableEcdsaChannelSigner_get_EcdsaChannelSigner(this.ptr)); - res.ptrs_to.add(this); - return res; - } - - - /** - * Gets the underlying ChannelSigner. - */ - public ChannelSigner get_channel_signer() { - ChannelSigner res = new ChannelSigner(null, bindings.LDKWriteableEcdsaChannelSigner_get_ChannelSigner(this.ptr)); - res.ptrs_to.add(this); - return res; - } - - /** - * Serialize the object into a byte array - */ - public byte[] write() { - byte[] ret = bindings.WriteableEcdsaChannelSigner_write(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - long clone_ptr() { - long ret = bindings.WriteableEcdsaChannelSigner_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Creates a copy of a WriteableEcdsaChannelSigner - */ - public WriteableEcdsaChannelSigner clone() { - long ret = bindings.WriteableEcdsaChannelSigner_clone(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - WriteableEcdsaChannelSigner ret_hu_conv = new WriteableEcdsaChannelSigner(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - return ret_hu_conv; - } - -} diff --git a/src/main/jni/bindings.c b/src/main/jni/bindings.c index 713207f8..41f53956 100644 --- a/src/main/jni/bindings.c +++ b/src/main/jni/bindings.c @@ -247,6 +247,52 @@ static inline uint64_t tag_ptr(const void* ptr, bool is_owned) { } } +static inline LDKBalanceSource LDKBalanceSource_from_java(JNIEnv *env, jclass clz) { + jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to BalanceSource.ordinal() from rust threw an exception."); + } + switch (ord) { + case 0: return LDKBalanceSource_HolderForceClosed; + case 1: return LDKBalanceSource_CounterpartyForceClosed; + case 2: return LDKBalanceSource_CoopClose; + case 3: return LDKBalanceSource_Htlc; + } + (*env)->FatalError(env, "A call to BalanceSource.ordinal() from rust returned an invalid value."); + abort(); // Unreachable, but will let the compiler know we don't return here +} +static jclass BalanceSource_class = NULL; +static jfieldID BalanceSource_LDKBalanceSource_HolderForceClosed = NULL; +static jfieldID BalanceSource_LDKBalanceSource_CounterpartyForceClosed = NULL; +static jfieldID BalanceSource_LDKBalanceSource_CoopClose = NULL; +static jfieldID BalanceSource_LDKBalanceSource_Htlc = NULL; +JNIEXPORT void JNICALL Java_org_ldk_enums_BalanceSource_init (JNIEnv *env, jclass clz) { + BalanceSource_class = (*env)->NewGlobalRef(env, clz); + CHECK(BalanceSource_class != NULL); + BalanceSource_LDKBalanceSource_HolderForceClosed = (*env)->GetStaticFieldID(env, BalanceSource_class, "LDKBalanceSource_HolderForceClosed", "Lorg/ldk/enums/BalanceSource;"); + CHECK(BalanceSource_LDKBalanceSource_HolderForceClosed != NULL); + BalanceSource_LDKBalanceSource_CounterpartyForceClosed = (*env)->GetStaticFieldID(env, BalanceSource_class, "LDKBalanceSource_CounterpartyForceClosed", "Lorg/ldk/enums/BalanceSource;"); + CHECK(BalanceSource_LDKBalanceSource_CounterpartyForceClosed != NULL); + BalanceSource_LDKBalanceSource_CoopClose = (*env)->GetStaticFieldID(env, BalanceSource_class, "LDKBalanceSource_CoopClose", "Lorg/ldk/enums/BalanceSource;"); + CHECK(BalanceSource_LDKBalanceSource_CoopClose != NULL); + BalanceSource_LDKBalanceSource_Htlc = (*env)->GetStaticFieldID(env, BalanceSource_class, "LDKBalanceSource_Htlc", "Lorg/ldk/enums/BalanceSource;"); + CHECK(BalanceSource_LDKBalanceSource_Htlc != NULL); +} +static inline jclass LDKBalanceSource_to_java(JNIEnv *env, LDKBalanceSource val) { + switch (val) { + case LDKBalanceSource_HolderForceClosed: + return (*env)->GetStaticObjectField(env, BalanceSource_class, BalanceSource_LDKBalanceSource_HolderForceClosed); + case LDKBalanceSource_CounterpartyForceClosed: + return (*env)->GetStaticObjectField(env, BalanceSource_class, BalanceSource_LDKBalanceSource_CounterpartyForceClosed); + case LDKBalanceSource_CoopClose: + return (*env)->GetStaticObjectField(env, BalanceSource_class, BalanceSource_LDKBalanceSource_CoopClose); + case LDKBalanceSource_Htlc: + return (*env)->GetStaticObjectField(env, BalanceSource_class, BalanceSource_LDKBalanceSource_Htlc); + default: abort(); + } +} + static inline LDKBlindedFailure LDKBlindedFailure_from_java(JNIEnv *env, jclass clz) { jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth); if (UNLIKELY((*env)->ExceptionCheck(env))) { @@ -397,7 +443,8 @@ static inline LDKBolt12SemanticError LDKBolt12SemanticError_from_java(JNIEnv *en case 24: return LDKBolt12SemanticError_InvalidPayInfo; case 25: return LDKBolt12SemanticError_MissingCreationTime; case 26: return LDKBolt12SemanticError_MissingPaymentHash; - case 27: return LDKBolt12SemanticError_MissingSignature; + case 27: return LDKBolt12SemanticError_UnexpectedPaymentHash; + case 28: return LDKBolt12SemanticError_MissingSignature; } (*env)->FatalError(env, "A call to Bolt12SemanticError.ordinal() from rust returned an invalid value."); abort(); // Unreachable, but will let the compiler know we don't return here @@ -430,6 +477,7 @@ static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedPaths = NUL static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_InvalidPayInfo = NULL; static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_MissingCreationTime = NULL; static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_MissingPaymentHash = NULL; +static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedPaymentHash = NULL; static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_MissingSignature = NULL; JNIEXPORT void JNICALL Java_org_ldk_enums_Bolt12SemanticError_init (JNIEnv *env, jclass clz) { Bolt12SemanticError_class = (*env)->NewGlobalRef(env, clz); @@ -488,6 +536,8 @@ JNIEXPORT void JNICALL Java_org_ldk_enums_Bolt12SemanticError_init (JNIEnv *env, CHECK(Bolt12SemanticError_LDKBolt12SemanticError_MissingCreationTime != NULL); Bolt12SemanticError_LDKBolt12SemanticError_MissingPaymentHash = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_MissingPaymentHash", "Lorg/ldk/enums/Bolt12SemanticError;"); CHECK(Bolt12SemanticError_LDKBolt12SemanticError_MissingPaymentHash != NULL); + Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedPaymentHash = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_UnexpectedPaymentHash", "Lorg/ldk/enums/Bolt12SemanticError;"); + CHECK(Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedPaymentHash != NULL); Bolt12SemanticError_LDKBolt12SemanticError_MissingSignature = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_MissingSignature", "Lorg/ldk/enums/Bolt12SemanticError;"); CHECK(Bolt12SemanticError_LDKBolt12SemanticError_MissingSignature != NULL); } @@ -547,6 +597,8 @@ static inline jclass LDKBolt12SemanticError_to_java(JNIEnv *env, LDKBolt12Semant return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_MissingCreationTime); case LDKBolt12SemanticError_MissingPaymentHash: return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_MissingPaymentHash); + case LDKBolt12SemanticError_UnexpectedPaymentHash: + return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedPaymentHash); case LDKBolt12SemanticError_MissingSignature: return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_MissingSignature); default: abort(); @@ -686,19 +738,21 @@ static inline LDKConfirmationTarget LDKConfirmationTarget_from_java(JNIEnv *env, (*env)->FatalError(env, "A call to ConfirmationTarget.ordinal() from rust threw an exception."); } switch (ord) { - case 0: return LDKConfirmationTarget_OnChainSweep; - case 1: return LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee; - case 2: return LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee; - case 3: return LDKConfirmationTarget_AnchorChannelFee; - case 4: return LDKConfirmationTarget_NonAnchorChannelFee; - case 5: return LDKConfirmationTarget_ChannelCloseMinimum; - case 6: return LDKConfirmationTarget_OutputSpendingFee; + case 0: return LDKConfirmationTarget_MaximumFeeEstimate; + case 1: return LDKConfirmationTarget_UrgentOnChainSweep; + case 2: return LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee; + case 3: return LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee; + case 4: return LDKConfirmationTarget_AnchorChannelFee; + case 5: return LDKConfirmationTarget_NonAnchorChannelFee; + case 6: return LDKConfirmationTarget_ChannelCloseMinimum; + case 7: return LDKConfirmationTarget_OutputSpendingFee; } (*env)->FatalError(env, "A call to ConfirmationTarget.ordinal() from rust returned an invalid value."); abort(); // Unreachable, but will let the compiler know we don't return here } static jclass ConfirmationTarget_class = NULL; -static jfieldID ConfirmationTarget_LDKConfirmationTarget_OnChainSweep = NULL; +static jfieldID ConfirmationTarget_LDKConfirmationTarget_MaximumFeeEstimate = NULL; +static jfieldID ConfirmationTarget_LDKConfirmationTarget_UrgentOnChainSweep = NULL; static jfieldID ConfirmationTarget_LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee = NULL; static jfieldID ConfirmationTarget_LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee = NULL; static jfieldID ConfirmationTarget_LDKConfirmationTarget_AnchorChannelFee = NULL; @@ -708,8 +762,10 @@ static jfieldID ConfirmationTarget_LDKConfirmationTarget_OutputSpendingFee = NUL JNIEXPORT void JNICALL Java_org_ldk_enums_ConfirmationTarget_init (JNIEnv *env, jclass clz) { ConfirmationTarget_class = (*env)->NewGlobalRef(env, clz); CHECK(ConfirmationTarget_class != NULL); - ConfirmationTarget_LDKConfirmationTarget_OnChainSweep = (*env)->GetStaticFieldID(env, ConfirmationTarget_class, "LDKConfirmationTarget_OnChainSweep", "Lorg/ldk/enums/ConfirmationTarget;"); - CHECK(ConfirmationTarget_LDKConfirmationTarget_OnChainSweep != NULL); + ConfirmationTarget_LDKConfirmationTarget_MaximumFeeEstimate = (*env)->GetStaticFieldID(env, ConfirmationTarget_class, "LDKConfirmationTarget_MaximumFeeEstimate", "Lorg/ldk/enums/ConfirmationTarget;"); + CHECK(ConfirmationTarget_LDKConfirmationTarget_MaximumFeeEstimate != NULL); + ConfirmationTarget_LDKConfirmationTarget_UrgentOnChainSweep = (*env)->GetStaticFieldID(env, ConfirmationTarget_class, "LDKConfirmationTarget_UrgentOnChainSweep", "Lorg/ldk/enums/ConfirmationTarget;"); + CHECK(ConfirmationTarget_LDKConfirmationTarget_UrgentOnChainSweep != NULL); ConfirmationTarget_LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee = (*env)->GetStaticFieldID(env, ConfirmationTarget_class, "LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee", "Lorg/ldk/enums/ConfirmationTarget;"); CHECK(ConfirmationTarget_LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee != NULL); ConfirmationTarget_LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee = (*env)->GetStaticFieldID(env, ConfirmationTarget_class, "LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee", "Lorg/ldk/enums/ConfirmationTarget;"); @@ -725,8 +781,10 @@ JNIEXPORT void JNICALL Java_org_ldk_enums_ConfirmationTarget_init (JNIEnv *env, } static inline jclass LDKConfirmationTarget_to_java(JNIEnv *env, LDKConfirmationTarget val) { switch (val) { - case LDKConfirmationTarget_OnChainSweep: - return (*env)->GetStaticObjectField(env, ConfirmationTarget_class, ConfirmationTarget_LDKConfirmationTarget_OnChainSweep); + case LDKConfirmationTarget_MaximumFeeEstimate: + return (*env)->GetStaticObjectField(env, ConfirmationTarget_class, ConfirmationTarget_LDKConfirmationTarget_MaximumFeeEstimate); + case LDKConfirmationTarget_UrgentOnChainSweep: + return (*env)->GetStaticObjectField(env, ConfirmationTarget_class, ConfirmationTarget_LDKConfirmationTarget_UrgentOnChainSweep); case LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee: return (*env)->GetStaticObjectField(env, ConfirmationTarget_class, ConfirmationTarget_LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee); case LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee: @@ -1278,6 +1336,9 @@ static inline LDKPaymentFailureReason LDKPaymentFailureReason_from_java(JNIEnv * case 3: return LDKPaymentFailureReason_PaymentExpired; case 4: return LDKPaymentFailureReason_RouteNotFound; case 5: return LDKPaymentFailureReason_UnexpectedError; + case 6: return LDKPaymentFailureReason_UnknownRequiredFeatures; + case 7: return LDKPaymentFailureReason_InvoiceRequestExpired; + case 8: return LDKPaymentFailureReason_InvoiceRequestRejected; } (*env)->FatalError(env, "A call to PaymentFailureReason.ordinal() from rust returned an invalid value."); abort(); // Unreachable, but will let the compiler know we don't return here @@ -1289,6 +1350,9 @@ static jfieldID PaymentFailureReason_LDKPaymentFailureReason_RetriesExhausted = static jfieldID PaymentFailureReason_LDKPaymentFailureReason_PaymentExpired = NULL; static jfieldID PaymentFailureReason_LDKPaymentFailureReason_RouteNotFound = NULL; static jfieldID PaymentFailureReason_LDKPaymentFailureReason_UnexpectedError = NULL; +static jfieldID PaymentFailureReason_LDKPaymentFailureReason_UnknownRequiredFeatures = NULL; +static jfieldID PaymentFailureReason_LDKPaymentFailureReason_InvoiceRequestExpired = NULL; +static jfieldID PaymentFailureReason_LDKPaymentFailureReason_InvoiceRequestRejected = NULL; JNIEXPORT void JNICALL Java_org_ldk_enums_PaymentFailureReason_init (JNIEnv *env, jclass clz) { PaymentFailureReason_class = (*env)->NewGlobalRef(env, clz); CHECK(PaymentFailureReason_class != NULL); @@ -1304,6 +1368,12 @@ JNIEXPORT void JNICALL Java_org_ldk_enums_PaymentFailureReason_init (JNIEnv *env CHECK(PaymentFailureReason_LDKPaymentFailureReason_RouteNotFound != NULL); PaymentFailureReason_LDKPaymentFailureReason_UnexpectedError = (*env)->GetStaticFieldID(env, PaymentFailureReason_class, "LDKPaymentFailureReason_UnexpectedError", "Lorg/ldk/enums/PaymentFailureReason;"); CHECK(PaymentFailureReason_LDKPaymentFailureReason_UnexpectedError != NULL); + PaymentFailureReason_LDKPaymentFailureReason_UnknownRequiredFeatures = (*env)->GetStaticFieldID(env, PaymentFailureReason_class, "LDKPaymentFailureReason_UnknownRequiredFeatures", "Lorg/ldk/enums/PaymentFailureReason;"); + CHECK(PaymentFailureReason_LDKPaymentFailureReason_UnknownRequiredFeatures != NULL); + PaymentFailureReason_LDKPaymentFailureReason_InvoiceRequestExpired = (*env)->GetStaticFieldID(env, PaymentFailureReason_class, "LDKPaymentFailureReason_InvoiceRequestExpired", "Lorg/ldk/enums/PaymentFailureReason;"); + CHECK(PaymentFailureReason_LDKPaymentFailureReason_InvoiceRequestExpired != NULL); + PaymentFailureReason_LDKPaymentFailureReason_InvoiceRequestRejected = (*env)->GetStaticFieldID(env, PaymentFailureReason_class, "LDKPaymentFailureReason_InvoiceRequestRejected", "Lorg/ldk/enums/PaymentFailureReason;"); + CHECK(PaymentFailureReason_LDKPaymentFailureReason_InvoiceRequestRejected != NULL); } static inline jclass LDKPaymentFailureReason_to_java(JNIEnv *env, LDKPaymentFailureReason val) { switch (val) { @@ -1319,6 +1389,12 @@ static inline jclass LDKPaymentFailureReason_to_java(JNIEnv *env, LDKPaymentFail return (*env)->GetStaticObjectField(env, PaymentFailureReason_class, PaymentFailureReason_LDKPaymentFailureReason_RouteNotFound); case LDKPaymentFailureReason_UnexpectedError: return (*env)->GetStaticObjectField(env, PaymentFailureReason_class, PaymentFailureReason_LDKPaymentFailureReason_UnexpectedError); + case LDKPaymentFailureReason_UnknownRequiredFeatures: + return (*env)->GetStaticObjectField(env, PaymentFailureReason_class, PaymentFailureReason_LDKPaymentFailureReason_UnknownRequiredFeatures); + case LDKPaymentFailureReason_InvoiceRequestExpired: + return (*env)->GetStaticObjectField(env, PaymentFailureReason_class, PaymentFailureReason_LDKPaymentFailureReason_InvoiceRequestExpired); + case LDKPaymentFailureReason_InvoiceRequestRejected: + return (*env)->GetStaticObjectField(env, PaymentFailureReason_class, PaymentFailureReason_LDKPaymentFailureReason_InvoiceRequestRejected); default: abort(); } } @@ -1367,6 +1443,7 @@ static inline LDKRetryableSendFailure LDKRetryableSendFailure_from_java(JNIEnv * case 0: return LDKRetryableSendFailure_PaymentExpired; case 1: return LDKRetryableSendFailure_RouteNotFound; case 2: return LDKRetryableSendFailure_DuplicatePayment; + case 3: return LDKRetryableSendFailure_OnionPacketSizeExceeded; } (*env)->FatalError(env, "A call to RetryableSendFailure.ordinal() from rust returned an invalid value."); abort(); // Unreachable, but will let the compiler know we don't return here @@ -1375,6 +1452,7 @@ static jclass RetryableSendFailure_class = NULL; static jfieldID RetryableSendFailure_LDKRetryableSendFailure_PaymentExpired = NULL; static jfieldID RetryableSendFailure_LDKRetryableSendFailure_RouteNotFound = NULL; static jfieldID RetryableSendFailure_LDKRetryableSendFailure_DuplicatePayment = NULL; +static jfieldID RetryableSendFailure_LDKRetryableSendFailure_OnionPacketSizeExceeded = NULL; JNIEXPORT void JNICALL Java_org_ldk_enums_RetryableSendFailure_init (JNIEnv *env, jclass clz) { RetryableSendFailure_class = (*env)->NewGlobalRef(env, clz); CHECK(RetryableSendFailure_class != NULL); @@ -1384,6 +1462,8 @@ JNIEXPORT void JNICALL Java_org_ldk_enums_RetryableSendFailure_init (JNIEnv *env CHECK(RetryableSendFailure_LDKRetryableSendFailure_RouteNotFound != NULL); RetryableSendFailure_LDKRetryableSendFailure_DuplicatePayment = (*env)->GetStaticFieldID(env, RetryableSendFailure_class, "LDKRetryableSendFailure_DuplicatePayment", "Lorg/ldk/enums/RetryableSendFailure;"); CHECK(RetryableSendFailure_LDKRetryableSendFailure_DuplicatePayment != NULL); + RetryableSendFailure_LDKRetryableSendFailure_OnionPacketSizeExceeded = (*env)->GetStaticFieldID(env, RetryableSendFailure_class, "LDKRetryableSendFailure_OnionPacketSizeExceeded", "Lorg/ldk/enums/RetryableSendFailure;"); + CHECK(RetryableSendFailure_LDKRetryableSendFailure_OnionPacketSizeExceeded != NULL); } static inline jclass LDKRetryableSendFailure_to_java(JNIEnv *env, LDKRetryableSendFailure val) { switch (val) { @@ -1393,6 +1473,8 @@ static inline jclass LDKRetryableSendFailure_to_java(JNIEnv *env, LDKRetryableSe return (*env)->GetStaticObjectField(env, RetryableSendFailure_class, RetryableSendFailure_LDKRetryableSendFailure_RouteNotFound); case LDKRetryableSendFailure_DuplicatePayment: return (*env)->GetStaticObjectField(env, RetryableSendFailure_class, RetryableSendFailure_LDKRetryableSendFailure_DuplicatePayment); + case LDKRetryableSendFailure_OnionPacketSizeExceeded: + return (*env)->GetStaticObjectField(env, RetryableSendFailure_class, RetryableSendFailure_LDKRetryableSendFailure_OnionPacketSizeExceeded); default: abort(); } } @@ -1415,6 +1497,7 @@ static inline LDKSecp256k1Error LDKSecp256k1Error_from_java(JNIEnv *env, jclass case 8: return LDKSecp256k1Error_NotEnoughMemory; case 9: return LDKSecp256k1Error_InvalidPublicKeySum; case 10: return LDKSecp256k1Error_InvalidParityValue; + case 11: return LDKSecp256k1Error_InvalidEllSwift; } (*env)->FatalError(env, "A call to Secp256k1Error.ordinal() from rust returned an invalid value."); abort(); // Unreachable, but will let the compiler know we don't return here @@ -1431,6 +1514,7 @@ static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidTweak = NULL; static jfieldID Secp256k1Error_LDKSecp256k1Error_NotEnoughMemory = NULL; static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidPublicKeySum = NULL; static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidParityValue = NULL; +static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidEllSwift = NULL; JNIEXPORT void JNICALL Java_org_ldk_enums_Secp256k1Error_init (JNIEnv *env, jclass clz) { Secp256k1Error_class = (*env)->NewGlobalRef(env, clz); CHECK(Secp256k1Error_class != NULL); @@ -1456,6 +1540,8 @@ JNIEXPORT void JNICALL Java_org_ldk_enums_Secp256k1Error_init (JNIEnv *env, jcla CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidPublicKeySum != NULL); Secp256k1Error_LDKSecp256k1Error_InvalidParityValue = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidParityValue", "Lorg/ldk/enums/Secp256k1Error;"); CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidParityValue != NULL); + Secp256k1Error_LDKSecp256k1Error_InvalidEllSwift = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidEllSwift", "Lorg/ldk/enums/Secp256k1Error;"); + CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidEllSwift != NULL); } static inline jclass LDKSecp256k1Error_to_java(JNIEnv *env, LDKSecp256k1Error val) { switch (val) { @@ -1481,6 +1567,8 @@ static inline jclass LDKSecp256k1Error_to_java(JNIEnv *env, LDKSecp256k1Error va return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidPublicKeySum); case LDKSecp256k1Error_InvalidParityValue: return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidParityValue); + case LDKSecp256k1Error_InvalidEllSwift: + return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidEllSwift); default: abort(); } } @@ -1834,71 +1922,13 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u64Z_1ref_1from default: abort(); } } -static inline LDKCVec_BlindedPathZ CVec_BlindedPathZ_clone(const LDKCVec_BlindedPathZ *orig) { - LDKCVec_BlindedPathZ ret = { .data = MALLOC(sizeof(LDKBlindedPath) * orig->datalen, "LDKCVec_BlindedPathZ clone bytes"), .datalen = orig->datalen }; +static inline LDKCVec_BlindedMessagePathZ CVec_BlindedMessagePathZ_clone(const LDKCVec_BlindedMessagePathZ *orig) { + LDKCVec_BlindedMessagePathZ ret = { .data = MALLOC(sizeof(LDKBlindedMessagePath) * orig->datalen, "LDKCVec_BlindedMessagePathZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = BlindedPath_clone(&orig->data[i]); + ret.data[i] = BlindedMessagePath_clone(&orig->data[i]); } return ret; } -static inline struct LDKRefund CResult_RefundBolt12ParseErrorZ_get_ok(LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR owner){ - LDKRefund ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RefundBolt12ParseErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_RefundBolt12ParseErrorZ* owner_conv = (LDKCResult_RefundBolt12ParseErrorZ*)untag_ptr(owner); - LDKRefund ret_var = CResult_RefundBolt12ParseErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline struct LDKBolt12ParseError CResult_RefundBolt12ParseErrorZ_get_err(LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR owner){ - LDKBolt12ParseError ret = *owner->contents.err; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RefundBolt12ParseErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_RefundBolt12ParseErrorZ* owner_conv = (LDKCResult_RefundBolt12ParseErrorZ*)untag_ptr(owner); - LDKBolt12ParseError ret_var = CResult_RefundBolt12ParseErrorZ_get_err(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static jclass LDKRetry_Attempts_class = NULL; -static jmethodID LDKRetry_Attempts_meth = NULL; -static jclass LDKRetry_Timeout_class = NULL; -static jmethodID LDKRetry_Timeout_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKRetry_init (JNIEnv *env, jclass clz) { - LDKRetry_Attempts_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKRetry$Attempts")); - CHECK(LDKRetry_Attempts_class != NULL); - LDKRetry_Attempts_meth = (*env)->GetMethodID(env, LDKRetry_Attempts_class, "", "(I)V"); - CHECK(LDKRetry_Attempts_meth != NULL); - LDKRetry_Timeout_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKRetry$Timeout")); - CHECK(LDKRetry_Timeout_class != NULL); - LDKRetry_Timeout_meth = (*env)->GetMethodID(env, LDKRetry_Timeout_class, "", "(J)V"); - CHECK(LDKRetry_Timeout_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKRetry_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKRetry *obj = (LDKRetry*)untag_ptr(ptr); - switch(obj->tag) { - case LDKRetry_Attempts: { - int32_t attempts_conv = obj->attempts; - return (*env)->NewObject(env, LDKRetry_Attempts_class, LDKRetry_Attempts_meth, attempts_conv); - } - case LDKRetry_Timeout: { - int64_t timeout_conv = obj->timeout; - return (*env)->NewObject(env, LDKRetry_Timeout_class, LDKRetry_Timeout_meth, timeout_conv); - } - default: abort(); - } -} static jclass LDKDecodeError_UnknownVersion_class = NULL; static jmethodID LDKDecodeError_UnknownVersion_meth = NULL; static jclass LDKDecodeError_UnknownRequiredFeature_class = NULL; @@ -1988,6 +2018,90 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKDecodeError_1ref_1from_1 default: abort(); } } +static inline struct LDKRefund CResult_RefundDecodeErrorZ_get_ok(LDKCResult_RefundDecodeErrorZ *NONNULL_PTR owner){ + LDKRefund ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RefundDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_RefundDecodeErrorZ* owner_conv = (LDKCResult_RefundDecodeErrorZ*)untag_ptr(owner); + LDKRefund ret_var = CResult_RefundDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_RefundDecodeErrorZ_get_err(LDKCResult_RefundDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RefundDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_RefundDecodeErrorZ* owner_conv = (LDKCResult_RefundDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_RefundDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKRefund CResult_RefundBolt12ParseErrorZ_get_ok(LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR owner){ + LDKRefund ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RefundBolt12ParseErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_RefundBolt12ParseErrorZ* owner_conv = (LDKCResult_RefundBolt12ParseErrorZ*)untag_ptr(owner); + LDKRefund ret_var = CResult_RefundBolt12ParseErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKBolt12ParseError CResult_RefundBolt12ParseErrorZ_get_err(LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR owner){ + LDKBolt12ParseError ret = *owner->contents.err; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RefundBolt12ParseErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_RefundBolt12ParseErrorZ* owner_conv = (LDKCResult_RefundBolt12ParseErrorZ*)untag_ptr(owner); + LDKBolt12ParseError ret_var = CResult_RefundBolt12ParseErrorZ_get_err(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static jclass LDKRetry_Attempts_class = NULL; +static jmethodID LDKRetry_Attempts_meth = NULL; +static jclass LDKRetry_Timeout_class = NULL; +static jmethodID LDKRetry_Timeout_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKRetry_init (JNIEnv *env, jclass clz) { + LDKRetry_Attempts_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKRetry$Attempts")); + CHECK(LDKRetry_Attempts_class != NULL); + LDKRetry_Attempts_meth = (*env)->GetMethodID(env, LDKRetry_Attempts_class, "", "(I)V"); + CHECK(LDKRetry_Attempts_meth != NULL); + LDKRetry_Timeout_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKRetry$Timeout")); + CHECK(LDKRetry_Timeout_class != NULL); + LDKRetry_Timeout_meth = (*env)->GetMethodID(env, LDKRetry_Timeout_class, "", "(J)V"); + CHECK(LDKRetry_Timeout_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKRetry_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKRetry *obj = (LDKRetry*)untag_ptr(ptr); + switch(obj->tag) { + case LDKRetry_Attempts: { + int32_t attempts_conv = obj->attempts; + return (*env)->NewObject(env, LDKRetry_Attempts_class, LDKRetry_Attempts_meth, attempts_conv); + } + case LDKRetry_Timeout: { + int64_t timeout_conv = obj->timeout; + return (*env)->NewObject(env, LDKRetry_Timeout_class, LDKRetry_Timeout_meth, timeout_conv); + } + default: abort(); + } +} static inline struct LDKRetry CResult_RetryDecodeErrorZ_get_ok(LDKCResult_RetryDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return Retry_clone(&*owner->contents.result); @@ -2528,28 +2642,28 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesNoneZ_1 CResult_ThirtyTwoBytesNoneZ_get_err(owner_conv); } -static inline struct LDKBlindedPayInfo CResult_BlindedPayInfoDecodeErrorZ_get_ok(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR owner){ - LDKBlindedPayInfo ret = *owner->contents.result; +static inline struct LDKBolt12Invoice CResult_Bolt12InvoiceDecodeErrorZ_get_ok(LDKCResult_Bolt12InvoiceDecodeErrorZ *NONNULL_PTR owner){ + LDKBolt12Invoice ret = *owner->contents.result; ret.is_owned = false; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_BlindedPayInfoDecodeErrorZ* owner_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(owner); - LDKBlindedPayInfo ret_var = CResult_BlindedPayInfoDecodeErrorZ_get_ok(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_Bolt12InvoiceDecodeErrorZ* owner_conv = (LDKCResult_Bolt12InvoiceDecodeErrorZ*)untag_ptr(owner); + LDKBolt12Invoice ret_var = CResult_Bolt12InvoiceDecodeErrorZ_get_ok(owner_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline struct LDKDecodeError CResult_BlindedPayInfoDecodeErrorZ_get_err(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_Bolt12InvoiceDecodeErrorZ_get_err(LDKCResult_Bolt12InvoiceDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return DecodeError_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_BlindedPayInfoDecodeErrorZ* owner_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(owner); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_Bolt12InvoiceDecodeErrorZ* owner_conv = (LDKCResult_Bolt12InvoiceDecodeErrorZ*)untag_ptr(owner); LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_BlindedPayInfoDecodeErrorZ_get_err(owner_conv); + *ret_copy = CResult_Bolt12InvoiceDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -2819,24 +2933,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCDescriptorDeco return ret_ref; } -static inline void CResult_NoneNoneZ_get_ok(LDKCResult_NoneNoneZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner); - CResult_NoneNoneZ_get_ok(owner_conv); -} - -static inline void CResult_NoneNoneZ_get_err(LDKCResult_NoneNoneZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; -} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner); - CResult_NoneNoneZ_get_err(owner_conv); -} - static inline struct LDKPublicKey CResult_PublicKeyNoneZ_get_ok(LDKCResult_PublicKeyNoneZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return *owner->contents.result; @@ -2857,6 +2953,44 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1get_1 CResult_PublicKeyNoneZ_get_err(owner_conv); } +static inline struct LDKThirtyTwoBytes CResult__u832NoneZ_get_ok(LDKCResult__u832NoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return ThirtyTwoBytes_clone(&*owner->contents.result); +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832NoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult__u832NoneZ* owner_conv = (LDKCResult__u832NoneZ*)untag_ptr(owner); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult__u832NoneZ_get_ok(owner_conv).data); + return ret_arr; +} + +static inline void CResult__u832NoneZ_get_err(LDKCResult__u832NoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832NoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult__u832NoneZ* owner_conv = (LDKCResult__u832NoneZ*)untag_ptr(owner); + CResult__u832NoneZ_get_err(owner_conv); +} + +static inline void CResult_NoneNoneZ_get_ok(LDKCResult_NoneNoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner); + CResult_NoneNoneZ_get_ok(owner_conv); +} + +static inline void CResult_NoneNoneZ_get_err(LDKCResult_NoneNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner); + CResult_NoneNoneZ_get_err(owner_conv); +} + static jclass LDKCOption_BigEndianScalarZ_Some_class = NULL; static jmethodID LDKCOption_BigEndianScalarZ_Some_meth = NULL; static jclass LDKCOption_BigEndianScalarZ_None_class = NULL; @@ -3023,7 +3157,7 @@ static void LDKChannelSigner_JCalls_free(void* this_arg) { FREE(j_calls); } } -LDKPublicKey get_per_commitment_point_LDKChannelSigner_jcall(const void* this_arg, uint64_t idx) { +LDKCResult_PublicKeyNoneZ get_per_commitment_point_LDKChannelSigner_jcall(const void* this_arg, uint64_t idx) { LDKChannelSigner_JCalls *j_calls = (LDKChannelSigner_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -3035,20 +3169,21 @@ LDKPublicKey get_per_commitment_point_LDKChannelSigner_jcall(const void* this_ar int64_t idx_conv = idx; jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_per_commitment_point_meth, idx_conv); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_per_commitment_point_meth, idx_conv); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); (*env)->FatalError(env, "A call to get_per_commitment_point in LDKChannelSigner from rust threw an exception."); } - LDKPublicKey ret_ref; - CHECK((*env)->GetArrayLength(env, ret) == 33); - (*env)->GetByteArrayRegion(env, ret, 0, 33, ret_ref.compressed_form); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_PublicKeyNoneZ ret_conv = *(LDKCResult_PublicKeyNoneZ*)(ret_ptr); + FREE(untag_ptr(ret)); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } - return ret_ref; + return ret_conv; } -LDKThirtyTwoBytes release_commitment_secret_LDKChannelSigner_jcall(const void* this_arg, uint64_t idx) { +LDKCResult__u832NoneZ release_commitment_secret_LDKChannelSigner_jcall(const void* this_arg, uint64_t idx) { LDKChannelSigner_JCalls *j_calls = (LDKChannelSigner_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -3060,18 +3195,19 @@ LDKThirtyTwoBytes release_commitment_secret_LDKChannelSigner_jcall(const void* t int64_t idx_conv = idx; jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->release_commitment_secret_meth, idx_conv); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->release_commitment_secret_meth, idx_conv); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); (*env)->FatalError(env, "A call to release_commitment_secret in LDKChannelSigner from rust threw an exception."); } - LDKThirtyTwoBytes ret_ref; - CHECK((*env)->GetArrayLength(env, ret) == 32); - (*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.data); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult__u832NoneZ ret_conv = *(LDKCResult__u832NoneZ*)(ret_ptr); + FREE(untag_ptr(ret)); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } - return ret_ref; + return ret_conv; } LDKCResult_NoneNoneZ validate_holder_commitment_LDKChannelSigner_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * holder_tx, LDKCVec_ThirtyTwoBytesZ outbound_htlc_preimages) { LDKChannelSigner_JCalls *j_calls = (LDKChannelSigner_JCalls*) this_arg; @@ -3198,9 +3334,9 @@ static inline LDKChannelSigner LDKChannelSigner_init (JNIEnv *env, jclass clz, j atomic_init(&calls->refcnt, 1); DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->get_per_commitment_point_meth = (*env)->GetMethodID(env, c, "get_per_commitment_point", "(J)[B"); + calls->get_per_commitment_point_meth = (*env)->GetMethodID(env, c, "get_per_commitment_point", "(J)J"); CHECK(calls->get_per_commitment_point_meth != NULL); - calls->release_commitment_secret_meth = (*env)->GetMethodID(env, c, "release_commitment_secret", "(J)[B"); + calls->release_commitment_secret_meth = (*env)->GetMethodID(env, c, "release_commitment_secret", "(J)J"); CHECK(calls->release_commitment_secret_meth != NULL); calls->validate_holder_commitment_meth = (*env)->GetMethodID(env, c, "validate_holder_commitment", "(J[[B)J"); CHECK(calls->validate_holder_commitment_meth != NULL); @@ -3235,22 +3371,22 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKChannelSigner_1new(JNIEn *res_ptr = LDKChannelSigner_init(env, clz, o, pubkeys); return tag_ptr(res_ptr, true); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelSigner_1get_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelSigner_1get_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelSigner* this_arg_conv = (LDKChannelSigner*)this_arg_ptr; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, (this_arg_conv->get_per_commitment_point)(this_arg_conv->this_arg, idx).compressed_form); - return ret_arr; + LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ"); + *ret_conv = (this_arg_conv->get_per_commitment_point)(this_arg_conv->this_arg, idx); + return tag_ptr(ret_conv, true); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelSigner_1release_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelSigner_1release_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelSigner* this_arg_conv = (LDKChannelSigner*)this_arg_ptr; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->release_commitment_secret)(this_arg_conv->this_arg, idx).data); - return ret_arr; + LDKCResult__u832NoneZ* ret_conv = MALLOC(sizeof(LDKCResult__u832NoneZ), "LDKCResult__u832NoneZ"); + *ret_conv = (this_arg_conv->release_commitment_secret)(this_arg_conv->this_arg, idx); + return tag_ptr(ret_conv, true); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelSigner_1validate_1holder_1commitment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t holder_tx, jobjectArray outbound_htlc_preimages) { @@ -3725,6 +3861,7 @@ static inline LDKEcdsaChannelSigner LDKEcdsaChannelSigner_init (JNIEnv *env, jcl .sign_closing_transaction = sign_closing_transaction_LDKEcdsaChannelSigner_jcall, .sign_holder_anchor_input = sign_holder_anchor_input_LDKEcdsaChannelSigner_jcall, .sign_channel_announcement_with_funding_key = sign_channel_announcement_with_funding_key_LDKEcdsaChannelSigner_jcall, + .cloned = LDKEcdsaChannelSigner_JCalls_cloned, .free = LDKEcdsaChannelSigner_JCalls_free, .ChannelSigner = LDKChannelSigner_init(env, clz, ChannelSigner, pubkeys), }; @@ -3918,131 +4055,25 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EcdsaChannelSigner_1sign_1c return tag_ptr(ret_conv, true); } -typedef struct LDKWriteableEcdsaChannelSigner_JCalls { - atomic_size_t refcnt; - JavaVM *vm; - jweak o; - LDKEcdsaChannelSigner_JCalls* EcdsaChannelSigner; - LDKChannelSigner_JCalls* ChannelSigner; - jmethodID write_meth; -} LDKWriteableEcdsaChannelSigner_JCalls; -static void LDKWriteableEcdsaChannelSigner_JCalls_free(void* this_arg) { - LDKWriteableEcdsaChannelSigner_JCalls *j_calls = (LDKWriteableEcdsaChannelSigner_JCalls*) this_arg; - if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { - JNIEnv *env; - jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK); - } else { - DO_ASSERT(get_jenv_res == JNI_OK); - } - (*env)->DeleteWeakGlobalRef(env, j_calls->o); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); - } - FREE(j_calls); - } -} -LDKCVec_u8Z write_LDKWriteableEcdsaChannelSigner_jcall(const void* this_arg) { - LDKWriteableEcdsaChannelSigner_JCalls *j_calls = (LDKWriteableEcdsaChannelSigner_JCalls*) this_arg; - JNIEnv *env; - jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK); - } else { - DO_ASSERT(get_jenv_res == JNI_OK); - } - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->write_meth); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to write in LDKWriteableEcdsaChannelSigner from rust threw an exception."); - } - LDKCVec_u8Z ret_ref; - ret_ref.datalen = (*env)->GetArrayLength(env, ret); - ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, ret, 0, ret_ref.datalen, ret_ref.data); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); - } - return ret_ref; -} -static void LDKWriteableEcdsaChannelSigner_JCalls_cloned(LDKWriteableEcdsaChannelSigner* new_obj) { - LDKWriteableEcdsaChannelSigner_JCalls *j_calls = (LDKWriteableEcdsaChannelSigner_JCalls*) new_obj->this_arg; - atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); - atomic_fetch_add_explicit(&j_calls->EcdsaChannelSigner->refcnt, 1, memory_order_release); - atomic_fetch_add_explicit(&j_calls->EcdsaChannelSigner->ChannelSigner->refcnt, 1, memory_order_release); -} -static inline LDKWriteableEcdsaChannelSigner LDKWriteableEcdsaChannelSigner_init (JNIEnv *env, jclass clz, jobject o, jobject EcdsaChannelSigner, jobject ChannelSigner, int64_t pubkeys) { - jclass c = (*env)->GetObjectClass(env, o); - CHECK(c != NULL); - LDKWriteableEcdsaChannelSigner_JCalls *calls = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner_JCalls), "LDKWriteableEcdsaChannelSigner_JCalls"); - atomic_init(&calls->refcnt, 1); - DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); - calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->write_meth = (*env)->GetMethodID(env, c, "write", "()[B"); - CHECK(calls->write_meth != NULL); - - LDKChannelPublicKeys pubkeys_conv; - pubkeys_conv.inner = untag_ptr(pubkeys); - pubkeys_conv.is_owned = ptr_is_owned(pubkeys); - CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv); - - LDKWriteableEcdsaChannelSigner ret = { - .this_arg = (void*) calls, - .write = write_LDKWriteableEcdsaChannelSigner_jcall, - .cloned = LDKWriteableEcdsaChannelSigner_JCalls_cloned, - .free = LDKWriteableEcdsaChannelSigner_JCalls_free, - .EcdsaChannelSigner = LDKEcdsaChannelSigner_init(env, clz, EcdsaChannelSigner, ChannelSigner, pubkeys), - }; - calls->EcdsaChannelSigner = ret.EcdsaChannelSigner.this_arg; - calls->ChannelSigner = ret.EcdsaChannelSigner.ChannelSigner.this_arg; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKWriteableEcdsaChannelSigner_1new(JNIEnv *env, jclass clz, jobject o, jobject EcdsaChannelSigner, jobject ChannelSigner, int64_t pubkeys) { - LDKWriteableEcdsaChannelSigner *res_ptr = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner"); - *res_ptr = LDKWriteableEcdsaChannelSigner_init(env, clz, o, EcdsaChannelSigner, ChannelSigner, pubkeys); - return tag_ptr(res_ptr, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKWriteableEcdsaChannelSigner_1get_1EcdsaChannelSigner(JNIEnv *env, jclass clz, int64_t arg) { - LDKWriteableEcdsaChannelSigner *inp = (LDKWriteableEcdsaChannelSigner *)untag_ptr(arg); - return tag_ptr(&inp->EcdsaChannelSigner, false); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKWriteableEcdsaChannelSigner_1get_1ChannelSigner(JNIEnv *env, jclass clz, int64_t arg) { - LDKWriteableEcdsaChannelSigner *inp = (LDKWriteableEcdsaChannelSigner *)untag_ptr(arg); - return tag_ptr(&inp->EcdsaChannelSigner.ChannelSigner, false); -} -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WriteableEcdsaChannelSigner_1write(JNIEnv *env, jclass clz, int64_t this_arg) { - void* this_arg_ptr = untag_ptr(this_arg); - if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKWriteableEcdsaChannelSigner* this_arg_conv = (LDKWriteableEcdsaChannelSigner*)this_arg_ptr; - LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -static inline struct LDKWriteableEcdsaChannelSigner CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_ok(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKEcdsaChannelSigner CResult_EcdsaChannelSignerDecodeErrorZ_get_ok(LDKCResult_EcdsaChannelSignerDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return WriteableEcdsaChannelSigner_clone(&*owner->contents.result); + return EcdsaChannelSigner_clone(&*owner->contents.result); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* owner_conv = (LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)untag_ptr(owner); - LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner"); - *ret_ret = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_ok(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1EcdsaChannelSignerDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_EcdsaChannelSignerDecodeErrorZ* owner_conv = (LDKCResult_EcdsaChannelSignerDecodeErrorZ*)untag_ptr(owner); + LDKEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner"); + *ret_ret = CResult_EcdsaChannelSignerDecodeErrorZ_get_ok(owner_conv); return tag_ptr(ret_ret, true); } -static inline struct LDKDecodeError CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_err(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_EcdsaChannelSignerDecodeErrorZ_get_err(LDKCResult_EcdsaChannelSignerDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return DecodeError_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* owner_conv = (LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)untag_ptr(owner); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1EcdsaChannelSignerDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_EcdsaChannelSignerDecodeErrorZ* owner_conv = (LDKCResult_EcdsaChannelSignerDecodeErrorZ*)untag_ptr(owner); LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_err(owner_conv); + *ret_copy = CResult_EcdsaChannelSignerDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -4900,103 +4931,135 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1NoneIOErrorZ_1get_1 return ret_conv; } -static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) { - LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = ChannelDetails_clone(&orig->data[i]); - } - return ret; +static inline struct LDKThirtyTwoBytes C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_a(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR owner){ + return ThirtyTwoBytes_clone(&owner->a); } -static inline struct LDKRoute CResult_RouteLightningErrorZ_get_ok(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){ - LDKRoute ret = *owner->contents.result; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* owner_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(owner); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_a(owner_conv).data); + return ret_arr; +} + +static inline struct LDKRecipientOnionFields C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_b(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR owner){ + LDKRecipientOnionFields ret = owner->b; ret.is_owned = false; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner); - LDKRoute ret_var = CResult_RouteLightningErrorZ_get_ok(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* owner_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(owner); + LDKRecipientOnionFields ret_var = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_b(owner_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline struct LDKLightningError CResult_RouteLightningErrorZ_get_err(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){ - LDKLightningError ret = *owner->contents.err; +static inline struct LDKRouteParameters C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_c(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR owner){ + LDKRouteParameters ret = owner->c; ret.is_owned = false; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner); - LDKLightningError ret_var = CResult_RouteLightningErrorZ_get_err(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1get_1c(JNIEnv *env, jclass clz, int64_t owner) { + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* owner_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(owner); + LDKRouteParameters ret_var = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_c(owner_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline struct LDKBlindedPayInfo C2Tuple_BlindedPayInfoBlindedPathZ_get_a(LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR owner){ - LDKBlindedPayInfo ret = owner->a; +static inline struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_ok(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(&*owner->contents.result); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* owner_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(owner); + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ), "LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ"); + *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_ok(owner_conv); + return tag_ptr(ret_conv, true); +} + +static inline void CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_err(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* owner_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(owner); + CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_err(owner_conv); +} + +static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) { + LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = ChannelDetails_clone(&orig->data[i]); + } + return ret; +} +static inline struct LDKRoute CResult_RouteLightningErrorZ_get_ok(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){ + LDKRoute ret = *owner->contents.result; ret.is_owned = false; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlindedPayInfoBlindedPathZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { - LDKC2Tuple_BlindedPayInfoBlindedPathZ* owner_conv = (LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(owner); - LDKBlindedPayInfo ret_var = C2Tuple_BlindedPayInfoBlindedPathZ_get_a(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner); + LDKRoute ret_var = CResult_RouteLightningErrorZ_get_ok(owner_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline struct LDKBlindedPath C2Tuple_BlindedPayInfoBlindedPathZ_get_b(LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR owner){ - LDKBlindedPath ret = owner->b; +static inline struct LDKLightningError CResult_RouteLightningErrorZ_get_err(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){ + LDKLightningError ret = *owner->contents.err; ret.is_owned = false; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlindedPayInfoBlindedPathZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { - LDKC2Tuple_BlindedPayInfoBlindedPathZ* owner_conv = (LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(owner); - LDKBlindedPath ret_var = C2Tuple_BlindedPayInfoBlindedPathZ_get_b(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner); + LDKLightningError ret_var = CResult_RouteLightningErrorZ_get_err(owner_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_clone(const LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ *orig) { - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ) * orig->datalen, "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ clone bytes"), .datalen = orig->datalen }; +static inline LDKCVec_BlindedPaymentPathZ CVec_BlindedPaymentPathZ_clone(const LDKCVec_BlindedPaymentPathZ *orig) { + LDKCVec_BlindedPaymentPathZ ret = { .data = MALLOC(sizeof(LDKBlindedPaymentPath) * orig->datalen, "LDKCVec_BlindedPaymentPathZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C2Tuple_BlindedPayInfoBlindedPathZ_clone(&orig->data[i]); + ret.data[i] = BlindedPaymentPath_clone(&orig->data[i]); } return ret; } -static inline struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_ok(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR owner){ +static inline struct LDKCVec_BlindedPaymentPathZ CResult_CVec_BlindedPaymentPathZNoneZ_get_ok(LDKCResult_CVec_BlindedPaymentPathZNoneZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_clone(&*owner->contents.result); + return CVec_BlindedPaymentPathZ_clone(&*owner->contents.result); } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlindedPayInfoBlindedPathZZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* owner_conv = (LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ*)untag_ptr(owner); - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ ret_var = CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_ok(owner_conv); +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPaymentPathZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_CVec_BlindedPaymentPathZNoneZ* owner_conv = (LDKCResult_CVec_BlindedPaymentPathZNoneZ*)untag_ptr(owner); + LDKCVec_BlindedPaymentPathZ ret_var = CResult_CVec_BlindedPaymentPathZNoneZ_get_ok(owner_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t l = 0; l < ret_var.datalen; l++) { - LDKC2Tuple_BlindedPayInfoBlindedPathZ* ret_conv_37_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ"); - *ret_conv_37_conv = ret_var.data[l]; - ret_arr_ptr[l] = tag_ptr(ret_conv_37_conv, true); + for (size_t u = 0; u < ret_var.datalen; u++) { + LDKBlindedPaymentPath ret_conv_20_var = ret_var.data[u]; + int64_t ret_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_20_var); + ret_conv_20_ref = tag_ptr(ret_conv_20_var.inner, ret_conv_20_var.is_owned); + ret_arr_ptr[u] = ret_conv_20_ref; } (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); FREE(ret_var.data); return ret_arr; } -static inline void CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_err(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR owner){ +static inline void CResult_CVec_BlindedPaymentPathZNoneZ_get_err(LDKCResult_CVec_BlindedPaymentPathZNoneZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return *owner->contents.err; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlindedPayInfoBlindedPathZZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* owner_conv = (LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ*)untag_ptr(owner); - CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_err(owner_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPaymentPathZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_CVec_BlindedPaymentPathZNoneZ* owner_conv = (LDKCResult_CVec_BlindedPaymentPathZNoneZ*)untag_ptr(owner); + CResult_CVec_BlindedPaymentPathZNoneZ_get_err(owner_conv); } static inline struct LDKOnionMessagePath CResult_OnionMessagePathNoneZ_get_ok(LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR owner){ @@ -5022,37 +5085,44 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_get_err(owner_conv); } -static inline struct LDKCVec_BlindedPathZ CResult_CVec_BlindedPathZNoneZ_get_ok(LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR owner){ +static inline struct LDKCVec_BlindedMessagePathZ CResult_CVec_BlindedMessagePathZNoneZ_get_ok(LDKCResult_CVec_BlindedMessagePathZNoneZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return CVec_BlindedPathZ_clone(&*owner->contents.result); + return CVec_BlindedMessagePathZ_clone(&*owner->contents.result); } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPathZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_CVec_BlindedPathZNoneZ* owner_conv = (LDKCResult_CVec_BlindedPathZNoneZ*)untag_ptr(owner); - LDKCVec_BlindedPathZ ret_var = CResult_CVec_BlindedPathZNoneZ_get_ok(owner_conv); +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_CVec_BlindedMessagePathZNoneZ* owner_conv = (LDKCResult_CVec_BlindedMessagePathZNoneZ*)untag_ptr(owner); + LDKCVec_BlindedMessagePathZ ret_var = CResult_CVec_BlindedMessagePathZNoneZ_get_ok(owner_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t n = 0; n < ret_var.datalen; n++) { - LDKBlindedPath ret_conv_13_var = ret_var.data[n]; - int64_t ret_conv_13_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_13_var); - ret_conv_13_ref = tag_ptr(ret_conv_13_var.inner, ret_conv_13_var.is_owned); - ret_arr_ptr[n] = ret_conv_13_ref; + for (size_t u = 0; u < ret_var.datalen; u++) { + LDKBlindedMessagePath ret_conv_20_var = ret_var.data[u]; + int64_t ret_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_20_var); + ret_conv_20_ref = tag_ptr(ret_conv_20_var.inner, ret_conv_20_var.is_owned); + ret_arr_ptr[u] = ret_conv_20_ref; } (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); FREE(ret_var.data); return ret_arr; } -static inline void CResult_CVec_BlindedPathZNoneZ_get_err(LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR owner){ +static inline void CResult_CVec_BlindedMessagePathZNoneZ_get_err(LDKCResult_CVec_BlindedMessagePathZNoneZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return *owner->contents.err; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPathZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_CVec_BlindedPathZNoneZ* owner_conv = (LDKCResult_CVec_BlindedPathZNoneZ*)untag_ptr(owner); - CResult_CVec_BlindedPathZNoneZ_get_err(owner_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_CVec_BlindedMessagePathZNoneZ* owner_conv = (LDKCResult_CVec_BlindedMessagePathZNoneZ*)untag_ptr(owner); + CResult_CVec_BlindedMessagePathZNoneZ_get_err(owner_conv); } +static inline LDKCVec_MessageForwardNodeZ CVec_MessageForwardNodeZ_clone(const LDKCVec_MessageForwardNodeZ *orig) { + LDKCVec_MessageForwardNodeZ ret = { .data = MALLOC(sizeof(LDKMessageForwardNode) * orig->datalen, "LDKCVec_MessageForwardNodeZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = MessageForwardNode_clone(&orig->data[i]); + } + return ret; +} static inline struct LDKInFlightHtlcs CResult_InFlightHtlcsDecodeErrorZ_get_ok(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner){ LDKInFlightHtlcs ret = *owner->contents.result; ret.is_owned = false; @@ -5242,13 +5312,6 @@ static inline LDKCVec_RouteHintZ CVec_RouteHintZ_clone(const LDKCVec_RouteHintZ } return ret; } -static inline LDKCVec_RouteHintHopZ CVec_RouteHintHopZ_clone(const LDKCVec_RouteHintHopZ *orig) { - LDKCVec_RouteHintHopZ ret = { .data = MALLOC(sizeof(LDKRouteHintHop) * orig->datalen, "LDKCVec_RouteHintHopZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = RouteHintHop_clone(&orig->data[i]); - } - return ret; -} static inline struct LDKRouteHint CResult_RouteHintDecodeErrorZ_get_ok(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR owner){ LDKRouteHint ret = *owner->contents.result; ret.is_owned = false; @@ -5716,6 +5779,8 @@ static jclass LDKClosureReason_FundingBatchClosure_class = NULL; static jmethodID LDKClosureReason_FundingBatchClosure_meth = NULL; static jclass LDKClosureReason_HTLCsTimedOut_class = NULL; static jmethodID LDKClosureReason_HTLCsTimedOut_meth = NULL; +static jclass LDKClosureReason_PeerFeerateTooLow_class = NULL; +static jmethodID LDKClosureReason_PeerFeerateTooLow_meth = NULL; JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKClosureReason_init (JNIEnv *env, jclass clz) { LDKClosureReason_CounterpartyForceClosed_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$CounterpartyForceClosed")); @@ -5725,7 +5790,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKClosureReason_init (JN LDKClosureReason_HolderForceClosed_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$HolderForceClosed")); CHECK(LDKClosureReason_HolderForceClosed_class != NULL); - LDKClosureReason_HolderForceClosed_meth = (*env)->GetMethodID(env, LDKClosureReason_HolderForceClosed_class, "", "()V"); + LDKClosureReason_HolderForceClosed_meth = (*env)->GetMethodID(env, LDKClosureReason_HolderForceClosed_class, "", "(J)V"); CHECK(LDKClosureReason_HolderForceClosed_meth != NULL); LDKClosureReason_LegacyCooperativeClosure_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$LegacyCooperativeClosure")); @@ -5782,6 +5847,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKClosureReason_init (JN CHECK(LDKClosureReason_HTLCsTimedOut_class != NULL); LDKClosureReason_HTLCsTimedOut_meth = (*env)->GetMethodID(env, LDKClosureReason_HTLCsTimedOut_class, "", "()V"); CHECK(LDKClosureReason_HTLCsTimedOut_meth != NULL); + LDKClosureReason_PeerFeerateTooLow_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$PeerFeerateTooLow")); + CHECK(LDKClosureReason_PeerFeerateTooLow_class != NULL); + LDKClosureReason_PeerFeerateTooLow_meth = (*env)->GetMethodID(env, LDKClosureReason_PeerFeerateTooLow_class, "", "(II)V"); + CHECK(LDKClosureReason_PeerFeerateTooLow_meth != NULL); } JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKClosureReason_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr); @@ -5794,7 +5864,8 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKClosureReason_1ref_1from return (*env)->NewObject(env, LDKClosureReason_CounterpartyForceClosed_class, LDKClosureReason_CounterpartyForceClosed_meth, peer_msg_ref); } case LDKClosureReason_HolderForceClosed: { - return (*env)->NewObject(env, LDKClosureReason_HolderForceClosed_class, LDKClosureReason_HolderForceClosed_meth); + int64_t broadcasted_latest_txn_ref = tag_ptr(&obj->holder_force_closed.broadcasted_latest_txn, false); + return (*env)->NewObject(env, LDKClosureReason_HolderForceClosed_class, LDKClosureReason_HolderForceClosed_meth, broadcasted_latest_txn_ref); } case LDKClosureReason_LegacyCooperativeClosure: { return (*env)->NewObject(env, LDKClosureReason_LegacyCooperativeClosure_class, LDKClosureReason_LegacyCooperativeClosure_meth); @@ -5831,6 +5902,11 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKClosureReason_1ref_1from case LDKClosureReason_HTLCsTimedOut: { return (*env)->NewObject(env, LDKClosureReason_HTLCsTimedOut_class, LDKClosureReason_HTLCsTimedOut_meth); } + case LDKClosureReason_PeerFeerateTooLow: { + int32_t peer_feerate_sat_per_kw_conv = obj->peer_feerate_too_low.peer_feerate_sat_per_kw; + int32_t required_feerate_sat_per_kw_conv = obj->peer_feerate_too_low.required_feerate_sat_per_kw; + return (*env)->NewObject(env, LDKClosureReason_PeerFeerateTooLow_class, LDKClosureReason_PeerFeerateTooLow_meth, peer_feerate_sat_per_kw_conv, required_feerate_sat_per_kw_conv); + } default: abort(); } } @@ -6279,6 +6355,32 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithE return ret_conv; } +static inline struct LDKOffer CResult_OfferDecodeErrorZ_get_ok(LDKCResult_OfferDecodeErrorZ *NONNULL_PTR owner){ + LDKOffer ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OfferDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_OfferDecodeErrorZ* owner_conv = (LDKCResult_OfferDecodeErrorZ*)untag_ptr(owner); + LDKOffer ret_var = CResult_OfferDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_OfferDecodeErrorZ_get_err(LDKCResult_OfferDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OfferDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_OfferDecodeErrorZ* owner_conv = (LDKCResult_OfferDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_OfferDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline struct LDKOffer CResult_OfferBolt12ParseErrorZ_get_ok(LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR owner){ LDKOffer ret = *owner->contents.result; ret.is_owned = false; @@ -6354,18 +6456,11 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecp256k1E return ret_conv; } -static jclass LDKNetworkUpdate_ChannelUpdateMessage_class = NULL; -static jmethodID LDKNetworkUpdate_ChannelUpdateMessage_meth = NULL; static jclass LDKNetworkUpdate_ChannelFailure_class = NULL; static jmethodID LDKNetworkUpdate_ChannelFailure_meth = NULL; static jclass LDKNetworkUpdate_NodeFailure_class = NULL; static jmethodID LDKNetworkUpdate_NodeFailure_meth = NULL; JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNetworkUpdate_init (JNIEnv *env, jclass clz) { - LDKNetworkUpdate_ChannelUpdateMessage_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetworkUpdate$ChannelUpdateMessage")); - CHECK(LDKNetworkUpdate_ChannelUpdateMessage_class != NULL); - LDKNetworkUpdate_ChannelUpdateMessage_meth = (*env)->GetMethodID(env, LDKNetworkUpdate_ChannelUpdateMessage_class, "", "(J)V"); - CHECK(LDKNetworkUpdate_ChannelUpdateMessage_meth != NULL); LDKNetworkUpdate_ChannelFailure_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetworkUpdate$ChannelFailure")); CHECK(LDKNetworkUpdate_ChannelFailure_class != NULL); @@ -6380,13 +6475,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNetworkUpdate_init (JN JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetworkUpdate_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr); switch(obj->tag) { - case LDKNetworkUpdate_ChannelUpdateMessage: { - LDKChannelUpdate msg_var = obj->channel_update_message.msg; - int64_t msg_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = tag_ptr(msg_var.inner, false); - return (*env)->NewObject(env, LDKNetworkUpdate_ChannelUpdateMessage_class, LDKNetworkUpdate_ChannelUpdateMessage_meth, msg_ref); - } case LDKNetworkUpdate_ChannelFailure: { int64_t short_channel_id_conv = obj->channel_failure.short_channel_id; jboolean is_permanent_conv = obj->channel_failure.is_permanent; @@ -6866,8 +6954,8 @@ static jclass LDKMessageSendEvent_SendFundingSigned_class = NULL; static jmethodID LDKMessageSendEvent_SendFundingSigned_meth = NULL; static jclass LDKMessageSendEvent_SendStfu_class = NULL; static jmethodID LDKMessageSendEvent_SendStfu_meth = NULL; -static jclass LDKMessageSendEvent_SendSplice_class = NULL; -static jmethodID LDKMessageSendEvent_SendSplice_meth = NULL; +static jclass LDKMessageSendEvent_SendSpliceInit_class = NULL; +static jmethodID LDKMessageSendEvent_SendSpliceInit_meth = NULL; static jclass LDKMessageSendEvent_SendSpliceAck_class = NULL; static jmethodID LDKMessageSendEvent_SendSpliceAck_meth = NULL; static jclass LDKMessageSendEvent_SendSpliceLocked_class = NULL; @@ -6960,11 +7048,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendEvent_init CHECK(LDKMessageSendEvent_SendStfu_class != NULL); LDKMessageSendEvent_SendStfu_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendStfu_class, "", "([BJ)V"); CHECK(LDKMessageSendEvent_SendStfu_meth != NULL); - LDKMessageSendEvent_SendSplice_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendSplice")); - CHECK(LDKMessageSendEvent_SendSplice_class != NULL); - LDKMessageSendEvent_SendSplice_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendSplice_class, "", "([BJ)V"); - CHECK(LDKMessageSendEvent_SendSplice_meth != NULL); + LDKMessageSendEvent_SendSpliceInit_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendSpliceInit")); + CHECK(LDKMessageSendEvent_SendSpliceInit_class != NULL); + LDKMessageSendEvent_SendSpliceInit_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendSpliceInit_class, "", "([BJ)V"); + CHECK(LDKMessageSendEvent_SendSpliceInit_meth != NULL); LDKMessageSendEvent_SendSpliceAck_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendSpliceAck")); CHECK(LDKMessageSendEvent_SendSpliceAck_class != NULL); @@ -7172,14 +7260,14 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f msg_ref = tag_ptr(msg_var.inner, false); return (*env)->NewObject(env, LDKMessageSendEvent_SendStfu_class, LDKMessageSendEvent_SendStfu_meth, node_id_arr, msg_ref); } - case LDKMessageSendEvent_SendSplice: { + case LDKMessageSendEvent_SendSpliceInit: { int8_tArray node_id_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_splice.node_id.compressed_form); - LDKSplice msg_var = obj->send_splice.msg; + (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_splice_init.node_id.compressed_form); + LDKSpliceInit msg_var = obj->send_splice_init.msg; int64_t msg_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, false); - return (*env)->NewObject(env, LDKMessageSendEvent_SendSplice_class, LDKMessageSendEvent_SendSplice_meth, node_id_arr, msg_ref); + return (*env)->NewObject(env, LDKMessageSendEvent_SendSpliceInit_class, LDKMessageSendEvent_SendSpliceInit_meth, node_id_arr, msg_ref); } case LDKMessageSendEvent_SendSpliceAck: { int8_tArray node_id_arr = (*env)->NewByteArray(env, 33); @@ -7603,17 +7691,51 @@ static inline LDKCVec_SocketAddressZ CVec_SocketAddressZ_clone(const LDKCVec_Soc } return ret; } +static jclass LDKNodeAnnouncementInfo_Relayed_class = NULL; +static jmethodID LDKNodeAnnouncementInfo_Relayed_meth = NULL; +static jclass LDKNodeAnnouncementInfo_Local_class = NULL; +static jmethodID LDKNodeAnnouncementInfo_Local_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNodeAnnouncementInfo_init (JNIEnv *env, jclass clz) { + LDKNodeAnnouncementInfo_Relayed_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNodeAnnouncementInfo$Relayed")); + CHECK(LDKNodeAnnouncementInfo_Relayed_class != NULL); + LDKNodeAnnouncementInfo_Relayed_meth = (*env)->GetMethodID(env, LDKNodeAnnouncementInfo_Relayed_class, "", "(J)V"); + CHECK(LDKNodeAnnouncementInfo_Relayed_meth != NULL); + LDKNodeAnnouncementInfo_Local_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNodeAnnouncementInfo$Local")); + CHECK(LDKNodeAnnouncementInfo_Local_class != NULL); + LDKNodeAnnouncementInfo_Local_meth = (*env)->GetMethodID(env, LDKNodeAnnouncementInfo_Local_class, "", "(J)V"); + CHECK(LDKNodeAnnouncementInfo_Local_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNodeAnnouncementInfo_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKNodeAnnouncementInfo *obj = (LDKNodeAnnouncementInfo*)untag_ptr(ptr); + switch(obj->tag) { + case LDKNodeAnnouncementInfo_Relayed: { + LDKNodeAnnouncement relayed_var = obj->relayed; + int64_t relayed_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(relayed_var); + relayed_ref = tag_ptr(relayed_var.inner, false); + return (*env)->NewObject(env, LDKNodeAnnouncementInfo_Relayed_class, LDKNodeAnnouncementInfo_Relayed_meth, relayed_ref); + } + case LDKNodeAnnouncementInfo_Local: { + LDKNodeAnnouncementDetails local_var = obj->local; + int64_t local_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(local_var); + local_ref = tag_ptr(local_var.inner, false); + return (*env)->NewObject(env, LDKNodeAnnouncementInfo_Local_class, LDKNodeAnnouncementInfo_Local_meth, local_ref); + } + default: abort(); + } +} static inline struct LDKNodeAnnouncementInfo CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner){ - LDKNodeAnnouncementInfo ret = *owner->contents.result; - ret.is_owned = false; - return ret; +CHECK(owner->result_ok); + return NodeAnnouncementInfo_clone(&*owner->contents.result); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(owner); - LDKNodeAnnouncementInfo ret_var = CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKNodeAnnouncementInfo *ret_copy = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo"); + *ret_copy = CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -7655,6 +7777,35 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErr return ret_ref; } +static jclass LDKCOption_NodeAnnouncementInfoZ_Some_class = NULL; +static jmethodID LDKCOption_NodeAnnouncementInfoZ_Some_meth = NULL; +static jclass LDKCOption_NodeAnnouncementInfoZ_None_class = NULL; +static jmethodID LDKCOption_NodeAnnouncementInfoZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1NodeAnnouncementInfoZ_init (JNIEnv *env, jclass clz) { + LDKCOption_NodeAnnouncementInfoZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_NodeAnnouncementInfoZ$Some")); + CHECK(LDKCOption_NodeAnnouncementInfoZ_Some_class != NULL); + LDKCOption_NodeAnnouncementInfoZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_NodeAnnouncementInfoZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_NodeAnnouncementInfoZ_Some_meth != NULL); + LDKCOption_NodeAnnouncementInfoZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_NodeAnnouncementInfoZ$None")); + CHECK(LDKCOption_NodeAnnouncementInfoZ_None_class != NULL); + LDKCOption_NodeAnnouncementInfoZ_None_meth = (*env)->GetMethodID(env, LDKCOption_NodeAnnouncementInfoZ_None_class, "", "()V"); + CHECK(LDKCOption_NodeAnnouncementInfoZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1NodeAnnouncementInfoZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_NodeAnnouncementInfoZ *obj = (LDKCOption_NodeAnnouncementInfoZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_NodeAnnouncementInfoZ_Some: { + int64_t some_ref = tag_ptr(&obj->some, false); + return (*env)->NewObject(env, LDKCOption_NodeAnnouncementInfoZ_Some_class, LDKCOption_NodeAnnouncementInfoZ_Some_meth, some_ref); + } + case LDKCOption_NodeAnnouncementInfoZ_None: { + return (*env)->NewObject(env, LDKCOption_NodeAnnouncementInfoZ_None_class, LDKCOption_NodeAnnouncementInfoZ_None_meth); + } + default: abort(); + } +} static inline struct LDKNodeInfo CResult_NodeInfoDecodeErrorZ_get_ok(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner){ LDKNodeInfo ret = *owner->contents.result; ret.is_owned = false; @@ -8552,6 +8703,87 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesAPIE return ret_ref; } +static jclass LDKOffersContext_InvoiceRequest_class = NULL; +static jmethodID LDKOffersContext_InvoiceRequest_meth = NULL; +static jclass LDKOffersContext_OutboundPayment_class = NULL; +static jmethodID LDKOffersContext_OutboundPayment_meth = NULL; +static jclass LDKOffersContext_InboundPayment_class = NULL; +static jmethodID LDKOffersContext_InboundPayment_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKOffersContext_init (JNIEnv *env, jclass clz) { + LDKOffersContext_InvoiceRequest_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKOffersContext$InvoiceRequest")); + CHECK(LDKOffersContext_InvoiceRequest_class != NULL); + LDKOffersContext_InvoiceRequest_meth = (*env)->GetMethodID(env, LDKOffersContext_InvoiceRequest_class, "", "(J)V"); + CHECK(LDKOffersContext_InvoiceRequest_meth != NULL); + LDKOffersContext_OutboundPayment_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKOffersContext$OutboundPayment")); + CHECK(LDKOffersContext_OutboundPayment_class != NULL); + LDKOffersContext_OutboundPayment_meth = (*env)->GetMethodID(env, LDKOffersContext_OutboundPayment_class, "", "([BJ[B)V"); + CHECK(LDKOffersContext_OutboundPayment_meth != NULL); + LDKOffersContext_InboundPayment_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKOffersContext$InboundPayment")); + CHECK(LDKOffersContext_InboundPayment_class != NULL); + LDKOffersContext_InboundPayment_meth = (*env)->GetMethodID(env, LDKOffersContext_InboundPayment_class, "", "([B)V"); + CHECK(LDKOffersContext_InboundPayment_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKOffersContext_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKOffersContext *obj = (LDKOffersContext*)untag_ptr(ptr); + switch(obj->tag) { + case LDKOffersContext_InvoiceRequest: { + LDKNonce nonce_var = obj->invoice_request.nonce; + int64_t nonce_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_var); + nonce_ref = tag_ptr(nonce_var.inner, false); + return (*env)->NewObject(env, LDKOffersContext_InvoiceRequest_class, LDKOffersContext_InvoiceRequest_meth, nonce_ref); + } + case LDKOffersContext_OutboundPayment: { + int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->outbound_payment.payment_id.data); + LDKNonce nonce_var = obj->outbound_payment.nonce; + int64_t nonce_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_var); + nonce_ref = tag_ptr(nonce_var.inner, false); + int8_tArray hmac_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, hmac_arr, 0, 32, obj->outbound_payment.hmac.data); + return (*env)->NewObject(env, LDKOffersContext_OutboundPayment_class, LDKOffersContext_OutboundPayment_meth, payment_id_arr, nonce_ref, hmac_arr); + } + case LDKOffersContext_InboundPayment: { + int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->inbound_payment.payment_hash.data); + return (*env)->NewObject(env, LDKOffersContext_InboundPayment_class, LDKOffersContext_InboundPayment_meth, payment_hash_arr); + } + default: abort(); + } +} +static jclass LDKCOption_OffersContextZ_Some_class = NULL; +static jmethodID LDKCOption_OffersContextZ_Some_meth = NULL; +static jclass LDKCOption_OffersContextZ_None_class = NULL; +static jmethodID LDKCOption_OffersContextZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1OffersContextZ_init (JNIEnv *env, jclass clz) { + LDKCOption_OffersContextZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_OffersContextZ$Some")); + CHECK(LDKCOption_OffersContextZ_Some_class != NULL); + LDKCOption_OffersContextZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_OffersContextZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_OffersContextZ_Some_meth != NULL); + LDKCOption_OffersContextZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_OffersContextZ$None")); + CHECK(LDKCOption_OffersContextZ_None_class != NULL); + LDKCOption_OffersContextZ_None_meth = (*env)->GetMethodID(env, LDKCOption_OffersContextZ_None_class, "", "()V"); + CHECK(LDKCOption_OffersContextZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1OffersContextZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_OffersContextZ *obj = (LDKCOption_OffersContextZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_OffersContextZ_Some: { + int64_t some_ref = tag_ptr(&obj->some, false); + return (*env)->NewObject(env, LDKCOption_OffersContextZ_Some_class, LDKCOption_OffersContextZ_Some_meth, some_ref); + } + case LDKCOption_OffersContextZ_None: { + return (*env)->NewObject(env, LDKCOption_OffersContextZ_None_class, LDKCOption_OffersContextZ_None_meth); + } + default: abort(); + } +} static jclass LDKOffersMessage_InvoiceRequest_class = NULL; static jmethodID LDKOffersMessage_InvoiceRequest_meth = NULL; static jclass LDKOffersMessage_Invoice_class = NULL; @@ -8602,31 +8834,58 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKOffersMessage_1ref_1from default: abort(); } } -static jclass LDKCOption_OffersMessageZ_Some_class = NULL; -static jmethodID LDKCOption_OffersMessageZ_Some_meth = NULL; -static jclass LDKCOption_OffersMessageZ_None_class = NULL; -static jmethodID LDKCOption_OffersMessageZ_None_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1OffersMessageZ_init (JNIEnv *env, jclass clz) { - LDKCOption_OffersMessageZ_Some_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_OffersMessageZ$Some")); - CHECK(LDKCOption_OffersMessageZ_Some_class != NULL); - LDKCOption_OffersMessageZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_OffersMessageZ_Some_class, "", "(J)V"); - CHECK(LDKCOption_OffersMessageZ_Some_meth != NULL); - LDKCOption_OffersMessageZ_None_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_OffersMessageZ$None")); - CHECK(LDKCOption_OffersMessageZ_None_class != NULL); - LDKCOption_OffersMessageZ_None_meth = (*env)->GetMethodID(env, LDKCOption_OffersMessageZ_None_class, "", "()V"); - CHECK(LDKCOption_OffersMessageZ_None_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1OffersMessageZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKCOption_OffersMessageZ *obj = (LDKCOption_OffersMessageZ*)untag_ptr(ptr); +static inline struct LDKOffersMessage C2Tuple_OffersMessageResponseInstructionZ_get_a(LDKC2Tuple_OffersMessageResponseInstructionZ *NONNULL_PTR owner){ + return OffersMessage_clone(&owner->a); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OffersMessageResponseInstructionZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_OffersMessageResponseInstructionZ* owner_conv = (LDKC2Tuple_OffersMessageResponseInstructionZ*)untag_ptr(owner); + LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); + *ret_copy = C2Tuple_OffersMessageResponseInstructionZ_get_a(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKResponseInstruction C2Tuple_OffersMessageResponseInstructionZ_get_b(LDKC2Tuple_OffersMessageResponseInstructionZ *NONNULL_PTR owner){ + LDKResponseInstruction ret = owner->b; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OffersMessageResponseInstructionZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_OffersMessageResponseInstructionZ* owner_conv = (LDKC2Tuple_OffersMessageResponseInstructionZ*)untag_ptr(owner); + LDKResponseInstruction ret_var = C2Tuple_OffersMessageResponseInstructionZ_get_b(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static jclass LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_Some_class = NULL; +static jmethodID LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_Some_meth = NULL; +static jclass LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_None_class = NULL; +static jmethodID LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C2Tuple_1OffersMessageResponseInstructionZZ_init (JNIEnv *env, jclass clz) { + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ$Some")); + CHECK(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_Some_class != NULL); + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_Some_meth != NULL); + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ$None")); + CHECK(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_None_class != NULL); + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_None_class, "", "()V"); + CHECK(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1OffersMessageResponseInstructionZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ *obj = (LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ*)untag_ptr(ptr); switch(obj->tag) { - case LDKCOption_OffersMessageZ_Some: { - int64_t some_ref = tag_ptr(&obj->some, false); - return (*env)->NewObject(env, LDKCOption_OffersMessageZ_Some_class, LDKCOption_OffersMessageZ_Some_meth, some_ref); + case LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_Some: { + LDKC2Tuple_OffersMessageResponseInstructionZ* some_conv = MALLOC(sizeof(LDKC2Tuple_OffersMessageResponseInstructionZ), "LDKC2Tuple_OffersMessageResponseInstructionZ"); + *some_conv = obj->some; + *some_conv = C2Tuple_OffersMessageResponseInstructionZ_clone(some_conv); + return (*env)->NewObject(env, LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_Some_class, LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_Some_meth, tag_ptr(some_conv, true)); } - case LDKCOption_OffersMessageZ_None: { - return (*env)->NewObject(env, LDKCOption_OffersMessageZ_None_class, LDKCOption_OffersMessageZ_None_meth); + case LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_None: { + return (*env)->NewObject(env, LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_None_class, LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_None_meth); } default: abort(); } @@ -8656,7 +8915,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKDestination_1ref_1from_1 return (*env)->NewObject(env, LDKDestination_Node_class, LDKDestination_Node_meth, node_arr); } case LDKDestination_BlindedPath: { - LDKBlindedPath blinded_path_var = obj->blinded_path; + LDKBlindedMessagePath blinded_path_var = obj->blinded_path; int64_t blinded_path_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_path_var); blinded_path_ref = tag_ptr(blinded_path_var.inner, false); @@ -8665,46 +8924,248 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKDestination_1ref_1from_1 default: abort(); } } -static inline struct LDKOffersMessage C3Tuple_OffersMessageDestinationBlindedPathZ_get_a(LDKC3Tuple_OffersMessageDestinationBlindedPathZ *NONNULL_PTR owner){ +static jclass LDKMessageContext_Offers_class = NULL; +static jmethodID LDKMessageContext_Offers_meth = NULL; +static jclass LDKMessageContext_Custom_class = NULL; +static jmethodID LDKMessageContext_Custom_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageContext_init (JNIEnv *env, jclass clz) { + LDKMessageContext_Offers_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageContext$Offers")); + CHECK(LDKMessageContext_Offers_class != NULL); + LDKMessageContext_Offers_meth = (*env)->GetMethodID(env, LDKMessageContext_Offers_class, "", "(J)V"); + CHECK(LDKMessageContext_Offers_meth != NULL); + LDKMessageContext_Custom_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageContext$Custom")); + CHECK(LDKMessageContext_Custom_class != NULL); + LDKMessageContext_Custom_meth = (*env)->GetMethodID(env, LDKMessageContext_Custom_class, "", "([B)V"); + CHECK(LDKMessageContext_Custom_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageContext_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKMessageContext *obj = (LDKMessageContext*)untag_ptr(ptr); + switch(obj->tag) { + case LDKMessageContext_Offers: { + int64_t offers_ref = tag_ptr(&obj->offers, false); + return (*env)->NewObject(env, LDKMessageContext_Offers_class, LDKMessageContext_Offers_meth, offers_ref); + } + case LDKMessageContext_Custom: { + LDKCVec_u8Z custom_var = obj->custom; + int8_tArray custom_arr = (*env)->NewByteArray(env, custom_var.datalen); + (*env)->SetByteArrayRegion(env, custom_arr, 0, custom_var.datalen, custom_var.data); + return (*env)->NewObject(env, LDKMessageContext_Custom_class, LDKMessageContext_Custom_meth, custom_arr); + } + default: abort(); + } +} +static jclass LDKMessageSendInstructions_WithSpecifiedReplyPath_class = NULL; +static jmethodID LDKMessageSendInstructions_WithSpecifiedReplyPath_meth = NULL; +static jclass LDKMessageSendInstructions_WithReplyPath_class = NULL; +static jmethodID LDKMessageSendInstructions_WithReplyPath_meth = NULL; +static jclass LDKMessageSendInstructions_WithoutReplyPath_class = NULL; +static jmethodID LDKMessageSendInstructions_WithoutReplyPath_meth = NULL; +static jclass LDKMessageSendInstructions_ForReply_class = NULL; +static jmethodID LDKMessageSendInstructions_ForReply_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendInstructions_init (JNIEnv *env, jclass clz) { + LDKMessageSendInstructions_WithSpecifiedReplyPath_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendInstructions$WithSpecifiedReplyPath")); + CHECK(LDKMessageSendInstructions_WithSpecifiedReplyPath_class != NULL); + LDKMessageSendInstructions_WithSpecifiedReplyPath_meth = (*env)->GetMethodID(env, LDKMessageSendInstructions_WithSpecifiedReplyPath_class, "", "(JJ)V"); + CHECK(LDKMessageSendInstructions_WithSpecifiedReplyPath_meth != NULL); + LDKMessageSendInstructions_WithReplyPath_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendInstructions$WithReplyPath")); + CHECK(LDKMessageSendInstructions_WithReplyPath_class != NULL); + LDKMessageSendInstructions_WithReplyPath_meth = (*env)->GetMethodID(env, LDKMessageSendInstructions_WithReplyPath_class, "", "(JJ)V"); + CHECK(LDKMessageSendInstructions_WithReplyPath_meth != NULL); + LDKMessageSendInstructions_WithoutReplyPath_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendInstructions$WithoutReplyPath")); + CHECK(LDKMessageSendInstructions_WithoutReplyPath_class != NULL); + LDKMessageSendInstructions_WithoutReplyPath_meth = (*env)->GetMethodID(env, LDKMessageSendInstructions_WithoutReplyPath_class, "", "(J)V"); + CHECK(LDKMessageSendInstructions_WithoutReplyPath_meth != NULL); + LDKMessageSendInstructions_ForReply_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendInstructions$ForReply")); + CHECK(LDKMessageSendInstructions_ForReply_class != NULL); + LDKMessageSendInstructions_ForReply_meth = (*env)->GetMethodID(env, LDKMessageSendInstructions_ForReply_class, "", "(J)V"); + CHECK(LDKMessageSendInstructions_ForReply_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendInstructions_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKMessageSendInstructions *obj = (LDKMessageSendInstructions*)untag_ptr(ptr); + switch(obj->tag) { + case LDKMessageSendInstructions_WithSpecifiedReplyPath: { + int64_t destination_ref = tag_ptr(&obj->with_specified_reply_path.destination, false); + LDKBlindedMessagePath reply_path_var = obj->with_specified_reply_path.reply_path; + int64_t reply_path_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(reply_path_var); + reply_path_ref = tag_ptr(reply_path_var.inner, false); + return (*env)->NewObject(env, LDKMessageSendInstructions_WithSpecifiedReplyPath_class, LDKMessageSendInstructions_WithSpecifiedReplyPath_meth, destination_ref, reply_path_ref); + } + case LDKMessageSendInstructions_WithReplyPath: { + int64_t destination_ref = tag_ptr(&obj->with_reply_path.destination, false); + int64_t context_ref = tag_ptr(&obj->with_reply_path.context, false); + return (*env)->NewObject(env, LDKMessageSendInstructions_WithReplyPath_class, LDKMessageSendInstructions_WithReplyPath_meth, destination_ref, context_ref); + } + case LDKMessageSendInstructions_WithoutReplyPath: { + int64_t destination_ref = tag_ptr(&obj->without_reply_path.destination, false); + return (*env)->NewObject(env, LDKMessageSendInstructions_WithoutReplyPath_class, LDKMessageSendInstructions_WithoutReplyPath_meth, destination_ref); + } + case LDKMessageSendInstructions_ForReply: { + LDKResponseInstruction instructions_var = obj->for_reply.instructions; + int64_t instructions_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(instructions_var); + instructions_ref = tag_ptr(instructions_var.inner, false); + return (*env)->NewObject(env, LDKMessageSendInstructions_ForReply_class, LDKMessageSendInstructions_ForReply_meth, instructions_ref); + } + default: abort(); + } +} +static inline struct LDKOffersMessage C2Tuple_OffersMessageMessageSendInstructionsZ_get_a(LDKC2Tuple_OffersMessageMessageSendInstructionsZ *NONNULL_PTR owner){ return OffersMessage_clone(&owner->a); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OffersMessageDestinationBlindedPathZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { - LDKC3Tuple_OffersMessageDestinationBlindedPathZ* owner_conv = (LDKC3Tuple_OffersMessageDestinationBlindedPathZ*)untag_ptr(owner); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OffersMessageMessageSendInstructionsZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_OffersMessageMessageSendInstructionsZ* owner_conv = (LDKC2Tuple_OffersMessageMessageSendInstructionsZ*)untag_ptr(owner); LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); - *ret_copy = C3Tuple_OffersMessageDestinationBlindedPathZ_get_a(owner_conv); + *ret_copy = C2Tuple_OffersMessageMessageSendInstructionsZ_get_a(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline struct LDKDestination C3Tuple_OffersMessageDestinationBlindedPathZ_get_b(LDKC3Tuple_OffersMessageDestinationBlindedPathZ *NONNULL_PTR owner){ - return Destination_clone(&owner->b); +static inline struct LDKMessageSendInstructions C2Tuple_OffersMessageMessageSendInstructionsZ_get_b(LDKC2Tuple_OffersMessageMessageSendInstructionsZ *NONNULL_PTR owner){ + return MessageSendInstructions_clone(&owner->b); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OffersMessageDestinationBlindedPathZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { - LDKC3Tuple_OffersMessageDestinationBlindedPathZ* owner_conv = (LDKC3Tuple_OffersMessageDestinationBlindedPathZ*)untag_ptr(owner); - LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); - *ret_copy = C3Tuple_OffersMessageDestinationBlindedPathZ_get_b(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OffersMessageMessageSendInstructionsZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_OffersMessageMessageSendInstructionsZ* owner_conv = (LDKC2Tuple_OffersMessageMessageSendInstructionsZ*)untag_ptr(owner); + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = C2Tuple_OffersMessageMessageSendInstructionsZ_get_b(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline struct LDKBlindedPath C3Tuple_OffersMessageDestinationBlindedPathZ_get_c(LDKC3Tuple_OffersMessageDestinationBlindedPathZ *NONNULL_PTR owner){ - LDKBlindedPath ret = owner->c; +static inline LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ CVec_C2Tuple_OffersMessageMessageSendInstructionsZZ_clone(const LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ *orig) { + LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_OffersMessageMessageSendInstructionsZ) * orig->datalen, "LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = C2Tuple_OffersMessageMessageSendInstructionsZ_clone(&orig->data[i]); + } + return ret; +} +static inline struct LDKReleaseHeldHtlc C2Tuple_ReleaseHeldHtlcResponseInstructionZ_get_a(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ *NONNULL_PTR owner){ + LDKReleaseHeldHtlc ret = owner->a; ret.is_owned = false; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OffersMessageDestinationBlindedPathZ_1get_1c(JNIEnv *env, jclass clz, int64_t owner) { - LDKC3Tuple_OffersMessageDestinationBlindedPathZ* owner_conv = (LDKC3Tuple_OffersMessageDestinationBlindedPathZ*)untag_ptr(owner); - LDKBlindedPath ret_var = C3Tuple_OffersMessageDestinationBlindedPathZ_get_c(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1ReleaseHeldHtlcResponseInstructionZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ* owner_conv = (LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ*)untag_ptr(owner); + LDKReleaseHeldHtlc ret_var = C2Tuple_ReleaseHeldHtlcResponseInstructionZ_get_a(owner_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ CVec_C3Tuple_OffersMessageDestinationBlindedPathZZ_clone(const LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ *orig) { - LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_OffersMessageDestinationBlindedPathZ) * orig->datalen, "LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ clone bytes"), .datalen = orig->datalen }; +static inline struct LDKResponseInstruction C2Tuple_ReleaseHeldHtlcResponseInstructionZ_get_b(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ *NONNULL_PTR owner){ + LDKResponseInstruction ret = owner->b; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1ReleaseHeldHtlcResponseInstructionZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ* owner_conv = (LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ*)untag_ptr(owner); + LDKResponseInstruction ret_var = C2Tuple_ReleaseHeldHtlcResponseInstructionZ_get_b(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static jclass LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_Some_class = NULL; +static jmethodID LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_Some_meth = NULL; +static jclass LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_None_class = NULL; +static jmethodID LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C2Tuple_1ReleaseHeldHtlcResponseInstructionZZ_init (JNIEnv *env, jclass clz) { + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ$Some")); + CHECK(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_Some_class != NULL); + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_Some_meth != NULL); + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ$None")); + CHECK(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_None_class != NULL); + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_None_class, "", "()V"); + CHECK(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1ReleaseHeldHtlcResponseInstructionZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ *obj = (LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_Some: { + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ* some_conv = MALLOC(sizeof(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ), "LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ"); + *some_conv = obj->some; + *some_conv = C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone(some_conv); + return (*env)->NewObject(env, LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_Some_class, LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_Some_meth, tag_ptr(some_conv, true)); + } + case LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_None: { + return (*env)->NewObject(env, LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_None_class, LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_None_meth); + } + default: abort(); + } +} +static jclass LDKAsyncPaymentsMessage_HeldHtlcAvailable_class = NULL; +static jmethodID LDKAsyncPaymentsMessage_HeldHtlcAvailable_meth = NULL; +static jclass LDKAsyncPaymentsMessage_ReleaseHeldHtlc_class = NULL; +static jmethodID LDKAsyncPaymentsMessage_ReleaseHeldHtlc_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKAsyncPaymentsMessage_init (JNIEnv *env, jclass clz) { + LDKAsyncPaymentsMessage_HeldHtlcAvailable_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAsyncPaymentsMessage$HeldHtlcAvailable")); + CHECK(LDKAsyncPaymentsMessage_HeldHtlcAvailable_class != NULL); + LDKAsyncPaymentsMessage_HeldHtlcAvailable_meth = (*env)->GetMethodID(env, LDKAsyncPaymentsMessage_HeldHtlcAvailable_class, "", "(J)V"); + CHECK(LDKAsyncPaymentsMessage_HeldHtlcAvailable_meth != NULL); + LDKAsyncPaymentsMessage_ReleaseHeldHtlc_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAsyncPaymentsMessage$ReleaseHeldHtlc")); + CHECK(LDKAsyncPaymentsMessage_ReleaseHeldHtlc_class != NULL); + LDKAsyncPaymentsMessage_ReleaseHeldHtlc_meth = (*env)->GetMethodID(env, LDKAsyncPaymentsMessage_ReleaseHeldHtlc_class, "", "(J)V"); + CHECK(LDKAsyncPaymentsMessage_ReleaseHeldHtlc_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAsyncPaymentsMessage_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKAsyncPaymentsMessage *obj = (LDKAsyncPaymentsMessage*)untag_ptr(ptr); + switch(obj->tag) { + case LDKAsyncPaymentsMessage_HeldHtlcAvailable: { + LDKHeldHtlcAvailable held_htlc_available_var = obj->held_htlc_available; + int64_t held_htlc_available_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(held_htlc_available_var); + held_htlc_available_ref = tag_ptr(held_htlc_available_var.inner, false); + return (*env)->NewObject(env, LDKAsyncPaymentsMessage_HeldHtlcAvailable_class, LDKAsyncPaymentsMessage_HeldHtlcAvailable_meth, held_htlc_available_ref); + } + case LDKAsyncPaymentsMessage_ReleaseHeldHtlc: { + LDKReleaseHeldHtlc release_held_htlc_var = obj->release_held_htlc; + int64_t release_held_htlc_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(release_held_htlc_var); + release_held_htlc_ref = tag_ptr(release_held_htlc_var.inner, false); + return (*env)->NewObject(env, LDKAsyncPaymentsMessage_ReleaseHeldHtlc_class, LDKAsyncPaymentsMessage_ReleaseHeldHtlc_meth, release_held_htlc_ref); + } + default: abort(); + } +} +static inline struct LDKAsyncPaymentsMessage C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_get_a(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ *NONNULL_PTR owner){ + return AsyncPaymentsMessage_clone(&owner->a); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1AsyncPaymentsMessageMessageSendInstructionsZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ* owner_conv = (LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ*)untag_ptr(owner); + LDKAsyncPaymentsMessage *ret_copy = MALLOC(sizeof(LDKAsyncPaymentsMessage), "LDKAsyncPaymentsMessage"); + *ret_copy = C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_get_a(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKMessageSendInstructions C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_get_b(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ *NONNULL_PTR owner){ + return MessageSendInstructions_clone(&owner->b); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1AsyncPaymentsMessageMessageSendInstructionsZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ* owner_conv = (LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ*)untag_ptr(owner); + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_get_b(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ CVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ_clone(const LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ *orig) { + LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ) * orig->datalen, "LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C3Tuple_OffersMessageDestinationBlindedPathZ_clone(&orig->data[i]); + ret.data[i] = C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone(&orig->data[i]); } return ret; } @@ -9486,7 +9947,7 @@ LDKCResult_ThirtyTwoBytesNoneZ ecdh_LDKNodeSigner_jcall(const void* this_arg, LD } return ret_conv; } -LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKNodeSigner_jcall(const void* this_arg, LDKu8slice hrp_bytes, LDKCVec_U5Z invoice_data, LDKRecipient recipient) { +LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKNodeSigner_jcall(const void* this_arg, const LDKRawBolt11Invoice * invoice, LDKRecipient recipient) { LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -9495,23 +9956,15 @@ LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKNodeSigner_jcall(const void } else { DO_ASSERT(get_jenv_res == JNI_OK); } - LDKu8slice hrp_bytes_var = hrp_bytes; - int8_tArray hrp_bytes_arr = (*env)->NewByteArray(env, hrp_bytes_var.datalen); - (*env)->SetByteArrayRegion(env, hrp_bytes_arr, 0, hrp_bytes_var.datalen, hrp_bytes_var.data); - LDKCVec_U5Z invoice_data_var = invoice_data; - jobjectArray invoice_data_arr = NULL; - invoice_data_arr = (*env)->NewByteArray(env, invoice_data_var.datalen); - int8_t *invoice_data_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, invoice_data_arr, NULL); - for (size_t h = 0; h < invoice_data_var.datalen; h++) { - uint8_t invoice_data_conv_7_val = invoice_data_var.data[h]._0; - invoice_data_arr_ptr[h] = invoice_data_conv_7_val; - } - (*env)->ReleasePrimitiveArrayCritical(env, invoice_data_arr, invoice_data_arr_ptr, 0); - FREE(invoice_data_var.data); + LDKRawBolt11Invoice invoice_var = *invoice; + int64_t invoice_ref = 0; + invoice_var = RawBolt11Invoice_clone(&invoice_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_var); + invoice_ref = tag_ptr(invoice_var.inner, invoice_var.is_owned); jclass recipient_conv = LDKRecipient_to_java(env, recipient); jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_invoice_meth, hrp_bytes_arr, invoice_data_arr, recipient_conv); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_invoice_meth, invoice_ref, recipient_conv); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); (*env)->FatalError(env, "A call to sign_invoice in LDKNodeSigner from rust threw an exception."); @@ -9630,7 +10083,7 @@ static inline LDKNodeSigner LDKNodeSigner_init (JNIEnv *env, jclass clz, jobject CHECK(calls->get_node_id_meth != NULL); calls->ecdh_meth = (*env)->GetMethodID(env, c, "ecdh", "(Lorg/ldk/enums/Recipient;[BJ)J"); CHECK(calls->ecdh_meth != NULL); - calls->sign_invoice_meth = (*env)->GetMethodID(env, c, "sign_invoice", "([B[BLorg/ldk/enums/Recipient;)J"); + calls->sign_invoice_meth = (*env)->GetMethodID(env, c, "sign_invoice", "(JLorg/ldk/enums/Recipient;)J"); CHECK(calls->sign_invoice_meth != NULL); calls->sign_bolt12_invoice_request_meth = (*env)->GetMethodID(env, c, "sign_bolt12_invoice_request", "(J)J"); CHECK(calls->sign_bolt12_invoice_request_meth != NULL); @@ -9693,30 +10146,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeSigner_1ecdh(JNIEnv *en return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeSigner_1sign_1invoice(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray hrp_bytes, jobjectArray invoice_data, jclass recipient) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeSigner_1sign_1invoice(JNIEnv *env, jclass clz, int64_t this_arg, int64_t invoice, jclass recipient) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKNodeSigner* this_arg_conv = (LDKNodeSigner*)this_arg_ptr; - LDKu8slice hrp_bytes_ref; - hrp_bytes_ref.datalen = (*env)->GetArrayLength(env, hrp_bytes); - hrp_bytes_ref.data = (*env)->GetByteArrayElements (env, hrp_bytes, NULL); - LDKCVec_U5Z invoice_data_constr; - invoice_data_constr.datalen = (*env)->GetArrayLength(env, invoice_data); - if (invoice_data_constr.datalen > 0) - invoice_data_constr.data = MALLOC(invoice_data_constr.datalen * sizeof(LDKU5), "LDKCVec_U5Z Elements"); - else - invoice_data_constr.data = NULL; - int8_t* invoice_data_vals = (*env)->GetByteArrayElements (env, invoice_data, NULL); - for (size_t h = 0; h < invoice_data_constr.datalen; h++) { - int8_t invoice_data_conv_7 = invoice_data_vals[h]; - - invoice_data_constr.data[h] = (LDKU5){ ._0 = invoice_data_conv_7 }; - } - (*env)->ReleaseByteArrayElements(env, invoice_data, invoice_data_vals, 0); + LDKRawBolt11Invoice invoice_conv; + invoice_conv.inner = untag_ptr(invoice); + invoice_conv.is_owned = ptr_is_owned(invoice); + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); + invoice_conv.is_owned = false; LDKRecipient recipient_conv = LDKRecipient_from_java(env, recipient); LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); - *ret_conv = (this_arg_conv->sign_invoice)(this_arg_conv->this_arg, hrp_bytes_ref, invoice_data_constr, recipient_conv); - (*env)->ReleaseByteArrayElements(env, hrp_bytes, (int8_t*)hrp_bytes_ref.data, 0); + *ret_conv = (this_arg_conv->sign_invoice)(this_arg_conv->this_arg, &invoice_conv, recipient_conv); return tag_ptr(ret_conv, true); } @@ -9816,7 +10257,7 @@ LDKThirtyTwoBytes generate_channel_keys_id_LDKSignerProvider_jcall(const void* t } return ret_ref; } -LDKWriteableEcdsaChannelSigner derive_channel_signer_LDKSignerProvider_jcall(const void* this_arg, uint64_t channel_value_satoshis, LDKThirtyTwoBytes channel_keys_id) { +LDKEcdsaChannelSigner derive_channel_signer_LDKSignerProvider_jcall(const void* this_arg, uint64_t channel_value_satoshis, LDKThirtyTwoBytes channel_keys_id) { LDKSignerProvider_JCalls *j_calls = (LDKSignerProvider_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -9837,14 +10278,14 @@ LDKWriteableEcdsaChannelSigner derive_channel_signer_LDKSignerProvider_jcall(con } void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); - LDKWriteableEcdsaChannelSigner ret_conv = *(LDKWriteableEcdsaChannelSigner*)(ret_ptr); + LDKEcdsaChannelSigner ret_conv = *(LDKEcdsaChannelSigner*)(ret_ptr); FREE(untag_ptr(ret)); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } return ret_conv; } -LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ read_chan_signer_LDKSignerProvider_jcall(const void* this_arg, LDKu8slice reader) { +LDKCResult_EcdsaChannelSignerDecodeErrorZ read_chan_signer_LDKSignerProvider_jcall(const void* this_arg, LDKu8slice reader) { LDKSignerProvider_JCalls *j_calls = (LDKSignerProvider_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -9865,7 +10306,7 @@ LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ read_chan_signer_LDKSignerPro } void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ ret_conv = *(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)(ret_ptr); + LDKCResult_EcdsaChannelSignerDecodeErrorZ ret_conv = *(LDKCResult_EcdsaChannelSignerDecodeErrorZ*)(ret_ptr); FREE(untag_ptr(ret)); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -9981,7 +10422,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignerProvider_1derive_1cha LDKThirtyTwoBytes channel_keys_id_ref; CHECK((*env)->GetArrayLength(env, channel_keys_id) == 32); (*env)->GetByteArrayRegion(env, channel_keys_id, 0, 32, channel_keys_id_ref.data); - LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner"); + LDKEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner"); *ret_ret = (this_arg_conv->derive_channel_signer)(this_arg_conv->this_arg, channel_value_satoshis, channel_keys_id_ref); return tag_ptr(ret_ret, true); } @@ -9993,7 +10434,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignerProvider_1read_1chan_ LDKu8slice reader_ref; reader_ref.datalen = (*env)->GetArrayLength(env, reader); reader_ref.data = (*env)->GetByteArrayElements (env, reader, NULL); - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ), "LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ"); + LDKCResult_EcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_EcdsaChannelSignerDecodeErrorZ), "LDKCResult_EcdsaChannelSignerDecodeErrorZ"); *ret_conv = (this_arg_conv->read_chan_signer)(this_arg_conv->this_arg, reader_ref); (*env)->ReleaseByteArrayElements(env, reader, (int8_t*)reader_ref.data, 0); return tag_ptr(ret_conv, true); @@ -10106,6 +10547,7 @@ typedef struct LDKMessageRouter_JCalls { jweak o; jmethodID find_path_meth; jmethodID create_blinded_paths_meth; + jmethodID create_compact_blinded_paths_meth; } LDKMessageRouter_JCalls; static void LDKMessageRouter_JCalls_free(void* this_arg) { LDKMessageRouter_JCalls *j_calls = (LDKMessageRouter_JCalls*) this_arg; @@ -10165,7 +10607,7 @@ LDKCResult_OnionMessagePathNoneZ find_path_LDKMessageRouter_jcall(const void* th } return ret_conv; } -LDKCResult_CVec_BlindedPathZNoneZ create_blinded_paths_LDKMessageRouter_jcall(const void* this_arg, LDKPublicKey recipient, LDKCVec_PublicKeyZ peers) { +LDKCResult_CVec_BlindedMessagePathZNoneZ create_blinded_paths_LDKMessageRouter_jcall(const void* this_arg, LDKPublicKey recipient, LDKMessageContext context, LDKCVec_PublicKeyZ peers) { LDKMessageRouter_JCalls *j_calls = (LDKMessageRouter_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -10176,6 +10618,9 @@ LDKCResult_CVec_BlindedPathZNoneZ create_blinded_paths_LDKMessageRouter_jcall(co } int8_tArray recipient_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, recipient_arr, 0, 33, recipient.compressed_form); + LDKMessageContext *context_copy = MALLOC(sizeof(LDKMessageContext), "LDKMessageContext"); + *context_copy = context; + int64_t context_ref = tag_ptr(context_copy, true); LDKCVec_PublicKeyZ peers_var = peers; jobjectArray peers_arr = NULL; peers_arr = (*env)->NewObjectArray(env, peers_var.datalen, arr_of_B_clz, NULL); @@ -10189,14 +10634,57 @@ LDKCResult_CVec_BlindedPathZNoneZ create_blinded_paths_LDKMessageRouter_jcall(co FREE(peers_var.data); jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->create_blinded_paths_meth, recipient_arr, peers_arr); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->create_blinded_paths_meth, recipient_arr, context_ref, peers_arr); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); (*env)->FatalError(env, "A call to create_blinded_paths in LDKMessageRouter from rust threw an exception."); } void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); - LDKCResult_CVec_BlindedPathZNoneZ ret_conv = *(LDKCResult_CVec_BlindedPathZNoneZ*)(ret_ptr); + LDKCResult_CVec_BlindedMessagePathZNoneZ ret_conv = *(LDKCResult_CVec_BlindedMessagePathZNoneZ*)(ret_ptr); + FREE(untag_ptr(ret)); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } + return ret_conv; +} +LDKCResult_CVec_BlindedMessagePathZNoneZ create_compact_blinded_paths_LDKMessageRouter_jcall(const void* this_arg, LDKPublicKey recipient, LDKMessageContext context, LDKCVec_MessageForwardNodeZ peers) { + LDKMessageRouter_JCalls *j_calls = (LDKMessageRouter_JCalls*) this_arg; + JNIEnv *env; + jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK); + } else { + DO_ASSERT(get_jenv_res == JNI_OK); + } + int8_tArray recipient_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, recipient_arr, 0, 33, recipient.compressed_form); + LDKMessageContext *context_copy = MALLOC(sizeof(LDKMessageContext), "LDKMessageContext"); + *context_copy = context; + int64_t context_ref = tag_ptr(context_copy, true); + LDKCVec_MessageForwardNodeZ peers_var = peers; + int64_tArray peers_arr = NULL; + peers_arr = (*env)->NewLongArray(env, peers_var.datalen); + int64_t *peers_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, peers_arr, NULL); + for (size_t u = 0; u < peers_var.datalen; u++) { + LDKMessageForwardNode peers_conv_20_var = peers_var.data[u]; + int64_t peers_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(peers_conv_20_var); + peers_conv_20_ref = tag_ptr(peers_conv_20_var.inner, peers_conv_20_var.is_owned); + peers_arr_ptr[u] = peers_conv_20_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, peers_arr, peers_arr_ptr, 0); + FREE(peers_var.data); + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->create_compact_blinded_paths_meth, recipient_arr, context_ref, peers_arr); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to create_compact_blinded_paths in LDKMessageRouter from rust threw an exception."); + } + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_CVec_BlindedMessagePathZNoneZ ret_conv = *(LDKCResult_CVec_BlindedMessagePathZNoneZ*)(ret_ptr); FREE(untag_ptr(ret)); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -10216,13 +10704,16 @@ static inline LDKMessageRouter LDKMessageRouter_init (JNIEnv *env, jclass clz, j calls->o = (*env)->NewWeakGlobalRef(env, o); calls->find_path_meth = (*env)->GetMethodID(env, c, "find_path", "([B[[BJ)J"); CHECK(calls->find_path_meth != NULL); - calls->create_blinded_paths_meth = (*env)->GetMethodID(env, c, "create_blinded_paths", "([B[[B)J"); + calls->create_blinded_paths_meth = (*env)->GetMethodID(env, c, "create_blinded_paths", "([BJ[[B)J"); CHECK(calls->create_blinded_paths_meth != NULL); + calls->create_compact_blinded_paths_meth = (*env)->GetMethodID(env, c, "create_compact_blinded_paths", "([BJ[J)J"); + CHECK(calls->create_compact_blinded_paths_meth != NULL); LDKMessageRouter ret = { .this_arg = (void*) calls, .find_path = find_path_LDKMessageRouter_jcall, .create_blinded_paths = create_blinded_paths_LDKMessageRouter_jcall, + .create_compact_blinded_paths = create_compact_blinded_paths_LDKMessageRouter_jcall, .free = LDKMessageRouter_JCalls_free, }; return ret; @@ -10261,13 +10752,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageRouter_1find_1path(J return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageRouter_1create_1blinded_1paths(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray recipient, jobjectArray peers) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageRouter_1create_1blinded_1paths(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray recipient, int64_t context, jobjectArray peers) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKMessageRouter* this_arg_conv = (LDKMessageRouter*)this_arg_ptr; LDKPublicKey recipient_ref; CHECK((*env)->GetArrayLength(env, recipient) == 33); (*env)->GetByteArrayRegion(env, recipient, 0, 33, recipient_ref.compressed_form); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKMessageContext context_conv = *(LDKMessageContext*)(context_ptr); + context_conv = MessageContext_clone((LDKMessageContext*)untag_ptr(context)); LDKCVec_PublicKeyZ peers_constr; peers_constr.datalen = (*env)->GetArrayLength(env, peers); if (peers_constr.datalen > 0) @@ -10281,8 +10776,41 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageRouter_1create_1blin (*env)->GetByteArrayRegion(env, peers_conv_8, 0, 33, peers_conv_8_ref.compressed_form); peers_constr.data[i] = peers_conv_8_ref; } - LDKCResult_CVec_BlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPathZNoneZ), "LDKCResult_CVec_BlindedPathZNoneZ"); - *ret_conv = (this_arg_conv->create_blinded_paths)(this_arg_conv->this_arg, recipient_ref, peers_constr); + LDKCResult_CVec_BlindedMessagePathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedMessagePathZNoneZ), "LDKCResult_CVec_BlindedMessagePathZNoneZ"); + *ret_conv = (this_arg_conv->create_blinded_paths)(this_arg_conv->this_arg, recipient_ref, context_conv, peers_constr); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageRouter_1create_1compact_1blinded_1paths(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray recipient, int64_t context, int64_tArray peers) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKMessageRouter* this_arg_conv = (LDKMessageRouter*)this_arg_ptr; + LDKPublicKey recipient_ref; + CHECK((*env)->GetArrayLength(env, recipient) == 33); + (*env)->GetByteArrayRegion(env, recipient, 0, 33, recipient_ref.compressed_form); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKMessageContext context_conv = *(LDKMessageContext*)(context_ptr); + context_conv = MessageContext_clone((LDKMessageContext*)untag_ptr(context)); + LDKCVec_MessageForwardNodeZ peers_constr; + peers_constr.datalen = (*env)->GetArrayLength(env, peers); + if (peers_constr.datalen > 0) + peers_constr.data = MALLOC(peers_constr.datalen * sizeof(LDKMessageForwardNode), "LDKCVec_MessageForwardNodeZ Elements"); + else + peers_constr.data = NULL; + int64_t* peers_vals = (*env)->GetLongArrayElements (env, peers, NULL); + for (size_t u = 0; u < peers_constr.datalen; u++) { + int64_t peers_conv_20 = peers_vals[u]; + LDKMessageForwardNode peers_conv_20_conv; + peers_conv_20_conv.inner = untag_ptr(peers_conv_20); + peers_conv_20_conv.is_owned = ptr_is_owned(peers_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(peers_conv_20_conv); + peers_conv_20_conv = MessageForwardNode_clone(&peers_conv_20_conv); + peers_constr.data[u] = peers_conv_20_conv; + } + (*env)->ReleaseLongArrayElements(env, peers, peers_vals, 0); + LDKCResult_CVec_BlindedMessagePathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedMessagePathZNoneZ), "LDKCResult_CVec_BlindedMessagePathZNoneZ"); + *ret_conv = (this_arg_conv->create_compact_blinded_paths)(this_arg_conv->this_arg, recipient_ref, context_conv, peers_constr); return tag_ptr(ret_conv, true); } @@ -10418,7 +10946,7 @@ LDKCResult_RouteLightningErrorZ find_route_with_id_LDKRouter_jcall(const void* t } return ret_conv; } -LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ create_blinded_payment_paths_LDKRouter_jcall(const void* this_arg, LDKPublicKey recipient, LDKCVec_ChannelDetailsZ first_hops, LDKReceiveTlvs tlvs, uint64_t amount_msats) { +LDKCResult_CVec_BlindedPaymentPathZNoneZ create_blinded_payment_paths_LDKRouter_jcall(const void* this_arg, LDKPublicKey recipient, LDKCVec_ChannelDetailsZ first_hops, LDKReceiveTlvs tlvs, uint64_t amount_msats) { LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -10456,7 +10984,7 @@ LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ create_blinded_payment_ } void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ ret_conv = *(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ*)(ret_ptr); + LDKCResult_CVec_BlindedPaymentPathZNoneZ ret_conv = *(LDKCResult_CVec_BlindedPaymentPathZNoneZ*)(ret_ptr); FREE(untag_ptr(ret)); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -10625,7 +11153,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1create_1blinded_1pa tlvs_conv.is_owned = ptr_is_owned(tlvs); CHECK_INNER_FIELD_ACCESS_OR_NULL(tlvs_conv); tlvs_conv = ReceiveTlvs_clone(&tlvs_conv); - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ), "LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ"); + LDKCResult_CVec_BlindedPaymentPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPaymentPathZNoneZ), "LDKCResult_CVec_BlindedPaymentPathZNoneZ"); *ret_conv = (this_arg_conv->create_blinded_payment_paths)(this_arg_conv->this_arg, recipient_ref, first_hops_constr, tlvs_conv, amount_msats); return tag_ptr(ret_conv, true); } @@ -11033,6 +11561,29 @@ static inline LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ CVec_C2 } return ret; } +static inline void CResult_NoneReplayEventZ_get_ok(LDKCResult_NoneReplayEventZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneReplayEventZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NoneReplayEventZ* owner_conv = (LDKCResult_NoneReplayEventZ*)untag_ptr(owner); + CResult_NoneReplayEventZ_get_ok(owner_conv); +} + +static inline struct LDKReplayEvent CResult_NoneReplayEventZ_get_err(LDKCResult_NoneReplayEventZ *NONNULL_PTR owner){ + LDKReplayEvent ret = *owner->contents.err; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneReplayEventZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NoneReplayEventZ* owner_conv = (LDKCResult_NoneReplayEventZ*)untag_ptr(owner); + LDKReplayEvent ret_var = CResult_NoneReplayEventZ_get_err(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + static inline LDKCVec_CommitmentTransactionZ CVec_CommitmentTransactionZ_clone(const LDKCVec_CommitmentTransactionZ *orig) { LDKCVec_CommitmentTransactionZ ret = { .data = MALLOC(sizeof(LDKCommitmentTransaction) * orig->datalen, "LDKCVec_CommitmentTransactionZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -11118,12 +11669,12 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKBalance_init (JNIEnv * LDKBalance_ClaimableOnChannelClose_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$ClaimableOnChannelClose")); CHECK(LDKBalance_ClaimableOnChannelClose_class != NULL); - LDKBalance_ClaimableOnChannelClose_meth = (*env)->GetMethodID(env, LDKBalance_ClaimableOnChannelClose_class, "", "(J)V"); + LDKBalance_ClaimableOnChannelClose_meth = (*env)->GetMethodID(env, LDKBalance_ClaimableOnChannelClose_class, "", "(JJJJJJ)V"); CHECK(LDKBalance_ClaimableOnChannelClose_meth != NULL); LDKBalance_ClaimableAwaitingConfirmations_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$ClaimableAwaitingConfirmations")); CHECK(LDKBalance_ClaimableAwaitingConfirmations_class != NULL); - LDKBalance_ClaimableAwaitingConfirmations_meth = (*env)->GetMethodID(env, LDKBalance_ClaimableAwaitingConfirmations_class, "", "(JI)V"); + LDKBalance_ClaimableAwaitingConfirmations_meth = (*env)->GetMethodID(env, LDKBalance_ClaimableAwaitingConfirmations_class, "", "(JILorg/ldk/enums/BalanceSource;)V"); CHECK(LDKBalance_ClaimableAwaitingConfirmations_meth != NULL); LDKBalance_ContentiousClaimable_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$ContentiousClaimable")); @@ -11133,7 +11684,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKBalance_init (JNIEnv * LDKBalance_MaybeTimeoutClaimableHTLC_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$MaybeTimeoutClaimableHTLC")); CHECK(LDKBalance_MaybeTimeoutClaimableHTLC_class != NULL); - LDKBalance_MaybeTimeoutClaimableHTLC_meth = (*env)->GetMethodID(env, LDKBalance_MaybeTimeoutClaimableHTLC_class, "", "(JI[B)V"); + LDKBalance_MaybeTimeoutClaimableHTLC_meth = (*env)->GetMethodID(env, LDKBalance_MaybeTimeoutClaimableHTLC_class, "", "(JI[BZ)V"); CHECK(LDKBalance_MaybeTimeoutClaimableHTLC_meth != NULL); LDKBalance_MaybePreimageClaimableHTLC_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$MaybePreimageClaimableHTLC")); @@ -11151,12 +11702,18 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBalance_1ref_1from_1ptr( switch(obj->tag) { case LDKBalance_ClaimableOnChannelClose: { int64_t amount_satoshis_conv = obj->claimable_on_channel_close.amount_satoshis; - return (*env)->NewObject(env, LDKBalance_ClaimableOnChannelClose_class, LDKBalance_ClaimableOnChannelClose_meth, amount_satoshis_conv); + int64_t transaction_fee_satoshis_conv = obj->claimable_on_channel_close.transaction_fee_satoshis; + int64_t outbound_payment_htlc_rounded_msat_conv = obj->claimable_on_channel_close.outbound_payment_htlc_rounded_msat; + int64_t outbound_forwarded_htlc_rounded_msat_conv = obj->claimable_on_channel_close.outbound_forwarded_htlc_rounded_msat; + int64_t inbound_claiming_htlc_rounded_msat_conv = obj->claimable_on_channel_close.inbound_claiming_htlc_rounded_msat; + int64_t inbound_htlc_rounded_msat_conv = obj->claimable_on_channel_close.inbound_htlc_rounded_msat; + return (*env)->NewObject(env, LDKBalance_ClaimableOnChannelClose_class, LDKBalance_ClaimableOnChannelClose_meth, amount_satoshis_conv, transaction_fee_satoshis_conv, outbound_payment_htlc_rounded_msat_conv, outbound_forwarded_htlc_rounded_msat_conv, inbound_claiming_htlc_rounded_msat_conv, inbound_htlc_rounded_msat_conv); } case LDKBalance_ClaimableAwaitingConfirmations: { int64_t amount_satoshis_conv = obj->claimable_awaiting_confirmations.amount_satoshis; int32_t confirmation_height_conv = obj->claimable_awaiting_confirmations.confirmation_height; - return (*env)->NewObject(env, LDKBalance_ClaimableAwaitingConfirmations_class, LDKBalance_ClaimableAwaitingConfirmations_meth, amount_satoshis_conv, confirmation_height_conv); + jclass source_conv = LDKBalanceSource_to_java(env, obj->claimable_awaiting_confirmations.source); + return (*env)->NewObject(env, LDKBalance_ClaimableAwaitingConfirmations_class, LDKBalance_ClaimableAwaitingConfirmations_meth, amount_satoshis_conv, confirmation_height_conv, source_conv); } case LDKBalance_ContentiousClaimable: { int64_t amount_satoshis_conv = obj->contentious_claimable.amount_satoshis; @@ -11172,7 +11729,8 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBalance_1ref_1from_1ptr( int32_t claimable_height_conv = obj->maybe_timeout_claimable_htlc.claimable_height; int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->maybe_timeout_claimable_htlc.payment_hash.data); - return (*env)->NewObject(env, LDKBalance_MaybeTimeoutClaimableHTLC_class, LDKBalance_MaybeTimeoutClaimableHTLC_meth, amount_satoshis_conv, claimable_height_conv, payment_hash_arr); + jboolean outbound_payment_conv = obj->maybe_timeout_claimable_htlc.outbound_payment; + return (*env)->NewObject(env, LDKBalance_MaybeTimeoutClaimableHTLC_class, LDKBalance_MaybeTimeoutClaimableHTLC_meth, amount_satoshis_conv, claimable_height_conv, payment_hash_arr, outbound_payment_conv); } case LDKBalance_MaybePreimageClaimableHTLC: { int64_t amount_satoshis_conv = obj->maybe_preimage_claimable_htlc.amount_satoshis; @@ -11424,48 +11982,12 @@ static inline LDKCVec_C2Tuple_PublicKeyTypeZZ CVec_C2Tuple_PublicKeyTypeZZ_clone } return ret; } -static inline struct LDKPublicKey C2Tuple_PublicKeyCVec_SocketAddressZZ_get_a(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *NONNULL_PTR owner){ - return owner->a; -} -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyCVec_1SocketAddressZZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* owner_conv = (LDKC2Tuple_PublicKeyCVec_SocketAddressZZ*)untag_ptr(owner); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, C2Tuple_PublicKeyCVec_SocketAddressZZ_get_a(owner_conv).compressed_form); - return ret_arr; -} - -static inline struct LDKCVec_SocketAddressZ C2Tuple_PublicKeyCVec_SocketAddressZZ_get_b(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *NONNULL_PTR owner){ - return CVec_SocketAddressZ_clone(&owner->b); -} -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyCVec_1SocketAddressZZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* owner_conv = (LDKC2Tuple_PublicKeyCVec_SocketAddressZZ*)untag_ptr(owner); - LDKCVec_SocketAddressZ ret_var = C2Tuple_PublicKeyCVec_SocketAddressZZ_get_b(owner_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t p = 0; p < ret_var.datalen; p++) { - LDKSocketAddress *ret_conv_15_copy = MALLOC(sizeof(LDKSocketAddress), "LDKSocketAddress"); - *ret_conv_15_copy = ret_var.data[p]; - int64_t ret_conv_15_ref = tag_ptr(ret_conv_15_copy, true); - ret_arr_ptr[p] = ret_conv_15_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; -} - -static inline LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ CVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ_clone(const LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ *orig) { - LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ) * orig->datalen, "LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C2Tuple_PublicKeyCVec_SocketAddressZZ_clone(&orig->data[i]); - } - return ret; -} typedef struct LDKOnionMessageContents_JCalls { atomic_size_t refcnt; JavaVM *vm; jweak o; jmethodID tlv_type_meth; + jmethodID msg_type_meth; jmethodID write_meth; jmethodID debug_str_meth; } LDKOnionMessageContents_JCalls; @@ -11507,6 +12029,28 @@ uint64_t tlv_type_LDKOnionMessageContents_jcall(const void* this_arg) { } return ret; } +LDKStr msg_type_LDKOnionMessageContents_jcall(const void* this_arg) { + LDKOnionMessageContents_JCalls *j_calls = (LDKOnionMessageContents_JCalls*) this_arg; + JNIEnv *env; + jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK); + } else { + DO_ASSERT(get_jenv_res == JNI_OK); + } + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + jstring ret = (*env)->CallObjectMethod(env, obj, j_calls->msg_type_meth); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to msg_type in LDKOnionMessageContents from rust threw an exception."); + } + LDKStr ret_conv = java_to_owned_str(env, ret); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } + return ret_conv; +} LDKCVec_u8Z write_LDKOnionMessageContents_jcall(const void* this_arg) { LDKOnionMessageContents_JCalls *j_calls = (LDKOnionMessageContents_JCalls*) this_arg; JNIEnv *env; @@ -11567,6 +12111,8 @@ static inline LDKOnionMessageContents LDKOnionMessageContents_init (JNIEnv *env, calls->o = (*env)->NewWeakGlobalRef(env, o); calls->tlv_type_meth = (*env)->GetMethodID(env, c, "tlv_type", "()J"); CHECK(calls->tlv_type_meth != NULL); + calls->msg_type_meth = (*env)->GetMethodID(env, c, "msg_type", "()Ljava/lang/String;"); + CHECK(calls->msg_type_meth != NULL); calls->write_meth = (*env)->GetMethodID(env, c, "write", "()[B"); CHECK(calls->write_meth != NULL); calls->debug_str_meth = (*env)->GetMethodID(env, c, "debug_str", "()Ljava/lang/String;"); @@ -11575,6 +12121,7 @@ static inline LDKOnionMessageContents LDKOnionMessageContents_init (JNIEnv *env, LDKOnionMessageContents ret = { .this_arg = (void*) calls, .tlv_type = tlv_type_LDKOnionMessageContents_jcall, + .msg_type = msg_type_LDKOnionMessageContents_jcall, .write = write_LDKOnionMessageContents_jcall, .debug_str = debug_str_LDKOnionMessageContents_jcall, .cloned = LDKOnionMessageContents_JCalls_cloned, @@ -11595,6 +12142,16 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1tlv_1 return ret_conv; } +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1msg_1type(JNIEnv *env, jclass clz, int64_t this_arg) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKOnionMessageContents* this_arg_conv = (LDKOnionMessageContents*)this_arg_ptr; + LDKStr ret_str = (this_arg_conv->msg_type)(this_arg_conv->this_arg); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1write(JNIEnv *env, jclass clz, int64_t this_arg) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } @@ -11616,6 +12173,61 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1debug return ret_conv; } +static inline struct LDKOnionMessageContents C2Tuple_OnionMessageContentsResponseInstructionZ_get_a(LDKC2Tuple_OnionMessageContentsResponseInstructionZ *NONNULL_PTR owner){ + return OnionMessageContents_clone(&owner->a); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OnionMessageContentsResponseInstructionZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_OnionMessageContentsResponseInstructionZ* owner_conv = (LDKC2Tuple_OnionMessageContentsResponseInstructionZ*)untag_ptr(owner); + LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *ret_ret = C2Tuple_OnionMessageContentsResponseInstructionZ_get_a(owner_conv); + return tag_ptr(ret_ret, true); +} + +static inline struct LDKResponseInstruction C2Tuple_OnionMessageContentsResponseInstructionZ_get_b(LDKC2Tuple_OnionMessageContentsResponseInstructionZ *NONNULL_PTR owner){ + LDKResponseInstruction ret = owner->b; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OnionMessageContentsResponseInstructionZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_OnionMessageContentsResponseInstructionZ* owner_conv = (LDKC2Tuple_OnionMessageContentsResponseInstructionZ*)untag_ptr(owner); + LDKResponseInstruction ret_var = C2Tuple_OnionMessageContentsResponseInstructionZ_get_b(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static jclass LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Some_class = NULL; +static jmethodID LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Some_meth = NULL; +static jclass LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_None_class = NULL; +static jmethodID LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C2Tuple_1OnionMessageContentsResponseInstructionZZ_init (JNIEnv *env, jclass clz) { + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ$Some")); + CHECK(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Some_class != NULL); + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Some_meth != NULL); + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ$None")); + CHECK(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_None_class != NULL); + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_None_class, "", "()V"); + CHECK(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1OnionMessageContentsResponseInstructionZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ *obj = (LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Some: { + LDKC2Tuple_OnionMessageContentsResponseInstructionZ* some_conv = MALLOC(sizeof(LDKC2Tuple_OnionMessageContentsResponseInstructionZ), "LDKC2Tuple_OnionMessageContentsResponseInstructionZ"); + *some_conv = obj->some; + *some_conv = C2Tuple_OnionMessageContentsResponseInstructionZ_clone(some_conv); + return (*env)->NewObject(env, LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Some_class, LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Some_meth, tag_ptr(some_conv, true)); + } + case LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_None: { + return (*env)->NewObject(env, LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_None_class, LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_None_meth); + } + default: abort(); + } +} static jclass LDKCOption_OnionMessageContentsZ_Some_class = NULL; static jmethodID LDKCOption_OnionMessageContentsZ_Some_meth = NULL; static jclass LDKCOption_OnionMessageContentsZ_None_class = NULL; @@ -11670,45 +12282,31 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1OnionMess return ret_ref; } -static inline struct LDKOnionMessageContents C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_a(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *NONNULL_PTR owner){ +static inline struct LDKOnionMessageContents C2Tuple_OnionMessageContentsMessageSendInstructionsZ_get_a(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ *NONNULL_PTR owner){ return OnionMessageContents_clone(&owner->a); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OnionMessageContentsDestinationBlindedPathZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ* owner_conv = (LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ*)untag_ptr(owner); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OnionMessageContentsMessageSendInstructionsZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ* owner_conv = (LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ*)untag_ptr(owner); LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); - *ret_ret = C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_a(owner_conv); + *ret_ret = C2Tuple_OnionMessageContentsMessageSendInstructionsZ_get_a(owner_conv); return tag_ptr(ret_ret, true); } -static inline struct LDKDestination C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_b(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *NONNULL_PTR owner){ - return Destination_clone(&owner->b); +static inline struct LDKMessageSendInstructions C2Tuple_OnionMessageContentsMessageSendInstructionsZ_get_b(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ *NONNULL_PTR owner){ + return MessageSendInstructions_clone(&owner->b); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OnionMessageContentsDestinationBlindedPathZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ* owner_conv = (LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ*)untag_ptr(owner); - LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); - *ret_copy = C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_b(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OnionMessageContentsMessageSendInstructionsZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ* owner_conv = (LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ*)untag_ptr(owner); + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = C2Tuple_OnionMessageContentsMessageSendInstructionsZ_get_b(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline struct LDKBlindedPath C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_c(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *NONNULL_PTR owner){ - LDKBlindedPath ret = owner->c; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OnionMessageContentsDestinationBlindedPathZ_1get_1c(JNIEnv *env, jclass clz, int64_t owner) { - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ* owner_conv = (LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ*)untag_ptr(owner); - LDKBlindedPath ret_var = C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_c(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ CVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ_clone(const LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ *orig) { - LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ) * orig->datalen, "LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ clone bytes"), .datalen = orig->datalen }; +static inline LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ CVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ_clone(const LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ *orig) { + LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ) * orig->datalen, "LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone(&orig->data[i]); + ret.data[i] = C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone(&orig->data[i]); } return ret; } @@ -12083,36 +12681,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestBolt1 return ret_conv; } -static jclass LDKCOption_SecretKeyZ_Some_class = NULL; -static jmethodID LDKCOption_SecretKeyZ_Some_meth = NULL; -static jclass LDKCOption_SecretKeyZ_None_class = NULL; -static jmethodID LDKCOption_SecretKeyZ_None_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1SecretKeyZ_init (JNIEnv *env, jclass clz) { - LDKCOption_SecretKeyZ_Some_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_SecretKeyZ$Some")); - CHECK(LDKCOption_SecretKeyZ_Some_class != NULL); - LDKCOption_SecretKeyZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_SecretKeyZ_Some_class, "", "([B)V"); - CHECK(LDKCOption_SecretKeyZ_Some_meth != NULL); - LDKCOption_SecretKeyZ_None_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_SecretKeyZ$None")); - CHECK(LDKCOption_SecretKeyZ_None_class != NULL); - LDKCOption_SecretKeyZ_None_meth = (*env)->GetMethodID(env, LDKCOption_SecretKeyZ_None_class, "", "()V"); - CHECK(LDKCOption_SecretKeyZ_None_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1SecretKeyZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKCOption_SecretKeyZ *obj = (LDKCOption_SecretKeyZ*)untag_ptr(ptr); - switch(obj->tag) { - case LDKCOption_SecretKeyZ_Some: { - int8_tArray some_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, some_arr, 0, 32, obj->some.bytes); - return (*env)->NewObject(env, LDKCOption_SecretKeyZ_Some_class, LDKCOption_SecretKeyZ_Some_meth, some_arr); - } - case LDKCOption_SecretKeyZ_None: { - return (*env)->NewObject(env, LDKCOption_SecretKeyZ_None_class, LDKCOption_SecretKeyZ_None_meth); - } - default: abort(); - } -} static inline struct LDKInvoiceWithExplicitSigningPubkeyBuilder CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ LDKInvoiceWithExplicitSigningPubkeyBuilder ret = *owner->contents.result; ret.is_owned = false; @@ -12428,28 +12996,28 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StfuDecodeErrorZ_1 return ret_ref; } -static inline struct LDKSplice CResult_SpliceDecodeErrorZ_get_ok(LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR owner){ - LDKSplice ret = *owner->contents.result; +static inline struct LDKSpliceInit CResult_SpliceInitDecodeErrorZ_get_ok(LDKCResult_SpliceInitDecodeErrorZ *NONNULL_PTR owner){ + LDKSpliceInit ret = *owner->contents.result; ret.is_owned = false; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_SpliceDecodeErrorZ* owner_conv = (LDKCResult_SpliceDecodeErrorZ*)untag_ptr(owner); - LDKSplice ret_var = CResult_SpliceDecodeErrorZ_get_ok(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceInitDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_SpliceInitDecodeErrorZ* owner_conv = (LDKCResult_SpliceInitDecodeErrorZ*)untag_ptr(owner); + LDKSpliceInit ret_var = CResult_SpliceInitDecodeErrorZ_get_ok(owner_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline struct LDKDecodeError CResult_SpliceDecodeErrorZ_get_err(LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_SpliceInitDecodeErrorZ_get_err(LDKCResult_SpliceInitDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return DecodeError_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_SpliceDecodeErrorZ* owner_conv = (LDKCResult_SpliceDecodeErrorZ*)untag_ptr(owner); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceInitDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_SpliceInitDecodeErrorZ* owner_conv = (LDKCResult_SpliceInitDecodeErrorZ*)untag_ptr(owner); LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_SpliceDecodeErrorZ_get_err(owner_conv); + *ret_copy = CResult_SpliceInitDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -12844,6 +13412,32 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRa return ret_ref; } +static inline struct LDKCommitmentSignedBatch CResult_CommitmentSignedBatchDecodeErrorZ_get_ok(LDKCResult_CommitmentSignedBatchDecodeErrorZ *NONNULL_PTR owner){ + LDKCommitmentSignedBatch ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedBatchDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_CommitmentSignedBatchDecodeErrorZ* owner_conv = (LDKCResult_CommitmentSignedBatchDecodeErrorZ*)untag_ptr(owner); + LDKCommitmentSignedBatch ret_var = CResult_CommitmentSignedBatchDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_CommitmentSignedBatchDecodeErrorZ_get_err(LDKCResult_CommitmentSignedBatchDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedBatchDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_CommitmentSignedBatchDecodeErrorZ* owner_conv = (LDKCResult_CommitmentSignedBatchDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_CommitmentSignedBatchDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline struct LDKCommitmentSigned CResult_CommitmentSignedDecodeErrorZ_get_ok(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR owner){ LDKCommitmentSigned ret = *owner->contents.result; ret.is_owned = false; @@ -13676,68 +14270,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFil return ret_ref; } -static inline LDKCVec_PhantomRouteHintsZ CVec_PhantomRouteHintsZ_clone(const LDKCVec_PhantomRouteHintsZ *orig) { - LDKCVec_PhantomRouteHintsZ ret = { .data = MALLOC(sizeof(LDKPhantomRouteHints) * orig->datalen, "LDKCVec_PhantomRouteHintsZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = PhantomRouteHints_clone(&orig->data[i]); - } - return ret; -} -static jclass LDKSignOrCreationError_SignError_class = NULL; -static jmethodID LDKSignOrCreationError_SignError_meth = NULL; -static jclass LDKSignOrCreationError_CreationError_class = NULL; -static jmethodID LDKSignOrCreationError_CreationError_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKSignOrCreationError_init (JNIEnv *env, jclass clz) { - LDKSignOrCreationError_SignError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSignOrCreationError$SignError")); - CHECK(LDKSignOrCreationError_SignError_class != NULL); - LDKSignOrCreationError_SignError_meth = (*env)->GetMethodID(env, LDKSignOrCreationError_SignError_class, "", "()V"); - CHECK(LDKSignOrCreationError_SignError_meth != NULL); - LDKSignOrCreationError_CreationError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSignOrCreationError$CreationError")); - CHECK(LDKSignOrCreationError_CreationError_class != NULL); - LDKSignOrCreationError_CreationError_meth = (*env)->GetMethodID(env, LDKSignOrCreationError_CreationError_class, "", "(Lorg/ldk/enums/CreationError;)V"); - CHECK(LDKSignOrCreationError_CreationError_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSignOrCreationError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKSignOrCreationError *obj = (LDKSignOrCreationError*)untag_ptr(ptr); - switch(obj->tag) { - case LDKSignOrCreationError_SignError: { - return (*env)->NewObject(env, LDKSignOrCreationError_SignError_class, LDKSignOrCreationError_SignError_meth); - } - case LDKSignOrCreationError_CreationError: { - jclass creation_error_conv = LDKCreationError_to_java(env, obj->creation_error); - return (*env)->NewObject(env, LDKSignOrCreationError_CreationError_class, LDKSignOrCreationError_CreationError_meth, creation_error_conv); - } - default: abort(); - } -} -static inline struct LDKBolt11Invoice CResult_Bolt11InvoiceSignOrCreationErrorZ_get_ok(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){ - LDKBolt11Invoice ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(owner); - LDKBolt11Invoice ret_var = CResult_Bolt11InvoiceSignOrCreationErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline struct LDKSignOrCreationError CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return SignOrCreationError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(owner); - LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError"); - *ret_copy = CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - static jclass LDKCOption_InboundHTLCStateDetailsZ_Some_class = NULL; static jmethodID LDKCOption_InboundHTLCStateDetailsZ_Some_meth = NULL; static jclass LDKCOption_InboundHTLCStateDetailsZ_None_class = NULL; @@ -14039,6 +14571,82 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelShutdownSta return ret_ref; } +static inline struct LDKHeldHtlcAvailable CResult_HeldHtlcAvailableDecodeErrorZ_get_ok(LDKCResult_HeldHtlcAvailableDecodeErrorZ *NONNULL_PTR owner){ + LDKHeldHtlcAvailable ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HeldHtlcAvailableDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_HeldHtlcAvailableDecodeErrorZ* owner_conv = (LDKCResult_HeldHtlcAvailableDecodeErrorZ*)untag_ptr(owner); + LDKHeldHtlcAvailable ret_var = CResult_HeldHtlcAvailableDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_HeldHtlcAvailableDecodeErrorZ_get_err(LDKCResult_HeldHtlcAvailableDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HeldHtlcAvailableDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_HeldHtlcAvailableDecodeErrorZ* owner_conv = (LDKCResult_HeldHtlcAvailableDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_HeldHtlcAvailableDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKReleaseHeldHtlc CResult_ReleaseHeldHtlcDecodeErrorZ_get_ok(LDKCResult_ReleaseHeldHtlcDecodeErrorZ *NONNULL_PTR owner){ + LDKReleaseHeldHtlc ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReleaseHeldHtlcDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* owner_conv = (LDKCResult_ReleaseHeldHtlcDecodeErrorZ*)untag_ptr(owner); + LDKReleaseHeldHtlc ret_var = CResult_ReleaseHeldHtlcDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_ReleaseHeldHtlcDecodeErrorZ_get_err(LDKCResult_ReleaseHeldHtlcDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReleaseHeldHtlcDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* owner_conv = (LDKCResult_ReleaseHeldHtlcDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ReleaseHeldHtlcDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKAsyncPaymentsMessage CResult_AsyncPaymentsMessageDecodeErrorZ_get_ok(LDKCResult_AsyncPaymentsMessageDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return AsyncPaymentsMessage_clone(&*owner->contents.result); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsMessageDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* owner_conv = (LDKCResult_AsyncPaymentsMessageDecodeErrorZ*)untag_ptr(owner); + LDKAsyncPaymentsMessage *ret_copy = MALLOC(sizeof(LDKAsyncPaymentsMessage), "LDKAsyncPaymentsMessage"); + *ret_copy = CResult_AsyncPaymentsMessageDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_AsyncPaymentsMessageDecodeErrorZ_get_err(LDKCResult_AsyncPaymentsMessageDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsMessageDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* owner_conv = (LDKCResult_AsyncPaymentsMessageDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_AsyncPaymentsMessageDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline struct LDKOffersMessage CResult_OffersMessageDecodeErrorZ_get_ok(LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return OffersMessage_clone(&*owner->contents.result); @@ -14483,6 +15091,65 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInva return ret_ref; } +static jclass LDKFundingInfo_Tx_class = NULL; +static jmethodID LDKFundingInfo_Tx_meth = NULL; +static jclass LDKFundingInfo_OutPoint_class = NULL; +static jmethodID LDKFundingInfo_OutPoint_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKFundingInfo_init (JNIEnv *env, jclass clz) { + LDKFundingInfo_Tx_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKFundingInfo$Tx")); + CHECK(LDKFundingInfo_Tx_class != NULL); + LDKFundingInfo_Tx_meth = (*env)->GetMethodID(env, LDKFundingInfo_Tx_class, "", "([B)V"); + CHECK(LDKFundingInfo_Tx_meth != NULL); + LDKFundingInfo_OutPoint_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKFundingInfo$OutPoint")); + CHECK(LDKFundingInfo_OutPoint_class != NULL); + LDKFundingInfo_OutPoint_meth = (*env)->GetMethodID(env, LDKFundingInfo_OutPoint_class, "", "(J)V"); + CHECK(LDKFundingInfo_OutPoint_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFundingInfo_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKFundingInfo *obj = (LDKFundingInfo*)untag_ptr(ptr); + switch(obj->tag) { + case LDKFundingInfo_Tx: { + LDKTransaction transaction_var = obj->tx.transaction; + int8_tArray transaction_arr = (*env)->NewByteArray(env, transaction_var.datalen); + (*env)->SetByteArrayRegion(env, transaction_arr, 0, transaction_var.datalen, transaction_var.data); + return (*env)->NewObject(env, LDKFundingInfo_Tx_class, LDKFundingInfo_Tx_meth, transaction_arr); + } + case LDKFundingInfo_OutPoint: { + LDKOutPoint outpoint_var = obj->out_point.outpoint; + int64_t outpoint_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_var); + outpoint_ref = tag_ptr(outpoint_var.inner, false); + return (*env)->NewObject(env, LDKFundingInfo_OutPoint_class, LDKFundingInfo_OutPoint_meth, outpoint_ref); + } + default: abort(); + } +} +static inline struct LDKFundingInfo CResult_FundingInfoDecodeErrorZ_get_ok(LDKCResult_FundingInfoDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return FundingInfo_clone(&*owner->contents.result); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_FundingInfoDecodeErrorZ* owner_conv = (LDKCResult_FundingInfoDecodeErrorZ*)untag_ptr(owner); + LDKFundingInfo *ret_copy = MALLOC(sizeof(LDKFundingInfo), "LDKFundingInfo"); + *ret_copy = CResult_FundingInfoDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_FundingInfoDecodeErrorZ_get_err(LDKCResult_FundingInfoDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_FundingInfoDecodeErrorZ* owner_conv = (LDKCResult_FundingInfoDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_FundingInfoDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static jclass LDKPaymentPurpose_Bolt11InvoicePayment_class = NULL; static jmethodID LDKPaymentPurpose_Bolt11InvoicePayment_meth = NULL; static jclass LDKPaymentPurpose_Bolt12OfferPayment_class = NULL; @@ -14857,24 +15524,55 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDesti return ret_ref; } -static inline enum LDKPaymentFailureReason CResult_PaymentFailureReasonDecodeErrorZ_get_ok(LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR owner){ +static jclass LDKCOption_PaymentFailureReasonZ_Some_class = NULL; +static jmethodID LDKCOption_PaymentFailureReasonZ_Some_meth = NULL; +static jclass LDKCOption_PaymentFailureReasonZ_None_class = NULL; +static jmethodID LDKCOption_PaymentFailureReasonZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1PaymentFailureReasonZ_init (JNIEnv *env, jclass clz) { + LDKCOption_PaymentFailureReasonZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_PaymentFailureReasonZ$Some")); + CHECK(LDKCOption_PaymentFailureReasonZ_Some_class != NULL); + LDKCOption_PaymentFailureReasonZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_PaymentFailureReasonZ_Some_class, "", "(Lorg/ldk/enums/PaymentFailureReason;)V"); + CHECK(LDKCOption_PaymentFailureReasonZ_Some_meth != NULL); + LDKCOption_PaymentFailureReasonZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_PaymentFailureReasonZ$None")); + CHECK(LDKCOption_PaymentFailureReasonZ_None_class != NULL); + LDKCOption_PaymentFailureReasonZ_None_meth = (*env)->GetMethodID(env, LDKCOption_PaymentFailureReasonZ_None_class, "", "()V"); + CHECK(LDKCOption_PaymentFailureReasonZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1PaymentFailureReasonZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_PaymentFailureReasonZ *obj = (LDKCOption_PaymentFailureReasonZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_PaymentFailureReasonZ_Some: { + jclass some_conv = LDKPaymentFailureReason_to_java(env, obj->some); + return (*env)->NewObject(env, LDKCOption_PaymentFailureReasonZ_Some_class, LDKCOption_PaymentFailureReasonZ_Some_meth, some_conv); + } + case LDKCOption_PaymentFailureReasonZ_None: { + return (*env)->NewObject(env, LDKCOption_PaymentFailureReasonZ_None_class, LDKCOption_PaymentFailureReasonZ_None_meth); + } + default: abort(); + } +} +static inline struct LDKCOption_PaymentFailureReasonZ CResult_COption_PaymentFailureReasonZDecodeErrorZ_get_ok(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return PaymentFailureReason_clone(&*owner->contents.result); + return COption_PaymentFailureReasonZ_clone(&*owner->contents.result); } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentFailureReasonDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_PaymentFailureReasonDecodeErrorZ* owner_conv = (LDKCResult_PaymentFailureReasonDecodeErrorZ*)untag_ptr(owner); - jclass ret_conv = LDKPaymentFailureReason_to_java(env, CResult_PaymentFailureReasonDecodeErrorZ_get_ok(owner_conv)); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PaymentFailureReasonZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* owner_conv = (LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ*)untag_ptr(owner); + LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); + *ret_copy = CResult_COption_PaymentFailureReasonZDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -static inline struct LDKDecodeError CResult_PaymentFailureReasonDecodeErrorZ_get_err(LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_COption_PaymentFailureReasonZDecodeErrorZ_get_err(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return DecodeError_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentFailureReasonDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_PaymentFailureReasonDecodeErrorZ* owner_conv = (LDKCResult_PaymentFailureReasonDecodeErrorZ*)untag_ptr(owner); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PaymentFailureReasonZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* owner_conv = (LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ*)untag_ptr(owner); LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_PaymentFailureReasonDecodeErrorZ_get_err(owner_conv); + *ret_copy = CResult_COption_PaymentFailureReasonZDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -14916,35 +15614,6 @@ static inline LDKCVec_ClaimedHTLCZ CVec_ClaimedHTLCZ_clone(const LDKCVec_Claimed } return ret; } -static jclass LDKCOption_PaymentFailureReasonZ_Some_class = NULL; -static jmethodID LDKCOption_PaymentFailureReasonZ_Some_meth = NULL; -static jclass LDKCOption_PaymentFailureReasonZ_None_class = NULL; -static jmethodID LDKCOption_PaymentFailureReasonZ_None_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1PaymentFailureReasonZ_init (JNIEnv *env, jclass clz) { - LDKCOption_PaymentFailureReasonZ_Some_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_PaymentFailureReasonZ$Some")); - CHECK(LDKCOption_PaymentFailureReasonZ_Some_class != NULL); - LDKCOption_PaymentFailureReasonZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_PaymentFailureReasonZ_Some_class, "", "(Lorg/ldk/enums/PaymentFailureReason;)V"); - CHECK(LDKCOption_PaymentFailureReasonZ_Some_meth != NULL); - LDKCOption_PaymentFailureReasonZ_None_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_PaymentFailureReasonZ$None")); - CHECK(LDKCOption_PaymentFailureReasonZ_None_class != NULL); - LDKCOption_PaymentFailureReasonZ_None_meth = (*env)->GetMethodID(env, LDKCOption_PaymentFailureReasonZ_None_class, "", "()V"); - CHECK(LDKCOption_PaymentFailureReasonZ_None_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1PaymentFailureReasonZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKCOption_PaymentFailureReasonZ *obj = (LDKCOption_PaymentFailureReasonZ*)untag_ptr(ptr); - switch(obj->tag) { - case LDKCOption_PaymentFailureReasonZ_Some: { - jclass some_conv = LDKPaymentFailureReason_to_java(env, obj->some); - return (*env)->NewObject(env, LDKCOption_PaymentFailureReasonZ_Some_class, LDKCOption_PaymentFailureReasonZ_Some_meth, some_conv); - } - case LDKCOption_PaymentFailureReasonZ_None: { - return (*env)->NewObject(env, LDKCOption_PaymentFailureReasonZ_None_class, LDKCOption_PaymentFailureReasonZ_None_meth); - } - default: abort(); - } -} static jclass LDKBumpTransactionEvent_ChannelClose_class = NULL; static jmethodID LDKBumpTransactionEvent_ChannelClose_meth = NULL; static jclass LDKBumpTransactionEvent_HTLCResolution_class = NULL; @@ -15026,14 +15695,16 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBumpTransactionEvent_1re } static jclass LDKEvent_FundingGenerationReady_class = NULL; static jmethodID LDKEvent_FundingGenerationReady_meth = NULL; +static jclass LDKEvent_FundingTxBroadcastSafe_class = NULL; +static jmethodID LDKEvent_FundingTxBroadcastSafe_meth = NULL; static jclass LDKEvent_PaymentClaimable_class = NULL; static jmethodID LDKEvent_PaymentClaimable_meth = NULL; static jclass LDKEvent_PaymentClaimed_class = NULL; static jmethodID LDKEvent_PaymentClaimed_meth = NULL; static jclass LDKEvent_ConnectionNeeded_class = NULL; static jmethodID LDKEvent_ConnectionNeeded_meth = NULL; -static jclass LDKEvent_InvoiceRequestFailed_class = NULL; -static jmethodID LDKEvent_InvoiceRequestFailed_meth = NULL; +static jclass LDKEvent_InvoiceReceived_class = NULL; +static jmethodID LDKEvent_InvoiceReceived_meth = NULL; static jclass LDKEvent_PaymentSent_class = NULL; static jmethodID LDKEvent_PaymentSent_meth = NULL; static jclass LDKEvent_PaymentFailed_class = NULL; @@ -15068,12 +15739,21 @@ static jclass LDKEvent_HTLCHandlingFailed_class = NULL; static jmethodID LDKEvent_HTLCHandlingFailed_meth = NULL; static jclass LDKEvent_BumpTransaction_class = NULL; static jmethodID LDKEvent_BumpTransaction_meth = NULL; +static jclass LDKEvent_OnionMessageIntercepted_class = NULL; +static jmethodID LDKEvent_OnionMessageIntercepted_meth = NULL; +static jclass LDKEvent_OnionMessagePeerConnected_class = NULL; +static jmethodID LDKEvent_OnionMessagePeerConnected_meth = NULL; JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *env, jclass clz) { LDKEvent_FundingGenerationReady_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$FundingGenerationReady")); CHECK(LDKEvent_FundingGenerationReady_class != NULL); LDKEvent_FundingGenerationReady_meth = (*env)->GetMethodID(env, LDKEvent_FundingGenerationReady_class, "", "(J[BJ[B[B)V"); CHECK(LDKEvent_FundingGenerationReady_meth != NULL); + LDKEvent_FundingTxBroadcastSafe_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$FundingTxBroadcastSafe")); + CHECK(LDKEvent_FundingTxBroadcastSafe_class != NULL); + LDKEvent_FundingTxBroadcastSafe_meth = (*env)->GetMethodID(env, LDKEvent_FundingTxBroadcastSafe_class, "", "(J[BJ[BJ)V"); + CHECK(LDKEvent_FundingTxBroadcastSafe_meth != NULL); LDKEvent_PaymentClaimable_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentClaimable")); CHECK(LDKEvent_PaymentClaimable_class != NULL); @@ -15082,18 +15762,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *en LDKEvent_PaymentClaimed_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentClaimed")); CHECK(LDKEvent_PaymentClaimed_class != NULL); - LDKEvent_PaymentClaimed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentClaimed_class, "", "([B[BJJ[JJ)V"); + LDKEvent_PaymentClaimed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentClaimed_class, "", "([B[BJJ[JJJ)V"); CHECK(LDKEvent_PaymentClaimed_meth != NULL); LDKEvent_ConnectionNeeded_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$ConnectionNeeded")); CHECK(LDKEvent_ConnectionNeeded_class != NULL); LDKEvent_ConnectionNeeded_meth = (*env)->GetMethodID(env, LDKEvent_ConnectionNeeded_class, "", "([B[J)V"); CHECK(LDKEvent_ConnectionNeeded_meth != NULL); - LDKEvent_InvoiceRequestFailed_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$InvoiceRequestFailed")); - CHECK(LDKEvent_InvoiceRequestFailed_class != NULL); - LDKEvent_InvoiceRequestFailed_meth = (*env)->GetMethodID(env, LDKEvent_InvoiceRequestFailed_class, "", "([B)V"); - CHECK(LDKEvent_InvoiceRequestFailed_meth != NULL); + LDKEvent_InvoiceReceived_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$InvoiceReceived")); + CHECK(LDKEvent_InvoiceReceived_class != NULL); + LDKEvent_InvoiceReceived_meth = (*env)->GetMethodID(env, LDKEvent_InvoiceReceived_class, "", "([BJJJ)V"); + CHECK(LDKEvent_InvoiceReceived_meth != NULL); LDKEvent_PaymentSent_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentSent")); CHECK(LDKEvent_PaymentSent_class != NULL); @@ -15102,7 +15782,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *en LDKEvent_PaymentFailed_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentFailed")); CHECK(LDKEvent_PaymentFailed_class != NULL); - LDKEvent_PaymentFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentFailed_class, "", "([B[BJ)V"); + LDKEvent_PaymentFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentFailed_class, "", "([BJJ)V"); CHECK(LDKEvent_PaymentFailed_meth != NULL); LDKEvent_PaymentPathSuccessful_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentPathSuccessful")); @@ -15162,12 +15842,12 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *en LDKEvent_DiscardFunding_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$DiscardFunding")); CHECK(LDKEvent_DiscardFunding_class != NULL); - LDKEvent_DiscardFunding_meth = (*env)->GetMethodID(env, LDKEvent_DiscardFunding_class, "", "(J[B)V"); + LDKEvent_DiscardFunding_meth = (*env)->GetMethodID(env, LDKEvent_DiscardFunding_class, "", "(JJ)V"); CHECK(LDKEvent_DiscardFunding_meth != NULL); LDKEvent_OpenChannelRequest_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$OpenChannelRequest")); CHECK(LDKEvent_OpenChannelRequest_class != NULL); - LDKEvent_OpenChannelRequest_meth = (*env)->GetMethodID(env, LDKEvent_OpenChannelRequest_class, "", "(J[BJJJ)V"); + LDKEvent_OpenChannelRequest_meth = (*env)->GetMethodID(env, LDKEvent_OpenChannelRequest_class, "", "(J[BJJJZJ)V"); CHECK(LDKEvent_OpenChannelRequest_meth != NULL); LDKEvent_HTLCHandlingFailed_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$HTLCHandlingFailed")); @@ -15179,6 +15859,16 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *en CHECK(LDKEvent_BumpTransaction_class != NULL); LDKEvent_BumpTransaction_meth = (*env)->GetMethodID(env, LDKEvent_BumpTransaction_class, "", "(J)V"); CHECK(LDKEvent_BumpTransaction_meth != NULL); + LDKEvent_OnionMessageIntercepted_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$OnionMessageIntercepted")); + CHECK(LDKEvent_OnionMessageIntercepted_class != NULL); + LDKEvent_OnionMessageIntercepted_meth = (*env)->GetMethodID(env, LDKEvent_OnionMessageIntercepted_class, "", "([BJ)V"); + CHECK(LDKEvent_OnionMessageIntercepted_meth != NULL); + LDKEvent_OnionMessagePeerConnected_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$OnionMessagePeerConnected")); + CHECK(LDKEvent_OnionMessagePeerConnected_class != NULL); + LDKEvent_OnionMessagePeerConnected_meth = (*env)->GetMethodID(env, LDKEvent_OnionMessagePeerConnected_class, "", "([B)V"); + CHECK(LDKEvent_OnionMessagePeerConnected_meth != NULL); } JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -15198,6 +15888,25 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN (*env)->SetByteArrayRegion(env, user_channel_id_arr, 0, 16, obj->funding_generation_ready.user_channel_id.le_bytes); return (*env)->NewObject(env, LDKEvent_FundingGenerationReady_class, LDKEvent_FundingGenerationReady_meth, temporary_channel_id_ref, counterparty_node_id_arr, channel_value_satoshis_conv, output_script_arr, user_channel_id_arr); } + case LDKEvent_FundingTxBroadcastSafe: { + LDKChannelId channel_id_var = obj->funding_tx_broadcast_safe.channel_id; + int64_t channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); + channel_id_ref = tag_ptr(channel_id_var.inner, false); + int8_tArray user_channel_id_arr = (*env)->NewByteArray(env, 16); + (*env)->SetByteArrayRegion(env, user_channel_id_arr, 0, 16, obj->funding_tx_broadcast_safe.user_channel_id.le_bytes); + LDKOutPoint funding_txo_var = obj->funding_tx_broadcast_safe.funding_txo; + int64_t funding_txo_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var); + funding_txo_ref = tag_ptr(funding_txo_var.inner, false); + int8_tArray counterparty_node_id_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, counterparty_node_id_arr, 0, 33, obj->funding_tx_broadcast_safe.counterparty_node_id.compressed_form); + LDKChannelId former_temporary_channel_id_var = obj->funding_tx_broadcast_safe.former_temporary_channel_id; + int64_t former_temporary_channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(former_temporary_channel_id_var); + former_temporary_channel_id_ref = tag_ptr(former_temporary_channel_id_var.inner, false); + return (*env)->NewObject(env, LDKEvent_FundingTxBroadcastSafe_class, LDKEvent_FundingTxBroadcastSafe_meth, channel_id_ref, user_channel_id_arr, funding_txo_ref, counterparty_node_id_arr, former_temporary_channel_id_ref); + } case LDKEvent_PaymentClaimable: { int8_tArray receiver_node_id_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, receiver_node_id_arr, 0, 33, obj->payment_claimable.receiver_node_id.compressed_form); @@ -15238,7 +15947,11 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN } (*env)->ReleasePrimitiveArrayCritical(env, htlcs_arr, htlcs_arr_ptr, 0); int64_t sender_intended_total_msat_ref = tag_ptr(&obj->payment_claimed.sender_intended_total_msat, false); - return (*env)->NewObject(env, LDKEvent_PaymentClaimed_class, LDKEvent_PaymentClaimed_meth, receiver_node_id_arr, payment_hash_arr, amount_msat_conv, purpose_ref, htlcs_arr, sender_intended_total_msat_ref); + LDKRecipientOnionFields onion_fields_var = obj->payment_claimed.onion_fields; + int64_t onion_fields_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(onion_fields_var); + onion_fields_ref = tag_ptr(onion_fields_var.inner, false); + return (*env)->NewObject(env, LDKEvent_PaymentClaimed_class, LDKEvent_PaymentClaimed_meth, receiver_node_id_arr, payment_hash_arr, amount_msat_conv, purpose_ref, htlcs_arr, sender_intended_total_msat_ref, onion_fields_ref); } case LDKEvent_ConnectionNeeded: { int8_tArray node_id_arr = (*env)->NewByteArray(env, 33); @@ -15254,10 +15967,19 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN (*env)->ReleasePrimitiveArrayCritical(env, addresses_arr, addresses_arr_ptr, 0); return (*env)->NewObject(env, LDKEvent_ConnectionNeeded_class, LDKEvent_ConnectionNeeded_meth, node_id_arr, addresses_arr); } - case LDKEvent_InvoiceRequestFailed: { + case LDKEvent_InvoiceReceived: { int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->invoice_request_failed.payment_id.data); - return (*env)->NewObject(env, LDKEvent_InvoiceRequestFailed_class, LDKEvent_InvoiceRequestFailed_meth, payment_id_arr); + (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->invoice_received.payment_id.data); + LDKBolt12Invoice invoice_var = obj->invoice_received.invoice; + int64_t invoice_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_var); + invoice_ref = tag_ptr(invoice_var.inner, false); + int64_t context_ref = tag_ptr(&obj->invoice_received.context, false); + LDKResponder responder_var = obj->invoice_received.responder; + int64_t responder_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(responder_var); + responder_ref = tag_ptr(responder_var.inner, false); + return (*env)->NewObject(env, LDKEvent_InvoiceReceived_class, LDKEvent_InvoiceReceived_meth, payment_id_arr, invoice_ref, context_ref, responder_ref); } case LDKEvent_PaymentSent: { int64_t payment_id_ref = tag_ptr(&obj->payment_sent.payment_id, false); @@ -15271,10 +15993,9 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN case LDKEvent_PaymentFailed: { int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_failed.payment_id.data); - int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_failed.payment_hash.data); + int64_t payment_hash_ref = tag_ptr(&obj->payment_failed.payment_hash, false); int64_t reason_ref = tag_ptr(&obj->payment_failed.reason, false); - return (*env)->NewObject(env, LDKEvent_PaymentFailed_class, LDKEvent_PaymentFailed_meth, payment_id_arr, payment_hash_arr, reason_ref); + return (*env)->NewObject(env, LDKEvent_PaymentFailed_class, LDKEvent_PaymentFailed_meth, payment_id_arr, payment_hash_ref, reason_ref); } case LDKEvent_PaymentPathSuccessful: { int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); @@ -15429,10 +16150,8 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN int64_t channel_id_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); channel_id_ref = tag_ptr(channel_id_var.inner, false); - LDKTransaction transaction_var = obj->discard_funding.transaction; - int8_tArray transaction_arr = (*env)->NewByteArray(env, transaction_var.datalen); - (*env)->SetByteArrayRegion(env, transaction_arr, 0, transaction_var.datalen, transaction_var.data); - return (*env)->NewObject(env, LDKEvent_DiscardFunding_class, LDKEvent_DiscardFunding_meth, channel_id_ref, transaction_arr); + int64_t funding_info_ref = tag_ptr(&obj->discard_funding.funding_info, false); + return (*env)->NewObject(env, LDKEvent_DiscardFunding_class, LDKEvent_DiscardFunding_meth, channel_id_ref, funding_info_ref); } case LDKEvent_OpenChannelRequest: { LDKChannelId temporary_channel_id_var = obj->open_channel_request.temporary_channel_id; @@ -15447,7 +16166,12 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN int64_t channel_type_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_var); channel_type_ref = tag_ptr(channel_type_var.inner, false); - return (*env)->NewObject(env, LDKEvent_OpenChannelRequest_class, LDKEvent_OpenChannelRequest_meth, temporary_channel_id_ref, counterparty_node_id_arr, funding_satoshis_conv, push_msat_conv, channel_type_ref); + jboolean is_announced_conv = obj->open_channel_request.is_announced; + LDKChannelParameters params_var = obj->open_channel_request.params; + int64_t params_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_var); + params_ref = tag_ptr(params_var.inner, false); + return (*env)->NewObject(env, LDKEvent_OpenChannelRequest_class, LDKEvent_OpenChannelRequest_meth, temporary_channel_id_ref, counterparty_node_id_arr, funding_satoshis_conv, push_msat_conv, channel_type_ref, is_announced_conv, params_ref); } case LDKEvent_HTLCHandlingFailed: { LDKChannelId prev_channel_id_var = obj->htlc_handling_failed.prev_channel_id; @@ -15461,6 +16185,20 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN int64_t bump_transaction_ref = tag_ptr(&obj->bump_transaction, false); return (*env)->NewObject(env, LDKEvent_BumpTransaction_class, LDKEvent_BumpTransaction_meth, bump_transaction_ref); } + case LDKEvent_OnionMessageIntercepted: { + int8_tArray peer_node_id_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, peer_node_id_arr, 0, 33, obj->onion_message_intercepted.peer_node_id.compressed_form); + LDKOnionMessage message_var = obj->onion_message_intercepted.message; + int64_t message_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_var); + message_ref = tag_ptr(message_var.inner, false); + return (*env)->NewObject(env, LDKEvent_OnionMessageIntercepted_class, LDKEvent_OnionMessageIntercepted_meth, peer_node_id_arr, message_ref); + } + case LDKEvent_OnionMessagePeerConnected: { + int8_tArray peer_node_id_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, peer_node_id_arr, 0, 33, obj->onion_message_peer_connected.peer_node_id.compressed_form); + return (*env)->NewObject(env, LDKEvent_OnionMessagePeerConnected_class, LDKEvent_OnionMessagePeerConnected_meth, peer_node_id_arr); + } default: abort(); } } @@ -15517,6 +16255,39 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDec return ret_ref; } +static inline struct LDKNonce CResult_NonceDecodeErrorZ_get_ok(LDKCResult_NonceDecodeErrorZ *NONNULL_PTR owner){ + LDKNonce ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonceDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NonceDecodeErrorZ* owner_conv = (LDKCResult_NonceDecodeErrorZ*)untag_ptr(owner); + LDKNonce ret_var = CResult_NonceDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_NonceDecodeErrorZ_get_err(LDKCResult_NonceDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonceDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NonceDecodeErrorZ* owner_conv = (LDKCResult_NonceDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_NonceDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline LDKCVec_RouteHintHopZ CVec_RouteHintHopZ_clone(const LDKCVec_RouteHintHopZ *orig) { + LDKCVec_RouteHintHopZ ret = { .data = MALLOC(sizeof(LDKRouteHintHop) * orig->datalen, "LDKCVec_RouteHintHopZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = RouteHintHop_clone(&orig->data[i]); + } + return ret; +} static jclass LDKBolt11ParseError_Bech32Error_class = NULL; static jmethodID LDKBolt11ParseError_Bech32Error_meth = NULL; static jclass LDKBolt11ParseError_ParseAmountError_class = NULL; @@ -16051,6 +16822,32 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BigSizeDecodeError return ret_ref; } +static inline struct LDKUntrustedString CResult_UntrustedStringDecodeErrorZ_get_ok(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR owner){ + LDKUntrustedString ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UntrustedStringDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_UntrustedStringDecodeErrorZ* owner_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(owner); + LDKUntrustedString ret_var = CResult_UntrustedStringDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_UntrustedStringDecodeErrorZ_get_err(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UntrustedStringDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_UntrustedStringDecodeErrorZ* owner_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_UntrustedStringDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline struct LDKHostname CResult_HostnameDecodeErrorZ_get_ok(LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR owner){ LDKHostname ret = *owner->contents.result; ret.is_owned = false; @@ -16126,32 +16923,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenL return ret_ref; } -static inline struct LDKUntrustedString CResult_UntrustedStringDecodeErrorZ_get_ok(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR owner){ - LDKUntrustedString ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UntrustedStringDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_UntrustedStringDecodeErrorZ* owner_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(owner); - LDKUntrustedString ret_var = CResult_UntrustedStringDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline struct LDKDecodeError CResult_UntrustedStringDecodeErrorZ_get_err(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UntrustedStringDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_UntrustedStringDecodeErrorZ* owner_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_UntrustedStringDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - static inline struct LDKChannelId CResult_ChannelIdDecodeErrorZ_get_ok(LDKCResult_ChannelIdDecodeErrorZ *NONNULL_PTR owner){ LDKChannelId ret = *owner->contents.result; ret.is_owned = false; @@ -16197,6 +16968,62 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1_1u832u16Z_1get_1b return ret_conv; } +static inline struct LDKBlindedPayInfo CResult_BlindedPayInfoDecodeErrorZ_get_ok(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR owner){ + LDKBlindedPayInfo ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_BlindedPayInfoDecodeErrorZ* owner_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(owner); + LDKBlindedPayInfo ret_var = CResult_BlindedPayInfoDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_BlindedPayInfoDecodeErrorZ_get_err(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_BlindedPayInfoDecodeErrorZ* owner_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_BlindedPayInfoDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKBlindedPaymentPath CResult_BlindedPaymentPathNoneZ_get_ok(LDKCResult_BlindedPaymentPathNoneZ *NONNULL_PTR owner){ + LDKBlindedPaymentPath ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPaymentPathNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_BlindedPaymentPathNoneZ* owner_conv = (LDKCResult_BlindedPaymentPathNoneZ*)untag_ptr(owner); + LDKBlindedPaymentPath ret_var = CResult_BlindedPaymentPathNoneZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline void CResult_BlindedPaymentPathNoneZ_get_err(LDKCResult_BlindedPaymentPathNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPaymentPathNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_BlindedPaymentPathNoneZ* owner_conv = (LDKCResult_BlindedPaymentPathNoneZ*)untag_ptr(owner); + CResult_BlindedPaymentPathNoneZ_get_err(owner_conv); +} + +static inline LDKCVec_PaymentForwardNodeZ CVec_PaymentForwardNodeZ_clone(const LDKCVec_PaymentForwardNodeZ *orig) { + LDKCVec_PaymentForwardNodeZ ret = { .data = MALLOC(sizeof(LDKPaymentForwardNode) * orig->datalen, "LDKCVec_PaymentForwardNodeZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = PaymentForwardNode_clone(&orig->data[i]); + } + return ret; +} static inline struct LDKPaymentRelay CResult_PaymentRelayDecodeErrorZ_get_ok(LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR owner){ LDKPaymentRelay ret = *owner->contents.result; ret.is_owned = false; @@ -16351,85 +17178,61 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12RefundContex return ret_ref; } -static inline struct LDKStr CResult_StrSecp256k1ErrorZ_get_ok(LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_CResult_1StrSecp256k1ErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_StrSecp256k1ErrorZ* owner_conv = (LDKCResult_StrSecp256k1ErrorZ*)untag_ptr(owner); - LDKStr ret_str = CResult_StrSecp256k1ErrorZ_get_ok(owner_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - return ret_conv; -} - -static inline enum LDKSecp256k1Error CResult_StrSecp256k1ErrorZ_get_err(LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; -} -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1StrSecp256k1ErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_StrSecp256k1ErrorZ* owner_conv = (LDKCResult_StrSecp256k1ErrorZ*)untag_ptr(owner); - jclass ret_conv = LDKSecp256k1Error_to_java(env, CResult_StrSecp256k1ErrorZ_get_err(owner_conv)); - return ret_conv; -} - -static inline struct LDKThirtyTwoBytes C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_a(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR owner){ - return ThirtyTwoBytes_clone(&owner->a); -} -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* owner_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(owner); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_a(owner_conv).data); - return ret_arr; -} - -static inline struct LDKRecipientOnionFields C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_b(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR owner){ - LDKRecipientOnionFields ret = owner->b; +static inline struct LDKResponder CResult_ResponderDecodeErrorZ_get_ok(LDKCResult_ResponderDecodeErrorZ *NONNULL_PTR owner){ + LDKResponder ret = *owner->contents.result; ret.is_owned = false; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* owner_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(owner); - LDKRecipientOnionFields ret_var = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_b(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ResponderDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_ResponderDecodeErrorZ* owner_conv = (LDKCResult_ResponderDecodeErrorZ*)untag_ptr(owner); + LDKResponder ret_var = CResult_ResponderDecodeErrorZ_get_ok(owner_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline struct LDKRouteParameters C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_c(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR owner){ - LDKRouteParameters ret = owner->c; - ret.is_owned = false; - return ret; +static inline struct LDKDecodeError CResult_ResponderDecodeErrorZ_get_err(LDKCResult_ResponderDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1get_1c(JNIEnv *env, jclass clz, int64_t owner) { - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* owner_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(owner); - LDKRouteParameters ret_var = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_c(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ResponderDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_ResponderDecodeErrorZ* owner_conv = (LDKCResult_ResponderDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ResponderDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_ok(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(&*owner->contents.result); +static jclass LDKCOption_MessageContextZ_Some_class = NULL; +static jmethodID LDKCOption_MessageContextZ_Some_meth = NULL; +static jclass LDKCOption_MessageContextZ_None_class = NULL; +static jmethodID LDKCOption_MessageContextZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1MessageContextZ_init (JNIEnv *env, jclass clz) { + LDKCOption_MessageContextZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_MessageContextZ$Some")); + CHECK(LDKCOption_MessageContextZ_Some_class != NULL); + LDKCOption_MessageContextZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_MessageContextZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_MessageContextZ_Some_meth != NULL); + LDKCOption_MessageContextZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_MessageContextZ$None")); + CHECK(LDKCOption_MessageContextZ_None_class != NULL); + LDKCOption_MessageContextZ_None_meth = (*env)->GetMethodID(env, LDKCOption_MessageContextZ_None_class, "", "()V"); + CHECK(LDKCOption_MessageContextZ_None_meth != NULL); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* owner_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(owner); - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ), "LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ"); - *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_ok(owner_conv); - return tag_ptr(ret_conv, true); -} - -static inline void CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_err(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; -} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* owner_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(owner); - CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_err(owner_conv); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1MessageContextZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_MessageContextZ *obj = (LDKCOption_MessageContextZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_MessageContextZ_Some: { + int64_t some_ref = tag_ptr(&obj->some, false); + return (*env)->NewObject(env, LDKCOption_MessageContextZ_Some_class, LDKCOption_MessageContextZ_Some_meth, some_ref); + } + case LDKCOption_MessageContextZ_None: { + return (*env)->NewObject(env, LDKCOption_MessageContextZ_None_class, LDKCOption_MessageContextZ_None_meth); + } + default: abort(); + } } - static inline struct LDKPublicKey C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_get_a(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *NONNULL_PTR owner){ return owner->a; } @@ -16674,7 +17477,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPeeledOnion_init (JNIE LDKPeeledOnion_Receive_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPeeledOnion$Receive")); CHECK(LDKPeeledOnion_Receive_class != NULL); - LDKPeeledOnion_Receive_meth = (*env)->GetMethodID(env, LDKPeeledOnion_Receive_class, "", "(J[BJ)V"); + LDKPeeledOnion_Receive_meth = (*env)->GetMethodID(env, LDKPeeledOnion_Receive_class, "", "(JJJ)V"); CHECK(LDKPeeledOnion_Receive_meth != NULL); } JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPeeledOnion_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { @@ -16690,13 +17493,12 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPeeledOnion_1ref_1from_1 } case LDKPeeledOnion_Receive: { int64_t _0_ref = tag_ptr(&obj->receive._0, false); - int8_tArray _1_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, _1_arr, 0, 32, obj->receive._1.data); - LDKBlindedPath _2_var = obj->receive._2; + int64_t _1_ref = tag_ptr(&obj->receive._1, false); + LDKBlindedMessagePath _2_var = obj->receive._2; int64_t _2_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(_2_var); _2_ref = tag_ptr(_2_var.inner, false); - return (*env)->NewObject(env, LDKPeeledOnion_Receive_class, LDKPeeledOnion_Receive_meth, _0_ref, _1_arr, _2_ref); + return (*env)->NewObject(env, LDKPeeledOnion_Receive_class, LDKPeeledOnion_Receive_meth, _0_ref, _1_ref, _2_ref); } default: abort(); } @@ -16776,104 +17578,111 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SendSuccessSendErr return ret_ref; } -static inline struct LDKBlindedPath CResult_BlindedPathNoneZ_get_ok(LDKCResult_BlindedPathNoneZ *NONNULL_PTR owner){ - LDKBlindedPath ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_BlindedPathNoneZ* owner_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(owner); - LDKBlindedPath ret_var = CResult_BlindedPathNoneZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline void CResult_BlindedPathNoneZ_get_err(LDKCResult_BlindedPathNoneZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; -} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_BlindedPathNoneZ* owner_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(owner); - CResult_BlindedPathNoneZ_get_err(owner_conv); -} - -static inline struct LDKC2Tuple_BlindedPayInfoBlindedPathZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_get_ok(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR owner){ +static inline void CResult_NoneSendErrorZ_get_ok(LDKCResult_NoneSendErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return C2Tuple_BlindedPayInfoBlindedPathZ_clone(&*owner->contents.result); + return *owner->contents.result; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlindedPayInfoBlindedPathZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* owner_conv = (LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ*)untag_ptr(owner); - LDKC2Tuple_BlindedPayInfoBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ"); - *ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_get_ok(owner_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NoneSendErrorZ* owner_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(owner); + CResult_NoneSendErrorZ_get_ok(owner_conv); } -static inline void CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_get_err(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR owner){ +static inline struct LDKSendError CResult_NoneSendErrorZ_get_err(LDKCResult_NoneSendErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); - return *owner->contents.err; + return SendError_clone(&*owner->contents.err); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlindedPayInfoBlindedPathZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* owner_conv = (LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ*)untag_ptr(owner); - CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_get_err(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NoneSendErrorZ* owner_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(owner); + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = CResult_NoneSendErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -static inline LDKCVec_ForwardNodeZ CVec_ForwardNodeZ_clone(const LDKCVec_ForwardNodeZ *orig) { - LDKCVec_ForwardNodeZ ret = { .data = MALLOC(sizeof(LDKForwardNode) * orig->datalen, "LDKCVec_ForwardNodeZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = ForwardNode_clone(&orig->data[i]); - } - return ret; -} -static inline struct LDKBlindedPath CResult_BlindedPathDecodeErrorZ_get_ok(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR owner){ - LDKBlindedPath ret = *owner->contents.result; +static inline struct LDKBlindedHop CResult_BlindedHopDecodeErrorZ_get_ok(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){ + LDKBlindedHop ret = *owner->contents.result; ret.is_owned = false; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_BlindedPathDecodeErrorZ* owner_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(owner); - LDKBlindedPath ret_var = CResult_BlindedPathDecodeErrorZ_get_ok(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner); + LDKBlindedHop ret_var = CResult_BlindedHopDecodeErrorZ_get_ok(owner_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline struct LDKDecodeError CResult_BlindedPathDecodeErrorZ_get_err(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_BlindedHopDecodeErrorZ_get_err(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return DecodeError_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_BlindedPathDecodeErrorZ* owner_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(owner); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner); LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_BlindedPathDecodeErrorZ_get_err(owner_conv); + *ret_copy = CResult_BlindedHopDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline struct LDKBlindedHop CResult_BlindedHopDecodeErrorZ_get_ok(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){ - LDKBlindedHop ret = *owner->contents.result; +static inline LDKCVec_PhantomRouteHintsZ CVec_PhantomRouteHintsZ_clone(const LDKCVec_PhantomRouteHintsZ *orig) { + LDKCVec_PhantomRouteHintsZ ret = { .data = MALLOC(sizeof(LDKPhantomRouteHints) * orig->datalen, "LDKCVec_PhantomRouteHintsZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = PhantomRouteHints_clone(&orig->data[i]); + } + return ret; +} +static jclass LDKSignOrCreationError_SignError_class = NULL; +static jmethodID LDKSignOrCreationError_SignError_meth = NULL; +static jclass LDKSignOrCreationError_CreationError_class = NULL; +static jmethodID LDKSignOrCreationError_CreationError_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKSignOrCreationError_init (JNIEnv *env, jclass clz) { + LDKSignOrCreationError_SignError_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSignOrCreationError$SignError")); + CHECK(LDKSignOrCreationError_SignError_class != NULL); + LDKSignOrCreationError_SignError_meth = (*env)->GetMethodID(env, LDKSignOrCreationError_SignError_class, "", "()V"); + CHECK(LDKSignOrCreationError_SignError_meth != NULL); + LDKSignOrCreationError_CreationError_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSignOrCreationError$CreationError")); + CHECK(LDKSignOrCreationError_CreationError_class != NULL); + LDKSignOrCreationError_CreationError_meth = (*env)->GetMethodID(env, LDKSignOrCreationError_CreationError_class, "", "(Lorg/ldk/enums/CreationError;)V"); + CHECK(LDKSignOrCreationError_CreationError_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSignOrCreationError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKSignOrCreationError *obj = (LDKSignOrCreationError*)untag_ptr(ptr); + switch(obj->tag) { + case LDKSignOrCreationError_SignError: { + return (*env)->NewObject(env, LDKSignOrCreationError_SignError_class, LDKSignOrCreationError_SignError_meth); + } + case LDKSignOrCreationError_CreationError: { + jclass creation_error_conv = LDKCreationError_to_java(env, obj->creation_error); + return (*env)->NewObject(env, LDKSignOrCreationError_CreationError_class, LDKSignOrCreationError_CreationError_meth, creation_error_conv); + } + default: abort(); + } +} +static inline struct LDKBolt11Invoice CResult_Bolt11InvoiceSignOrCreationErrorZ_get_ok(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){ + LDKBolt11Invoice ret = *owner->contents.result; ret.is_owned = false; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner); - LDKBlindedHop ret_var = CResult_BlindedHopDecodeErrorZ_get_ok(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(owner); + LDKBolt11Invoice ret_var = CResult_Bolt11InvoiceSignOrCreationErrorZ_get_ok(owner_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline struct LDKDecodeError CResult_BlindedHopDecodeErrorZ_get_err(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKSignOrCreationError CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); + return SignOrCreationError_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_BlindedHopDecodeErrorZ_get_err(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(owner); + LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError"); + *ret_copy = CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -17955,55 +18764,142 @@ static inline LDKCVec_C2Tuple_OutPointChannelIdZZ CVec_C2Tuple_OutPointChannelId } return ret; } -static inline LDKCVec_MonitorUpdateIdZ CVec_MonitorUpdateIdZ_clone(const LDKCVec_MonitorUpdateIdZ *orig) { - LDKCVec_MonitorUpdateIdZ ret = { .data = MALLOC(sizeof(LDKMonitorUpdateId) * orig->datalen, "LDKCVec_MonitorUpdateIdZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = MonitorUpdateId_clone(&orig->data[i]); - } - return ret; -} -static inline struct LDKOutPoint C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR owner){ +static inline struct LDKOutPoint C2Tuple_OutPointCVec_u64ZZ_get_a(LDKC2Tuple_OutPointCVec_u64ZZ *NONNULL_PTR owner){ LDKOutPoint ret = owner->a; ret.is_owned = false; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* owner_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(owner); - LDKOutPoint ret_var = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1u64ZZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_OutPointCVec_u64ZZ* owner_conv = (LDKC2Tuple_OutPointCVec_u64ZZ*)untag_ptr(owner); + LDKOutPoint ret_var = C2Tuple_OutPointCVec_u64ZZ_get_a(owner_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline struct LDKCVec_MonitorUpdateIdZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR owner){ - return CVec_MonitorUpdateIdZ_clone(&owner->b); +static inline struct LDKCVec_u64Z C2Tuple_OutPointCVec_u64ZZ_get_b(LDKC2Tuple_OutPointCVec_u64ZZ *NONNULL_PTR owner){ + return CVec_u64Z_clone(&owner->b); } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* owner_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(owner); - LDKCVec_MonitorUpdateIdZ ret_var = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(owner_conv); +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1u64ZZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_OutPointCVec_u64ZZ* owner_conv = (LDKC2Tuple_OutPointCVec_u64ZZ*)untag_ptr(owner); + LDKCVec_u64Z ret_var = C2Tuple_OutPointCVec_u64ZZ_get_b(owner_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t r = 0; r < ret_var.datalen; r++) { - LDKMonitorUpdateId ret_conv_17_var = ret_var.data[r]; - int64_t ret_conv_17_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_17_var); - ret_conv_17_ref = tag_ptr(ret_conv_17_var.inner, ret_conv_17_var.is_owned); - ret_arr_ptr[r] = ret_conv_17_ref; + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; } (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); FREE(ret_var.data); return ret_arr; } -static inline LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_clone(const LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ *orig) { - LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ) * orig->datalen, "LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ clone bytes"), .datalen = orig->datalen }; +static inline LDKCVec_C2Tuple_OutPointCVec_u64ZZZ CVec_C2Tuple_OutPointCVec_u64ZZZ_clone(const LDKCVec_C2Tuple_OutPointCVec_u64ZZZ *orig) { + LDKCVec_C2Tuple_OutPointCVec_u64ZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_u64ZZ) * orig->datalen, "LDKCVec_C2Tuple_OutPointCVec_u64ZZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(&orig->data[i]); + ret.data[i] = C2Tuple_OutPointCVec_u64ZZ_clone(&orig->data[i]); } return ret; } +static inline struct LDKBlindedMessagePath CResult_BlindedMessagePathDecodeErrorZ_get_ok(LDKCResult_BlindedMessagePathDecodeErrorZ *NONNULL_PTR owner){ + LDKBlindedMessagePath ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_BlindedMessagePathDecodeErrorZ* owner_conv = (LDKCResult_BlindedMessagePathDecodeErrorZ*)untag_ptr(owner); + LDKBlindedMessagePath ret_var = CResult_BlindedMessagePathDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_BlindedMessagePathDecodeErrorZ_get_err(LDKCResult_BlindedMessagePathDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_BlindedMessagePathDecodeErrorZ* owner_conv = (LDKCResult_BlindedMessagePathDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_BlindedMessagePathDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKBlindedMessagePath CResult_BlindedMessagePathNoneZ_get_ok(LDKCResult_BlindedMessagePathNoneZ *NONNULL_PTR owner){ + LDKBlindedMessagePath ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_BlindedMessagePathNoneZ* owner_conv = (LDKCResult_BlindedMessagePathNoneZ*)untag_ptr(owner); + LDKBlindedMessagePath ret_var = CResult_BlindedMessagePathNoneZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline void CResult_BlindedMessagePathNoneZ_get_err(LDKCResult_BlindedMessagePathNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_BlindedMessagePathNoneZ* owner_conv = (LDKCResult_BlindedMessagePathNoneZ*)untag_ptr(owner); + CResult_BlindedMessagePathNoneZ_get_err(owner_conv); +} + +static inline struct LDKMessageContext CResult_MessageContextDecodeErrorZ_get_ok(LDKCResult_MessageContextDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return MessageContext_clone(&*owner->contents.result); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1MessageContextDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_MessageContextDecodeErrorZ* owner_conv = (LDKCResult_MessageContextDecodeErrorZ*)untag_ptr(owner); + LDKMessageContext *ret_copy = MALLOC(sizeof(LDKMessageContext), "LDKMessageContext"); + *ret_copy = CResult_MessageContextDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_MessageContextDecodeErrorZ_get_err(LDKCResult_MessageContextDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1MessageContextDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_MessageContextDecodeErrorZ* owner_conv = (LDKCResult_MessageContextDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_MessageContextDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKOffersContext CResult_OffersContextDecodeErrorZ_get_ok(LDKCResult_OffersContextDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return OffersContext_clone(&*owner->contents.result); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OffersContextDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_OffersContextDecodeErrorZ* owner_conv = (LDKCResult_OffersContextDecodeErrorZ*)untag_ptr(owner); + LDKOffersContext *ret_copy = MALLOC(sizeof(LDKOffersContext), "LDKOffersContext"); + *ret_copy = CResult_OffersContextDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_OffersContextDecodeErrorZ_get_err(LDKCResult_OffersContextDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OffersContextDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_OffersContextDecodeErrorZ* owner_conv = (LDKCResult_OffersContextDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_OffersContextDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + typedef struct LDKPersister_JCalls { atomic_size_t refcnt; JavaVM *vm; @@ -18213,7 +19109,7 @@ static void LDKPersist_JCalls_free(void* this_arg) { FREE(j_calls); } } -LDKChannelMonitorUpdateStatus persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_funding_outpoint, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) { +LDKChannelMonitorUpdateStatus persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_funding_outpoint, const LDKChannelMonitor * monitor) { LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -18226,18 +19122,14 @@ LDKChannelMonitorUpdateStatus persist_new_channel_LDKPersist_jcall(const void* t int64_t channel_funding_outpoint_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_funding_outpoint_var); channel_funding_outpoint_ref = tag_ptr(channel_funding_outpoint_var.inner, channel_funding_outpoint_var.is_owned); - LDKChannelMonitor data_var = *data; - int64_t data_ref = 0; - data_var = ChannelMonitor_clone(&data_var); - CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var); - data_ref = tag_ptr(data_var.inner, data_var.is_owned); - LDKMonitorUpdateId update_id_var = update_id; - int64_t update_id_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var); - update_id_ref = tag_ptr(update_id_var.inner, update_id_var.is_owned); + LDKChannelMonitor monitor_var = *monitor; + int64_t monitor_ref = 0; + monitor_var = ChannelMonitor_clone(&monitor_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_var); + monitor_ref = tag_ptr(monitor_var.inner, monitor_var.is_owned); jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - jclass ret = (*env)->CallObjectMethod(env, obj, j_calls->persist_new_channel_meth, channel_funding_outpoint_ref, data_ref, update_id_ref); + jclass ret = (*env)->CallObjectMethod(env, obj, j_calls->persist_new_channel_meth, channel_funding_outpoint_ref, monitor_ref); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); (*env)->FatalError(env, "A call to persist_new_channel in LDKPersist from rust threw an exception."); @@ -18248,7 +19140,7 @@ LDKChannelMonitorUpdateStatus persist_new_channel_LDKPersist_jcall(const void* t } return ret_conv; } -LDKChannelMonitorUpdateStatus update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_funding_outpoint, LDKChannelMonitorUpdate update, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) { +LDKChannelMonitorUpdateStatus update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_funding_outpoint, LDKChannelMonitorUpdate monitor_update, const LDKChannelMonitor * monitor) { LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -18261,22 +19153,18 @@ LDKChannelMonitorUpdateStatus update_persisted_channel_LDKPersist_jcall(const vo int64_t channel_funding_outpoint_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_funding_outpoint_var); channel_funding_outpoint_ref = tag_ptr(channel_funding_outpoint_var.inner, channel_funding_outpoint_var.is_owned); - LDKChannelMonitorUpdate update_var = update; - int64_t update_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var); - update_ref = tag_ptr(update_var.inner, update_var.is_owned); - LDKChannelMonitor data_var = *data; - int64_t data_ref = 0; - data_var = ChannelMonitor_clone(&data_var); - CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var); - data_ref = tag_ptr(data_var.inner, data_var.is_owned); - LDKMonitorUpdateId update_id_var = update_id; - int64_t update_id_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var); - update_id_ref = tag_ptr(update_id_var.inner, update_id_var.is_owned); + LDKChannelMonitorUpdate monitor_update_var = monitor_update; + int64_t monitor_update_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_update_var); + monitor_update_ref = tag_ptr(monitor_update_var.inner, monitor_update_var.is_owned); + LDKChannelMonitor monitor_var = *monitor; + int64_t monitor_ref = 0; + monitor_var = ChannelMonitor_clone(&monitor_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_var); + monitor_ref = tag_ptr(monitor_var.inner, monitor_var.is_owned); jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - jclass ret = (*env)->CallObjectMethod(env, obj, j_calls->update_persisted_channel_meth, channel_funding_outpoint_ref, update_ref, data_ref, update_id_ref); + jclass ret = (*env)->CallObjectMethod(env, obj, j_calls->update_persisted_channel_meth, channel_funding_outpoint_ref, monitor_update_ref, monitor_ref); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); (*env)->FatalError(env, "A call to update_persisted_channel in LDKPersist from rust threw an exception."); @@ -18322,9 +19210,9 @@ static inline LDKPersist LDKPersist_init (JNIEnv *env, jclass clz, jobject o) { atomic_init(&calls->refcnt, 1); DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->persist_new_channel_meth = (*env)->GetMethodID(env, c, "persist_new_channel", "(JJJ)Lorg/ldk/enums/ChannelMonitorUpdateStatus;"); + calls->persist_new_channel_meth = (*env)->GetMethodID(env, c, "persist_new_channel", "(JJ)Lorg/ldk/enums/ChannelMonitorUpdateStatus;"); CHECK(calls->persist_new_channel_meth != NULL); - calls->update_persisted_channel_meth = (*env)->GetMethodID(env, c, "update_persisted_channel", "(JJJJ)Lorg/ldk/enums/ChannelMonitorUpdateStatus;"); + calls->update_persisted_channel_meth = (*env)->GetMethodID(env, c, "update_persisted_channel", "(JJJ)Lorg/ldk/enums/ChannelMonitorUpdateStatus;"); CHECK(calls->update_persisted_channel_meth != NULL); calls->archive_persisted_channel_meth = (*env)->GetMethodID(env, c, "archive_persisted_channel", "(J)V"); CHECK(calls->archive_persisted_channel_meth != NULL); @@ -18343,7 +19231,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKPersist_1new(JNIEnv *env *res_ptr = LDKPersist_init(env, clz, o); return tag_ptr(res_ptr, true); } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Persist_1persist_1new_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_funding_outpoint, int64_t data, int64_t update_id) { +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Persist_1persist_1new_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_funding_outpoint, int64_t monitor) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr; @@ -18352,21 +19240,16 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Persist_1persist_1new_1chann channel_funding_outpoint_conv.is_owned = ptr_is_owned(channel_funding_outpoint); CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_funding_outpoint_conv); channel_funding_outpoint_conv = OutPoint_clone(&channel_funding_outpoint_conv); - LDKChannelMonitor data_conv; - data_conv.inner = untag_ptr(data); - data_conv.is_owned = ptr_is_owned(data); - CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv); - data_conv.is_owned = false; - LDKMonitorUpdateId update_id_conv; - update_id_conv.inner = untag_ptr(update_id); - update_id_conv.is_owned = ptr_is_owned(update_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv); - update_id_conv = MonitorUpdateId_clone(&update_id_conv); - jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, (this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_funding_outpoint_conv, &data_conv, update_id_conv)); + LDKChannelMonitor monitor_conv; + monitor_conv.inner = untag_ptr(monitor); + monitor_conv.is_owned = ptr_is_owned(monitor); + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_conv); + monitor_conv.is_owned = false; + jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, (this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_funding_outpoint_conv, &monitor_conv)); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Persist_1update_1persisted_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_funding_outpoint, int64_t update, int64_t data, int64_t update_id) { +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Persist_1update_1persisted_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_funding_outpoint, int64_t monitor_update, int64_t monitor) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr; @@ -18375,22 +19258,17 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Persist_1update_1persisted_1 channel_funding_outpoint_conv.is_owned = ptr_is_owned(channel_funding_outpoint); CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_funding_outpoint_conv); channel_funding_outpoint_conv = OutPoint_clone(&channel_funding_outpoint_conv); - LDKChannelMonitorUpdate update_conv; - update_conv.inner = untag_ptr(update); - update_conv.is_owned = ptr_is_owned(update); - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv); - update_conv = ChannelMonitorUpdate_clone(&update_conv); - LDKChannelMonitor data_conv; - data_conv.inner = untag_ptr(data); - data_conv.is_owned = ptr_is_owned(data); - CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv); - data_conv.is_owned = false; - LDKMonitorUpdateId update_id_conv; - update_id_conv.inner = untag_ptr(update_id); - update_id_conv.is_owned = ptr_is_owned(update_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv); - update_id_conv = MonitorUpdateId_clone(&update_id_conv); - jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, (this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_funding_outpoint_conv, update_conv, &data_conv, update_id_conv)); + LDKChannelMonitorUpdate monitor_update_conv; + monitor_update_conv.inner = untag_ptr(monitor_update); + monitor_update_conv.is_owned = ptr_is_owned(monitor_update); + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_update_conv); + monitor_update_conv = ChannelMonitorUpdate_clone(&monitor_update_conv); + LDKChannelMonitor monitor_conv; + monitor_conv.inner = untag_ptr(monitor); + monitor_conv.is_owned = ptr_is_owned(monitor); + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_conv); + monitor_conv.is_owned = false; + jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, (this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_funding_outpoint_conv, monitor_update_conv, &monitor_conv)); return ret_conv; } @@ -18966,7 +19844,7 @@ static void LDKEventHandler_JCalls_free(void* this_arg) { FREE(j_calls); } } -void handle_event_LDKEventHandler_jcall(const void* this_arg, LDKEvent event) { +LDKCResult_NoneReplayEventZ handle_event_LDKEventHandler_jcall(const void* this_arg, LDKEvent event) { LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -18980,14 +19858,19 @@ void handle_event_LDKEventHandler_jcall(const void* this_arg, LDKEvent event) { int64_t event_ref = tag_ptr(event_copy, true); jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - (*env)->CallVoidMethod(env, obj, j_calls->handle_event_meth, event_ref); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_event_meth, event_ref); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); (*env)->FatalError(env, "A call to handle_event in LDKEventHandler from rust threw an exception."); } + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_NoneReplayEventZ ret_conv = *(LDKCResult_NoneReplayEventZ*)(ret_ptr); + FREE(untag_ptr(ret)); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } + return ret_conv; } static void LDKEventHandler_JCalls_cloned(LDKEventHandler* new_obj) { LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) new_obj->this_arg; @@ -19000,7 +19883,7 @@ static inline LDKEventHandler LDKEventHandler_init (JNIEnv *env, jclass clz, job atomic_init(&calls->refcnt, 1); DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->handle_event_meth = (*env)->GetMethodID(env, c, "handle_event", "(J)V"); + calls->handle_event_meth = (*env)->GetMethodID(env, c, "handle_event", "(J)J"); CHECK(calls->handle_event_meth != NULL); LDKEventHandler ret = { @@ -19015,7 +19898,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKEventHandler_1new(JNIEnv *res_ptr = LDKEventHandler_init(env, clz, o); return tag_ptr(res_ptr, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventHandler_1handle_1event(JNIEnv *env, jclass clz, int64_t this_arg, int64_t event) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EventHandler_1handle_1event(JNIEnv *env, jclass clz, int64_t this_arg, int64_t event) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKEventHandler* this_arg_conv = (LDKEventHandler*)this_arg_ptr; @@ -19023,7 +19906,9 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventHandler_1handle_1event(JN CHECK_ACCESS(event_ptr); LDKEvent event_conv = *(LDKEvent*)(event_ptr); event_conv = Event_clone((LDKEvent*)untag_ptr(event)); - (this_arg_conv->handle_event)(this_arg_conv->this_arg, event_conv); + LDKCResult_NoneReplayEventZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneReplayEventZ), "LDKCResult_NoneReplayEventZ"); + *ret_conv = (this_arg_conv->handle_event)(this_arg_conv->this_arg, event_conv); + return tag_ptr(ret_conv, true); } typedef struct LDKEventsProvider_JCalls { @@ -20936,7 +21821,7 @@ static void LDKOffersMessageHandler_JCalls_free(void* this_arg) { FREE(j_calls); } } -LDKCOption_OffersMessageZ handle_message_LDKOffersMessageHandler_jcall(const void* this_arg, LDKOffersMessage message) { +LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ handle_message_LDKOffersMessageHandler_jcall(const void* this_arg, LDKOffersMessage message, LDKCOption_OffersContextZ context, LDKResponder responder) { LDKOffersMessageHandler_JCalls *j_calls = (LDKOffersMessageHandler_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -20948,23 +21833,30 @@ LDKCOption_OffersMessageZ handle_message_LDKOffersMessageHandler_jcall(const voi LDKOffersMessage *message_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); *message_copy = message; int64_t message_ref = tag_ptr(message_copy, true); + LDKCOption_OffersContextZ *context_copy = MALLOC(sizeof(LDKCOption_OffersContextZ), "LDKCOption_OffersContextZ"); + *context_copy = context; + int64_t context_ref = tag_ptr(context_copy, true); + LDKResponder responder_var = responder; + int64_t responder_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(responder_var); + responder_ref = tag_ptr(responder_var.inner, responder_var.is_owned); jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_message_meth, message_ref); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_message_meth, message_ref, context_ref, responder_ref); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); (*env)->FatalError(env, "A call to handle_message in LDKOffersMessageHandler from rust threw an exception."); } void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); - LDKCOption_OffersMessageZ ret_conv = *(LDKCOption_OffersMessageZ*)(ret_ptr); + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ ret_conv = *(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ*)(ret_ptr); FREE(untag_ptr(ret)); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } return ret_conv; } -LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ release_pending_messages_LDKOffersMessageHandler_jcall(const void* this_arg) { +LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ release_pending_messages_LDKOffersMessageHandler_jcall(const void* this_arg) { LDKOffersMessageHandler_JCalls *j_calls = (LDKOffersMessageHandler_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -20980,20 +21872,20 @@ LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ release_pending_messages_L (*env)->ExceptionDescribe(env); (*env)->FatalError(env, "A call to release_pending_messages in LDKOffersMessageHandler from rust threw an exception."); } - LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ ret_constr; + LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ ret_constr; ret_constr.datalen = (*env)->GetArrayLength(env, ret); if (ret_constr.datalen > 0) - ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC3Tuple_OffersMessageDestinationBlindedPathZ), "LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ Elements"); + ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_OffersMessageMessageSendInstructionsZ), "LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ Elements"); else ret_constr.data = NULL; int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL); - for (size_t x = 0; x < ret_constr.datalen; x++) { - int64_t ret_conv_49 = ret_vals[x]; - void* ret_conv_49_ptr = untag_ptr(ret_conv_49); - CHECK_ACCESS(ret_conv_49_ptr); - LDKC3Tuple_OffersMessageDestinationBlindedPathZ ret_conv_49_conv = *(LDKC3Tuple_OffersMessageDestinationBlindedPathZ*)(ret_conv_49_ptr); - FREE(untag_ptr(ret_conv_49)); - ret_constr.data[x] = ret_conv_49_conv; + for (size_t w = 0; w < ret_constr.datalen; w++) { + int64_t ret_conv_48 = ret_vals[w]; + void* ret_conv_48_ptr = untag_ptr(ret_conv_48); + CHECK_ACCESS(ret_conv_48_ptr); + LDKC2Tuple_OffersMessageMessageSendInstructionsZ ret_conv_48_conv = *(LDKC2Tuple_OffersMessageMessageSendInstructionsZ*)(ret_conv_48_ptr); + FREE(untag_ptr(ret_conv_48)); + ret_constr.data[w] = ret_conv_48_conv; } (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0); if (get_jenv_res == JNI_EDETACHED) { @@ -21012,7 +21904,7 @@ static inline LDKOffersMessageHandler LDKOffersMessageHandler_init (JNIEnv *env, atomic_init(&calls->refcnt, 1); DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->handle_message_meth = (*env)->GetMethodID(env, c, "handle_message", "(J)J"); + calls->handle_message_meth = (*env)->GetMethodID(env, c, "handle_message", "(JJJ)J"); CHECK(calls->handle_message_meth != NULL); calls->release_pending_messages_meth = (*env)->GetMethodID(env, c, "release_pending_messages", "()[J"); CHECK(calls->release_pending_messages_meth != NULL); @@ -21030,7 +21922,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKOffersMessageHandler_1ne *res_ptr = LDKOffersMessageHandler_init(env, clz, o); return tag_ptr(res_ptr, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessageHandler_1handle_1message(JNIEnv *env, jclass clz, int64_t this_arg, int64_t message) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessageHandler_1handle_1message(JNIEnv *env, jclass clz, int64_t this_arg, int64_t message, int64_t context, int64_t responder) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKOffersMessageHandler* this_arg_conv = (LDKOffersMessageHandler*)this_arg_ptr; @@ -21038,8 +21930,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessageHandler_1handl CHECK_ACCESS(message_ptr); LDKOffersMessage message_conv = *(LDKOffersMessage*)(message_ptr); message_conv = OffersMessage_clone((LDKOffersMessage*)untag_ptr(message)); - LDKCOption_OffersMessageZ *ret_copy = MALLOC(sizeof(LDKCOption_OffersMessageZ), "LDKCOption_OffersMessageZ"); - *ret_copy = (this_arg_conv->handle_message)(this_arg_conv->this_arg, message_conv); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKCOption_OffersContextZ context_conv = *(LDKCOption_OffersContextZ*)(context_ptr); + context_conv = COption_OffersContextZ_clone((LDKCOption_OffersContextZ*)untag_ptr(context)); + LDKResponder responder_conv; + responder_conv.inner = untag_ptr(responder); + responder_conv.is_owned = ptr_is_owned(responder); + CHECK_INNER_FIELD_ACCESS_OR_NULL(responder_conv); + responder_conv = Responder_clone(&responder_conv); + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ), "LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ"); + *ret_copy = (this_arg_conv->handle_message)(this_arg_conv->this_arg, message_conv, context_conv, responder_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -21048,14 +21949,215 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_OffersMessageHandler_1 void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKOffersMessageHandler* this_arg_conv = (LDKOffersMessageHandler*)this_arg_ptr; - LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ ret_var = (this_arg_conv->release_pending_messages)(this_arg_conv->this_arg); + LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ ret_var = (this_arg_conv->release_pending_messages)(this_arg_conv->this_arg); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t x = 0; x < ret_var.datalen; x++) { - LDKC3Tuple_OffersMessageDestinationBlindedPathZ* ret_conv_49_conv = MALLOC(sizeof(LDKC3Tuple_OffersMessageDestinationBlindedPathZ), "LDKC3Tuple_OffersMessageDestinationBlindedPathZ"); - *ret_conv_49_conv = ret_var.data[x]; - ret_arr_ptr[x] = tag_ptr(ret_conv_49_conv, true); + for (size_t w = 0; w < ret_var.datalen; w++) { + LDKC2Tuple_OffersMessageMessageSendInstructionsZ* ret_conv_48_conv = MALLOC(sizeof(LDKC2Tuple_OffersMessageMessageSendInstructionsZ), "LDKC2Tuple_OffersMessageMessageSendInstructionsZ"); + *ret_conv_48_conv = ret_var.data[w]; + ret_arr_ptr[w] = tag_ptr(ret_conv_48_conv, true); + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; +} + +typedef struct LDKAsyncPaymentsMessageHandler_JCalls { + atomic_size_t refcnt; + JavaVM *vm; + jweak o; + jmethodID held_htlc_available_meth; + jmethodID release_held_htlc_meth; + jmethodID release_pending_messages_meth; +} LDKAsyncPaymentsMessageHandler_JCalls; +static void LDKAsyncPaymentsMessageHandler_JCalls_free(void* this_arg) { + LDKAsyncPaymentsMessageHandler_JCalls *j_calls = (LDKAsyncPaymentsMessageHandler_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + JNIEnv *env; + jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK); + } else { + DO_ASSERT(get_jenv_res == JNI_OK); + } + (*env)->DeleteWeakGlobalRef(env, j_calls->o); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } + FREE(j_calls); + } +} +LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ held_htlc_available_LDKAsyncPaymentsMessageHandler_jcall(const void* this_arg, LDKHeldHtlcAvailable message, LDKResponder responder) { + LDKAsyncPaymentsMessageHandler_JCalls *j_calls = (LDKAsyncPaymentsMessageHandler_JCalls*) this_arg; + JNIEnv *env; + jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK); + } else { + DO_ASSERT(get_jenv_res == JNI_OK); + } + LDKHeldHtlcAvailable message_var = message; + int64_t message_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_var); + message_ref = tag_ptr(message_var.inner, message_var.is_owned); + LDKResponder responder_var = responder; + int64_t responder_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(responder_var); + responder_ref = tag_ptr(responder_var.inner, responder_var.is_owned); + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->held_htlc_available_meth, message_ref, responder_ref); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to held_htlc_available in LDKAsyncPaymentsMessageHandler from rust threw an exception."); + } + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ ret_conv = *(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ*)(ret_ptr); + FREE(untag_ptr(ret)); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } + return ret_conv; +} +void release_held_htlc_LDKAsyncPaymentsMessageHandler_jcall(const void* this_arg, LDKReleaseHeldHtlc message) { + LDKAsyncPaymentsMessageHandler_JCalls *j_calls = (LDKAsyncPaymentsMessageHandler_JCalls*) this_arg; + JNIEnv *env; + jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK); + } else { + DO_ASSERT(get_jenv_res == JNI_OK); + } + LDKReleaseHeldHtlc message_var = message; + int64_t message_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_var); + message_ref = tag_ptr(message_var.inner, message_var.is_owned); + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + (*env)->CallVoidMethod(env, obj, j_calls->release_held_htlc_meth, message_ref); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to release_held_htlc in LDKAsyncPaymentsMessageHandler from rust threw an exception."); + } + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } +} +LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ release_pending_messages_LDKAsyncPaymentsMessageHandler_jcall(const void* this_arg) { + LDKAsyncPaymentsMessageHandler_JCalls *j_calls = (LDKAsyncPaymentsMessageHandler_JCalls*) this_arg; + JNIEnv *env; + jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK); + } else { + DO_ASSERT(get_jenv_res == JNI_OK); + } + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->release_pending_messages_meth); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to release_pending_messages in LDKAsyncPaymentsMessageHandler from rust threw an exception."); + } + LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ ret_constr; + ret_constr.datalen = (*env)->GetArrayLength(env, ret); + if (ret_constr.datalen > 0) + ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ), "LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ Elements"); + else + ret_constr.data = NULL; + int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL); + for (size_t d = 0; d < ret_constr.datalen; d++) { + int64_t ret_conv_55 = ret_vals[d]; + void* ret_conv_55_ptr = untag_ptr(ret_conv_55); + CHECK_ACCESS(ret_conv_55_ptr); + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ ret_conv_55_conv = *(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ*)(ret_conv_55_ptr); + FREE(untag_ptr(ret_conv_55)); + ret_constr.data[d] = ret_conv_55_conv; + } + (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } + return ret_constr; +} +static void LDKAsyncPaymentsMessageHandler_JCalls_cloned(LDKAsyncPaymentsMessageHandler* new_obj) { + LDKAsyncPaymentsMessageHandler_JCalls *j_calls = (LDKAsyncPaymentsMessageHandler_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +} +static inline LDKAsyncPaymentsMessageHandler LDKAsyncPaymentsMessageHandler_init (JNIEnv *env, jclass clz, jobject o) { + jclass c = (*env)->GetObjectClass(env, o); + CHECK(c != NULL); + LDKAsyncPaymentsMessageHandler_JCalls *calls = MALLOC(sizeof(LDKAsyncPaymentsMessageHandler_JCalls), "LDKAsyncPaymentsMessageHandler_JCalls"); + atomic_init(&calls->refcnt, 1); + DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); + calls->o = (*env)->NewWeakGlobalRef(env, o); + calls->held_htlc_available_meth = (*env)->GetMethodID(env, c, "held_htlc_available", "(JJ)J"); + CHECK(calls->held_htlc_available_meth != NULL); + calls->release_held_htlc_meth = (*env)->GetMethodID(env, c, "release_held_htlc", "(J)V"); + CHECK(calls->release_held_htlc_meth != NULL); + calls->release_pending_messages_meth = (*env)->GetMethodID(env, c, "release_pending_messages", "()[J"); + CHECK(calls->release_pending_messages_meth != NULL); + + LDKAsyncPaymentsMessageHandler ret = { + .this_arg = (void*) calls, + .held_htlc_available = held_htlc_available_LDKAsyncPaymentsMessageHandler_jcall, + .release_held_htlc = release_held_htlc_LDKAsyncPaymentsMessageHandler_jcall, + .release_pending_messages = release_pending_messages_LDKAsyncPaymentsMessageHandler_jcall, + .free = LDKAsyncPaymentsMessageHandler_JCalls_free, + }; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKAsyncPaymentsMessageHandler_1new(JNIEnv *env, jclass clz, jobject o) { + LDKAsyncPaymentsMessageHandler *res_ptr = MALLOC(sizeof(LDKAsyncPaymentsMessageHandler), "LDKAsyncPaymentsMessageHandler"); + *res_ptr = LDKAsyncPaymentsMessageHandler_init(env, clz, o); + return tag_ptr(res_ptr, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessageHandler_1held_1htlc_1available(JNIEnv *env, jclass clz, int64_t this_arg, int64_t message, int64_t responder) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKAsyncPaymentsMessageHandler* this_arg_conv = (LDKAsyncPaymentsMessageHandler*)this_arg_ptr; + LDKHeldHtlcAvailable message_conv; + message_conv.inner = untag_ptr(message); + message_conv.is_owned = ptr_is_owned(message); + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_conv); + message_conv = HeldHtlcAvailable_clone(&message_conv); + LDKResponder responder_conv; + responder_conv.inner = untag_ptr(responder); + responder_conv.is_owned = ptr_is_owned(responder); + CHECK_INNER_FIELD_ACCESS_OR_NULL(responder_conv); + responder_conv = Responder_clone(&responder_conv); + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ), "LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ"); + *ret_copy = (this_arg_conv->held_htlc_available)(this_arg_conv->this_arg, message_conv, responder_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessageHandler_1release_1held_1htlc(JNIEnv *env, jclass clz, int64_t this_arg, int64_t message) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKAsyncPaymentsMessageHandler* this_arg_conv = (LDKAsyncPaymentsMessageHandler*)this_arg_ptr; + LDKReleaseHeldHtlc message_conv; + message_conv.inner = untag_ptr(message); + message_conv.is_owned = ptr_is_owned(message); + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_conv); + message_conv = ReleaseHeldHtlc_clone(&message_conv); + (this_arg_conv->release_held_htlc)(this_arg_conv->this_arg, message_conv); +} + +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessageHandler_1release_1pending_1messages(JNIEnv *env, jclass clz, int64_t this_arg) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKAsyncPaymentsMessageHandler* this_arg_conv = (LDKAsyncPaymentsMessageHandler*)this_arg_ptr; + LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ ret_var = (this_arg_conv->release_pending_messages)(this_arg_conv->this_arg); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t d = 0; d < ret_var.datalen; d++) { + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ* ret_conv_55_conv = MALLOC(sizeof(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ), "LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ"); + *ret_conv_55_conv = ret_var.data[d]; + ret_arr_ptr[d] = tag_ptr(ret_conv_55_conv, true); } (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); FREE(ret_var.data); @@ -21815,7 +22917,6 @@ typedef struct LDKOnionMessageHandler_JCalls { atomic_size_t refcnt; JavaVM *vm; jweak o; - jmethodID get_and_clear_connections_needed_meth; jmethodID handle_onion_message_meth; jmethodID next_onion_message_for_peer_meth; jmethodID peer_connected_meth; @@ -21841,43 +22942,6 @@ static void LDKOnionMessageHandler_JCalls_free(void* this_arg) { FREE(j_calls); } } -LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ get_and_clear_connections_needed_LDKOnionMessageHandler_jcall(const void* this_arg) { - LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg; - JNIEnv *env; - jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK); - } else { - DO_ASSERT(get_jenv_res == JNI_OK); - } - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_and_clear_connections_needed_meth); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to get_and_clear_connections_needed in LDKOnionMessageHandler from rust threw an exception."); - } - LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ ret_constr; - ret_constr.datalen = (*env)->GetArrayLength(env, ret); - if (ret_constr.datalen > 0) - ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ), "LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ Elements"); - else - ret_constr.data = NULL; - int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL); - for (size_t o = 0; o < ret_constr.datalen; o++) { - int64_t ret_conv_40 = ret_vals[o]; - void* ret_conv_40_ptr = untag_ptr(ret_conv_40); - CHECK_ACCESS(ret_conv_40_ptr); - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ ret_conv_40_conv = *(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ*)(ret_conv_40_ptr); - FREE(untag_ptr(ret_conv_40)); - ret_constr.data[o] = ret_conv_40_conv; - } - (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); - } - return ret_constr; -} void handle_onion_message_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey peer_node_id, const LDKOnionMessage * msg) { LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg; JNIEnv *env; @@ -22070,8 +23134,6 @@ static inline LDKOnionMessageHandler LDKOnionMessageHandler_init (JNIEnv *env, j atomic_init(&calls->refcnt, 1); DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->get_and_clear_connections_needed_meth = (*env)->GetMethodID(env, c, "get_and_clear_connections_needed", "()[J"); - CHECK(calls->get_and_clear_connections_needed_meth != NULL); calls->handle_onion_message_meth = (*env)->GetMethodID(env, c, "handle_onion_message", "([BJ)V"); CHECK(calls->handle_onion_message_meth != NULL); calls->next_onion_message_for_peer_meth = (*env)->GetMethodID(env, c, "next_onion_message_for_peer", "([B)J"); @@ -22089,7 +23151,6 @@ static inline LDKOnionMessageHandler LDKOnionMessageHandler_init (JNIEnv *env, j LDKOnionMessageHandler ret = { .this_arg = (void*) calls, - .get_and_clear_connections_needed = get_and_clear_connections_needed_LDKOnionMessageHandler_jcall, .handle_onion_message = handle_onion_message_LDKOnionMessageHandler_jcall, .next_onion_message_for_peer = next_onion_message_for_peer_LDKOnionMessageHandler_jcall, .peer_connected = peer_connected_LDKOnionMessageHandler_jcall, @@ -22106,24 +23167,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKOnionMessageHandler_1new *res_ptr = LDKOnionMessageHandler_init(env, clz, o); return tag_ptr(res_ptr, true); } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_OnionMessageHandler_1get_1and_1clear_1connections_1needed(JNIEnv *env, jclass clz, int64_t this_arg) { - void* this_arg_ptr = untag_ptr(this_arg); - if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr; - LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ ret_var = (this_arg_conv->get_and_clear_connections_needed)(this_arg_conv->this_arg); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t o = 0; o < ret_var.datalen; o++) { - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* ret_conv_40_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ), "LDKC2Tuple_PublicKeyCVec_SocketAddressZZ"); - *ret_conv_40_conv = ret_var.data[o]; - ret_arr_ptr[o] = tag_ptr(ret_conv_40_conv, true); - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; -} - JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessageHandler_1handle_1onion_1message(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray peer_node_id, int64_t msg) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } @@ -22310,6 +23353,8 @@ typedef struct LDKCustomMessageHandler_JCalls { LDKCustomMessageReader_JCalls* CustomMessageReader; jmethodID handle_custom_message_meth; jmethodID get_and_clear_pending_msg_meth; + jmethodID peer_disconnected_meth; + jmethodID peer_connected_meth; jmethodID provided_node_features_meth; jmethodID provided_init_features_meth; } LDKCustomMessageHandler_JCalls; @@ -22396,6 +23441,61 @@ LDKCVec_C2Tuple_PublicKeyTypeZZ get_and_clear_pending_msg_LDKCustomMessageHandle } return ret_constr; } +void peer_disconnected_LDKCustomMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id) { + LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg; + JNIEnv *env; + jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK); + } else { + DO_ASSERT(get_jenv_res == JNI_OK); + } + int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form); + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + (*env)->CallVoidMethod(env, obj, j_calls->peer_disconnected_meth, their_node_id_arr); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to peer_disconnected in LDKCustomMessageHandler from rust threw an exception."); + } + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } +} +LDKCResult_NoneNoneZ peer_connected_LDKCustomMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * msg, bool inbound) { + LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg; + JNIEnv *env; + jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK); + } else { + DO_ASSERT(get_jenv_res == JNI_OK); + } + int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form); + LDKInit msg_var = *msg; + int64_t msg_ref = 0; + msg_var = Init_clone(&msg_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); + msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); + jboolean inbound_conv = inbound; + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->peer_connected_meth, their_node_id_arr, msg_ref, inbound_conv); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to peer_connected in LDKCustomMessageHandler from rust threw an exception."); + } + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr); + FREE(untag_ptr(ret)); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } + return ret_conv; +} LDKNodeFeatures provided_node_features_LDKCustomMessageHandler_jcall(const void* this_arg) { LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg; JNIEnv *env; @@ -22464,6 +23564,10 @@ static inline LDKCustomMessageHandler LDKCustomMessageHandler_init (JNIEnv *env, CHECK(calls->handle_custom_message_meth != NULL); calls->get_and_clear_pending_msg_meth = (*env)->GetMethodID(env, c, "get_and_clear_pending_msg", "()[J"); CHECK(calls->get_and_clear_pending_msg_meth != NULL); + calls->peer_disconnected_meth = (*env)->GetMethodID(env, c, "peer_disconnected", "([B)V"); + CHECK(calls->peer_disconnected_meth != NULL); + calls->peer_connected_meth = (*env)->GetMethodID(env, c, "peer_connected", "([BJZ)J"); + CHECK(calls->peer_connected_meth != NULL); calls->provided_node_features_meth = (*env)->GetMethodID(env, c, "provided_node_features", "()J"); CHECK(calls->provided_node_features_meth != NULL); calls->provided_init_features_meth = (*env)->GetMethodID(env, c, "provided_init_features", "([B)J"); @@ -22473,6 +23577,8 @@ static inline LDKCustomMessageHandler LDKCustomMessageHandler_init (JNIEnv *env, .this_arg = (void*) calls, .handle_custom_message = handle_custom_message_LDKCustomMessageHandler_jcall, .get_and_clear_pending_msg = get_and_clear_pending_msg_LDKCustomMessageHandler_jcall, + .peer_disconnected = peer_disconnected_LDKCustomMessageHandler_jcall, + .peer_connected = peer_connected_LDKCustomMessageHandler_jcall, .provided_node_features = provided_node_features_LDKCustomMessageHandler_jcall, .provided_init_features = provided_init_features_LDKCustomMessageHandler_jcall, .free = LDKCustomMessageHandler_JCalls_free, @@ -22527,6 +23633,33 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CustomMessageHandler_1 return ret_arr; } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomMessageHandler_1peer_1disconnected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr; + LDKPublicKey their_node_id_ref; + CHECK((*env)->GetArrayLength(env, their_node_id) == 33); + (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form); + (this_arg_conv->peer_disconnected)(this_arg_conv->this_arg, their_node_id_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CustomMessageHandler_1peer_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg, jboolean inbound) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr; + LDKPublicKey their_node_id_ref; + CHECK((*env)->GetArrayLength(env, their_node_id) == 33); + (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form); + LDKInit msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv, inbound); + return tag_ptr(ret_conv, true); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CustomMessageHandler_1provided_1node_1features(JNIEnv *env, jclass clz, int64_t this_arg) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } @@ -22577,7 +23710,7 @@ static void LDKCustomOnionMessageHandler_JCalls_free(void* this_arg) { FREE(j_calls); } } -LDKCOption_OnionMessageContentsZ handle_custom_message_LDKCustomOnionMessageHandler_jcall(const void* this_arg, LDKOnionMessageContents msg) { +LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ handle_custom_message_LDKCustomOnionMessageHandler_jcall(const void* this_arg, LDKOnionMessageContents message, LDKCOption_CVec_u8ZZ context, LDKResponder responder) { LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -22586,18 +23719,25 @@ LDKCOption_OnionMessageContentsZ handle_custom_message_LDKCustomOnionMessageHand } else { DO_ASSERT(get_jenv_res == JNI_OK); } - LDKOnionMessageContents* msg_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); - *msg_ret = msg; + LDKOnionMessageContents* message_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *message_ret = message; + LDKCOption_CVec_u8ZZ *context_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *context_copy = context; + int64_t context_ref = tag_ptr(context_copy, true); + LDKResponder responder_var = responder; + int64_t responder_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(responder_var); + responder_ref = tag_ptr(responder_var.inner, responder_var.is_owned); jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_custom_message_meth, tag_ptr(msg_ret, true)); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_custom_message_meth, tag_ptr(message_ret, true), context_ref, responder_ref); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); (*env)->FatalError(env, "A call to handle_custom_message in LDKCustomOnionMessageHandler from rust threw an exception."); } void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); - LDKCOption_OnionMessageContentsZ ret_conv = *(LDKCOption_OnionMessageContentsZ*)(ret_ptr); + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ ret_conv = *(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ*)(ret_ptr); FREE(untag_ptr(ret)); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -22633,7 +23773,7 @@ LDKCResult_COption_OnionMessageContentsZDecodeErrorZ read_custom_message_LDKCust } return ret_conv; } -LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ release_pending_custom_messages_LDKCustomOnionMessageHandler_jcall(const void* this_arg) { +LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ release_pending_custom_messages_LDKCustomOnionMessageHandler_jcall(const void* this_arg) { LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -22649,20 +23789,20 @@ LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ release_pending_cus (*env)->ExceptionDescribe(env); (*env)->FatalError(env, "A call to release_pending_custom_messages in LDKCustomOnionMessageHandler from rust threw an exception."); } - LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ ret_constr; + LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ ret_constr; ret_constr.datalen = (*env)->GetArrayLength(env, ret); if (ret_constr.datalen > 0) - ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ), "LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ Elements"); + ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ), "LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ Elements"); else ret_constr.data = NULL; int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL); - for (size_t e = 0; e < ret_constr.datalen; e++) { - int64_t ret_conv_56 = ret_vals[e]; - void* ret_conv_56_ptr = untag_ptr(ret_conv_56); - CHECK_ACCESS(ret_conv_56_ptr); - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ ret_conv_56_conv = *(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ*)(ret_conv_56_ptr); - FREE(untag_ptr(ret_conv_56)); - ret_constr.data[e] = ret_conv_56_conv; + for (size_t d = 0; d < ret_constr.datalen; d++) { + int64_t ret_conv_55 = ret_vals[d]; + void* ret_conv_55_ptr = untag_ptr(ret_conv_55); + CHECK_ACCESS(ret_conv_55_ptr); + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ ret_conv_55_conv = *(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ*)(ret_conv_55_ptr); + FREE(untag_ptr(ret_conv_55)); + ret_constr.data[d] = ret_conv_55_conv; } (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0); if (get_jenv_res == JNI_EDETACHED) { @@ -22681,7 +23821,7 @@ static inline LDKCustomOnionMessageHandler LDKCustomOnionMessageHandler_init (JN atomic_init(&calls->refcnt, 1); DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->handle_custom_message_meth = (*env)->GetMethodID(env, c, "handle_custom_message", "(J)J"); + calls->handle_custom_message_meth = (*env)->GetMethodID(env, c, "handle_custom_message", "(JJJ)J"); CHECK(calls->handle_custom_message_meth != NULL); calls->read_custom_message_meth = (*env)->GetMethodID(env, c, "read_custom_message", "(J[B)J"); CHECK(calls->read_custom_message_meth != NULL); @@ -22702,19 +23842,28 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCustomOnionMessageHandle *res_ptr = LDKCustomOnionMessageHandler_init(env, clz, o); return tag_ptr(res_ptr, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageHandler_1handle_1custom_1message(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageHandler_1handle_1custom_1message(JNIEnv *env, jclass clz, int64_t this_arg, int64_t message, int64_t context, int64_t responder) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKCustomOnionMessageHandler* this_arg_conv = (LDKCustomOnionMessageHandler*)this_arg_ptr; - void* msg_ptr = untag_ptr(msg); - CHECK_ACCESS(msg_ptr); - LDKOnionMessageContents msg_conv = *(LDKOnionMessageContents*)(msg_ptr); - if (msg_conv.free == LDKOnionMessageContents_JCalls_free) { + void* message_ptr = untag_ptr(message); + CHECK_ACCESS(message_ptr); + LDKOnionMessageContents message_conv = *(LDKOnionMessageContents*)(message_ptr); + if (message_conv.free == LDKOnionMessageContents_JCalls_free) { // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKOnionMessageContents_JCalls_cloned(&msg_conv); + LDKOnionMessageContents_JCalls_cloned(&message_conv); } - LDKCOption_OnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_OnionMessageContentsZ), "LDKCOption_OnionMessageContentsZ"); - *ret_copy = (this_arg_conv->handle_custom_message)(this_arg_conv->this_arg, msg_conv); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKCOption_CVec_u8ZZ context_conv = *(LDKCOption_CVec_u8ZZ*)(context_ptr); + context_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(context)); + LDKResponder responder_conv; + responder_conv.inner = untag_ptr(responder); + responder_conv.is_owned = ptr_is_owned(responder); + CHECK_INNER_FIELD_ACCESS_OR_NULL(responder_conv); + responder_conv = Responder_clone(&responder_conv); + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ), "LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ"); + *ret_copy = (this_arg_conv->handle_custom_message)(this_arg_conv->this_arg, message_conv, context_conv, responder_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -22736,14 +23885,14 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageHand void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKCustomOnionMessageHandler* this_arg_conv = (LDKCustomOnionMessageHandler*)this_arg_ptr; - LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ ret_var = (this_arg_conv->release_pending_custom_messages)(this_arg_conv->this_arg); + LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ ret_var = (this_arg_conv->release_pending_custom_messages)(this_arg_conv->this_arg); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t e = 0; e < ret_var.datalen; e++) { - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ* ret_conv_56_conv = MALLOC(sizeof(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ), "LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ"); - *ret_conv_56_conv = ret_var.data[e]; - ret_arr_ptr[e] = tag_ptr(ret_conv_56_conv, true); + for (size_t d = 0; d < ret_var.datalen; d++) { + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ* ret_conv_55_conv = MALLOC(sizeof(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ), "LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ"); + *ret_conv_55_conv = ret_var.data[d]; + ret_arr_ptr[d] = tag_ptr(ret_conv_55_conv, true); } (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); FREE(ret_var.data); @@ -22928,6 +24077,55 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1hash(JNIE return ret_conv; } +static jclass LDKBolt12PaymentError_UnexpectedInvoice_class = NULL; +static jmethodID LDKBolt12PaymentError_UnexpectedInvoice_meth = NULL; +static jclass LDKBolt12PaymentError_DuplicateInvoice_class = NULL; +static jmethodID LDKBolt12PaymentError_DuplicateInvoice_meth = NULL; +static jclass LDKBolt12PaymentError_UnknownRequiredFeatures_class = NULL; +static jmethodID LDKBolt12PaymentError_UnknownRequiredFeatures_meth = NULL; +static jclass LDKBolt12PaymentError_SendingFailed_class = NULL; +static jmethodID LDKBolt12PaymentError_SendingFailed_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKBolt12PaymentError_init (JNIEnv *env, jclass clz) { + LDKBolt12PaymentError_UnexpectedInvoice_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt12PaymentError$UnexpectedInvoice")); + CHECK(LDKBolt12PaymentError_UnexpectedInvoice_class != NULL); + LDKBolt12PaymentError_UnexpectedInvoice_meth = (*env)->GetMethodID(env, LDKBolt12PaymentError_UnexpectedInvoice_class, "", "()V"); + CHECK(LDKBolt12PaymentError_UnexpectedInvoice_meth != NULL); + LDKBolt12PaymentError_DuplicateInvoice_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt12PaymentError$DuplicateInvoice")); + CHECK(LDKBolt12PaymentError_DuplicateInvoice_class != NULL); + LDKBolt12PaymentError_DuplicateInvoice_meth = (*env)->GetMethodID(env, LDKBolt12PaymentError_DuplicateInvoice_class, "", "()V"); + CHECK(LDKBolt12PaymentError_DuplicateInvoice_meth != NULL); + LDKBolt12PaymentError_UnknownRequiredFeatures_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt12PaymentError$UnknownRequiredFeatures")); + CHECK(LDKBolt12PaymentError_UnknownRequiredFeatures_class != NULL); + LDKBolt12PaymentError_UnknownRequiredFeatures_meth = (*env)->GetMethodID(env, LDKBolt12PaymentError_UnknownRequiredFeatures_class, "", "()V"); + CHECK(LDKBolt12PaymentError_UnknownRequiredFeatures_meth != NULL); + LDKBolt12PaymentError_SendingFailed_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt12PaymentError$SendingFailed")); + CHECK(LDKBolt12PaymentError_SendingFailed_class != NULL); + LDKBolt12PaymentError_SendingFailed_meth = (*env)->GetMethodID(env, LDKBolt12PaymentError_SendingFailed_class, "", "(Lorg/ldk/enums/RetryableSendFailure;)V"); + CHECK(LDKBolt12PaymentError_SendingFailed_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBolt12PaymentError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKBolt12PaymentError *obj = (LDKBolt12PaymentError*)untag_ptr(ptr); + switch(obj->tag) { + case LDKBolt12PaymentError_UnexpectedInvoice: { + return (*env)->NewObject(env, LDKBolt12PaymentError_UnexpectedInvoice_class, LDKBolt12PaymentError_UnexpectedInvoice_meth); + } + case LDKBolt12PaymentError_DuplicateInvoice: { + return (*env)->NewObject(env, LDKBolt12PaymentError_DuplicateInvoice_class, LDKBolt12PaymentError_DuplicateInvoice_meth); + } + case LDKBolt12PaymentError_UnknownRequiredFeatures: { + return (*env)->NewObject(env, LDKBolt12PaymentError_UnknownRequiredFeatures_class, LDKBolt12PaymentError_UnknownRequiredFeatures_meth); + } + case LDKBolt12PaymentError_SendingFailed: { + jclass sending_failed_conv = LDKRetryableSendFailure_to_java(env, obj->sending_failed); + return (*env)->NewObject(env, LDKBolt12PaymentError_SendingFailed_class, LDKBolt12PaymentError_SendingFailed_meth, sending_failed_conv); + } + default: abort(); + } +} typedef struct LDKSignBolt12InvoiceFn_JCalls { atomic_size_t refcnt; JavaVM *vm; @@ -23236,15 +24434,16 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPayee_1ref_1from_1ptr(JN LDKPayee *obj = (LDKPayee*)untag_ptr(ptr); switch(obj->tag) { case LDKPayee_Blinded: { - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ route_hints_var = obj->blinded.route_hints; + LDKCVec_BlindedPaymentPathZ route_hints_var = obj->blinded.route_hints; int64_tArray route_hints_arr = NULL; route_hints_arr = (*env)->NewLongArray(env, route_hints_var.datalen); int64_t *route_hints_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, route_hints_arr, NULL); - for (size_t l = 0; l < route_hints_var.datalen; l++) { - LDKC2Tuple_BlindedPayInfoBlindedPathZ* route_hints_conv_37_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ"); - *route_hints_conv_37_conv = route_hints_var.data[l]; - *route_hints_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone(route_hints_conv_37_conv); - route_hints_arr_ptr[l] = tag_ptr(route_hints_conv_37_conv, true); + for (size_t u = 0; u < route_hints_var.datalen; u++) { + LDKBlindedPaymentPath route_hints_conv_20_var = route_hints_var.data[u]; + int64_t route_hints_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_hints_conv_20_var); + route_hints_conv_20_ref = tag_ptr(route_hints_conv_20_var.inner, false); + route_hints_arr_ptr[u] = route_hints_conv_20_ref; } (*env)->ReleasePrimitiveArrayCritical(env, route_hints_arr, route_hints_arr_ptr, 0); LDKBolt12InvoiceFeatures features_var = obj->blinded.features; @@ -24292,24 +25491,78 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1clone(JNIEnv return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1BlindedPathZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_BlindedPathZ _res_constr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1BlindedMessagePathZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_BlindedMessagePathZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKBlindedPath), "LDKCVec_BlindedPathZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKBlindedMessagePath), "LDKCVec_BlindedMessagePathZ Elements"); else _res_constr.data = NULL; int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t n = 0; n < _res_constr.datalen; n++) { - int64_t _res_conv_13 = _res_vals[n]; - LDKBlindedPath _res_conv_13_conv; - _res_conv_13_conv.inner = untag_ptr(_res_conv_13); - _res_conv_13_conv.is_owned = ptr_is_owned(_res_conv_13); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_13_conv); - _res_constr.data[n] = _res_conv_13_conv; + for (size_t u = 0; u < _res_constr.datalen; u++) { + int64_t _res_conv_20 = _res_vals[u]; + LDKBlindedMessagePath _res_conv_20_conv; + _res_conv_20_conv.inner = untag_ptr(_res_conv_20); + _res_conv_20_conv.is_owned = ptr_is_owned(_res_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_20_conv); + _res_constr.data[u] = _res_conv_20_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_BlindedPathZ_free(_res_constr); + CVec_BlindedMessagePathZ_free(_res_constr); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RefundDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKRefund o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = Refund_clone(&o_conv); + LDKCResult_RefundDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundDecodeErrorZ), "LDKCResult_RefundDecodeErrorZ"); + *ret_conv = CResult_RefundDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RefundDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_RefundDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundDecodeErrorZ), "LDKCResult_RefundDecodeErrorZ"); + *ret_conv = CResult_RefundDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RefundDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RefundDecodeErrorZ* o_conv = (LDKCResult_RefundDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_RefundDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RefundDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_RefundDecodeErrorZ _res_conv = *(LDKCResult_RefundDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_RefundDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_RefundDecodeErrorZ_clone_ptr(LDKCResult_RefundDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RefundDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundDecodeErrorZ), "LDKCResult_RefundDecodeErrorZ"); + *ret_conv = CResult_RefundDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RefundDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RefundDecodeErrorZ* arg_conv = (LDKCResult_RefundDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_RefundDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RefundDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_RefundDecodeErrorZ* orig_conv = (LDKCResult_RefundDecodeErrorZ*)untag_ptr(orig); + LDKCResult_RefundDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundDecodeErrorZ), "LDKCResult_RefundDecodeErrorZ"); + *ret_conv = CResult_RefundDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RefundBolt12ParseErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { @@ -24913,6 +26166,21 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SchnorrSignatureNo return tag_ptr(ret_conv, true); } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1StrZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) { + LDKCVec_StrZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKStr), "LDKCVec_StrZ Elements"); + else + _res_constr.data = NULL; + for (size_t i = 0; i < _res_constr.datalen; i++) { + jstring _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i); + LDKStr dummy = { .chars = NULL, .len = 0, .chars_is_owned = false }; + _res_constr.data[i] = dummy; + } + CVec_StrZ_free(_res_constr); +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ThirtyTwoBytesZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) { LDKCVec_ThirtyTwoBytesZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); @@ -25128,57 +26396,57 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesNone return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKBlindedPayInfo o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKBolt12Invoice o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = BlindedPayInfo_clone(&o_conv); - LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); - *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_ok(o_conv); + o_conv = Bolt12Invoice_clone(&o_conv); + LDKCResult_Bolt12InvoiceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceDecodeErrorZ), "LDKCResult_Bolt12InvoiceDecodeErrorZ"); + *ret_conv = CResult_Bolt12InvoiceDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); - *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_err(e_conv); + LDKCResult_Bolt12InvoiceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceDecodeErrorZ), "LDKCResult_Bolt12InvoiceDecodeErrorZ"); + *ret_conv = CResult_Bolt12InvoiceDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_BlindedPayInfoDecodeErrorZ* o_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_BlindedPayInfoDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_Bolt12InvoiceDecodeErrorZ* o_conv = (LDKCResult_Bolt12InvoiceDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_Bolt12InvoiceDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_BlindedPayInfoDecodeErrorZ _res_conv = *(LDKCResult_BlindedPayInfoDecodeErrorZ*)(_res_ptr); + LDKCResult_Bolt12InvoiceDecodeErrorZ _res_conv = *(LDKCResult_Bolt12InvoiceDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_BlindedPayInfoDecodeErrorZ_free(_res_conv); + CResult_Bolt12InvoiceDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_BlindedPayInfoDecodeErrorZ_clone_ptr(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); - *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_clone(arg); +static inline uint64_t CResult_Bolt12InvoiceDecodeErrorZ_clone_ptr(LDKCResult_Bolt12InvoiceDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_Bolt12InvoiceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceDecodeErrorZ), "LDKCResult_Bolt12InvoiceDecodeErrorZ"); + *ret_conv = CResult_Bolt12InvoiceDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_BlindedPayInfoDecodeErrorZ* arg_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_BlindedPayInfoDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_Bolt12InvoiceDecodeErrorZ* arg_conv = (LDKCResult_Bolt12InvoiceDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_Bolt12InvoiceDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_BlindedPayInfoDecodeErrorZ* orig_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(orig); - LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); - *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_Bolt12InvoiceDecodeErrorZ* orig_conv = (LDKCResult_Bolt12InvoiceDecodeErrorZ*)untag_ptr(orig); + LDKCResult_Bolt12InvoiceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceDecodeErrorZ), "LDKCResult_Bolt12InvoiceDecodeErrorZ"); + *ret_conv = CResult_Bolt12InvoiceDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -25620,51 +26888,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCDescriptorDeco return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1ok(JNIEnv *env, jclass clz) { - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = CResult_NoneNoneZ_ok(); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = CResult_NoneNoneZ_err(); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_NoneNoneZ* o_conv = (LDKCResult_NoneNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_NoneNoneZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_NoneNoneZ _res_conv = *(LDKCResult_NoneNoneZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_NoneNoneZ_free(_res_conv); -} - -static inline uint64_t CResult_NoneNoneZ_clone_ptr(LDKCResult_NoneNoneZ *NONNULL_PTR arg) { - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = CResult_NoneNoneZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_NoneNoneZ* arg_conv = (LDKCResult_NoneNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_NoneNoneZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_NoneNoneZ* orig_conv = (LDKCResult_NoneNoneZ*)untag_ptr(orig); - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = CResult_NoneNoneZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) { LDKPublicKey o_ref; CHECK((*env)->GetArrayLength(env, o) == 33); @@ -25713,6 +26936,99 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1cl return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832NoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) { + LDKThirtyTwoBytes o_ref; + CHECK((*env)->GetArrayLength(env, o) == 32); + (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.data); + LDKCResult__u832NoneZ* ret_conv = MALLOC(sizeof(LDKCResult__u832NoneZ), "LDKCResult__u832NoneZ"); + *ret_conv = CResult__u832NoneZ_ok(o_ref); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832NoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult__u832NoneZ* ret_conv = MALLOC(sizeof(LDKCResult__u832NoneZ), "LDKCResult__u832NoneZ"); + *ret_conv = CResult__u832NoneZ_err(); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832NoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult__u832NoneZ* o_conv = (LDKCResult__u832NoneZ*)untag_ptr(o); + jboolean ret_conv = CResult__u832NoneZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832NoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult__u832NoneZ _res_conv = *(LDKCResult__u832NoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult__u832NoneZ_free(_res_conv); +} + +static inline uint64_t CResult__u832NoneZ_clone_ptr(LDKCResult__u832NoneZ *NONNULL_PTR arg) { + LDKCResult__u832NoneZ* ret_conv = MALLOC(sizeof(LDKCResult__u832NoneZ), "LDKCResult__u832NoneZ"); + *ret_conv = CResult__u832NoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832NoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult__u832NoneZ* arg_conv = (LDKCResult__u832NoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult__u832NoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832NoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult__u832NoneZ* orig_conv = (LDKCResult__u832NoneZ*)untag_ptr(orig); + LDKCResult__u832NoneZ* ret_conv = MALLOC(sizeof(LDKCResult__u832NoneZ), "LDKCResult__u832NoneZ"); + *ret_conv = CResult__u832NoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1ok(JNIEnv *env, jclass clz) { + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = CResult_NoneNoneZ_ok(); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = CResult_NoneNoneZ_err(); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneNoneZ* o_conv = (LDKCResult_NoneNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_NoneNoneZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_NoneNoneZ _res_conv = *(LDKCResult_NoneNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_NoneNoneZ_free(_res_conv); +} + +static inline uint64_t CResult_NoneNoneZ_clone_ptr(LDKCResult_NoneNoneZ *NONNULL_PTR arg) { + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = CResult_NoneNoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NoneNoneZ* arg_conv = (LDKCResult_NoneNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_NoneNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_NoneNoneZ* orig_conv = (LDKCResult_NoneNoneZ*)untag_ptr(orig); + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = CResult_NoneNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1BigEndianScalarZ_1some(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -25760,23 +27076,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1BigEndianScalarZ_1 return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1U5Z_1free(JNIEnv *env, jclass clz, jobjectArray _res) { - LDKCVec_U5Z _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKU5), "LDKCVec_U5Z Elements"); - else - _res_constr.data = NULL; - int8_t* _res_vals = (*env)->GetByteArrayElements (env, _res, NULL); - for (size_t h = 0; h < _res_constr.datalen; h++) { - int8_t _res_conv_7 = _res_vals[h]; - - _res_constr.data[h] = (LDKU5){ ._0 = _res_conv_7 }; - } - (*env)->ReleaseByteArrayElements(env, _res, _res_vals, 0); - CVec_U5Z_free(_res_constr); -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) { LDKRecoverableSignature o_ref; CHECK((*env)->GetArrayLength(env, o) == 68); @@ -25923,59 +27222,59 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1 return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1EcdsaChannelSignerDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); - LDKWriteableEcdsaChannelSigner o_conv = *(LDKWriteableEcdsaChannelSigner*)(o_ptr); - if (o_conv.free == LDKWriteableEcdsaChannelSigner_JCalls_free) { + LDKEcdsaChannelSigner o_conv = *(LDKEcdsaChannelSigner*)(o_ptr); + if (o_conv.free == LDKEcdsaChannelSigner_JCalls_free) { // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKWriteableEcdsaChannelSigner_JCalls_cloned(&o_conv); + LDKEcdsaChannelSigner_JCalls_cloned(&o_conv); } - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ), "LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ"); - *ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(o_conv); + LDKCResult_EcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_EcdsaChannelSignerDecodeErrorZ), "LDKCResult_EcdsaChannelSignerDecodeErrorZ"); + *ret_conv = CResult_EcdsaChannelSignerDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1EcdsaChannelSignerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ), "LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ"); - *ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err(e_conv); + LDKCResult_EcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_EcdsaChannelSignerDecodeErrorZ), "LDKCResult_EcdsaChannelSignerDecodeErrorZ"); + *ret_conv = CResult_EcdsaChannelSignerDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* o_conv = (LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1EcdsaChannelSignerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_EcdsaChannelSignerDecodeErrorZ* o_conv = (LDKCResult_EcdsaChannelSignerDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_EcdsaChannelSignerDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1EcdsaChannelSignerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ _res_conv = *(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)(_res_ptr); + LDKCResult_EcdsaChannelSignerDecodeErrorZ _res_conv = *(LDKCResult_EcdsaChannelSignerDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free(_res_conv); + CResult_EcdsaChannelSignerDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone_ptr(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ), "LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ"); - *ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(arg); +static inline uint64_t CResult_EcdsaChannelSignerDecodeErrorZ_clone_ptr(LDKCResult_EcdsaChannelSignerDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_EcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_EcdsaChannelSignerDecodeErrorZ), "LDKCResult_EcdsaChannelSignerDecodeErrorZ"); + *ret_conv = CResult_EcdsaChannelSignerDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* arg_conv = (LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1EcdsaChannelSignerDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_EcdsaChannelSignerDecodeErrorZ* arg_conv = (LDKCResult_EcdsaChannelSignerDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_EcdsaChannelSignerDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* orig_conv = (LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)untag_ptr(orig); - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ), "LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ"); - *ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1EcdsaChannelSignerDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_EcdsaChannelSignerDecodeErrorZ* orig_conv = (LDKCResult_EcdsaChannelSignerDecodeErrorZ*)untag_ptr(orig); + LDKCResult_EcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_EcdsaChannelSignerDecodeErrorZ), "LDKCResult_EcdsaChannelSignerDecodeErrorZ"); + *ret_conv = CResult_EcdsaChannelSignerDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -26459,6 +27758,101 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneIOErrorZ_1clon return tag_ptr(ret_conv, true); } +static inline uint64_t C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone_ptr(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR arg) { + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ), "LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ"); + *ret_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* arg_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(arg); + int64_t ret_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* orig_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(orig); + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ), "LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ"); + *ret_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b, int64_t c) { + LDKThirtyTwoBytes a_ref; + CHECK((*env)->GetArrayLength(env, a) == 32); + (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data); + LDKRecipientOnionFields b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv = RecipientOnionFields_clone(&b_conv); + LDKRouteParameters c_conv; + c_conv.inner = untag_ptr(c); + c_conv.is_owned = ptr_is_owned(c); + CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv); + c_conv = RouteParameters_clone(&c_conv); + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ), "LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ"); + *ret_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new(a_ref, b_conv, c_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ _res_conv = *(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(_res_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ o_conv = *(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)(o_ptr); + o_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone((LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(o)); + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); + *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); + *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err(); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* o_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ _res_conv = *(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(_res_conv); +} + +static inline uint64_t CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone_ptr(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR arg) { + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); + *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* arg_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* orig_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(orig); + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); + *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { LDKCVec_ChannelDetailsZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); @@ -26534,127 +27928,85 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErro return tag_ptr(ret_conv, true); } -static inline uint64_t C2Tuple_BlindedPayInfoBlindedPathZ_clone_ptr(LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR arg) { - LDKC2Tuple_BlindedPayInfoBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ"); - *ret_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlindedPayInfoBlindedPathZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC2Tuple_BlindedPayInfoBlindedPathZ* arg_conv = (LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(arg); - int64_t ret_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlindedPayInfoBlindedPathZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC2Tuple_BlindedPayInfoBlindedPathZ* orig_conv = (LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(orig); - LDKC2Tuple_BlindedPayInfoBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ"); - *ret_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlindedPayInfoBlindedPathZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKBlindedPayInfo a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = BlindedPayInfo_clone(&a_conv); - LDKBlindedPath b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv = BlindedPath_clone(&b_conv); - LDKC2Tuple_BlindedPayInfoBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ"); - *ret_conv = C2Tuple_BlindedPayInfoBlindedPathZ_new(a_conv, b_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlindedPayInfoBlindedPathZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ _res_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(_res_ptr); - FREE(untag_ptr(_res)); - C2Tuple_BlindedPayInfoBlindedPathZ_free(_res_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1BlindedPayInfoBlindedPathZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ _res_constr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1BlindedPaymentPathZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_BlindedPaymentPathZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); else _res_constr.data = NULL; int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t l = 0; l < _res_constr.datalen; l++) { - int64_t _res_conv_37 = _res_vals[l]; - void* _res_conv_37_ptr = untag_ptr(_res_conv_37); - CHECK_ACCESS(_res_conv_37_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ _res_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(_res_conv_37_ptr); - FREE(untag_ptr(_res_conv_37)); - _res_constr.data[l] = _res_conv_37_conv; + for (size_t u = 0; u < _res_constr.datalen; u++) { + int64_t _res_conv_20 = _res_vals[u]; + LDKBlindedPaymentPath _res_conv_20_conv; + _res_conv_20_conv.inner = untag_ptr(_res_conv_20); + _res_conv_20_conv.is_owned = ptr_is_owned(_res_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_20_conv); + _res_constr.data[u] = _res_conv_20_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_free(_res_constr); + CVec_BlindedPaymentPathZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlindedPayInfoBlindedPathZZNoneZ_1ok(JNIEnv *env, jclass clz, int64_tArray o) { - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ o_constr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPaymentPathZNoneZ_1ok(JNIEnv *env, jclass clz, int64_tArray o) { + LDKCVec_BlindedPaymentPathZ o_constr; o_constr.datalen = (*env)->GetArrayLength(env, o); if (o_constr.datalen > 0) - o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); + o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); else o_constr.data = NULL; int64_t* o_vals = (*env)->GetLongArrayElements (env, o, NULL); - for (size_t l = 0; l < o_constr.datalen; l++) { - int64_t o_conv_37 = o_vals[l]; - void* o_conv_37_ptr = untag_ptr(o_conv_37); - CHECK_ACCESS(o_conv_37_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ o_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(o_conv_37_ptr); - o_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(o_conv_37)); - o_constr.data[l] = o_conv_37_conv; + for (size_t u = 0; u < o_constr.datalen; u++) { + int64_t o_conv_20 = o_vals[u]; + LDKBlindedPaymentPath o_conv_20_conv; + o_conv_20_conv.inner = untag_ptr(o_conv_20); + o_conv_20_conv.is_owned = ptr_is_owned(o_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv_20_conv); + o_conv_20_conv = BlindedPaymentPath_clone(&o_conv_20_conv); + o_constr.data[u] = o_conv_20_conv; } (*env)->ReleaseLongArrayElements(env, o, o_vals, 0); - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ), "LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ"); - *ret_conv = CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_ok(o_constr); + LDKCResult_CVec_BlindedPaymentPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPaymentPathZNoneZ), "LDKCResult_CVec_BlindedPaymentPathZNoneZ"); + *ret_conv = CResult_CVec_BlindedPaymentPathZNoneZ_ok(o_constr); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlindedPayInfoBlindedPathZZNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ), "LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ"); - *ret_conv = CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_err(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPaymentPathZNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_CVec_BlindedPaymentPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPaymentPathZNoneZ), "LDKCResult_CVec_BlindedPaymentPathZNoneZ"); + *ret_conv = CResult_CVec_BlindedPaymentPathZNoneZ_err(); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlindedPayInfoBlindedPathZZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* o_conv = (LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPaymentPathZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_CVec_BlindedPaymentPathZNoneZ* o_conv = (LDKCResult_CVec_BlindedPaymentPathZNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_CVec_BlindedPaymentPathZNoneZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlindedPayInfoBlindedPathZZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPaymentPathZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ _res_conv = *(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ*)(_res_ptr); + LDKCResult_CVec_BlindedPaymentPathZNoneZ _res_conv = *(LDKCResult_CVec_BlindedPaymentPathZNoneZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_free(_res_conv); + CResult_CVec_BlindedPaymentPathZNoneZ_free(_res_conv); } -static inline uint64_t CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone_ptr(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR arg) { - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ), "LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ"); - *ret_conv = CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone(arg); +static inline uint64_t CResult_CVec_BlindedPaymentPathZNoneZ_clone_ptr(LDKCResult_CVec_BlindedPaymentPathZNoneZ *NONNULL_PTR arg) { + LDKCResult_CVec_BlindedPaymentPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPaymentPathZNoneZ), "LDKCResult_CVec_BlindedPaymentPathZNoneZ"); + *ret_conv = CResult_CVec_BlindedPaymentPathZNoneZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlindedPayInfoBlindedPathZZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* arg_conv = (LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPaymentPathZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_CVec_BlindedPaymentPathZNoneZ* arg_conv = (LDKCResult_CVec_BlindedPaymentPathZNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_CVec_BlindedPaymentPathZNoneZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlindedPayInfoBlindedPathZZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* orig_conv = (LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ*)untag_ptr(orig); - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ), "LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ"); - *ret_conv = CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPaymentPathZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_CVec_BlindedPaymentPathZNoneZ* orig_conv = (LDKCResult_CVec_BlindedPaymentPathZNoneZ*)untag_ptr(orig); + LDKCResult_CVec_BlindedPaymentPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPaymentPathZNoneZ), "LDKCResult_CVec_BlindedPaymentPathZNoneZ"); + *ret_conv = CResult_CVec_BlindedPaymentPathZNoneZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -26725,68 +28077,88 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNo return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPathZNoneZ_1ok(JNIEnv *env, jclass clz, int64_tArray o) { - LDKCVec_BlindedPathZ o_constr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1ok(JNIEnv *env, jclass clz, int64_tArray o) { + LDKCVec_BlindedMessagePathZ o_constr; o_constr.datalen = (*env)->GetArrayLength(env, o); if (o_constr.datalen > 0) - o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKBlindedPath), "LDKCVec_BlindedPathZ Elements"); + o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKBlindedMessagePath), "LDKCVec_BlindedMessagePathZ Elements"); else o_constr.data = NULL; int64_t* o_vals = (*env)->GetLongArrayElements (env, o, NULL); - for (size_t n = 0; n < o_constr.datalen; n++) { - int64_t o_conv_13 = o_vals[n]; - LDKBlindedPath o_conv_13_conv; - o_conv_13_conv.inner = untag_ptr(o_conv_13); - o_conv_13_conv.is_owned = ptr_is_owned(o_conv_13); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv_13_conv); - o_conv_13_conv = BlindedPath_clone(&o_conv_13_conv); - o_constr.data[n] = o_conv_13_conv; + for (size_t u = 0; u < o_constr.datalen; u++) { + int64_t o_conv_20 = o_vals[u]; + LDKBlindedMessagePath o_conv_20_conv; + o_conv_20_conv.inner = untag_ptr(o_conv_20); + o_conv_20_conv.is_owned = ptr_is_owned(o_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv_20_conv); + o_conv_20_conv = BlindedMessagePath_clone(&o_conv_20_conv); + o_constr.data[u] = o_conv_20_conv; } (*env)->ReleaseLongArrayElements(env, o, o_vals, 0); - LDKCResult_CVec_BlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPathZNoneZ), "LDKCResult_CVec_BlindedPathZNoneZ"); - *ret_conv = CResult_CVec_BlindedPathZNoneZ_ok(o_constr); + LDKCResult_CVec_BlindedMessagePathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedMessagePathZNoneZ), "LDKCResult_CVec_BlindedMessagePathZNoneZ"); + *ret_conv = CResult_CVec_BlindedMessagePathZNoneZ_ok(o_constr); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPathZNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_CVec_BlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPathZNoneZ), "LDKCResult_CVec_BlindedPathZNoneZ"); - *ret_conv = CResult_CVec_BlindedPathZNoneZ_err(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_CVec_BlindedMessagePathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedMessagePathZNoneZ), "LDKCResult_CVec_BlindedMessagePathZNoneZ"); + *ret_conv = CResult_CVec_BlindedMessagePathZNoneZ_err(); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPathZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_CVec_BlindedPathZNoneZ* o_conv = (LDKCResult_CVec_BlindedPathZNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_CVec_BlindedPathZNoneZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_CVec_BlindedMessagePathZNoneZ* o_conv = (LDKCResult_CVec_BlindedMessagePathZNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_CVec_BlindedMessagePathZNoneZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPathZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_CVec_BlindedPathZNoneZ _res_conv = *(LDKCResult_CVec_BlindedPathZNoneZ*)(_res_ptr); + LDKCResult_CVec_BlindedMessagePathZNoneZ _res_conv = *(LDKCResult_CVec_BlindedMessagePathZNoneZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_CVec_BlindedPathZNoneZ_free(_res_conv); + CResult_CVec_BlindedMessagePathZNoneZ_free(_res_conv); } -static inline uint64_t CResult_CVec_BlindedPathZNoneZ_clone_ptr(LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR arg) { - LDKCResult_CVec_BlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPathZNoneZ), "LDKCResult_CVec_BlindedPathZNoneZ"); - *ret_conv = CResult_CVec_BlindedPathZNoneZ_clone(arg); +static inline uint64_t CResult_CVec_BlindedMessagePathZNoneZ_clone_ptr(LDKCResult_CVec_BlindedMessagePathZNoneZ *NONNULL_PTR arg) { + LDKCResult_CVec_BlindedMessagePathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedMessagePathZNoneZ), "LDKCResult_CVec_BlindedMessagePathZNoneZ"); + *ret_conv = CResult_CVec_BlindedMessagePathZNoneZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPathZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_CVec_BlindedPathZNoneZ* arg_conv = (LDKCResult_CVec_BlindedPathZNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_CVec_BlindedPathZNoneZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_CVec_BlindedMessagePathZNoneZ* arg_conv = (LDKCResult_CVec_BlindedMessagePathZNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_CVec_BlindedMessagePathZNoneZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPathZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_CVec_BlindedPathZNoneZ* orig_conv = (LDKCResult_CVec_BlindedPathZNoneZ*)untag_ptr(orig); - LDKCResult_CVec_BlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPathZNoneZ), "LDKCResult_CVec_BlindedPathZNoneZ"); - *ret_conv = CResult_CVec_BlindedPathZNoneZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_CVec_BlindedMessagePathZNoneZ* orig_conv = (LDKCResult_CVec_BlindedMessagePathZNoneZ*)untag_ptr(orig); + LDKCResult_CVec_BlindedMessagePathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedMessagePathZNoneZ), "LDKCResult_CVec_BlindedMessagePathZNoneZ"); + *ret_conv = CResult_CVec_BlindedMessagePathZNoneZ_clone(orig_conv); return tag_ptr(ret_conv, true); } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MessageForwardNodeZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_MessageForwardNodeZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMessageForwardNode), "LDKCVec_MessageForwardNodeZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t u = 0; u < _res_constr.datalen; u++) { + int64_t _res_conv_20 = _res_vals[u]; + LDKMessageForwardNode _res_conv_20_conv; + _res_conv_20_conv.inner = untag_ptr(_res_conv_20); + _res_conv_20_conv.is_owned = ptr_is_owned(_res_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_20_conv); + _res_constr.data[u] = _res_conv_20_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_MessageForwardNodeZ_free(_res_constr); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKInFlightHtlcs o_conv; o_conv.inner = untag_ptr(o); @@ -27207,26 +28579,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintZ_1free(JNIEnv CVec_RouteHintZ_free(_res_constr); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintHopZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_RouteHintHopZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t o = 0; o < _res_constr.datalen; o++) { - int64_t _res_conv_14 = _res_vals[o]; - LDKRouteHintHop _res_conv_14_conv; - _res_conv_14_conv.inner = untag_ptr(_res_conv_14); - _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv); - _res_constr.data[o] = _res_conv_14_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_RouteHintHopZ_free(_res_constr); -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKRouteHint o_conv; o_conv.inner = untag_ptr(o); @@ -28555,6 +29907,60 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithExp CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_free(_res_conv); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OfferDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKOffer o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = Offer_clone(&o_conv); + LDKCResult_OfferDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferDecodeErrorZ), "LDKCResult_OfferDecodeErrorZ"); + *ret_conv = CResult_OfferDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OfferDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_OfferDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferDecodeErrorZ), "LDKCResult_OfferDecodeErrorZ"); + *ret_conv = CResult_OfferDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OfferDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_OfferDecodeErrorZ* o_conv = (LDKCResult_OfferDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OfferDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OfferDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_OfferDecodeErrorZ _res_conv = *(LDKCResult_OfferDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_OfferDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_OfferDecodeErrorZ_clone_ptr(LDKCResult_OfferDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OfferDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferDecodeErrorZ), "LDKCResult_OfferDecodeErrorZ"); + *ret_conv = CResult_OfferDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OfferDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_OfferDecodeErrorZ* arg_conv = (LDKCResult_OfferDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OfferDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OfferDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_OfferDecodeErrorZ* orig_conv = (LDKCResult_OfferDecodeErrorZ*)untag_ptr(orig); + LDKCResult_OfferDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferDecodeErrorZ), "LDKCResult_OfferDecodeErrorZ"); + *ret_conv = CResult_OfferDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OfferBolt12ParseErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKOffer o_conv; o_conv.inner = untag_ptr(o); @@ -29241,11 +30647,10 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SocketAddressZ_1free(JNI } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKNodeAnnouncementInfo o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = NodeAnnouncementInfo_clone(&o_conv); + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKNodeAnnouncementInfo o_conv = *(LDKNodeAnnouncementInfo*)(o_ptr); + o_conv = NodeAnnouncementInfo_clone((LDKNodeAnnouncementInfo*)untag_ptr(o)); LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); @@ -29348,6 +30753,53 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErr return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NodeAnnouncementInfoZ_1some(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKNodeAnnouncementInfo o_conv = *(LDKNodeAnnouncementInfo*)(o_ptr); + o_conv = NodeAnnouncementInfo_clone((LDKNodeAnnouncementInfo*)untag_ptr(o)); + LDKCOption_NodeAnnouncementInfoZ *ret_copy = MALLOC(sizeof(LDKCOption_NodeAnnouncementInfoZ), "LDKCOption_NodeAnnouncementInfoZ"); + *ret_copy = COption_NodeAnnouncementInfoZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NodeAnnouncementInfoZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_NodeAnnouncementInfoZ *ret_copy = MALLOC(sizeof(LDKCOption_NodeAnnouncementInfoZ), "LDKCOption_NodeAnnouncementInfoZ"); + *ret_copy = COption_NodeAnnouncementInfoZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NodeAnnouncementInfoZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_NodeAnnouncementInfoZ _res_conv = *(LDKCOption_NodeAnnouncementInfoZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_NodeAnnouncementInfoZ_free(_res_conv); +} + +static inline uint64_t COption_NodeAnnouncementInfoZ_clone_ptr(LDKCOption_NodeAnnouncementInfoZ *NONNULL_PTR arg) { + LDKCOption_NodeAnnouncementInfoZ *ret_copy = MALLOC(sizeof(LDKCOption_NodeAnnouncementInfoZ), "LDKCOption_NodeAnnouncementInfoZ"); + *ret_copy = COption_NodeAnnouncementInfoZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NodeAnnouncementInfoZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_NodeAnnouncementInfoZ* arg_conv = (LDKCOption_NodeAnnouncementInfoZ*)untag_ptr(arg); + int64_t ret_conv = COption_NodeAnnouncementInfoZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NodeAnnouncementInfoZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_NodeAnnouncementInfoZ* orig_conv = (LDKCOption_NodeAnnouncementInfoZ*)untag_ptr(orig); + LDKCOption_NodeAnnouncementInfoZ *ret_copy = MALLOC(sizeof(LDKCOption_NodeAnnouncementInfoZ), "LDKCOption_NodeAnnouncementInfoZ"); + *ret_copy = COption_NodeAnnouncementInfoZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKNodeInfo o_conv; o_conv.inner = untag_ptr(o); @@ -30671,117 +32123,352 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesAPIE return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1OffersMessageZ_1some(JNIEnv *env, jclass clz, int64_t o) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1OffersContextZ_1some(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); - LDKOffersMessage o_conv = *(LDKOffersMessage*)(o_ptr); - o_conv = OffersMessage_clone((LDKOffersMessage*)untag_ptr(o)); - LDKCOption_OffersMessageZ *ret_copy = MALLOC(sizeof(LDKCOption_OffersMessageZ), "LDKCOption_OffersMessageZ"); - *ret_copy = COption_OffersMessageZ_some(o_conv); + LDKOffersContext o_conv = *(LDKOffersContext*)(o_ptr); + o_conv = OffersContext_clone((LDKOffersContext*)untag_ptr(o)); + LDKCOption_OffersContextZ *ret_copy = MALLOC(sizeof(LDKCOption_OffersContextZ), "LDKCOption_OffersContextZ"); + *ret_copy = COption_OffersContextZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1OffersContextZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_OffersContextZ *ret_copy = MALLOC(sizeof(LDKCOption_OffersContextZ), "LDKCOption_OffersContextZ"); + *ret_copy = COption_OffersContextZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1OffersContextZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_OffersContextZ _res_conv = *(LDKCOption_OffersContextZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_OffersContextZ_free(_res_conv); +} + +static inline uint64_t COption_OffersContextZ_clone_ptr(LDKCOption_OffersContextZ *NONNULL_PTR arg) { + LDKCOption_OffersContextZ *ret_copy = MALLOC(sizeof(LDKCOption_OffersContextZ), "LDKCOption_OffersContextZ"); + *ret_copy = COption_OffersContextZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1OffersContextZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_OffersContextZ* arg_conv = (LDKCOption_OffersContextZ*)untag_ptr(arg); + int64_t ret_conv = COption_OffersContextZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1OffersContextZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_OffersContextZ* orig_conv = (LDKCOption_OffersContextZ*)untag_ptr(orig); + LDKCOption_OffersContextZ *ret_copy = MALLOC(sizeof(LDKCOption_OffersContextZ), "LDKCOption_OffersContextZ"); + *ret_copy = COption_OffersContextZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline uint64_t C2Tuple_OffersMessageResponseInstructionZ_clone_ptr(LDKC2Tuple_OffersMessageResponseInstructionZ *NONNULL_PTR arg) { + LDKC2Tuple_OffersMessageResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OffersMessageResponseInstructionZ), "LDKC2Tuple_OffersMessageResponseInstructionZ"); + *ret_conv = C2Tuple_OffersMessageResponseInstructionZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OffersMessageResponseInstructionZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_OffersMessageResponseInstructionZ* arg_conv = (LDKC2Tuple_OffersMessageResponseInstructionZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_OffersMessageResponseInstructionZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OffersMessageResponseInstructionZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_OffersMessageResponseInstructionZ* orig_conv = (LDKC2Tuple_OffersMessageResponseInstructionZ*)untag_ptr(orig); + LDKC2Tuple_OffersMessageResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OffersMessageResponseInstructionZ), "LDKC2Tuple_OffersMessageResponseInstructionZ"); + *ret_conv = C2Tuple_OffersMessageResponseInstructionZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OffersMessageResponseInstructionZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKOffersMessage a_conv = *(LDKOffersMessage*)(a_ptr); + a_conv = OffersMessage_clone((LDKOffersMessage*)untag_ptr(a)); + LDKResponseInstruction b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv = ResponseInstruction_clone(&b_conv); + LDKC2Tuple_OffersMessageResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OffersMessageResponseInstructionZ), "LDKC2Tuple_OffersMessageResponseInstructionZ"); + *ret_conv = C2Tuple_OffersMessageResponseInstructionZ_new(a_conv, b_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OffersMessageResponseInstructionZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKC2Tuple_OffersMessageResponseInstructionZ _res_conv = *(LDKC2Tuple_OffersMessageResponseInstructionZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_OffersMessageResponseInstructionZ_free(_res_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1OffersMessageResponseInstructionZZ_1some(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_OffersMessageResponseInstructionZ o_conv = *(LDKC2Tuple_OffersMessageResponseInstructionZ*)(o_ptr); + o_conv = C2Tuple_OffersMessageResponseInstructionZ_clone((LDKC2Tuple_OffersMessageResponseInstructionZ*)untag_ptr(o)); + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ), "LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_OffersMessageResponseInstructionZZ_some(o_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1OffersMessageZ_1none(JNIEnv *env, jclass clz) { - LDKCOption_OffersMessageZ *ret_copy = MALLOC(sizeof(LDKCOption_OffersMessageZ), "LDKCOption_OffersMessageZ"); - *ret_copy = COption_OffersMessageZ_none(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1OffersMessageResponseInstructionZZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ), "LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_OffersMessageResponseInstructionZZ_none(); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1OffersMessageZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1OffersMessageResponseInstructionZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCOption_OffersMessageZ _res_conv = *(LDKCOption_OffersMessageZ*)(_res_ptr); + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ _res_conv = *(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_OffersMessageZ_free(_res_conv); + COption_C2Tuple_OffersMessageResponseInstructionZZ_free(_res_conv); } -static inline uint64_t COption_OffersMessageZ_clone_ptr(LDKCOption_OffersMessageZ *NONNULL_PTR arg) { - LDKCOption_OffersMessageZ *ret_copy = MALLOC(sizeof(LDKCOption_OffersMessageZ), "LDKCOption_OffersMessageZ"); - *ret_copy = COption_OffersMessageZ_clone(arg); +static inline uint64_t COption_C2Tuple_OffersMessageResponseInstructionZZ_clone_ptr(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ *NONNULL_PTR arg) { + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ), "LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_OffersMessageResponseInstructionZZ_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1OffersMessageZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCOption_OffersMessageZ* arg_conv = (LDKCOption_OffersMessageZ*)untag_ptr(arg); - int64_t ret_conv = COption_OffersMessageZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1OffersMessageResponseInstructionZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ* arg_conv = (LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ*)untag_ptr(arg); + int64_t ret_conv = COption_C2Tuple_OffersMessageResponseInstructionZZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1OffersMessageZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCOption_OffersMessageZ* orig_conv = (LDKCOption_OffersMessageZ*)untag_ptr(orig); - LDKCOption_OffersMessageZ *ret_copy = MALLOC(sizeof(LDKCOption_OffersMessageZ), "LDKCOption_OffersMessageZ"); - *ret_copy = COption_OffersMessageZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1OffersMessageResponseInstructionZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ* orig_conv = (LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ*)untag_ptr(orig); + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ), "LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_OffersMessageResponseInstructionZZ_clone(orig_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline uint64_t C3Tuple_OffersMessageDestinationBlindedPathZ_clone_ptr(LDKC3Tuple_OffersMessageDestinationBlindedPathZ *NONNULL_PTR arg) { - LDKC3Tuple_OffersMessageDestinationBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OffersMessageDestinationBlindedPathZ), "LDKC3Tuple_OffersMessageDestinationBlindedPathZ"); - *ret_conv = C3Tuple_OffersMessageDestinationBlindedPathZ_clone(arg); +static inline uint64_t C2Tuple_OffersMessageMessageSendInstructionsZ_clone_ptr(LDKC2Tuple_OffersMessageMessageSendInstructionsZ *NONNULL_PTR arg) { + LDKC2Tuple_OffersMessageMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OffersMessageMessageSendInstructionsZ), "LDKC2Tuple_OffersMessageMessageSendInstructionsZ"); + *ret_conv = C2Tuple_OffersMessageMessageSendInstructionsZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OffersMessageDestinationBlindedPathZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC3Tuple_OffersMessageDestinationBlindedPathZ* arg_conv = (LDKC3Tuple_OffersMessageDestinationBlindedPathZ*)untag_ptr(arg); - int64_t ret_conv = C3Tuple_OffersMessageDestinationBlindedPathZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OffersMessageMessageSendInstructionsZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_OffersMessageMessageSendInstructionsZ* arg_conv = (LDKC2Tuple_OffersMessageMessageSendInstructionsZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_OffersMessageMessageSendInstructionsZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OffersMessageDestinationBlindedPathZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC3Tuple_OffersMessageDestinationBlindedPathZ* orig_conv = (LDKC3Tuple_OffersMessageDestinationBlindedPathZ*)untag_ptr(orig); - LDKC3Tuple_OffersMessageDestinationBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OffersMessageDestinationBlindedPathZ), "LDKC3Tuple_OffersMessageDestinationBlindedPathZ"); - *ret_conv = C3Tuple_OffersMessageDestinationBlindedPathZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OffersMessageMessageSendInstructionsZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_OffersMessageMessageSendInstructionsZ* orig_conv = (LDKC2Tuple_OffersMessageMessageSendInstructionsZ*)untag_ptr(orig); + LDKC2Tuple_OffersMessageMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OffersMessageMessageSendInstructionsZ), "LDKC2Tuple_OffersMessageMessageSendInstructionsZ"); + *ret_conv = C2Tuple_OffersMessageMessageSendInstructionsZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OffersMessageDestinationBlindedPathZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b, int64_t c) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OffersMessageMessageSendInstructionsZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b) { void* a_ptr = untag_ptr(a); CHECK_ACCESS(a_ptr); LDKOffersMessage a_conv = *(LDKOffersMessage*)(a_ptr); a_conv = OffersMessage_clone((LDKOffersMessage*)untag_ptr(a)); void* b_ptr = untag_ptr(b); CHECK_ACCESS(b_ptr); - LDKDestination b_conv = *(LDKDestination*)(b_ptr); - b_conv = Destination_clone((LDKDestination*)untag_ptr(b)); - LDKBlindedPath c_conv; - c_conv.inner = untag_ptr(c); - c_conv.is_owned = ptr_is_owned(c); - CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv); - c_conv = BlindedPath_clone(&c_conv); - LDKC3Tuple_OffersMessageDestinationBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OffersMessageDestinationBlindedPathZ), "LDKC3Tuple_OffersMessageDestinationBlindedPathZ"); - *ret_conv = C3Tuple_OffersMessageDestinationBlindedPathZ_new(a_conv, b_conv, c_conv); + LDKMessageSendInstructions b_conv = *(LDKMessageSendInstructions*)(b_ptr); + b_conv = MessageSendInstructions_clone((LDKMessageSendInstructions*)untag_ptr(b)); + LDKC2Tuple_OffersMessageMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OffersMessageMessageSendInstructionsZ), "LDKC2Tuple_OffersMessageMessageSendInstructionsZ"); + *ret_conv = C2Tuple_OffersMessageMessageSendInstructionsZ_new(a_conv, b_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OffersMessageDestinationBlindedPathZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OffersMessageMessageSendInstructionsZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKC3Tuple_OffersMessageDestinationBlindedPathZ _res_conv = *(LDKC3Tuple_OffersMessageDestinationBlindedPathZ*)(_res_ptr); + LDKC2Tuple_OffersMessageMessageSendInstructionsZ _res_conv = *(LDKC2Tuple_OffersMessageMessageSendInstructionsZ*)(_res_ptr); FREE(untag_ptr(_res)); - C3Tuple_OffersMessageDestinationBlindedPathZ_free(_res_conv); + C2Tuple_OffersMessageMessageSendInstructionsZ_free(_res_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C3Tuple_1OffersMessageDestinationBlindedPathZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ _res_constr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1OffersMessageMessageSendInstructionsZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC3Tuple_OffersMessageDestinationBlindedPathZ), "LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OffersMessageMessageSendInstructionsZ), "LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ Elements"); else _res_constr.data = NULL; int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t x = 0; x < _res_constr.datalen; x++) { - int64_t _res_conv_49 = _res_vals[x]; - void* _res_conv_49_ptr = untag_ptr(_res_conv_49); - CHECK_ACCESS(_res_conv_49_ptr); - LDKC3Tuple_OffersMessageDestinationBlindedPathZ _res_conv_49_conv = *(LDKC3Tuple_OffersMessageDestinationBlindedPathZ*)(_res_conv_49_ptr); - FREE(untag_ptr(_res_conv_49)); - _res_constr.data[x] = _res_conv_49_conv; + for (size_t w = 0; w < _res_constr.datalen; w++) { + int64_t _res_conv_48 = _res_vals[w]; + void* _res_conv_48_ptr = untag_ptr(_res_conv_48); + CHECK_ACCESS(_res_conv_48_ptr); + LDKC2Tuple_OffersMessageMessageSendInstructionsZ _res_conv_48_conv = *(LDKC2Tuple_OffersMessageMessageSendInstructionsZ*)(_res_conv_48_ptr); + FREE(untag_ptr(_res_conv_48)); + _res_constr.data[w] = _res_conv_48_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_C3Tuple_OffersMessageDestinationBlindedPathZZ_free(_res_constr); + CVec_C2Tuple_OffersMessageMessageSendInstructionsZZ_free(_res_constr); +} + +static inline uint64_t C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone_ptr(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ *NONNULL_PTR arg) { + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ), "LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ"); + *ret_conv = C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1ReleaseHeldHtlcResponseInstructionZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ* arg_conv = (LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1ReleaseHeldHtlcResponseInstructionZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ* orig_conv = (LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ*)untag_ptr(orig); + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ), "LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ"); + *ret_conv = C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1ReleaseHeldHtlcResponseInstructionZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKReleaseHeldHtlc a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = ReleaseHeldHtlc_clone(&a_conv); + LDKResponseInstruction b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv = ResponseInstruction_clone(&b_conv); + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ), "LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ"); + *ret_conv = C2Tuple_ReleaseHeldHtlcResponseInstructionZ_new(a_conv, b_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1ReleaseHeldHtlcResponseInstructionZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ _res_conv = *(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_ReleaseHeldHtlcResponseInstructionZ_free(_res_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1ReleaseHeldHtlcResponseInstructionZZ_1some(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ o_conv = *(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ*)(o_ptr); + o_conv = C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone((LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ*)untag_ptr(o)); + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ), "LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1ReleaseHeldHtlcResponseInstructionZZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ), "LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1ReleaseHeldHtlcResponseInstructionZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ _res_conv = *(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_free(_res_conv); +} + +static inline uint64_t COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone_ptr(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ *NONNULL_PTR arg) { + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ), "LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1ReleaseHeldHtlcResponseInstructionZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ* arg_conv = (LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ*)untag_ptr(arg); + int64_t ret_conv = COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1ReleaseHeldHtlcResponseInstructionZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ* orig_conv = (LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ*)untag_ptr(orig); + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ), "LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline uint64_t C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone_ptr(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ *NONNULL_PTR arg) { + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ), "LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ"); + *ret_conv = C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1AsyncPaymentsMessageMessageSendInstructionsZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ* arg_conv = (LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1AsyncPaymentsMessageMessageSendInstructionsZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ* orig_conv = (LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ*)untag_ptr(orig); + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ), "LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ"); + *ret_conv = C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1AsyncPaymentsMessageMessageSendInstructionsZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKAsyncPaymentsMessage a_conv = *(LDKAsyncPaymentsMessage*)(a_ptr); + a_conv = AsyncPaymentsMessage_clone((LDKAsyncPaymentsMessage*)untag_ptr(a)); + void* b_ptr = untag_ptr(b); + CHECK_ACCESS(b_ptr); + LDKMessageSendInstructions b_conv = *(LDKMessageSendInstructions*)(b_ptr); + b_conv = MessageSendInstructions_clone((LDKMessageSendInstructions*)untag_ptr(b)); + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ), "LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ"); + *ret_conv = C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_new(a_conv, b_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1AsyncPaymentsMessageMessageSendInstructionsZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ _res_conv = *(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_free(_res_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1AsyncPaymentsMessageMessageSendInstructionsZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ), "LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t d = 0; d < _res_constr.datalen; d++) { + int64_t _res_conv_55 = _res_vals[d]; + void* _res_conv_55_ptr = untag_ptr(_res_conv_55); + CHECK_ACCESS(_res_conv_55_ptr); + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ _res_conv_55_conv = *(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ*)(_res_conv_55_ptr); + FREE(untag_ptr(_res_conv_55)); + _res_constr.data[d] = _res_conv_55_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ_free(_res_constr); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { @@ -31761,6 +33448,56 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1ThirtyTwoBytesC CVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ_free(_res_constr); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneReplayEventZ_1ok(JNIEnv *env, jclass clz) { + LDKCResult_NoneReplayEventZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneReplayEventZ), "LDKCResult_NoneReplayEventZ"); + *ret_conv = CResult_NoneReplayEventZ_ok(); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneReplayEventZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKReplayEvent e_conv; + e_conv.inner = untag_ptr(e); + e_conv.is_owned = ptr_is_owned(e); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = ReplayEvent_clone(&e_conv); + LDKCResult_NoneReplayEventZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneReplayEventZ), "LDKCResult_NoneReplayEventZ"); + *ret_conv = CResult_NoneReplayEventZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneReplayEventZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneReplayEventZ* o_conv = (LDKCResult_NoneReplayEventZ*)untag_ptr(o); + jboolean ret_conv = CResult_NoneReplayEventZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneReplayEventZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_NoneReplayEventZ _res_conv = *(LDKCResult_NoneReplayEventZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_NoneReplayEventZ_free(_res_conv); +} + +static inline uint64_t CResult_NoneReplayEventZ_clone_ptr(LDKCResult_NoneReplayEventZ *NONNULL_PTR arg) { + LDKCResult_NoneReplayEventZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneReplayEventZ), "LDKCResult_NoneReplayEventZ"); + *ret_conv = CResult_NoneReplayEventZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneReplayEventZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NoneReplayEventZ* arg_conv = (LDKCResult_NoneReplayEventZ*)untag_ptr(arg); + int64_t ret_conv = CResult_NoneReplayEventZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneReplayEventZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_NoneReplayEventZ* orig_conv = (LDKCResult_NoneReplayEventZ*)untag_ptr(orig); + LDKCResult_NoneReplayEventZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneReplayEventZ), "LDKCResult_NoneReplayEventZ"); + *ret_conv = CResult_NoneReplayEventZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CommitmentTransactionZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { LDKCVec_CommitmentTransactionZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); @@ -32087,76 +33824,96 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1PublicKeyTypeZZ CVec_C2Tuple_PublicKeyTypeZZ_free(_res_constr); } -static inline uint64_t C2Tuple_PublicKeyCVec_SocketAddressZZ_clone_ptr(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *NONNULL_PTR arg) { - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ), "LDKC2Tuple_PublicKeyCVec_SocketAddressZZ"); - *ret_conv = C2Tuple_PublicKeyCVec_SocketAddressZZ_clone(arg); +static inline uint64_t C2Tuple_OnionMessageContentsResponseInstructionZ_clone_ptr(LDKC2Tuple_OnionMessageContentsResponseInstructionZ *NONNULL_PTR arg) { + LDKC2Tuple_OnionMessageContentsResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OnionMessageContentsResponseInstructionZ), "LDKC2Tuple_OnionMessageContentsResponseInstructionZ"); + *ret_conv = C2Tuple_OnionMessageContentsResponseInstructionZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyCVec_1SocketAddressZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* arg_conv = (LDKC2Tuple_PublicKeyCVec_SocketAddressZZ*)untag_ptr(arg); - int64_t ret_conv = C2Tuple_PublicKeyCVec_SocketAddressZZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OnionMessageContentsResponseInstructionZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_OnionMessageContentsResponseInstructionZ* arg_conv = (LDKC2Tuple_OnionMessageContentsResponseInstructionZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_OnionMessageContentsResponseInstructionZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyCVec_1SocketAddressZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* orig_conv = (LDKC2Tuple_PublicKeyCVec_SocketAddressZZ*)untag_ptr(orig); - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ), "LDKC2Tuple_PublicKeyCVec_SocketAddressZZ"); - *ret_conv = C2Tuple_PublicKeyCVec_SocketAddressZZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OnionMessageContentsResponseInstructionZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_OnionMessageContentsResponseInstructionZ* orig_conv = (LDKC2Tuple_OnionMessageContentsResponseInstructionZ*)untag_ptr(orig); + LDKC2Tuple_OnionMessageContentsResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OnionMessageContentsResponseInstructionZ), "LDKC2Tuple_OnionMessageContentsResponseInstructionZ"); + *ret_conv = C2Tuple_OnionMessageContentsResponseInstructionZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyCVec_1SocketAddressZZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_tArray b) { - LDKPublicKey a_ref; - CHECK((*env)->GetArrayLength(env, a) == 33); - (*env)->GetByteArrayRegion(env, a, 0, 33, a_ref.compressed_form); - LDKCVec_SocketAddressZ b_constr; - b_constr.datalen = (*env)->GetArrayLength(env, b); - if (b_constr.datalen > 0) - b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKSocketAddress), "LDKCVec_SocketAddressZ Elements"); - else - b_constr.data = NULL; - int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL); - for (size_t p = 0; p < b_constr.datalen; p++) { - int64_t b_conv_15 = b_vals[p]; - void* b_conv_15_ptr = untag_ptr(b_conv_15); - CHECK_ACCESS(b_conv_15_ptr); - LDKSocketAddress b_conv_15_conv = *(LDKSocketAddress*)(b_conv_15_ptr); - b_conv_15_conv = SocketAddress_clone((LDKSocketAddress*)untag_ptr(b_conv_15)); - b_constr.data[p] = b_conv_15_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OnionMessageContentsResponseInstructionZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKOnionMessageContents a_conv = *(LDKOnionMessageContents*)(a_ptr); + if (a_conv.free == LDKOnionMessageContents_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOnionMessageContents_JCalls_cloned(&a_conv); } - (*env)->ReleaseLongArrayElements(env, b, b_vals, 0); - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ), "LDKC2Tuple_PublicKeyCVec_SocketAddressZZ"); - *ret_conv = C2Tuple_PublicKeyCVec_SocketAddressZZ_new(a_ref, b_constr); + LDKResponseInstruction b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv = ResponseInstruction_clone(&b_conv); + LDKC2Tuple_OnionMessageContentsResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OnionMessageContentsResponseInstructionZ), "LDKC2Tuple_OnionMessageContentsResponseInstructionZ"); + *ret_conv = C2Tuple_OnionMessageContentsResponseInstructionZ_new(a_conv, b_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyCVec_1SocketAddressZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OnionMessageContentsResponseInstructionZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ _res_conv = *(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ*)(_res_ptr); + LDKC2Tuple_OnionMessageContentsResponseInstructionZ _res_conv = *(LDKC2Tuple_OnionMessageContentsResponseInstructionZ*)(_res_ptr); FREE(untag_ptr(_res)); - C2Tuple_PublicKeyCVec_SocketAddressZZ_free(_res_conv); + C2Tuple_OnionMessageContentsResponseInstructionZ_free(_res_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1PublicKeyCVec_1SocketAddressZZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ), "LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t o = 0; o < _res_constr.datalen; o++) { - int64_t _res_conv_40 = _res_vals[o]; - void* _res_conv_40_ptr = untag_ptr(_res_conv_40); - CHECK_ACCESS(_res_conv_40_ptr); - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ _res_conv_40_conv = *(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ*)(_res_conv_40_ptr); - FREE(untag_ptr(_res_conv_40)); - _res_constr.data[o] = _res_conv_40_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ_free(_res_constr); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1OnionMessageContentsResponseInstructionZZ_1some(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_OnionMessageContentsResponseInstructionZ o_conv = *(LDKC2Tuple_OnionMessageContentsResponseInstructionZ*)(o_ptr); + o_conv = C2Tuple_OnionMessageContentsResponseInstructionZ_clone((LDKC2Tuple_OnionMessageContentsResponseInstructionZ*)untag_ptr(o)); + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ), "LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1OnionMessageContentsResponseInstructionZZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ), "LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1OnionMessageContentsResponseInstructionZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ _res_conv = *(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_free(_res_conv); +} + +static inline uint64_t COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone_ptr(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ *NONNULL_PTR arg) { + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ), "LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1OnionMessageContentsResponseInstructionZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ* arg_conv = (LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ*)untag_ptr(arg); + int64_t ret_conv = COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1OnionMessageContentsResponseInstructionZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ* orig_conv = (LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ*)untag_ptr(orig); + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ), "LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1OnionMessageContentsZ_1some(JNIEnv *env, jclass clz, int64_t o) { @@ -32262,25 +34019,25 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1OnionMess return tag_ptr(ret_conv, true); } -static inline uint64_t C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone_ptr(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *NONNULL_PTR arg) { - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ), "LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ"); - *ret_conv = C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone(arg); +static inline uint64_t C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone_ptr(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ *NONNULL_PTR arg) { + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ), "LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ"); + *ret_conv = C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OnionMessageContentsDestinationBlindedPathZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ* arg_conv = (LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ*)untag_ptr(arg); - int64_t ret_conv = C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OnionMessageContentsMessageSendInstructionsZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ* arg_conv = (LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OnionMessageContentsDestinationBlindedPathZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ* orig_conv = (LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ*)untag_ptr(orig); - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ), "LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ"); - *ret_conv = C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OnionMessageContentsMessageSendInstructionsZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ* orig_conv = (LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ*)untag_ptr(orig); + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ), "LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ"); + *ret_conv = C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OnionMessageContentsDestinationBlindedPathZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b, int64_t c) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OnionMessageContentsMessageSendInstructionsZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b) { void* a_ptr = untag_ptr(a); CHECK_ACCESS(a_ptr); LDKOnionMessageContents a_conv = *(LDKOnionMessageContents*)(a_ptr); @@ -32290,45 +34047,40 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OnionMessageConten } void* b_ptr = untag_ptr(b); CHECK_ACCESS(b_ptr); - LDKDestination b_conv = *(LDKDestination*)(b_ptr); - b_conv = Destination_clone((LDKDestination*)untag_ptr(b)); - LDKBlindedPath c_conv; - c_conv.inner = untag_ptr(c); - c_conv.is_owned = ptr_is_owned(c); - CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv); - c_conv = BlindedPath_clone(&c_conv); - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ), "LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ"); - *ret_conv = C3Tuple_OnionMessageContentsDestinationBlindedPathZ_new(a_conv, b_conv, c_conv); + LDKMessageSendInstructions b_conv = *(LDKMessageSendInstructions*)(b_ptr); + b_conv = MessageSendInstructions_clone((LDKMessageSendInstructions*)untag_ptr(b)); + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ), "LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ"); + *ret_conv = C2Tuple_OnionMessageContentsMessageSendInstructionsZ_new(a_conv, b_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OnionMessageContentsDestinationBlindedPathZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OnionMessageContentsMessageSendInstructionsZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ _res_conv = *(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ*)(_res_ptr); + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ _res_conv = *(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ*)(_res_ptr); FREE(untag_ptr(_res)); - C3Tuple_OnionMessageContentsDestinationBlindedPathZ_free(_res_conv); + C2Tuple_OnionMessageContentsMessageSendInstructionsZ_free(_res_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C3Tuple_1OnionMessageContentsDestinationBlindedPathZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ _res_constr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1OnionMessageContentsMessageSendInstructionsZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ), "LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ), "LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ Elements"); else _res_constr.data = NULL; int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t e = 0; e < _res_constr.datalen; e++) { - int64_t _res_conv_56 = _res_vals[e]; - void* _res_conv_56_ptr = untag_ptr(_res_conv_56); - CHECK_ACCESS(_res_conv_56_ptr); - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ _res_conv_56_conv = *(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ*)(_res_conv_56_ptr); - FREE(untag_ptr(_res_conv_56)); - _res_constr.data[e] = _res_conv_56_conv; + for (size_t d = 0; d < _res_constr.datalen; d++) { + int64_t _res_conv_55 = _res_vals[d]; + void* _res_conv_55_ptr = untag_ptr(_res_conv_55); + CHECK_ACCESS(_res_conv_55_ptr); + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ _res_conv_55_conv = *(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ*)(_res_conv_55_ptr); + FREE(untag_ptr(_res_conv_55)); + _res_constr.data[d] = _res_conv_55_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ_free(_res_constr); + CVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ_free(_res_constr); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1some(JNIEnv *env, jclass clz, int64_t o) { @@ -32736,21 +34488,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZIOErrorZ_ return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1StrZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) { - LDKCVec_StrZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKStr), "LDKCVec_StrZ Elements"); - else - _res_constr.data = NULL; - for (size_t i = 0; i < _res_constr.datalen; i++) { - jstring _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i); - LDKStr dummy = { .chars = NULL, .len = 0, .chars_is_owned = false }; - _res_constr.data[i] = dummy; - } - CVec_StrZ_free(_res_constr); -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1StrZIOErrorZ_1ok(JNIEnv *env, jclass clz, jobjectArray o) { LDKCVec_StrZ o_constr; o_constr.datalen = (*env)->GetArrayLength(env, o); @@ -33042,52 +34779,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestBolt return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1SecretKeyZ_1some(JNIEnv *env, jclass clz, int8_tArray o) { - LDKSecretKey o_ref; - CHECK((*env)->GetArrayLength(env, o) == 32); - (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.bytes); - LDKCOption_SecretKeyZ *ret_copy = MALLOC(sizeof(LDKCOption_SecretKeyZ), "LDKCOption_SecretKeyZ"); - *ret_copy = COption_SecretKeyZ_some(o_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1SecretKeyZ_1none(JNIEnv *env, jclass clz) { - LDKCOption_SecretKeyZ *ret_copy = MALLOC(sizeof(LDKCOption_SecretKeyZ), "LDKCOption_SecretKeyZ"); - *ret_copy = COption_SecretKeyZ_none(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1SecretKeyZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCOption_SecretKeyZ _res_conv = *(LDKCOption_SecretKeyZ*)(_res_ptr); - FREE(untag_ptr(_res)); - COption_SecretKeyZ_free(_res_conv); -} - -static inline uint64_t COption_SecretKeyZ_clone_ptr(LDKCOption_SecretKeyZ *NONNULL_PTR arg) { - LDKCOption_SecretKeyZ *ret_copy = MALLOC(sizeof(LDKCOption_SecretKeyZ), "LDKCOption_SecretKeyZ"); - *ret_copy = COption_SecretKeyZ_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1SecretKeyZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCOption_SecretKeyZ* arg_conv = (LDKCOption_SecretKeyZ*)untag_ptr(arg); - int64_t ret_conv = COption_SecretKeyZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1SecretKeyZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCOption_SecretKeyZ* orig_conv = (LDKCOption_SecretKeyZ*)untag_ptr(orig); - LDKCOption_SecretKeyZ *ret_copy = MALLOC(sizeof(LDKCOption_SecretKeyZ), "LDKCOption_SecretKeyZ"); - *ret_copy = COption_SecretKeyZ_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKInvoiceWithExplicitSigningPubkeyBuilder o_conv; o_conv.inner = untag_ptr(o); @@ -33728,57 +35419,57 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StfuDecodeErrorZ_1 return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKSplice o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceInitDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKSpliceInit o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = Splice_clone(&o_conv); - LDKCResult_SpliceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceDecodeErrorZ), "LDKCResult_SpliceDecodeErrorZ"); - *ret_conv = CResult_SpliceDecodeErrorZ_ok(o_conv); + o_conv = SpliceInit_clone(&o_conv); + LDKCResult_SpliceInitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceInitDecodeErrorZ), "LDKCResult_SpliceInitDecodeErrorZ"); + *ret_conv = CResult_SpliceInitDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceInitDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_SpliceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceDecodeErrorZ), "LDKCResult_SpliceDecodeErrorZ"); - *ret_conv = CResult_SpliceDecodeErrorZ_err(e_conv); + LDKCResult_SpliceInitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceInitDecodeErrorZ), "LDKCResult_SpliceInitDecodeErrorZ"); + *ret_conv = CResult_SpliceInitDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_SpliceDecodeErrorZ* o_conv = (LDKCResult_SpliceDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_SpliceDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceInitDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_SpliceInitDecodeErrorZ* o_conv = (LDKCResult_SpliceInitDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_SpliceInitDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceInitDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_SpliceDecodeErrorZ _res_conv = *(LDKCResult_SpliceDecodeErrorZ*)(_res_ptr); + LDKCResult_SpliceInitDecodeErrorZ _res_conv = *(LDKCResult_SpliceInitDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_SpliceDecodeErrorZ_free(_res_conv); + CResult_SpliceInitDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_SpliceDecodeErrorZ_clone_ptr(LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_SpliceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceDecodeErrorZ), "LDKCResult_SpliceDecodeErrorZ"); - *ret_conv = CResult_SpliceDecodeErrorZ_clone(arg); +static inline uint64_t CResult_SpliceInitDecodeErrorZ_clone_ptr(LDKCResult_SpliceInitDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_SpliceInitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceInitDecodeErrorZ), "LDKCResult_SpliceInitDecodeErrorZ"); + *ret_conv = CResult_SpliceInitDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_SpliceDecodeErrorZ* arg_conv = (LDKCResult_SpliceDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_SpliceDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceInitDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_SpliceInitDecodeErrorZ* arg_conv = (LDKCResult_SpliceInitDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_SpliceInitDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_SpliceDecodeErrorZ* orig_conv = (LDKCResult_SpliceDecodeErrorZ*)untag_ptr(orig); - LDKCResult_SpliceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceDecodeErrorZ), "LDKCResult_SpliceDecodeErrorZ"); - *ret_conv = CResult_SpliceDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceInitDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_SpliceInitDecodeErrorZ* orig_conv = (LDKCResult_SpliceInitDecodeErrorZ*)untag_ptr(orig); + LDKCResult_SpliceInitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceInitDecodeErrorZ), "LDKCResult_SpliceInitDecodeErrorZ"); + *ret_conv = CResult_SpliceInitDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -34592,6 +36283,60 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRa return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedBatchDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCommitmentSignedBatch o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = CommitmentSignedBatch_clone(&o_conv); + LDKCResult_CommitmentSignedBatchDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedBatchDecodeErrorZ), "LDKCResult_CommitmentSignedBatchDecodeErrorZ"); + *ret_conv = CResult_CommitmentSignedBatchDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedBatchDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_CommitmentSignedBatchDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedBatchDecodeErrorZ), "LDKCResult_CommitmentSignedBatchDecodeErrorZ"); + *ret_conv = CResult_CommitmentSignedBatchDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedBatchDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_CommitmentSignedBatchDecodeErrorZ* o_conv = (LDKCResult_CommitmentSignedBatchDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_CommitmentSignedBatchDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedBatchDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_CommitmentSignedBatchDecodeErrorZ _res_conv = *(LDKCResult_CommitmentSignedBatchDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_CommitmentSignedBatchDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_CommitmentSignedBatchDecodeErrorZ_clone_ptr(LDKCResult_CommitmentSignedBatchDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_CommitmentSignedBatchDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedBatchDecodeErrorZ), "LDKCResult_CommitmentSignedBatchDecodeErrorZ"); + *ret_conv = CResult_CommitmentSignedBatchDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedBatchDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_CommitmentSignedBatchDecodeErrorZ* arg_conv = (LDKCResult_CommitmentSignedBatchDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_CommitmentSignedBatchDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedBatchDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_CommitmentSignedBatchDecodeErrorZ* orig_conv = (LDKCResult_CommitmentSignedBatchDecodeErrorZ*)untag_ptr(orig); + LDKCResult_CommitmentSignedBatchDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedBatchDecodeErrorZ), "LDKCResult_CommitmentSignedBatchDecodeErrorZ"); + *ret_conv = CResult_CommitmentSignedBatchDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKCommitmentSigned o_conv; o_conv.inner = untag_ptr(o); @@ -36320,80 +38065,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFil return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PhantomRouteHintsZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_PhantomRouteHintsZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t t = 0; t < _res_constr.datalen; t++) { - int64_t _res_conv_19 = _res_vals[t]; - LDKPhantomRouteHints _res_conv_19_conv; - _res_conv_19_conv.inner = untag_ptr(_res_conv_19); - _res_conv_19_conv.is_owned = ptr_is_owned(_res_conv_19); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_19_conv); - _res_constr.data[t] = _res_conv_19_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_PhantomRouteHintsZ_free(_res_constr); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKBolt11Invoice o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = Bolt11Invoice_clone(&o_conv); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKSignOrCreationError e_conv = *(LDKSignOrCreationError*)(e_ptr); - e_conv = SignOrCreationError_clone((LDKSignOrCreationError*)untag_ptr(e)); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* o_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ _res_conv = *(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_Bolt11InvoiceSignOrCreationErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_Bolt11InvoiceSignOrCreationErrorZ_clone_ptr(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR arg) { - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* arg_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* orig_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(orig); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1InboundHTLCStateDetailsZ_1some(JNIEnv *env, jclass clz, jclass o) { LDKInboundHTLCStateDetails o_conv = LDKInboundHTLCStateDetails_from_java(env, o); LDKCOption_InboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_InboundHTLCStateDetailsZ), "LDKCOption_InboundHTLCStateDetailsZ"); @@ -37012,6 +38683,167 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1FutureZ_1free(JNIEnv *en CVec_FutureZ_free(_res_constr); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HeldHtlcAvailableDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKHeldHtlcAvailable o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = HeldHtlcAvailable_clone(&o_conv); + LDKCResult_HeldHtlcAvailableDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HeldHtlcAvailableDecodeErrorZ), "LDKCResult_HeldHtlcAvailableDecodeErrorZ"); + *ret_conv = CResult_HeldHtlcAvailableDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HeldHtlcAvailableDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_HeldHtlcAvailableDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HeldHtlcAvailableDecodeErrorZ), "LDKCResult_HeldHtlcAvailableDecodeErrorZ"); + *ret_conv = CResult_HeldHtlcAvailableDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HeldHtlcAvailableDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_HeldHtlcAvailableDecodeErrorZ* o_conv = (LDKCResult_HeldHtlcAvailableDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_HeldHtlcAvailableDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HeldHtlcAvailableDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_HeldHtlcAvailableDecodeErrorZ _res_conv = *(LDKCResult_HeldHtlcAvailableDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_HeldHtlcAvailableDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_HeldHtlcAvailableDecodeErrorZ_clone_ptr(LDKCResult_HeldHtlcAvailableDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HeldHtlcAvailableDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HeldHtlcAvailableDecodeErrorZ), "LDKCResult_HeldHtlcAvailableDecodeErrorZ"); + *ret_conv = CResult_HeldHtlcAvailableDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HeldHtlcAvailableDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_HeldHtlcAvailableDecodeErrorZ* arg_conv = (LDKCResult_HeldHtlcAvailableDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_HeldHtlcAvailableDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HeldHtlcAvailableDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_HeldHtlcAvailableDecodeErrorZ* orig_conv = (LDKCResult_HeldHtlcAvailableDecodeErrorZ*)untag_ptr(orig); + LDKCResult_HeldHtlcAvailableDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HeldHtlcAvailableDecodeErrorZ), "LDKCResult_HeldHtlcAvailableDecodeErrorZ"); + *ret_conv = CResult_HeldHtlcAvailableDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReleaseHeldHtlcDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKReleaseHeldHtlc o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = ReleaseHeldHtlc_clone(&o_conv); + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReleaseHeldHtlcDecodeErrorZ), "LDKCResult_ReleaseHeldHtlcDecodeErrorZ"); + *ret_conv = CResult_ReleaseHeldHtlcDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReleaseHeldHtlcDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReleaseHeldHtlcDecodeErrorZ), "LDKCResult_ReleaseHeldHtlcDecodeErrorZ"); + *ret_conv = CResult_ReleaseHeldHtlcDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ReleaseHeldHtlcDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* o_conv = (LDKCResult_ReleaseHeldHtlcDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ReleaseHeldHtlcDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ReleaseHeldHtlcDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_ReleaseHeldHtlcDecodeErrorZ _res_conv = *(LDKCResult_ReleaseHeldHtlcDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_ReleaseHeldHtlcDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_ReleaseHeldHtlcDecodeErrorZ_clone_ptr(LDKCResult_ReleaseHeldHtlcDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReleaseHeldHtlcDecodeErrorZ), "LDKCResult_ReleaseHeldHtlcDecodeErrorZ"); + *ret_conv = CResult_ReleaseHeldHtlcDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReleaseHeldHtlcDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* arg_conv = (LDKCResult_ReleaseHeldHtlcDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ReleaseHeldHtlcDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReleaseHeldHtlcDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* orig_conv = (LDKCResult_ReleaseHeldHtlcDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReleaseHeldHtlcDecodeErrorZ), "LDKCResult_ReleaseHeldHtlcDecodeErrorZ"); + *ret_conv = CResult_ReleaseHeldHtlcDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsMessageDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKAsyncPaymentsMessage o_conv = *(LDKAsyncPaymentsMessage*)(o_ptr); + o_conv = AsyncPaymentsMessage_clone((LDKAsyncPaymentsMessage*)untag_ptr(o)); + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AsyncPaymentsMessageDecodeErrorZ), "LDKCResult_AsyncPaymentsMessageDecodeErrorZ"); + *ret_conv = CResult_AsyncPaymentsMessageDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsMessageDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AsyncPaymentsMessageDecodeErrorZ), "LDKCResult_AsyncPaymentsMessageDecodeErrorZ"); + *ret_conv = CResult_AsyncPaymentsMessageDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsMessageDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* o_conv = (LDKCResult_AsyncPaymentsMessageDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_AsyncPaymentsMessageDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsMessageDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_AsyncPaymentsMessageDecodeErrorZ _res_conv = *(LDKCResult_AsyncPaymentsMessageDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_AsyncPaymentsMessageDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_AsyncPaymentsMessageDecodeErrorZ_clone_ptr(LDKCResult_AsyncPaymentsMessageDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AsyncPaymentsMessageDecodeErrorZ), "LDKCResult_AsyncPaymentsMessageDecodeErrorZ"); + *ret_conv = CResult_AsyncPaymentsMessageDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsMessageDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* arg_conv = (LDKCResult_AsyncPaymentsMessageDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_AsyncPaymentsMessageDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsMessageDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* orig_conv = (LDKCResult_AsyncPaymentsMessageDecodeErrorZ*)untag_ptr(orig); + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AsyncPaymentsMessageDecodeErrorZ), "LDKCResult_AsyncPaymentsMessageDecodeErrorZ"); + *ret_conv = CResult_AsyncPaymentsMessageDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OffersMessageDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -37870,6 +39702,59 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TransactionZ_1free(JNIEn CVec_TransactionZ_free(_res_constr); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKFundingInfo o_conv = *(LDKFundingInfo*)(o_ptr); + o_conv = FundingInfo_clone((LDKFundingInfo*)untag_ptr(o)); + LDKCResult_FundingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingInfoDecodeErrorZ), "LDKCResult_FundingInfoDecodeErrorZ"); + *ret_conv = CResult_FundingInfoDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_FundingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingInfoDecodeErrorZ), "LDKCResult_FundingInfoDecodeErrorZ"); + *ret_conv = CResult_FundingInfoDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FundingInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_FundingInfoDecodeErrorZ* o_conv = (LDKCResult_FundingInfoDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_FundingInfoDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_FundingInfoDecodeErrorZ _res_conv = *(LDKCResult_FundingInfoDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_FundingInfoDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_FundingInfoDecodeErrorZ_clone_ptr(LDKCResult_FundingInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_FundingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingInfoDecodeErrorZ), "LDKCResult_FundingInfoDecodeErrorZ"); + *ret_conv = CResult_FundingInfoDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_FundingInfoDecodeErrorZ* arg_conv = (LDKCResult_FundingInfoDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_FundingInfoDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_FundingInfoDecodeErrorZ* orig_conv = (LDKCResult_FundingInfoDecodeErrorZ*)untag_ptr(orig); + LDKCResult_FundingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingInfoDecodeErrorZ), "LDKCResult_FundingInfoDecodeErrorZ"); + *ret_conv = CResult_FundingInfoDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -38277,53 +40162,100 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDesti return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentFailureReasonDecodeErrorZ_1ok(JNIEnv *env, jclass clz, jclass o) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1PaymentFailureReasonZ_1some(JNIEnv *env, jclass clz, jclass o) { LDKPaymentFailureReason o_conv = LDKPaymentFailureReason_from_java(env, o); - LDKCResult_PaymentFailureReasonDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentFailureReasonDecodeErrorZ), "LDKCResult_PaymentFailureReasonDecodeErrorZ"); - *ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_ok(o_conv); + LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); + *ret_copy = COption_PaymentFailureReasonZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1PaymentFailureReasonZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); + *ret_copy = COption_PaymentFailureReasonZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1PaymentFailureReasonZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_PaymentFailureReasonZ _res_conv = *(LDKCOption_PaymentFailureReasonZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_PaymentFailureReasonZ_free(_res_conv); +} + +static inline uint64_t COption_PaymentFailureReasonZ_clone_ptr(LDKCOption_PaymentFailureReasonZ *NONNULL_PTR arg) { + LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); + *ret_copy = COption_PaymentFailureReasonZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1PaymentFailureReasonZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_PaymentFailureReasonZ* arg_conv = (LDKCOption_PaymentFailureReasonZ*)untag_ptr(arg); + int64_t ret_conv = COption_PaymentFailureReasonZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1PaymentFailureReasonZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_PaymentFailureReasonZ* orig_conv = (LDKCOption_PaymentFailureReasonZ*)untag_ptr(orig); + LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); + *ret_copy = COption_PaymentFailureReasonZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PaymentFailureReasonZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKCOption_PaymentFailureReasonZ o_conv = *(LDKCOption_PaymentFailureReasonZ*)(o_ptr); + o_conv = COption_PaymentFailureReasonZ_clone((LDKCOption_PaymentFailureReasonZ*)untag_ptr(o)); + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ), "LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_PaymentFailureReasonZDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentFailureReasonDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PaymentFailureReasonZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_PaymentFailureReasonDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentFailureReasonDecodeErrorZ), "LDKCResult_PaymentFailureReasonDecodeErrorZ"); - *ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_err(e_conv); + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ), "LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_PaymentFailureReasonZDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentFailureReasonDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_PaymentFailureReasonDecodeErrorZ* o_conv = (LDKCResult_PaymentFailureReasonDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PaymentFailureReasonZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* o_conv = (LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_COption_PaymentFailureReasonZDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentFailureReasonDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PaymentFailureReasonZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_PaymentFailureReasonDecodeErrorZ _res_conv = *(LDKCResult_PaymentFailureReasonDecodeErrorZ*)(_res_ptr); + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ _res_conv = *(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_PaymentFailureReasonDecodeErrorZ_free(_res_conv); + CResult_COption_PaymentFailureReasonZDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_PaymentFailureReasonDecodeErrorZ_clone_ptr(LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_PaymentFailureReasonDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentFailureReasonDecodeErrorZ), "LDKCResult_PaymentFailureReasonDecodeErrorZ"); - *ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_clone(arg); +static inline uint64_t CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone_ptr(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ), "LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentFailureReasonDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_PaymentFailureReasonDecodeErrorZ* arg_conv = (LDKCResult_PaymentFailureReasonDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PaymentFailureReasonZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* arg_conv = (LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentFailureReasonDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_PaymentFailureReasonDecodeErrorZ* orig_conv = (LDKCResult_PaymentFailureReasonDecodeErrorZ*)untag_ptr(orig); - LDKCResult_PaymentFailureReasonDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentFailureReasonDecodeErrorZ), "LDKCResult_PaymentFailureReasonDecodeErrorZ"); - *ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PaymentFailureReasonZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* orig_conv = (LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ*)untag_ptr(orig); + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ), "LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -38393,50 +40325,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ClaimedHTLCZ_1free(JNIEn CVec_ClaimedHTLCZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1PaymentFailureReasonZ_1some(JNIEnv *env, jclass clz, jclass o) { - LDKPaymentFailureReason o_conv = LDKPaymentFailureReason_from_java(env, o); - LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); - *ret_copy = COption_PaymentFailureReasonZ_some(o_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1PaymentFailureReasonZ_1none(JNIEnv *env, jclass clz) { - LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); - *ret_copy = COption_PaymentFailureReasonZ_none(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1PaymentFailureReasonZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCOption_PaymentFailureReasonZ _res_conv = *(LDKCOption_PaymentFailureReasonZ*)(_res_ptr); - FREE(untag_ptr(_res)); - COption_PaymentFailureReasonZ_free(_res_conv); -} - -static inline uint64_t COption_PaymentFailureReasonZ_clone_ptr(LDKCOption_PaymentFailureReasonZ *NONNULL_PTR arg) { - LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); - *ret_copy = COption_PaymentFailureReasonZ_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1PaymentFailureReasonZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCOption_PaymentFailureReasonZ* arg_conv = (LDKCOption_PaymentFailureReasonZ*)untag_ptr(arg); - int64_t ret_conv = COption_PaymentFailureReasonZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1PaymentFailureReasonZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCOption_PaymentFailureReasonZ* orig_conv = (LDKCOption_PaymentFailureReasonZ*)untag_ptr(orig); - LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); - *ret_copy = COption_PaymentFailureReasonZ_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1some(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -38537,6 +40425,80 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDec return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonceDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKNonce o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = Nonce_clone(&o_conv); + LDKCResult_NonceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonceDecodeErrorZ), "LDKCResult_NonceDecodeErrorZ"); + *ret_conv = CResult_NonceDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonceDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_NonceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonceDecodeErrorZ), "LDKCResult_NonceDecodeErrorZ"); + *ret_conv = CResult_NonceDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonceDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NonceDecodeErrorZ* o_conv = (LDKCResult_NonceDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_NonceDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonceDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_NonceDecodeErrorZ _res_conv = *(LDKCResult_NonceDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_NonceDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_NonceDecodeErrorZ_clone_ptr(LDKCResult_NonceDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NonceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonceDecodeErrorZ), "LDKCResult_NonceDecodeErrorZ"); + *ret_conv = CResult_NonceDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonceDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NonceDecodeErrorZ* arg_conv = (LDKCResult_NonceDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_NonceDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonceDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_NonceDecodeErrorZ* orig_conv = (LDKCResult_NonceDecodeErrorZ*)untag_ptr(orig); + LDKCResult_NonceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonceDecodeErrorZ), "LDKCResult_NonceDecodeErrorZ"); + *ret_conv = CResult_NonceDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintHopZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_RouteHintHopZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t o = 0; o < _res_constr.datalen; o++) { + int64_t _res_conv_14 = _res_vals[o]; + LDKRouteHintHop _res_conv_14_conv; + _res_conv_14_conv.inner = untag_ptr(_res_conv_14); + _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv); + _res_constr.data[o] = _res_conv_14_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_RouteHintHopZ_free(_res_constr); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixBolt11ParseErrorZ_1ok(JNIEnv *env, jclass clz, jclass o) { LDKSiPrefix o_conv = LDKSiPrefix_from_java(env, o); LDKCResult_SiPrefixBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixBolt11ParseErrorZ), "LDKCResult_SiPrefixBolt11ParseErrorZ"); @@ -39170,164 +41132,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BigSizeDecodeError return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HostnameDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKHostname o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = Hostname_clone(&o_conv); - LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); - *ret_conv = CResult_HostnameDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HostnameDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); - e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); - *ret_conv = CResult_HostnameDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HostnameDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_HostnameDecodeErrorZ* o_conv = (LDKCResult_HostnameDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_HostnameDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HostnameDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_HostnameDecodeErrorZ _res_conv = *(LDKCResult_HostnameDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_HostnameDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_HostnameDecodeErrorZ_clone_ptr(LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); - *ret_conv = CResult_HostnameDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HostnameDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_HostnameDecodeErrorZ* arg_conv = (LDKCResult_HostnameDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_HostnameDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HostnameDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_HostnameDecodeErrorZ* orig_conv = (LDKCResult_HostnameDecodeErrorZ*)untag_ptr(orig); - LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); - *ret_conv = CResult_HostnameDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKTransactionU16LenLimited o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = TransactionU16LenLimited_clone(&o_conv); - LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); - *ret_conv = CResult_TransactionU16LenLimitedNoneZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); - *ret_conv = CResult_TransactionU16LenLimitedNoneZ_err(); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_TransactionU16LenLimitedNoneZ* o_conv = (LDKCResult_TransactionU16LenLimitedNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_TransactionU16LenLimitedNoneZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_TransactionU16LenLimitedNoneZ _res_conv = *(LDKCResult_TransactionU16LenLimitedNoneZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_TransactionU16LenLimitedNoneZ_free(_res_conv); -} - -static inline uint64_t CResult_TransactionU16LenLimitedNoneZ_clone_ptr(LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR arg) { - LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); - *ret_conv = CResult_TransactionU16LenLimitedNoneZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_TransactionU16LenLimitedNoneZ* arg_conv = (LDKCResult_TransactionU16LenLimitedNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_TransactionU16LenLimitedNoneZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_TransactionU16LenLimitedNoneZ* orig_conv = (LDKCResult_TransactionU16LenLimitedNoneZ*)untag_ptr(orig); - LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); - *ret_conv = CResult_TransactionU16LenLimitedNoneZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKTransactionU16LenLimited o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = TransactionU16LenLimited_clone(&o_conv); - LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); - *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); - e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); - *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_TransactionU16LenLimitedDecodeErrorZ* o_conv = (LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_TransactionU16LenLimitedDecodeErrorZ _res_conv = *(LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_TransactionU16LenLimitedDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_TransactionU16LenLimitedDecodeErrorZ_clone_ptr(LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); - *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_TransactionU16LenLimitedDecodeErrorZ* arg_conv = (LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_TransactionU16LenLimitedDecodeErrorZ* orig_conv = (LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)untag_ptr(orig); - LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); - *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UntrustedStringDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKUntrustedString o_conv; o_conv.inner = untag_ptr(o); @@ -39382,6 +41186,164 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UntrustedStringDec return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HostnameDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKHostname o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = Hostname_clone(&o_conv); + LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); + *ret_conv = CResult_HostnameDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HostnameDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); + *ret_conv = CResult_HostnameDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HostnameDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_HostnameDecodeErrorZ* o_conv = (LDKCResult_HostnameDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_HostnameDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HostnameDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_HostnameDecodeErrorZ _res_conv = *(LDKCResult_HostnameDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_HostnameDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_HostnameDecodeErrorZ_clone_ptr(LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); + *ret_conv = CResult_HostnameDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HostnameDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_HostnameDecodeErrorZ* arg_conv = (LDKCResult_HostnameDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_HostnameDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HostnameDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_HostnameDecodeErrorZ* orig_conv = (LDKCResult_HostnameDecodeErrorZ*)untag_ptr(orig); + LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); + *ret_conv = CResult_HostnameDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKTransactionU16LenLimited o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = TransactionU16LenLimited_clone(&o_conv); + LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); + *ret_conv = CResult_TransactionU16LenLimitedNoneZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); + *ret_conv = CResult_TransactionU16LenLimitedNoneZ_err(); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_TransactionU16LenLimitedNoneZ* o_conv = (LDKCResult_TransactionU16LenLimitedNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_TransactionU16LenLimitedNoneZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_TransactionU16LenLimitedNoneZ _res_conv = *(LDKCResult_TransactionU16LenLimitedNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_TransactionU16LenLimitedNoneZ_free(_res_conv); +} + +static inline uint64_t CResult_TransactionU16LenLimitedNoneZ_clone_ptr(LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR arg) { + LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); + *ret_conv = CResult_TransactionU16LenLimitedNoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_TransactionU16LenLimitedNoneZ* arg_conv = (LDKCResult_TransactionU16LenLimitedNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_TransactionU16LenLimitedNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_TransactionU16LenLimitedNoneZ* orig_conv = (LDKCResult_TransactionU16LenLimitedNoneZ*)untag_ptr(orig); + LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); + *ret_conv = CResult_TransactionU16LenLimitedNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKTransactionU16LenLimited o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = TransactionU16LenLimited_clone(&o_conv); + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); + *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); + *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* o_conv = (LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_TransactionU16LenLimitedDecodeErrorZ _res_conv = *(LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_TransactionU16LenLimitedDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_TransactionU16LenLimitedDecodeErrorZ_clone_ptr(LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); + *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* arg_conv = (LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* orig_conv = (LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)untag_ptr(orig); + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); + *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelIdDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKChannelId o_conv; o_conv.inner = untag_ptr(o); @@ -39472,6 +41434,130 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1_1u832u16Z_1free(JNIE C2Tuple__u832u16Z_free(_res_conv); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKBlindedPayInfo o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = BlindedPayInfo_clone(&o_conv); + LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); + *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); + *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_BlindedPayInfoDecodeErrorZ* o_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_BlindedPayInfoDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_BlindedPayInfoDecodeErrorZ _res_conv = *(LDKCResult_BlindedPayInfoDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_BlindedPayInfoDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_BlindedPayInfoDecodeErrorZ_clone_ptr(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); + *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_BlindedPayInfoDecodeErrorZ* arg_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BlindedPayInfoDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_BlindedPayInfoDecodeErrorZ* orig_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(orig); + LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); + *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPaymentPathNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKBlindedPaymentPath o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = BlindedPaymentPath_clone(&o_conv); + LDKCResult_BlindedPaymentPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPaymentPathNoneZ), "LDKCResult_BlindedPaymentPathNoneZ"); + *ret_conv = CResult_BlindedPaymentPathNoneZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPaymentPathNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_BlindedPaymentPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPaymentPathNoneZ), "LDKCResult_BlindedPaymentPathNoneZ"); + *ret_conv = CResult_BlindedPaymentPathNoneZ_err(); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPaymentPathNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_BlindedPaymentPathNoneZ* o_conv = (LDKCResult_BlindedPaymentPathNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_BlindedPaymentPathNoneZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPaymentPathNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_BlindedPaymentPathNoneZ _res_conv = *(LDKCResult_BlindedPaymentPathNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_BlindedPaymentPathNoneZ_free(_res_conv); +} + +static inline uint64_t CResult_BlindedPaymentPathNoneZ_clone_ptr(LDKCResult_BlindedPaymentPathNoneZ *NONNULL_PTR arg) { + LDKCResult_BlindedPaymentPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPaymentPathNoneZ), "LDKCResult_BlindedPaymentPathNoneZ"); + *ret_conv = CResult_BlindedPaymentPathNoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPaymentPathNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_BlindedPaymentPathNoneZ* arg_conv = (LDKCResult_BlindedPaymentPathNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BlindedPaymentPathNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPaymentPathNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_BlindedPaymentPathNoneZ* orig_conv = (LDKCResult_BlindedPaymentPathNoneZ*)untag_ptr(orig); + LDKCResult_BlindedPaymentPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPaymentPathNoneZ), "LDKCResult_BlindedPaymentPathNoneZ"); + *ret_conv = CResult_BlindedPaymentPathNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PaymentForwardNodeZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_PaymentForwardNodeZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPaymentForwardNode), "LDKCVec_PaymentForwardNodeZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t u = 0; u < _res_constr.datalen; u++) { + int64_t _res_conv_20 = _res_vals[u]; + LDKPaymentForwardNode _res_conv_20_conv; + _res_conv_20_conv.inner = untag_ptr(_res_conv_20); + _res_conv_20_conv.is_owned = ptr_is_owned(_res_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_20_conv); + _res_constr.data[u] = _res_conv_20_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_PaymentForwardNodeZ_free(_res_constr); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentRelayDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKPaymentRelay o_conv; o_conv.inner = untag_ptr(o); @@ -39795,196 +41881,155 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12RefundContex return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StrSecp256k1ErrorZ_1ok(JNIEnv *env, jclass clz, jstring o) { - LDKStr o_conv = java_to_owned_str(env, o); - LDKCResult_StrSecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StrSecp256k1ErrorZ), "LDKCResult_StrSecp256k1ErrorZ"); - *ret_conv = CResult_StrSecp256k1ErrorZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKTxOut o_conv = *(LDKTxOut*)(o_ptr); + o_conv = TxOut_clone((LDKTxOut*)untag_ptr(o)); + LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); + *ret_conv = CResult_TxOutUtxoLookupErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StrSecp256k1ErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { - LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e); - LDKCResult_StrSecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StrSecp256k1ErrorZ), "LDKCResult_StrSecp256k1ErrorZ"); - *ret_conv = CResult_StrSecp256k1ErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { + LDKUtxoLookupError e_conv = LDKUtxoLookupError_from_java(env, e); + LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); + *ret_conv = CResult_TxOutUtxoLookupErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1StrSecp256k1ErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_StrSecp256k1ErrorZ* o_conv = (LDKCResult_StrSecp256k1ErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_StrSecp256k1ErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_TxOutUtxoLookupErrorZ* o_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_TxOutUtxoLookupErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StrSecp256k1ErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_StrSecp256k1ErrorZ _res_conv = *(LDKCResult_StrSecp256k1ErrorZ*)(_res_ptr); + LDKCResult_TxOutUtxoLookupErrorZ _res_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_StrSecp256k1ErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_StrSecp256k1ErrorZ_clone_ptr(LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR arg) { - LDKCResult_StrSecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StrSecp256k1ErrorZ), "LDKCResult_StrSecp256k1ErrorZ"); - *ret_conv = CResult_StrSecp256k1ErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StrSecp256k1ErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_StrSecp256k1ErrorZ* arg_conv = (LDKCResult_StrSecp256k1ErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_StrSecp256k1ErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StrSecp256k1ErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_StrSecp256k1ErrorZ* orig_conv = (LDKCResult_StrSecp256k1ErrorZ*)untag_ptr(orig); - LDKCResult_StrSecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StrSecp256k1ErrorZ), "LDKCResult_StrSecp256k1ErrorZ"); - *ret_conv = CResult_StrSecp256k1ErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); + CResult_TxOutUtxoLookupErrorZ_free(_res_conv); } -static inline uint64_t C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone_ptr(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR arg) { - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ), "LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ"); - *ret_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(arg); +static inline uint64_t CResult_TxOutUtxoLookupErrorZ_clone_ptr(LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR arg) { + LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); + *ret_conv = CResult_TxOutUtxoLookupErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* arg_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(arg); - int64_t ret_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_TxOutUtxoLookupErrorZ* arg_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_TxOutUtxoLookupErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* orig_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(orig); - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ), "LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ"); - *ret_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b, int64_t c) { - LDKThirtyTwoBytes a_ref; - CHECK((*env)->GetArrayLength(env, a) == 32); - (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data); - LDKRecipientOnionFields b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv = RecipientOnionFields_clone(&b_conv); - LDKRouteParameters c_conv; - c_conv.inner = untag_ptr(c); - c_conv.is_owned = ptr_is_owned(c); - CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv); - c_conv = RouteParameters_clone(&c_conv); - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ), "LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ"); - *ret_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new(a_ref, b_conv, c_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_TxOutUtxoLookupErrorZ* orig_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(orig); + LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); + *ret_conv = CResult_TxOutUtxoLookupErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ _res_conv = *(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)(_res_ptr); - FREE(untag_ptr(_res)); - C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(_res_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ o_conv = *(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)(o_ptr); - o_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone((LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(o)); - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); - *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ResponderDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKResponder o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = Responder_clone(&o_conv); + LDKCResult_ResponderDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ResponderDecodeErrorZ), "LDKCResult_ResponderDecodeErrorZ"); + *ret_conv = CResult_ResponderDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); - *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ResponderDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_ResponderDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ResponderDecodeErrorZ), "LDKCResult_ResponderDecodeErrorZ"); + *ret_conv = CResult_ResponderDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* o_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ResponderDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ResponderDecodeErrorZ* o_conv = (LDKCResult_ResponderDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ResponderDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ResponderDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ _res_conv = *(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)(_res_ptr); + LDKCResult_ResponderDecodeErrorZ _res_conv = *(LDKCResult_ResponderDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(_res_conv); + CResult_ResponderDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone_ptr(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR arg) { - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); - *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone(arg); +static inline uint64_t CResult_ResponderDecodeErrorZ_clone_ptr(LDKCResult_ResponderDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ResponderDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ResponderDecodeErrorZ), "LDKCResult_ResponderDecodeErrorZ"); + *ret_conv = CResult_ResponderDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* arg_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ResponderDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ResponderDecodeErrorZ* arg_conv = (LDKCResult_ResponderDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ResponderDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* orig_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(orig); - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); - *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ResponderDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_ResponderDecodeErrorZ* orig_conv = (LDKCResult_ResponderDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ResponderDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ResponderDecodeErrorZ), "LDKCResult_ResponderDecodeErrorZ"); + *ret_conv = CResult_ResponderDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MessageContextZ_1some(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); - LDKTxOut o_conv = *(LDKTxOut*)(o_ptr); - o_conv = TxOut_clone((LDKTxOut*)untag_ptr(o)); - LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); - *ret_conv = CResult_TxOutUtxoLookupErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { - LDKUtxoLookupError e_conv = LDKUtxoLookupError_from_java(env, e); - LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); - *ret_conv = CResult_TxOutUtxoLookupErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); + LDKMessageContext o_conv = *(LDKMessageContext*)(o_ptr); + o_conv = MessageContext_clone((LDKMessageContext*)untag_ptr(o)); + LDKCOption_MessageContextZ *ret_copy = MALLOC(sizeof(LDKCOption_MessageContextZ), "LDKCOption_MessageContextZ"); + *ret_copy = COption_MessageContextZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_TxOutUtxoLookupErrorZ* o_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_TxOutUtxoLookupErrorZ_is_ok(o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MessageContextZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_MessageContextZ *ret_copy = MALLOC(sizeof(LDKCOption_MessageContextZ), "LDKCOption_MessageContextZ"); + *ret_copy = COption_MessageContextZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1MessageContextZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_TxOutUtxoLookupErrorZ _res_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(_res_ptr); + LDKCOption_MessageContextZ _res_conv = *(LDKCOption_MessageContextZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_TxOutUtxoLookupErrorZ_free(_res_conv); + COption_MessageContextZ_free(_res_conv); } -static inline uint64_t CResult_TxOutUtxoLookupErrorZ_clone_ptr(LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR arg) { - LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); - *ret_conv = CResult_TxOutUtxoLookupErrorZ_clone(arg); - return tag_ptr(ret_conv, true); +static inline uint64_t COption_MessageContextZ_clone_ptr(LDKCOption_MessageContextZ *NONNULL_PTR arg) { + LDKCOption_MessageContextZ *ret_copy = MALLOC(sizeof(LDKCOption_MessageContextZ), "LDKCOption_MessageContextZ"); + *ret_copy = COption_MessageContextZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_TxOutUtxoLookupErrorZ* arg_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_TxOutUtxoLookupErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MessageContextZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_MessageContextZ* arg_conv = (LDKCOption_MessageContextZ*)untag_ptr(arg); + int64_t ret_conv = COption_MessageContextZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_TxOutUtxoLookupErrorZ* orig_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(orig); - LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); - *ret_conv = CResult_TxOutUtxoLookupErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MessageContextZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_MessageContextZ* orig_conv = (LDKCOption_MessageContextZ*)untag_ptr(orig); + LDKCOption_MessageContextZ *ret_copy = MALLOC(sizeof(LDKCOption_MessageContextZ), "LDKCOption_MessageContextZ"); + *ret_copy = COption_MessageContextZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } static inline uint64_t C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone_ptr(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *NONNULL_PTR arg) { @@ -40187,265 +42232,215 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SendSuccessSendErr return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKBlindedPath o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = BlindedPath_clone(&o_conv); - LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); - *ret_conv = CResult_BlindedPathNoneZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1ok(JNIEnv *env, jclass clz) { + LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ"); + *ret_conv = CResult_NoneSendErrorZ_ok(); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); - *ret_conv = CResult_BlindedPathNoneZ_err(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKSendError e_conv = *(LDKSendError*)(e_ptr); + e_conv = SendError_clone((LDKSendError*)untag_ptr(e)); + LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ"); + *ret_conv = CResult_NoneSendErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_BlindedPathNoneZ* o_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_BlindedPathNoneZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneSendErrorZ* o_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_NoneSendErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_BlindedPathNoneZ _res_conv = *(LDKCResult_BlindedPathNoneZ*)(_res_ptr); + LDKCResult_NoneSendErrorZ _res_conv = *(LDKCResult_NoneSendErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_BlindedPathNoneZ_free(_res_conv); + CResult_NoneSendErrorZ_free(_res_conv); } -static inline uint64_t CResult_BlindedPathNoneZ_clone_ptr(LDKCResult_BlindedPathNoneZ *NONNULL_PTR arg) { - LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); - *ret_conv = CResult_BlindedPathNoneZ_clone(arg); +static inline uint64_t CResult_NoneSendErrorZ_clone_ptr(LDKCResult_NoneSendErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ"); + *ret_conv = CResult_NoneSendErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_BlindedPathNoneZ* arg_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_BlindedPathNoneZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NoneSendErrorZ* arg_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_NoneSendErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_BlindedPathNoneZ* orig_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(orig); - LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); - *ret_conv = CResult_BlindedPathNoneZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_NoneSendErrorZ* orig_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(orig); + LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ"); + *ret_conv = CResult_NoneSendErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlindedPayInfoBlindedPathZNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ o_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(o_ptr); - o_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(o)); - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ), "LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ"); - *ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKBlindedHop o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = BlindedHop_clone(&o_conv); + LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); + *ret_conv = CResult_BlindedHopDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlindedPayInfoBlindedPathZNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ), "LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ"); - *ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_err(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); + *ret_conv = CResult_BlindedHopDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlindedPayInfoBlindedPathZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* o_conv = (LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_BlindedHopDecodeErrorZ* o_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_BlindedHopDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlindedPayInfoBlindedPathZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ _res_conv = *(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ*)(_res_ptr); + LDKCResult_BlindedHopDecodeErrorZ _res_conv = *(LDKCResult_BlindedHopDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free(_res_conv); + CResult_BlindedHopDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone_ptr(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR arg) { - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ), "LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ"); - *ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(arg); +static inline uint64_t CResult_BlindedHopDecodeErrorZ_clone_ptr(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); + *ret_conv = CResult_BlindedHopDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlindedPayInfoBlindedPathZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* arg_conv = (LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_BlindedHopDecodeErrorZ* arg_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BlindedHopDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlindedPayInfoBlindedPathZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* orig_conv = (LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ*)untag_ptr(orig); - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ), "LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ"); - *ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_BlindedHopDecodeErrorZ* orig_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(orig); + LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); + *ret_conv = CResult_BlindedHopDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ForwardNodeZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_ForwardNodeZ _res_constr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PhantomRouteHintsZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_PhantomRouteHintsZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKForwardNode), "LDKCVec_ForwardNodeZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements"); else _res_constr.data = NULL; int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t n = 0; n < _res_constr.datalen; n++) { - int64_t _res_conv_13 = _res_vals[n]; - LDKForwardNode _res_conv_13_conv; - _res_conv_13_conv.inner = untag_ptr(_res_conv_13); - _res_conv_13_conv.is_owned = ptr_is_owned(_res_conv_13); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_13_conv); - _res_constr.data[n] = _res_conv_13_conv; + for (size_t t = 0; t < _res_constr.datalen; t++) { + int64_t _res_conv_19 = _res_vals[t]; + LDKPhantomRouteHints _res_conv_19_conv; + _res_conv_19_conv.inner = untag_ptr(_res_conv_19); + _res_conv_19_conv.is_owned = ptr_is_owned(_res_conv_19); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_19_conv); + _res_constr.data[t] = _res_conv_19_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_ForwardNodeZ_free(_res_constr); + CVec_PhantomRouteHintsZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKBlindedPath o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKBolt11Invoice o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = BlindedPath_clone(&o_conv); - LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ"); - *ret_conv = CResult_BlindedPathDecodeErrorZ_ok(o_conv); + o_conv = Bolt11Invoice_clone(&o_conv); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); - LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); - e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ"); - *ret_conv = CResult_BlindedPathDecodeErrorZ_err(e_conv); + LDKSignOrCreationError e_conv = *(LDKSignOrCreationError*)(e_ptr); + e_conv = SignOrCreationError_clone((LDKSignOrCreationError*)untag_ptr(e)); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_BlindedPathDecodeErrorZ* o_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_BlindedPathDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* o_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_BlindedPathDecodeErrorZ _res_conv = *(LDKCResult_BlindedPathDecodeErrorZ*)(_res_ptr); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ _res_conv = *(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_BlindedPathDecodeErrorZ_free(_res_conv); + CResult_Bolt11InvoiceSignOrCreationErrorZ_free(_res_conv); } -static inline uint64_t CResult_BlindedPathDecodeErrorZ_clone_ptr(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ"); - *ret_conv = CResult_BlindedPathDecodeErrorZ_clone(arg); +static inline uint64_t CResult_Bolt11InvoiceSignOrCreationErrorZ_clone_ptr(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_BlindedPathDecodeErrorZ* arg_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_BlindedPathDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* arg_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_BlindedPathDecodeErrorZ* orig_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(orig); - LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ"); - *ret_conv = CResult_BlindedPathDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* orig_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(orig); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKBlindedHop o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceErrorDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKInvoiceError o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = BlindedHop_clone(&o_conv); - LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); - *ret_conv = CResult_BlindedHopDecodeErrorZ_ok(o_conv); + o_conv = InvoiceError_clone(&o_conv); + LDKCResult_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); + *ret_conv = CResult_InvoiceErrorDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceErrorDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); - *ret_conv = CResult_BlindedHopDecodeErrorZ_err(e_conv); + LDKCResult_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); + *ret_conv = CResult_InvoiceErrorDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_BlindedHopDecodeErrorZ* o_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_BlindedHopDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceErrorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InvoiceErrorDecodeErrorZ* o_conv = (LDKCResult_InvoiceErrorDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceErrorDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceErrorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_BlindedHopDecodeErrorZ _res_conv = *(LDKCResult_BlindedHopDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_BlindedHopDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_BlindedHopDecodeErrorZ_clone_ptr(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); - *ret_conv = CResult_BlindedHopDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_BlindedHopDecodeErrorZ* arg_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_BlindedHopDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_BlindedHopDecodeErrorZ* orig_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(orig); - LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); - *ret_conv = CResult_BlindedHopDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceErrorDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKInvoiceError o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = InvoiceError_clone(&o_conv); - LDKCResult_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); - *ret_conv = CResult_InvoiceErrorDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceErrorDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); - e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); - *ret_conv = CResult_InvoiceErrorDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceErrorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_InvoiceErrorDecodeErrorZ* o_conv = (LDKCResult_InvoiceErrorDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_InvoiceErrorDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceErrorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_InvoiceErrorDecodeErrorZ _res_conv = *(LDKCResult_InvoiceErrorDecodeErrorZ*)(_res_ptr); + LDKCResult_InvoiceErrorDecodeErrorZ _res_conv = *(LDKCResult_InvoiceErrorDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); CResult_InvoiceErrorDecodeErrorZ_free(_res_conv); } @@ -41143,99 +43138,284 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1OutPointChannel CVec_C2Tuple_OutPointChannelIdZZ_free(_res_constr); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MonitorUpdateIdZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_MonitorUpdateIdZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMonitorUpdateId), "LDKCVec_MonitorUpdateIdZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t r = 0; r < _res_constr.datalen; r++) { - int64_t _res_conv_17 = _res_vals[r]; - LDKMonitorUpdateId _res_conv_17_conv; - _res_conv_17_conv.inner = untag_ptr(_res_conv_17); - _res_conv_17_conv.is_owned = ptr_is_owned(_res_conv_17); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_17_conv); - _res_constr.data[r] = _res_conv_17_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_MonitorUpdateIdZ_free(_res_constr); -} - -static inline uint64_t C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR arg) { - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ"); - *ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(arg); +static inline uint64_t C2Tuple_OutPointCVec_u64ZZ_clone_ptr(LDKC2Tuple_OutPointCVec_u64ZZ *NONNULL_PTR arg) { + LDKC2Tuple_OutPointCVec_u64ZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_u64ZZ), "LDKC2Tuple_OutPointCVec_u64ZZ"); + *ret_conv = C2Tuple_OutPointCVec_u64ZZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* arg_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(arg); - int64_t ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1u64ZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_OutPointCVec_u64ZZ* arg_conv = (LDKC2Tuple_OutPointCVec_u64ZZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_OutPointCVec_u64ZZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* orig_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(orig); - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ"); - *ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1u64ZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_OutPointCVec_u64ZZ* orig_conv = (LDKC2Tuple_OutPointCVec_u64ZZ*)untag_ptr(orig); + LDKC2Tuple_OutPointCVec_u64ZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_u64ZZ), "LDKC2Tuple_OutPointCVec_u64ZZ"); + *ret_conv = C2Tuple_OutPointCVec_u64ZZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_tArray b) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1u64ZZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_tArray b) { LDKOutPoint a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = OutPoint_clone(&a_conv); - LDKCVec_MonitorUpdateIdZ b_constr; + LDKCVec_u64Z b_constr; b_constr.datalen = (*env)->GetArrayLength(env, b); if (b_constr.datalen > 0) - b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKMonitorUpdateId), "LDKCVec_MonitorUpdateIdZ Elements"); + b_constr.data = MALLOC(b_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); else b_constr.data = NULL; int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL); - for (size_t r = 0; r < b_constr.datalen; r++) { - int64_t b_conv_17 = b_vals[r]; - LDKMonitorUpdateId b_conv_17_conv; - b_conv_17_conv.inner = untag_ptr(b_conv_17); - b_conv_17_conv.is_owned = ptr_is_owned(b_conv_17); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv_17_conv); - b_conv_17_conv = MonitorUpdateId_clone(&b_conv_17_conv); - b_constr.data[r] = b_conv_17_conv; + for (size_t g = 0; g < b_constr.datalen; g++) { + int64_t b_conv_6 = b_vals[g]; + b_constr.data[g] = b_conv_6; } (*env)->ReleaseLongArrayElements(env, b, b_vals, 0); - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ"); - *ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(a_conv, b_constr); + LDKC2Tuple_OutPointCVec_u64ZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_u64ZZ), "LDKC2Tuple_OutPointCVec_u64ZZ"); + *ret_conv = C2Tuple_OutPointCVec_u64ZZ_new(a_conv, b_constr); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1u64ZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res_conv = *(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)(_res_ptr); + LDKC2Tuple_OutPointCVec_u64ZZ _res_conv = *(LDKC2Tuple_OutPointCVec_u64ZZ*)(_res_ptr); FREE(untag_ptr(_res)); - C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(_res_conv); + C2Tuple_OutPointCVec_u64ZZ_free(_res_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1OutPointCVec_1MonitorUpdateIdZZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ _res_constr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1OutPointCVec_1u64ZZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C2Tuple_OutPointCVec_u64ZZZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OutPointCVec_u64ZZ), "LDKCVec_C2Tuple_OutPointCVec_u64ZZZ Elements"); else _res_constr.data = NULL; int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t p = 0; p < _res_constr.datalen; p++) { - int64_t _res_conv_41 = _res_vals[p]; - void* _res_conv_41_ptr = untag_ptr(_res_conv_41); - CHECK_ACCESS(_res_conv_41_ptr); - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res_conv_41_conv = *(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)(_res_conv_41_ptr); - FREE(untag_ptr(_res_conv_41)); - _res_constr.data[p] = _res_conv_41_conv; + for (size_t d = 0; d < _res_constr.datalen; d++) { + int64_t _res_conv_29 = _res_vals[d]; + void* _res_conv_29_ptr = untag_ptr(_res_conv_29); + CHECK_ACCESS(_res_conv_29_ptr); + LDKC2Tuple_OutPointCVec_u64ZZ _res_conv_29_conv = *(LDKC2Tuple_OutPointCVec_u64ZZ*)(_res_conv_29_ptr); + FREE(untag_ptr(_res_conv_29)); + _res_constr.data[d] = _res_conv_29_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(_res_constr); + CVec_C2Tuple_OutPointCVec_u64ZZZ_free(_res_constr); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKBlindedMessagePath o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = BlindedMessagePath_clone(&o_conv); + LDKCResult_BlindedMessagePathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathDecodeErrorZ), "LDKCResult_BlindedMessagePathDecodeErrorZ"); + *ret_conv = CResult_BlindedMessagePathDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_BlindedMessagePathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathDecodeErrorZ), "LDKCResult_BlindedMessagePathDecodeErrorZ"); + *ret_conv = CResult_BlindedMessagePathDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_BlindedMessagePathDecodeErrorZ* o_conv = (LDKCResult_BlindedMessagePathDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_BlindedMessagePathDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_BlindedMessagePathDecodeErrorZ _res_conv = *(LDKCResult_BlindedMessagePathDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_BlindedMessagePathDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_BlindedMessagePathDecodeErrorZ_clone_ptr(LDKCResult_BlindedMessagePathDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_BlindedMessagePathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathDecodeErrorZ), "LDKCResult_BlindedMessagePathDecodeErrorZ"); + *ret_conv = CResult_BlindedMessagePathDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_BlindedMessagePathDecodeErrorZ* arg_conv = (LDKCResult_BlindedMessagePathDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BlindedMessagePathDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_BlindedMessagePathDecodeErrorZ* orig_conv = (LDKCResult_BlindedMessagePathDecodeErrorZ*)untag_ptr(orig); + LDKCResult_BlindedMessagePathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathDecodeErrorZ), "LDKCResult_BlindedMessagePathDecodeErrorZ"); + *ret_conv = CResult_BlindedMessagePathDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKBlindedMessagePath o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = BlindedMessagePath_clone(&o_conv); + LDKCResult_BlindedMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathNoneZ), "LDKCResult_BlindedMessagePathNoneZ"); + *ret_conv = CResult_BlindedMessagePathNoneZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_BlindedMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathNoneZ), "LDKCResult_BlindedMessagePathNoneZ"); + *ret_conv = CResult_BlindedMessagePathNoneZ_err(); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_BlindedMessagePathNoneZ* o_conv = (LDKCResult_BlindedMessagePathNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_BlindedMessagePathNoneZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_BlindedMessagePathNoneZ _res_conv = *(LDKCResult_BlindedMessagePathNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_BlindedMessagePathNoneZ_free(_res_conv); +} + +static inline uint64_t CResult_BlindedMessagePathNoneZ_clone_ptr(LDKCResult_BlindedMessagePathNoneZ *NONNULL_PTR arg) { + LDKCResult_BlindedMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathNoneZ), "LDKCResult_BlindedMessagePathNoneZ"); + *ret_conv = CResult_BlindedMessagePathNoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_BlindedMessagePathNoneZ* arg_conv = (LDKCResult_BlindedMessagePathNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BlindedMessagePathNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_BlindedMessagePathNoneZ* orig_conv = (LDKCResult_BlindedMessagePathNoneZ*)untag_ptr(orig); + LDKCResult_BlindedMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathNoneZ), "LDKCResult_BlindedMessagePathNoneZ"); + *ret_conv = CResult_BlindedMessagePathNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1MessageContextDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKMessageContext o_conv = *(LDKMessageContext*)(o_ptr); + o_conv = MessageContext_clone((LDKMessageContext*)untag_ptr(o)); + LDKCResult_MessageContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_MessageContextDecodeErrorZ), "LDKCResult_MessageContextDecodeErrorZ"); + *ret_conv = CResult_MessageContextDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1MessageContextDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_MessageContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_MessageContextDecodeErrorZ), "LDKCResult_MessageContextDecodeErrorZ"); + *ret_conv = CResult_MessageContextDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1MessageContextDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_MessageContextDecodeErrorZ* o_conv = (LDKCResult_MessageContextDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_MessageContextDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1MessageContextDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_MessageContextDecodeErrorZ _res_conv = *(LDKCResult_MessageContextDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_MessageContextDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_MessageContextDecodeErrorZ_clone_ptr(LDKCResult_MessageContextDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_MessageContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_MessageContextDecodeErrorZ), "LDKCResult_MessageContextDecodeErrorZ"); + *ret_conv = CResult_MessageContextDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1MessageContextDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_MessageContextDecodeErrorZ* arg_conv = (LDKCResult_MessageContextDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_MessageContextDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1MessageContextDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_MessageContextDecodeErrorZ* orig_conv = (LDKCResult_MessageContextDecodeErrorZ*)untag_ptr(orig); + LDKCResult_MessageContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_MessageContextDecodeErrorZ), "LDKCResult_MessageContextDecodeErrorZ"); + *ret_conv = CResult_MessageContextDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OffersContextDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKOffersContext o_conv = *(LDKOffersContext*)(o_ptr); + o_conv = OffersContext_clone((LDKOffersContext*)untag_ptr(o)); + LDKCResult_OffersContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersContextDecodeErrorZ), "LDKCResult_OffersContextDecodeErrorZ"); + *ret_conv = CResult_OffersContextDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OffersContextDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_OffersContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersContextDecodeErrorZ), "LDKCResult_OffersContextDecodeErrorZ"); + *ret_conv = CResult_OffersContextDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OffersContextDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_OffersContextDecodeErrorZ* o_conv = (LDKCResult_OffersContextDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OffersContextDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OffersContextDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_OffersContextDecodeErrorZ _res_conv = *(LDKCResult_OffersContextDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_OffersContextDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_OffersContextDecodeErrorZ_clone_ptr(LDKCResult_OffersContextDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OffersContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersContextDecodeErrorZ), "LDKCResult_OffersContextDecodeErrorZ"); + *ret_conv = CResult_OffersContextDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OffersContextDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_OffersContextDecodeErrorZ* arg_conv = (LDKCResult_OffersContextDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OffersContextDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OffersContextDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_OffersContextDecodeErrorZ* orig_conv = (LDKCResult_OffersContextDecodeErrorZ*)untag_ptr(orig); + LDKCResult_OffersContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersContextDecodeErrorZ), "LDKCResult_OffersContextDecodeErrorZ"); + *ret_conv = CResult_OffersContextDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_APIError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -41457,6 +43637,29 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BigSize_1read(JNIEnv *env, return tag_ptr(ret_conv, true); } +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UntrustedString_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKUntrustedString obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = UntrustedString_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UntrustedString_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ"); + *ret_conv = UntrustedString_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Hostname_1free(JNIEnv *env, jclass clz, int64_t this_obj) { LDKHostname this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -41688,7 +43891,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TransactionU16LenLimited_1r return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_sign(JNIEnv *env, jclass clz, int8_tArray msg, int8_tArray sk) { +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_sign(JNIEnv *env, jclass clz, int8_tArray msg, int8_tArray sk) { LDKu8slice msg_ref; msg_ref.datalen = (*env)->GetArrayLength(env, msg); msg_ref.data = (*env)->GetByteArrayElements (env, msg, NULL); @@ -41696,10 +43899,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_sign(JNIEnv *env, jclass cl CHECK((*env)->GetArrayLength(env, sk) == 32); (*env)->GetByteArrayRegion(env, sk, 0, 32, sk_arr); uint8_t (*sk_ref)[32] = &sk_arr; - LDKCResult_StrSecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StrSecp256k1ErrorZ), "LDKCResult_StrSecp256k1ErrorZ"); - *ret_conv = sign(msg_ref, sk_ref); + LDKStr ret_str = sign(msg_ref, sk_ref); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); (*env)->ReleaseByteArrayElements(env, msg, (int8_t*)msg_ref.data, 0); - return tag_ptr(ret_conv, true); + return ret_conv; } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_recover_1pk(JNIEnv *env, jclass clz, int8_tArray msg, jstring sig) { @@ -41726,31 +43930,6 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_verify(JNIEnv *env, jclass return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_construct_1invoice_1preimage(JNIEnv *env, jclass clz, int8_tArray hrp_bytes, jobjectArray data_without_signature) { - LDKu8slice hrp_bytes_ref; - hrp_bytes_ref.datalen = (*env)->GetArrayLength(env, hrp_bytes); - hrp_bytes_ref.data = (*env)->GetByteArrayElements (env, hrp_bytes, NULL); - LDKCVec_U5Z data_without_signature_constr; - data_without_signature_constr.datalen = (*env)->GetArrayLength(env, data_without_signature); - if (data_without_signature_constr.datalen > 0) - data_without_signature_constr.data = MALLOC(data_without_signature_constr.datalen * sizeof(LDKU5), "LDKCVec_U5Z Elements"); - else - data_without_signature_constr.data = NULL; - int8_t* data_without_signature_vals = (*env)->GetByteArrayElements (env, data_without_signature, NULL); - for (size_t h = 0; h < data_without_signature_constr.datalen; h++) { - int8_t data_without_signature_conv_7 = data_without_signature_vals[h]; - - data_without_signature_constr.data[h] = (LDKU5){ ._0 = data_without_signature_conv_7 }; - } - (*env)->ReleaseByteArrayElements(env, data_without_signature, data_without_signature_vals, 0); - LDKCVec_u8Z ret_var = construct_invoice_preimage(hrp_bytes_ref, data_without_signature_constr); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - (*env)->ReleaseByteArrayElements(env, hrp_bytes, (int8_t*)hrp_bytes_ref.data, 0); - return ret_arr; -} - JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KVStore_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -41804,7 +43983,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdatingPersister_1free MonitorUpdatingPersister_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdatingPersister_1new(JNIEnv *env, jclass clz, int64_t kv_store, int64_t logger, int64_t maximum_pending_updates, int64_t entropy_source, int64_t signer_provider) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdatingPersister_1new(JNIEnv *env, jclass clz, int64_t kv_store, int64_t logger, int64_t maximum_pending_updates, int64_t entropy_source, int64_t signer_provider, int64_t broadcaster, int64_t fee_estimator) { void* kv_store_ptr = untag_ptr(kv_store); CHECK_ACCESS(kv_store_ptr); LDKKVStore kv_store_conv = *(LDKKVStore*)(kv_store_ptr); @@ -41833,45 +44012,47 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdatingPersister_1n // If this_arg is a JCalls struct, then we need to increment the refcnt in it. LDKSignerProvider_JCalls_cloned(&signer_provider_conv); } - LDKMonitorUpdatingPersister ret_var = MonitorUpdatingPersister_new(kv_store_conv, logger_conv, maximum_pending_updates, entropy_source_conv, signer_provider_conv); + void* broadcaster_ptr = untag_ptr(broadcaster); + CHECK_ACCESS(broadcaster_ptr); + LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); + if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); + } + void* fee_estimator_ptr = untag_ptr(fee_estimator); + CHECK_ACCESS(fee_estimator_ptr); + LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); + if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); + } + LDKMonitorUpdatingPersister ret_var = MonitorUpdatingPersister_new(kv_store_conv, logger_conv, maximum_pending_updates, entropy_source_conv, signer_provider_conv, broadcaster_conv, fee_estimator_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdatingPersister_1read_1all_1channel_1monitors_1with_1updates(JNIEnv *env, jclass clz, int64_t this_arg, int64_t broadcaster, int64_t fee_estimator) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdatingPersister_1read_1all_1channel_1monitors_1with_1updates(JNIEnv *env, jclass clz, int64_t this_arg) { LDKMonitorUpdatingPersister this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - void* broadcaster_ptr = untag_ptr(broadcaster); - if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); } - LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; - void* fee_estimator_ptr = untag_ptr(fee_estimator); - if (ptr_is_owned(fee_estimator)) { CHECK_ACCESS(fee_estimator_ptr); } - LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ), "LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ"); - *ret_conv = MonitorUpdatingPersister_read_all_channel_monitors_with_updates(&this_arg_conv, broadcaster_conv, fee_estimator_conv); + *ret_conv = MonitorUpdatingPersister_read_all_channel_monitors_with_updates(&this_arg_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdatingPersister_1read_1channel_1monitor_1with_1updates(JNIEnv *env, jclass clz, int64_t this_arg, int64_t broadcaster, int64_t fee_estimator, jstring monitor_key) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdatingPersister_1read_1channel_1monitor_1with_1updates(JNIEnv *env, jclass clz, int64_t this_arg, jstring monitor_key) { LDKMonitorUpdatingPersister this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - void* broadcaster_ptr = untag_ptr(broadcaster); - if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); } - LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; - void* fee_estimator_ptr = untag_ptr(fee_estimator); - if (ptr_is_owned(fee_estimator)) { CHECK_ACCESS(fee_estimator_ptr); } - LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; LDKStr monitor_key_conv = java_to_owned_str(env, monitor_key); LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ), "LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ"); - *ret_conv = MonitorUpdatingPersister_read_channel_monitor_with_updates(&this_arg_conv, broadcaster_conv, fee_estimator_conv, monitor_key_conv); + *ret_conv = MonitorUpdatingPersister_read_channel_monitor_with_updates(&this_arg_conv, monitor_key_conv); return tag_ptr(ret_conv, true); } @@ -41946,186 +44127,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_scid_1from_1parts(JNIEnv *e return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UntrustedString_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKUntrustedString this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - UntrustedString_free(this_obj_conv); -} - -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_UntrustedString_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUntrustedString this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKStr ret_str = UntrustedString_get_a(&this_ptr_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UntrustedString_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { - LDKUntrustedString this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKStr val_conv = java_to_owned_str(env, val); - UntrustedString_set_a(&this_ptr_conv, val_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UntrustedString_1new(JNIEnv *env, jclass clz, jstring a_arg) { - LDKStr a_arg_conv = java_to_owned_str(env, a_arg); - LDKUntrustedString ret_var = UntrustedString_new(a_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline uint64_t UntrustedString_clone_ptr(LDKUntrustedString *NONNULL_PTR arg) { - LDKUntrustedString ret_var = UntrustedString_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UntrustedString_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKUntrustedString arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = UntrustedString_clone_ptr(&arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UntrustedString_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKUntrustedString orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKUntrustedString ret_var = UntrustedString_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UntrustedString_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKUntrustedString a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKUntrustedString b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = UntrustedString_eq(&a_conv, &b_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UntrustedString_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKUntrustedString o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = UntrustedString_hash(&o_conv); - return ret_conv; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UntrustedString_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKUntrustedString obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = UntrustedString_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UntrustedString_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ"); - *ret_conv = UntrustedString_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_UntrustedString_1to_1str(JNIEnv *env, jclass clz, int64_t o) { - LDKUntrustedString o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = UntrustedString_to_str(&o_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PrintableString_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKPrintableString this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PrintableString_free(this_obj_conv); -} - -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_PrintableString_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPrintableString this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKStr ret_str = PrintableString_get_a(&this_ptr_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PrintableString_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { - LDKPrintableString this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKStr val_conv = java_to_owned_str(env, val); - PrintableString_set_a(&this_ptr_conv, val_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrintableString_1new(JNIEnv *env, jclass clz, jstring a_arg) { - LDKStr a_arg_conv = java_to_owned_str(env, a_arg); - LDKPrintableString ret_var = PrintableString_new(a_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_PrintableString_1to_1str(JNIEnv *env, jclass clz, int64_t o) { - LDKPrintableString o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = PrintableString_to_str(&o_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; -} - JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TrackedSpendableOutput_1free(JNIEnv *env, jclass clz, int64_t this_obj) { LDKTrackedSpendableOutput this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -42841,6 +44842,29 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sleeper_1from_1two_1futures return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sleeper_1from_1three_1futures(JNIEnv *env, jclass clz, int64_t fut_a, int64_t fut_b, int64_t fut_c) { + LDKFuture fut_a_conv; + fut_a_conv.inner = untag_ptr(fut_a); + fut_a_conv.is_owned = ptr_is_owned(fut_a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(fut_a_conv); + fut_a_conv.is_owned = false; + LDKFuture fut_b_conv; + fut_b_conv.inner = untag_ptr(fut_b); + fut_b_conv.is_owned = ptr_is_owned(fut_b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(fut_b_conv); + fut_b_conv.is_owned = false; + LDKFuture fut_c_conv; + fut_c_conv.inner = untag_ptr(fut_c); + fut_c_conv.is_owned = ptr_is_owned(fut_c); + CHECK_INNER_FIELD_ACCESS_OR_NULL(fut_c_conv); + fut_c_conv.is_owned = false; + LDKSleeper ret_var = Sleeper_from_three_futures(&fut_a_conv, &fut_b_conv, &fut_c_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sleeper_1new(JNIEnv *env, jclass clz, int64_tArray futures) { LDKCVec_FutureZ futures_constr; futures_constr.datalen = (*env)->GetArrayLength(env, futures); @@ -43111,7 +45135,32 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1line(JNIEnv *env, Record_set_line(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Record_1new(JNIEnv *env, jclass clz, jclass level_arg, int8_tArray peer_id_arg, int64_t channel_id_arg, jstring args_arg, jstring module_path_arg, jstring file_arg, int32_t line_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Record_1get_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); + *ret_copy = Record_get_payment_hash(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_ThirtyTwoBytesZ val_conv = *(LDKCOption_ThirtyTwoBytesZ*)(val_ptr); + val_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(val)); + Record_set_payment_hash(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Record_1new(JNIEnv *env, jclass clz, jclass level_arg, int8_tArray peer_id_arg, int64_t channel_id_arg, jstring args_arg, jstring module_path_arg, jstring file_arg, int32_t line_arg, int64_t payment_hash_arg) { LDKLevel level_arg_conv = LDKLevel_from_java(env, level_arg); LDKPublicKey peer_id_arg_ref; CHECK((*env)->GetArrayLength(env, peer_id_arg) == 33); @@ -43124,7 +45173,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Record_1new(JNIEnv *env, jc LDKStr args_arg_conv = java_to_owned_str(env, args_arg); LDKStr module_path_arg_conv = java_to_owned_str(env, module_path_arg); LDKStr file_arg_conv = java_to_owned_str(env, file_arg); - LDKRecord ret_var = Record_new(level_arg_conv, peer_id_arg_ref, channel_id_arg_conv, args_arg_conv, module_path_arg_conv, file_arg_conv, line_arg); + void* payment_hash_arg_ptr = untag_ptr(payment_hash_arg); + CHECK_ACCESS(payment_hash_arg_ptr); + LDKCOption_ThirtyTwoBytesZ payment_hash_arg_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_arg_ptr); + payment_hash_arg_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash_arg)); + LDKRecord ret_var = Record_new(level_arg_conv, peer_id_arg_ref, channel_id_arg_conv, args_arg_conv, module_path_arg_conv, file_arg_conv, line_arg, payment_hash_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -43273,23 +45326,23 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1n ChannelHandshakeConfig_set_negotiate_scid_privacy(&this_ptr_conv, val); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1announced_1channel(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1announce_1for_1forwarding(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - jboolean ret_conv = ChannelHandshakeConfig_get_announced_channel(&this_ptr_conv); + jboolean ret_conv = ChannelHandshakeConfig_get_announce_for_forwarding(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1announced_1channel(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1announce_1for_1forwarding(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelHandshakeConfig_set_announced_channel(&this_ptr_conv, val); + ChannelHandshakeConfig_set_announce_for_forwarding(&this_ptr_conv, val); } JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1commit_1upfront_1shutdown_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -43368,8 +45421,8 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1o ChannelHandshakeConfig_set_our_max_accepted_htlcs(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1new(JNIEnv *env, jclass clz, int32_t minimum_depth_arg, int16_t our_to_self_delay_arg, int64_t our_htlc_minimum_msat_arg, int8_t max_inbound_htlc_value_in_flight_percent_of_channel_arg, jboolean negotiate_scid_privacy_arg, jboolean announced_channel_arg, jboolean commit_upfront_shutdown_pubkey_arg, int32_t their_channel_reserve_proportional_millionths_arg, jboolean negotiate_anchors_zero_fee_htlc_tx_arg, int16_t our_max_accepted_htlcs_arg) { - LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg, max_inbound_htlc_value_in_flight_percent_of_channel_arg, negotiate_scid_privacy_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg, their_channel_reserve_proportional_millionths_arg, negotiate_anchors_zero_fee_htlc_tx_arg, our_max_accepted_htlcs_arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1new(JNIEnv *env, jclass clz, int32_t minimum_depth_arg, int16_t our_to_self_delay_arg, int64_t our_htlc_minimum_msat_arg, int8_t max_inbound_htlc_value_in_flight_percent_of_channel_arg, jboolean negotiate_scid_privacy_arg, jboolean announce_for_forwarding_arg, jboolean commit_upfront_shutdown_pubkey_arg, int32_t their_channel_reserve_proportional_millionths_arg, jboolean negotiate_anchors_zero_fee_htlc_tx_arg, int16_t our_max_accepted_htlcs_arg) { + LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg, max_inbound_htlc_value_in_flight_percent_of_channel_arg, negotiate_scid_privacy_arg, announce_for_forwarding_arg, commit_upfront_shutdown_pubkey_arg, their_channel_reserve_proportional_millionths_arg, negotiate_anchors_zero_fee_htlc_tx_arg, our_max_accepted_htlcs_arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -44118,14 +46171,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfigUpdate_1new(JN return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfigUpdate_1default(JNIEnv *env, jclass clz) { - LDKChannelConfigUpdate ret_var = ChannelConfigUpdate_default(); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1free(JNIEnv *env, jclass clz, int64_t this_obj) { LDKUserConfig this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -44310,7 +46355,26 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1accept_1mpp_1 UserConfig_set_accept_mpp_keysend(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1new(JNIEnv *env, jclass clz, int64_t channel_handshake_config_arg, int64_t channel_handshake_limits_arg, int64_t channel_config_arg, jboolean accept_forwards_to_priv_channels_arg, jboolean accept_inbound_channels_arg, jboolean manually_accept_inbound_channels_arg, jboolean accept_intercept_htlcs_arg, jboolean accept_mpp_keysend_arg) { +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1manually_1handle_1bolt12_1invoices(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + jboolean ret_conv = UserConfig_get_manually_handle_bolt12_invoices(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1manually_1handle_1bolt12_1invoices(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + UserConfig_set_manually_handle_bolt12_invoices(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1new(JNIEnv *env, jclass clz, int64_t channel_handshake_config_arg, int64_t channel_handshake_limits_arg, int64_t channel_config_arg, jboolean accept_forwards_to_priv_channels_arg, jboolean accept_inbound_channels_arg, jboolean manually_accept_inbound_channels_arg, jboolean accept_intercept_htlcs_arg, jboolean accept_mpp_keysend_arg, jboolean manually_handle_bolt12_invoices_arg) { LDKChannelHandshakeConfig channel_handshake_config_arg_conv; channel_handshake_config_arg_conv.inner = untag_ptr(channel_handshake_config_arg); channel_handshake_config_arg_conv.is_owned = ptr_is_owned(channel_handshake_config_arg); @@ -44326,7 +46390,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1new(JNIEnv *env channel_config_arg_conv.is_owned = ptr_is_owned(channel_config_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_config_arg_conv); channel_config_arg_conv = ChannelConfig_clone(&channel_config_arg_conv); - LDKUserConfig ret_var = UserConfig_new(channel_handshake_config_arg_conv, channel_handshake_limits_arg_conv, channel_config_arg_conv, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg, manually_accept_inbound_channels_arg, accept_intercept_htlcs_arg, accept_mpp_keysend_arg); + LDKUserConfig ret_var = UserConfig_new(channel_handshake_config_arg_conv, channel_handshake_limits_arg_conv, channel_config_arg_conv, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg, manually_accept_inbound_channels_arg, accept_intercept_htlcs_arg, accept_mpp_keysend_arg, manually_handle_bolt12_invoices_arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -44760,8 +46824,13 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1clone(JN return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1on_1chain_1sweep(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_on_chain_sweep()); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1maximum_1fee_1estimate(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_maximum_fee_estimate()); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1urgent_1on_1chain_1sweep(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_urgent_on_chain_sweep()); return ret_conv; } @@ -44817,69 +46886,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1free(JNIEnv *env FeeEstimator_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKMonitorUpdateId this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - MonitorUpdateId_free(this_obj_conv); -} - -static inline uint64_t MonitorUpdateId_clone_ptr(LDKMonitorUpdateId *NONNULL_PTR arg) { - LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKMonitorUpdateId arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = MonitorUpdateId_clone_ptr(&arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKMonitorUpdateId orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKMonitorUpdateId o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = MonitorUpdateId_hash(&o_conv); - return ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKMonitorUpdateId a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKMonitorUpdateId b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = MonitorUpdateId_eq(&a_conv, &b_conv); - return ret_conv; -} - JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Persist_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -45032,14 +47038,14 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1list_1pe this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ret_var = ChainMonitor_list_pending_monitor_updates(&this_arg_conv); + LDKCVec_C2Tuple_OutPointCVec_u64ZZZ ret_var = ChainMonitor_list_pending_monitor_updates(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t p = 0; p < ret_var.datalen; p++) { - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv_41_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ"); - *ret_conv_41_conv = ret_var.data[p]; - ret_arr_ptr[p] = tag_ptr(ret_conv_41_conv, true); + for (size_t d = 0; d < ret_var.datalen; d++) { + LDKC2Tuple_OutPointCVec_u64ZZ* ret_conv_29_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_u64ZZ), "LDKC2Tuple_OutPointCVec_u64ZZ"); + *ret_conv_29_conv = ret_var.data[d]; + ret_arr_ptr[d] = tag_ptr(ret_conv_29_conv, true); } (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); FREE(ret_var.data); @@ -45057,13 +47063,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1channel_1moni funding_txo_conv.is_owned = ptr_is_owned(funding_txo); CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); funding_txo_conv = OutPoint_clone(&funding_txo_conv); - LDKMonitorUpdateId completed_update_id_conv; - completed_update_id_conv.inner = untag_ptr(completed_update_id); - completed_update_id_conv.is_owned = ptr_is_owned(completed_update_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(completed_update_id_conv); - completed_update_id_conv = MonitorUpdateId_clone(&completed_update_id_conv); LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id_conv); + *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id); return tag_ptr(ret_conv, true); } @@ -45471,6 +47472,39 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1read(JNIEnv *en return tag_ptr(ret_conv, true); } +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_BalanceSource_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBalanceSource* orig_conv = (LDKBalanceSource*)untag_ptr(orig); + jclass ret_conv = LDKBalanceSource_to_java(env, BalanceSource_clone(orig_conv)); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_BalanceSource_1holder_1force_1closed(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBalanceSource_to_java(env, BalanceSource_holder_force_closed()); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_BalanceSource_1counterparty_1force_1closed(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBalanceSource_to_java(env, BalanceSource_counterparty_force_closed()); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_BalanceSource_1coop_1close(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBalanceSource_to_java(env, BalanceSource_coop_close()); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_BalanceSource_1htlc(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBalanceSource_to_java(env, BalanceSource_htlc()); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BalanceSource_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKBalanceSource* a_conv = (LDKBalanceSource*)untag_ptr(a); + LDKBalanceSource* b_conv = (LDKBalanceSource*)untag_ptr(b); + jboolean ret_conv = BalanceSource_eq(a_conv, b_conv); + return ret_conv; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Balance_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -45500,16 +47534,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1clone(JNIEnv *env, return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1claimable_1on_1channel_1close(JNIEnv *env, jclass clz, int64_t amount_satoshis) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1claimable_1on_1channel_1close(JNIEnv *env, jclass clz, int64_t amount_satoshis, int64_t transaction_fee_satoshis, int64_t outbound_payment_htlc_rounded_msat, int64_t outbound_forwarded_htlc_rounded_msat, int64_t inbound_claiming_htlc_rounded_msat, int64_t inbound_htlc_rounded_msat) { LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_claimable_on_channel_close(amount_satoshis); + *ret_copy = Balance_claimable_on_channel_close(amount_satoshis, transaction_fee_satoshis, outbound_payment_htlc_rounded_msat, outbound_forwarded_htlc_rounded_msat, inbound_claiming_htlc_rounded_msat, inbound_htlc_rounded_msat); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1claimable_1awaiting_1confirmations(JNIEnv *env, jclass clz, int64_t amount_satoshis, int32_t confirmation_height) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1claimable_1awaiting_1confirmations(JNIEnv *env, jclass clz, int64_t amount_satoshis, int32_t confirmation_height, jclass source) { + LDKBalanceSource source_conv = LDKBalanceSource_from_java(env, source); LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_claimable_awaiting_confirmations(amount_satoshis, confirmation_height); + *ret_copy = Balance_claimable_awaiting_confirmations(amount_satoshis, confirmation_height, source_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -45527,12 +47562,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1contentious_1claim return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1maybe_1timeout_1claimable_1htlc(JNIEnv *env, jclass clz, int64_t amount_satoshis, int32_t claimable_height, int8_tArray payment_hash) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1maybe_1timeout_1claimable_1htlc(JNIEnv *env, jclass clz, int64_t amount_satoshis, int32_t claimable_height, int8_tArray payment_hash, jboolean outbound_payment) { LDKThirtyTwoBytes payment_hash_ref; CHECK((*env)->GetArrayLength(env, payment_hash) == 32); (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_maybe_timeout_claimable_htlc(amount_satoshis, claimable_height, payment_hash_ref); + *ret_copy = Balance_maybe_timeout_claimable_htlc(amount_satoshis, claimable_height, payment_hash_ref, outbound_payment); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -45733,7 +47768,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1a return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1process_1pending_1events(JNIEnv *env, jclass clz, int64_t this_arg, int64_t handler) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1process_1pending_1events(JNIEnv *env, jclass clz, int64_t this_arg, int64_t handler) { LDKChannelMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -45742,7 +47777,9 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1process_1pendi void* handler_ptr = untag_ptr(handler); if (ptr_is_owned(handler)) { CHECK_ACCESS(handler_ptr); } LDKEventHandler* handler_conv = (LDKEventHandler*)handler_ptr; - ChannelMonitor_process_pending_events(&this_arg_conv, handler_conv); + LDKCResult_NoneReplayEventZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneReplayEventZ), "LDKCResult_NoneReplayEventZ"); + *ret_conv = ChannelMonitor_process_pending_events(&this_arg_conv, handler_conv); + return tag_ptr(ret_conv, true); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1initial_1counterparty_1commitment_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { @@ -46104,6 +48141,16 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1rebroadcast_1p ChannelMonitor_rebroadcast_pending_claims(&this_arg_conv, broadcaster_conv, fee_estimator_conv, logger_conv); } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1has_1pending_1claims(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelMonitor_has_pending_claims(&this_arg_conv); + return ret_conv; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1signer_1unblocked(JNIEnv *env, jclass clz, int64_t this_arg, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { LDKChannelMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -46507,11 +48554,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_peel_1payment_1onion(JNIEnv CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv.is_owned = false; void* node_signer_ptr = untag_ptr(node_signer); - if (ptr_is_owned(node_signer)) { CHECK_ACCESS(node_signer_ptr); } - LDKNodeSigner* node_signer_conv = (LDKNodeSigner*)node_signer_ptr; + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } void* logger_ptr = untag_ptr(logger); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } LDKCResult_PendingHTLCInfoInboundHTLCErrZ* ret_conv = MALLOC(sizeof(LDKCResult_PendingHTLCInfoInboundHTLCErrZ), "LDKCResult_PendingHTLCInfoInboundHTLCErrZ"); *ret_conv = peel_payment_onion(&msg_conv, node_signer_conv, logger_conv, cur_height, accept_mpp_keysend, allow_skimmed_fees); return tag_ptr(ret_conv, true); @@ -46688,12 +48743,38 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedForward_1set_1failure(J BlindedForward_set_failure(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedForward_1new(JNIEnv *env, jclass clz, int8_tArray inbound_blinding_point_arg, jclass failure_arg) { +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedForward_1get_1next_1blinding_1override(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBlindedForward this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, BlindedForward_get_next_blinding_override(&this_ptr_conv).compressed_form); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedForward_1set_1next_1blinding_1override(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKBlindedForward this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + BlindedForward_set_next_blinding_override(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedForward_1new(JNIEnv *env, jclass clz, int8_tArray inbound_blinding_point_arg, jclass failure_arg, int8_tArray next_blinding_override_arg) { LDKPublicKey inbound_blinding_point_arg_ref; CHECK((*env)->GetArrayLength(env, inbound_blinding_point_arg) == 33); (*env)->GetByteArrayRegion(env, inbound_blinding_point_arg, 0, 33, inbound_blinding_point_arg_ref.compressed_form); LDKBlindedFailure failure_arg_conv = LDKBlindedFailure_from_java(env, failure_arg); - LDKBlindedForward ret_var = BlindedForward_new(inbound_blinding_point_arg_ref, failure_arg_conv); + LDKPublicKey next_blinding_override_arg_ref; + CHECK((*env)->GetArrayLength(env, next_blinding_override_arg) == 33); + (*env)->GetByteArrayRegion(env, next_blinding_override_arg, 0, 33, next_blinding_override_arg_ref.compressed_form); + LDKBlindedForward ret_var = BlindedForward_new(inbound_blinding_point_arg_ref, failure_arg_conv, next_blinding_override_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -47661,7 +49742,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1close_1chan return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1broadcasting_1latest_1txn(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_id, int8_tArray counterparty_node_id) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1broadcasting_1latest_1txn(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_id, int8_tArray counterparty_node_id, jstring error_message) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -47675,12 +49756,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1clos LDKPublicKey counterparty_node_id_ref; CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); + LDKStr error_message_conv = java_to_owned_str(env, error_message); LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_force_close_broadcasting_latest_txn(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref); + *ret_conv = ChannelManager_force_close_broadcasting_latest_txn(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref, error_message_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1without_1broadcasting_1txn(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_id, int8_tArray counterparty_node_id) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1without_1broadcasting_1txn(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_id, int8_tArray counterparty_node_id, jstring error_message) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -47694,27 +49776,30 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1clos LDKPublicKey counterparty_node_id_ref; CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); + LDKStr error_message_conv = java_to_owned_str(env, error_message); LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_force_close_without_broadcasting_txn(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref); + *ret_conv = ChannelManager_force_close_without_broadcasting_txn(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref, error_message_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1all_1channels_1broadcasting_1latest_1txn(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1all_1channels_1broadcasting_1latest_1txn(JNIEnv *env, jclass clz, int64_t this_arg, jstring error_message) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelManager_force_close_all_channels_broadcasting_latest_txn(&this_arg_conv); + LDKStr error_message_conv = java_to_owned_str(env, error_message); + ChannelManager_force_close_all_channels_broadcasting_latest_txn(&this_arg_conv, error_message_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1all_1channels_1without_1broadcasting_1txn(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1all_1channels_1without_1broadcasting_1txn(JNIEnv *env, jclass clz, int64_t this_arg, jstring error_message) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelManager_force_close_all_channels_without_broadcasting_txn(&this_arg_conv); + LDKStr error_message_conv = java_to_owned_str(env, error_message); + ChannelManager_force_close_all_channels_without_broadcasting_txn(&this_arg_conv, error_message_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payment_1with_1route(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_hash, int64_t recipient_onion, int8_tArray payment_id) { @@ -47727,7 +49812,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payme route_conv.inner = untag_ptr(route); route_conv.is_owned = ptr_is_owned(route); CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); - route_conv.is_owned = false; + route_conv = Route_clone(&route_conv); LDKThirtyTwoBytes payment_hash_ref; CHECK((*env)->GetArrayLength(env, payment_hash) == 32); (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); @@ -47740,7 +49825,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payme CHECK((*env)->GetArrayLength(env, payment_id) == 32); (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); - *ret_conv = ChannelManager_send_payment_with_route(&this_arg_conv, &route_conv, payment_hash_ref, recipient_onion_conv, payment_id_ref); + *ret_conv = ChannelManager_send_payment_with_route(&this_arg_conv, route_conv, payment_hash_ref, recipient_onion_conv, payment_id_ref); return tag_ptr(ret_conv, true); } @@ -47911,7 +49996,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1funding_1tr temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); - temporary_channel_id_conv.is_owned = false; + temporary_channel_id_conv = ChannelId_clone(&temporary_channel_id_conv); LDKPublicKey counterparty_node_id_ref; CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); @@ -47921,7 +50006,31 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1funding_1tr (*env)->GetByteArrayRegion(env, funding_transaction, 0, funding_transaction_ref.datalen, funding_transaction_ref.data); funding_transaction_ref.data_is_owned = true; LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_funding_transaction_generated(&this_arg_conv, &temporary_channel_id_conv, counterparty_node_id_ref, funding_transaction_ref); + *ret_conv = ChannelManager_funding_transaction_generated(&this_arg_conv, temporary_channel_id_conv, counterparty_node_id_ref, funding_transaction_ref); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1unsafe_1manual_1funding_1transaction_1generated(JNIEnv *env, jclass clz, int64_t this_arg, int64_t temporary_channel_id, int8_tArray counterparty_node_id, int64_t funding) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelId temporary_channel_id_conv; + temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); + temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); + temporary_channel_id_conv = ChannelId_clone(&temporary_channel_id_conv); + LDKPublicKey counterparty_node_id_ref; + CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); + (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); + LDKOutPoint funding_conv; + funding_conv.inner = untag_ptr(funding); + funding_conv.is_owned = ptr_is_owned(funding); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_conv); + funding_conv = OutPoint_clone(&funding_conv); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_unsafe_manual_funding_transaction_generated(&this_arg_conv, temporary_channel_id_conv, counterparty_node_id_ref, funding_conv); return tag_ptr(ret_conv, true); } @@ -48192,14 +50301,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1accept_1inb return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1offer_1builder(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1offer_1builder(JNIEnv *env, jclass clz, int64_t this_arg, int64_t absolute_expiry) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; + void* absolute_expiry_ptr = untag_ptr(absolute_expiry); + CHECK_ACCESS(absolute_expiry_ptr); + LDKCOption_u64Z absolute_expiry_conv = *(LDKCOption_u64Z*)(absolute_expiry_ptr); + absolute_expiry_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(absolute_expiry)); LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ"); - *ret_conv = ChannelManager_create_offer_builder(&this_arg_conv); + *ret_conv = ChannelManager_create_offer_builder(&this_arg_conv, absolute_expiry_conv); return tag_ptr(ret_conv, true); } @@ -48538,6 +50651,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1OffersM return tag_ptr(ret_ret, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1AsyncPaymentsMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKAsyncPaymentsMessageHandler* ret_ret = MALLOC(sizeof(LDKAsyncPaymentsMessageHandler), "LDKAsyncPaymentsMessageHandler"); + *ret_ret = ChannelManager_as_AsyncPaymentsMessageHandler(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1NodeIdLookUp(JNIEnv *env, jclass clz, int64_t this_arg) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -51340,23 +53464,23 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1usabl ChannelDetails_set_is_usable(&this_ptr_conv, val); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1public(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1announced(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - jboolean ret_conv = ChannelDetails_get_is_public(&this_ptr_conv); + jboolean ret_conv = ChannelDetails_get_is_announced(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1public(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1announced(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelDetails_set_is_public(&this_ptr_conv, val); + ChannelDetails_set_is_announced(&this_ptr_conv, val); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -51532,7 +53656,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1pending_1 ChannelDetails_set_pending_outbound_htlcs(&this_ptr_conv, val_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new(JNIEnv *env, jclass clz, int64_t channel_id_arg, int64_t counterparty_arg, int64_t funding_txo_arg, int64_t channel_type_arg, int64_t short_channel_id_arg, int64_t outbound_scid_alias_arg, int64_t inbound_scid_alias_arg, int64_t channel_value_satoshis_arg, int64_t unspendable_punishment_reserve_arg, int8_tArray user_channel_id_arg, int64_t feerate_sat_per_1000_weight_arg, int64_t balance_msat_arg, int64_t outbound_capacity_msat_arg, int64_t next_outbound_htlc_limit_msat_arg, int64_t next_outbound_htlc_minimum_msat_arg, int64_t inbound_capacity_msat_arg, int64_t confirmations_required_arg, int64_t confirmations_arg, int64_t force_close_spend_delay_arg, jboolean is_outbound_arg, jboolean is_channel_ready_arg, int64_t channel_shutdown_state_arg, jboolean is_usable_arg, jboolean is_public_arg, int64_t inbound_htlc_minimum_msat_arg, int64_t inbound_htlc_maximum_msat_arg, int64_t config_arg, int64_tArray pending_inbound_htlcs_arg, int64_tArray pending_outbound_htlcs_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new(JNIEnv *env, jclass clz, int64_t channel_id_arg, int64_t counterparty_arg, int64_t funding_txo_arg, int64_t channel_type_arg, int64_t short_channel_id_arg, int64_t outbound_scid_alias_arg, int64_t inbound_scid_alias_arg, int64_t channel_value_satoshis_arg, int64_t unspendable_punishment_reserve_arg, int8_tArray user_channel_id_arg, int64_t feerate_sat_per_1000_weight_arg, int64_t balance_msat_arg, int64_t outbound_capacity_msat_arg, int64_t next_outbound_htlc_limit_msat_arg, int64_t next_outbound_htlc_minimum_msat_arg, int64_t inbound_capacity_msat_arg, int64_t confirmations_required_arg, int64_t confirmations_arg, int64_t force_close_spend_delay_arg, jboolean is_outbound_arg, jboolean is_channel_ready_arg, int64_t channel_shutdown_state_arg, jboolean is_usable_arg, jboolean is_announced_arg, int64_t inbound_htlc_minimum_msat_arg, int64_t inbound_htlc_maximum_msat_arg, int64_t config_arg, int64_tArray pending_inbound_htlcs_arg, int64_tArray pending_outbound_htlcs_arg) { LDKChannelId channel_id_arg_conv; channel_id_arg_conv.inner = untag_ptr(channel_id_arg); channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); @@ -51568,6 +53692,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new(JNIEnv void* unspendable_punishment_reserve_arg_ptr = untag_ptr(unspendable_punishment_reserve_arg); CHECK_ACCESS(unspendable_punishment_reserve_arg_ptr); LDKCOption_u64Z unspendable_punishment_reserve_arg_conv = *(LDKCOption_u64Z*)(unspendable_punishment_reserve_arg_ptr); + unspendable_punishment_reserve_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(unspendable_punishment_reserve_arg)); LDKU128 user_channel_id_arg_ref; CHECK((*env)->GetArrayLength(env, user_channel_id_arg) == 16); (*env)->GetByteArrayRegion(env, user_channel_id_arg, 0, 16, user_channel_id_arg_ref.le_bytes); @@ -51638,7 +53763,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new(JNIEnv pending_outbound_htlcs_arg_constr.data[v] = pending_outbound_htlcs_arg_conv_21_conv; } (*env)->ReleaseLongArrayElements(env, pending_outbound_htlcs_arg, pending_outbound_htlcs_arg_vals, 0); - LDKChannelDetails ret_var = ChannelDetails_new(channel_id_arg_conv, counterparty_arg_conv, funding_txo_arg_conv, channel_type_arg_conv, short_channel_id_arg_conv, outbound_scid_alias_arg_conv, inbound_scid_alias_arg_conv, channel_value_satoshis_arg, unspendable_punishment_reserve_arg_conv, user_channel_id_arg_ref, feerate_sat_per_1000_weight_arg_conv, balance_msat_arg, outbound_capacity_msat_arg, next_outbound_htlc_limit_msat_arg, next_outbound_htlc_minimum_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg_conv, confirmations_arg_conv, force_close_spend_delay_arg_conv, is_outbound_arg, is_channel_ready_arg, channel_shutdown_state_arg_conv, is_usable_arg, is_public_arg, inbound_htlc_minimum_msat_arg_conv, inbound_htlc_maximum_msat_arg_conv, config_arg_conv, pending_inbound_htlcs_arg_constr, pending_outbound_htlcs_arg_constr); + LDKChannelDetails ret_var = ChannelDetails_new(channel_id_arg_conv, counterparty_arg_conv, funding_txo_arg_conv, channel_type_arg_conv, short_channel_id_arg_conv, outbound_scid_alias_arg_conv, inbound_scid_alias_arg_conv, channel_value_satoshis_arg, unspendable_punishment_reserve_arg_conv, user_channel_id_arg_ref, feerate_sat_per_1000_weight_arg_conv, balance_msat_arg, outbound_capacity_msat_arg, next_outbound_htlc_limit_msat_arg, next_outbound_htlc_minimum_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg_conv, confirmations_arg_conv, force_close_spend_delay_arg_conv, is_outbound_arg, is_channel_ready_arg, channel_shutdown_state_arg_conv, is_usable_arg, is_announced_arg, inbound_htlc_minimum_msat_arg_conv, inbound_htlc_maximum_msat_arg_conv, config_arg_conv, pending_inbound_htlcs_arg_constr, pending_outbound_htlcs_arg_constr); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -52040,6 +54165,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1new(JNIEnv *env, jcla void* remote_network_address_arg_ptr = untag_ptr(remote_network_address_arg); CHECK_ACCESS(remote_network_address_arg_ptr); LDKCOption_SocketAddressZ remote_network_address_arg_conv = *(LDKCOption_SocketAddressZ*)(remote_network_address_arg_ptr); + remote_network_address_arg_conv = COption_SocketAddressZ_clone((LDKCOption_SocketAddressZ*)untag_ptr(remote_network_address_arg)); LDKInit ret_var = Init_new(features_arg_conv, networks_arg_conv, remote_network_address_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); @@ -53051,6 +55177,204 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CommonOpenChannelFields_1e return ret_conv; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommonOpenChannelFields_1channel_1parameters(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKCommonOpenChannelFields this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelParameters ret_var = CommonOpenChannelFields_channel_parameters(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelParameters this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelParameters_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1get_1dust_1limit_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ChannelParameters_get_dust_limit_satoshis(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1set_1dust_1limit_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelParameters_set_dust_limit_satoshis(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1get_1max_1htlc_1value_1in_1flight_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ChannelParameters_get_max_htlc_value_in_flight_msat(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1set_1max_1htlc_1value_1in_1flight_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelParameters_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ChannelParameters_get_htlc_minimum_msat(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelParameters_set_htlc_minimum_msat(&this_ptr_conv, val); +} + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1get_1commitment_1feerate_1sat_1per_11000_1weight(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = ChannelParameters_get_commitment_feerate_sat_per_1000_weight(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1set_1commitment_1feerate_1sat_1per_11000_1weight(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelParameters_set_commitment_feerate_sat_per_1000_weight(&this_ptr_conv, val); +} + +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1get_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int16_t ret_conv = ChannelParameters_get_to_self_delay(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1set_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelParameters_set_to_self_delay(&this_ptr_conv, val); +} + +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1get_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int16_t ret_conv = ChannelParameters_get_max_accepted_htlcs(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1set_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelParameters_set_max_accepted_htlcs(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1new(JNIEnv *env, jclass clz, int64_t dust_limit_satoshis_arg, int64_t max_htlc_value_in_flight_msat_arg, int64_t htlc_minimum_msat_arg, int32_t commitment_feerate_sat_per_1000_weight_arg, int16_t to_self_delay_arg, int16_t max_accepted_htlcs_arg) { + LDKChannelParameters ret_var = ChannelParameters_new(dust_limit_satoshis_arg, max_htlc_value_in_flight_msat_arg, htlc_minimum_msat_arg, commitment_feerate_sat_per_1000_weight_arg, to_self_delay_arg, max_accepted_htlcs_arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t ChannelParameters_clone_ptr(LDKChannelParameters *NONNULL_PTR arg) { + LDKChannelParameters ret_var = ChannelParameters_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelParameters arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = ChannelParameters_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelParameters orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKChannelParameters ret_var = ChannelParameters_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKChannelParameters o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = ChannelParameters_hash(&o_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKChannelParameters a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKChannelParameters b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ChannelParameters_eq(&a_conv, &b_conv); + return ret_conv; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1free(JNIEnv *env, jclass clz, int64_t this_obj) { LDKOpenChannel this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -54678,29 +57002,29 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Stfu_1eq(JNIEnv *env, jcla return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Splice_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKSplice this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceInit_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKSpliceInit this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Splice_free(this_obj_conv); + SpliceInit_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Splice_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKSplice this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpliceInit_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelId ret_var = Splice_get_channel_id(&this_ptr_conv); + LDKChannelId ret_var = SpliceInit_get_channel_id(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Splice_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKSplice this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceInit_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -54710,173 +57034,168 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Splice_1set_1channel_1id(JNIEn val_conv.is_owned = ptr_is_owned(val); CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelId_clone(&val_conv); - Splice_set_channel_id(&this_ptr_conv, val_conv); + SpliceInit_set_channel_id(&this_ptr_conv, val_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Splice_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKSplice this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpliceInit_1get_1funding_1contribution_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *Splice_get_chain_hash(&this_ptr_conv)); - return ret_arr; + int64_t ret_conv = SpliceInit_get_funding_contribution_satoshis(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Splice_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKSplice this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceInit_1set_1funding_1contribution_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - Splice_set_chain_hash(&this_ptr_conv, val_ref); + SpliceInit_set_funding_contribution_satoshis(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Splice_1get_1relative_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKSplice this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_SpliceInit_1get_1funding_1feerate_1perkw(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = Splice_get_relative_satoshis(&this_ptr_conv); + int32_t ret_conv = SpliceInit_get_funding_feerate_perkw(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Splice_1set_1relative_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKSplice this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceInit_1set_1funding_1feerate_1perkw(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - Splice_set_relative_satoshis(&this_ptr_conv, val); + SpliceInit_set_funding_feerate_perkw(&this_ptr_conv, val); } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_Splice_1get_1funding_1feerate_1perkw(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKSplice this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_SpliceInit_1get_1locktime(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int32_t ret_conv = Splice_get_funding_feerate_perkw(&this_ptr_conv); + int32_t ret_conv = SpliceInit_get_locktime(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Splice_1set_1funding_1feerate_1perkw(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKSplice this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceInit_1set_1locktime(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - Splice_set_funding_feerate_perkw(&this_ptr_conv, val); + SpliceInit_set_locktime(&this_ptr_conv, val); } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_Splice_1get_1locktime(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKSplice this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SpliceInit_1get_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int32_t ret_conv = Splice_get_locktime(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, SpliceInit_get_funding_pubkey(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Splice_1set_1locktime(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKSplice this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceInit_1set_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - Splice_set_locktime(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + SpliceInit_set_funding_pubkey(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Splice_1get_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKSplice this_ptr_conv; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SpliceInit_1get_1require_1confirmed_1inputs(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Splice_get_funding_pubkey(&this_ptr_conv).compressed_form); - return ret_arr; + jclass ret_conv = LDKCOption_NoneZ_to_java(env, SpliceInit_get_require_confirmed_inputs(&this_ptr_conv)); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Splice_1set_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKSplice this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceInit_1set_1require_1confirmed_1inputs(JNIEnv *env, jclass clz, int64_t this_ptr, jclass val) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - Splice_set_funding_pubkey(&this_ptr_conv, val_ref); + LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_java(env, val); + SpliceInit_set_require_confirmed_inputs(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Splice_1new(JNIEnv *env, jclass clz, int64_t channel_id_arg, int8_tArray chain_hash_arg, int64_t relative_satoshis_arg, int32_t funding_feerate_perkw_arg, int32_t locktime_arg, int8_tArray funding_pubkey_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpliceInit_1new(JNIEnv *env, jclass clz, int64_t channel_id_arg, int64_t funding_contribution_satoshis_arg, int32_t funding_feerate_perkw_arg, int32_t locktime_arg, int8_tArray funding_pubkey_arg, jclass require_confirmed_inputs_arg) { LDKChannelId channel_id_arg_conv; channel_id_arg_conv.inner = untag_ptr(channel_id_arg); channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); - LDKThirtyTwoBytes chain_hash_arg_ref; - CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32); - (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data); LDKPublicKey funding_pubkey_arg_ref; CHECK((*env)->GetArrayLength(env, funding_pubkey_arg) == 33); (*env)->GetByteArrayRegion(env, funding_pubkey_arg, 0, 33, funding_pubkey_arg_ref.compressed_form); - LDKSplice ret_var = Splice_new(channel_id_arg_conv, chain_hash_arg_ref, relative_satoshis_arg, funding_feerate_perkw_arg, locktime_arg, funding_pubkey_arg_ref); + LDKCOption_NoneZ require_confirmed_inputs_arg_conv = LDKCOption_NoneZ_from_java(env, require_confirmed_inputs_arg); + LDKSpliceInit ret_var = SpliceInit_new(channel_id_arg_conv, funding_contribution_satoshis_arg, funding_feerate_perkw_arg, locktime_arg, funding_pubkey_arg_ref, require_confirmed_inputs_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t Splice_clone_ptr(LDKSplice *NONNULL_PTR arg) { - LDKSplice ret_var = Splice_clone(arg); +static inline uint64_t SpliceInit_clone_ptr(LDKSpliceInit *NONNULL_PTR arg) { + LDKSpliceInit ret_var = SpliceInit_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Splice_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKSplice arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpliceInit_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKSpliceInit arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Splice_clone_ptr(&arg_conv); + int64_t ret_conv = SpliceInit_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Splice_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKSplice orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpliceInit_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKSpliceInit orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKSplice ret_var = Splice_clone(&orig_conv); + LDKSpliceInit ret_var = SpliceInit_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Splice_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKSplice a_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SpliceInit_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKSpliceInit a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKSplice b_conv; + LDKSpliceInit b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = Splice_eq(&a_conv, &b_conv); + jboolean ret_conv = SpliceInit_eq(&a_conv, &b_conv); return ret_conv; } @@ -54915,84 +57234,79 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceAck_1set_1channel_1id(JN SpliceAck_set_channel_id(&this_ptr_conv, val_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SpliceAck_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpliceAck_1get_1funding_1contribution_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKSpliceAck this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *SpliceAck_get_chain_hash(&this_ptr_conv)); - return ret_arr; + int64_t ret_conv = SpliceAck_get_funding_contribution_satoshis(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceAck_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceAck_1set_1funding_1contribution_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { LDKSpliceAck this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - SpliceAck_set_chain_hash(&this_ptr_conv, val_ref); + SpliceAck_set_funding_contribution_satoshis(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpliceAck_1get_1relative_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SpliceAck_1get_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKSpliceAck this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = SpliceAck_get_relative_satoshis(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, SpliceAck_get_funding_pubkey(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceAck_1set_1relative_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceAck_1set_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { LDKSpliceAck this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - SpliceAck_set_relative_satoshis(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + SpliceAck_set_funding_pubkey(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SpliceAck_1get_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SpliceAck_1get_1require_1confirmed_1inputs(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKSpliceAck this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, SpliceAck_get_funding_pubkey(&this_ptr_conv).compressed_form); - return ret_arr; + jclass ret_conv = LDKCOption_NoneZ_to_java(env, SpliceAck_get_require_confirmed_inputs(&this_ptr_conv)); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceAck_1set_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceAck_1set_1require_1confirmed_1inputs(JNIEnv *env, jclass clz, int64_t this_ptr, jclass val) { LDKSpliceAck this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - SpliceAck_set_funding_pubkey(&this_ptr_conv, val_ref); + LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_java(env, val); + SpliceAck_set_require_confirmed_inputs(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpliceAck_1new(JNIEnv *env, jclass clz, int64_t channel_id_arg, int8_tArray chain_hash_arg, int64_t relative_satoshis_arg, int8_tArray funding_pubkey_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpliceAck_1new(JNIEnv *env, jclass clz, int64_t channel_id_arg, int64_t funding_contribution_satoshis_arg, int8_tArray funding_pubkey_arg, jclass require_confirmed_inputs_arg) { LDKChannelId channel_id_arg_conv; channel_id_arg_conv.inner = untag_ptr(channel_id_arg); channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); - LDKThirtyTwoBytes chain_hash_arg_ref; - CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32); - (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data); LDKPublicKey funding_pubkey_arg_ref; CHECK((*env)->GetArrayLength(env, funding_pubkey_arg) == 33); (*env)->GetByteArrayRegion(env, funding_pubkey_arg, 0, 33, funding_pubkey_arg_ref.compressed_form); - LDKSpliceAck ret_var = SpliceAck_new(channel_id_arg_conv, chain_hash_arg_ref, relative_satoshis_arg, funding_pubkey_arg_ref); + LDKCOption_NoneZ require_confirmed_inputs_arg_conv = LDKCOption_NoneZ_from_java(env, require_confirmed_inputs_arg); + LDKSpliceAck ret_var = SpliceAck_new(channel_id_arg_conv, funding_contribution_satoshis_arg, funding_pubkey_arg_ref, require_confirmed_inputs_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -55079,13 +57393,39 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceLocked_1set_1channel_1id SpliceLocked_set_channel_id(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpliceLocked_1new(JNIEnv *env, jclass clz, int64_t channel_id_arg) { +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SpliceLocked_1get_1splice_1txid(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKSpliceLocked this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *SpliceLocked_get_splice_txid(&this_ptr_conv)); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceLocked_1set_1splice_1txid(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKSpliceLocked this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + SpliceLocked_set_splice_txid(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpliceLocked_1new(JNIEnv *env, jclass clz, int64_t channel_id_arg, int8_tArray splice_txid_arg) { LDKChannelId channel_id_arg_conv; channel_id_arg_conv.inner = untag_ptr(channel_id_arg); channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); - LDKSpliceLocked ret_var = SpliceLocked_new(channel_id_arg_conv); + LDKThirtyTwoBytes splice_txid_arg_ref; + CHECK((*env)->GetArrayLength(env, splice_txid_arg) == 32); + (*env)->GetByteArrayRegion(env, splice_txid_arg, 0, 32, splice_txid_arg_ref.data); + LDKSpliceLocked ret_var = SpliceLocked_new(channel_id_arg_conv, splice_txid_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -55256,7 +57596,32 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxAddInput_1set_1sequence(JNIE TxAddInput_set_sequence(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxAddInput_1new(JNIEnv *env, jclass clz, int64_t channel_id_arg, int64_t serial_id_arg, int64_t prevtx_arg, int32_t prevtx_out_arg, int32_t sequence_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxAddInput_1get_1shared_1input_1txid(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKTxAddInput this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); + *ret_copy = TxAddInput_get_shared_input_txid(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxAddInput_1set_1shared_1input_1txid(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKTxAddInput this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_ThirtyTwoBytesZ val_conv = *(LDKCOption_ThirtyTwoBytesZ*)(val_ptr); + val_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(val)); + TxAddInput_set_shared_input_txid(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxAddInput_1new(JNIEnv *env, jclass clz, int64_t channel_id_arg, int64_t serial_id_arg, int64_t prevtx_arg, int32_t prevtx_out_arg, int32_t sequence_arg, int64_t shared_input_txid_arg) { LDKChannelId channel_id_arg_conv; channel_id_arg_conv.inner = untag_ptr(channel_id_arg); channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); @@ -55267,7 +57632,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxAddInput_1new(JNIEnv *env prevtx_arg_conv.is_owned = ptr_is_owned(prevtx_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(prevtx_arg_conv); prevtx_arg_conv = TransactionU16LenLimited_clone(&prevtx_arg_conv); - LDKTxAddInput ret_var = TxAddInput_new(channel_id_arg_conv, serial_id_arg, prevtx_arg_conv, prevtx_out_arg, sequence_arg); + void* shared_input_txid_arg_ptr = untag_ptr(shared_input_txid_arg); + CHECK_ACCESS(shared_input_txid_arg_ptr); + LDKCOption_ThirtyTwoBytesZ shared_input_txid_arg_conv = *(LDKCOption_ThirtyTwoBytesZ*)(shared_input_txid_arg_ptr); + shared_input_txid_arg_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(shared_input_txid_arg)); + LDKTxAddInput ret_var = TxAddInput_new(channel_id_arg_conv, serial_id_arg, prevtx_arg_conv, prevtx_out_arg, sequence_arg, shared_input_txid_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -55951,19 +58320,19 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxSignatures_1set_1witnesses(J TxSignatures_set_witnesses(&this_ptr_conv, val_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxSignatures_1get_1funding_1outpoint_1sig(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxSignatures_1get_1shared_1input_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKTxSignatures this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; LDKCOption_ECDSASignatureZ *ret_copy = MALLOC(sizeof(LDKCOption_ECDSASignatureZ), "LDKCOption_ECDSASignatureZ"); - *ret_copy = TxSignatures_get_funding_outpoint_sig(&this_ptr_conv); + *ret_copy = TxSignatures_get_shared_input_signature(&this_ptr_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxSignatures_1set_1funding_1outpoint_1sig(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxSignatures_1set_1shared_1input_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { LDKTxSignatures this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); @@ -55973,10 +58342,10 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxSignatures_1set_1funding_1ou CHECK_ACCESS(val_ptr); LDKCOption_ECDSASignatureZ val_conv = *(LDKCOption_ECDSASignatureZ*)(val_ptr); val_conv = COption_ECDSASignatureZ_clone((LDKCOption_ECDSASignatureZ*)untag_ptr(val)); - TxSignatures_set_funding_outpoint_sig(&this_ptr_conv, val_conv); + TxSignatures_set_shared_input_signature(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxSignatures_1new(JNIEnv *env, jclass clz, int64_t channel_id_arg, int8_tArray tx_hash_arg, jobjectArray witnesses_arg, int64_t funding_outpoint_sig_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxSignatures_1new(JNIEnv *env, jclass clz, int64_t channel_id_arg, int8_tArray tx_hash_arg, jobjectArray witnesses_arg, int64_t shared_input_signature_arg) { LDKChannelId channel_id_arg_conv; channel_id_arg_conv.inner = untag_ptr(channel_id_arg); channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); @@ -56000,11 +58369,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxSignatures_1new(JNIEnv *e witnesses_arg_conv_8_ref.data_is_owned = true; witnesses_arg_constr.data[i] = witnesses_arg_conv_8_ref; } - void* funding_outpoint_sig_arg_ptr = untag_ptr(funding_outpoint_sig_arg); - CHECK_ACCESS(funding_outpoint_sig_arg_ptr); - LDKCOption_ECDSASignatureZ funding_outpoint_sig_arg_conv = *(LDKCOption_ECDSASignatureZ*)(funding_outpoint_sig_arg_ptr); - funding_outpoint_sig_arg_conv = COption_ECDSASignatureZ_clone((LDKCOption_ECDSASignatureZ*)untag_ptr(funding_outpoint_sig_arg)); - LDKTxSignatures ret_var = TxSignatures_new(channel_id_arg_conv, tx_hash_arg_ref, witnesses_arg_constr, funding_outpoint_sig_arg_conv); + void* shared_input_signature_arg_ptr = untag_ptr(shared_input_signature_arg); + CHECK_ACCESS(shared_input_signature_arg_ptr); + LDKCOption_ECDSASignatureZ shared_input_signature_arg_conv = *(LDKCOption_ECDSASignatureZ*)(shared_input_signature_arg_ptr); + shared_input_signature_arg_conv = COption_ECDSASignatureZ_clone((LDKCOption_ECDSASignatureZ*)untag_ptr(shared_input_signature_arg)); + LDKTxSignatures ret_var = TxSignatures_new(channel_id_arg_conv, tx_hash_arg_ref, witnesses_arg_constr, shared_input_signature_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -57710,6 +60079,122 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1e return ret_conv; } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSignedBatch_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKCommitmentSignedBatch this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + CommitmentSignedBatch_free(this_obj_conv); +} + +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_CommitmentSignedBatch_1get_1batch_1size(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKCommitmentSignedBatch this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int16_t ret_conv = CommitmentSignedBatch_get_batch_size(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSignedBatch_1set_1batch_1size(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKCommitmentSignedBatch this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + CommitmentSignedBatch_set_batch_size(&this_ptr_conv, val); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSignedBatch_1get_1funding_1txid(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKCommitmentSignedBatch this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *CommitmentSignedBatch_get_funding_txid(&this_ptr_conv)); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSignedBatch_1set_1funding_1txid(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKCommitmentSignedBatch this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + CommitmentSignedBatch_set_funding_txid(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSignedBatch_1new(JNIEnv *env, jclass clz, int16_t batch_size_arg, int8_tArray funding_txid_arg) { + LDKThirtyTwoBytes funding_txid_arg_ref; + CHECK((*env)->GetArrayLength(env, funding_txid_arg) == 32); + (*env)->GetByteArrayRegion(env, funding_txid_arg, 0, 32, funding_txid_arg_ref.data); + LDKCommitmentSignedBatch ret_var = CommitmentSignedBatch_new(batch_size_arg, funding_txid_arg_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t CommitmentSignedBatch_clone_ptr(LDKCommitmentSignedBatch *NONNULL_PTR arg) { + LDKCommitmentSignedBatch ret_var = CommitmentSignedBatch_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSignedBatch_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCommitmentSignedBatch arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = CommitmentSignedBatch_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSignedBatch_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCommitmentSignedBatch orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKCommitmentSignedBatch ret_var = CommitmentSignedBatch_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSignedBatch_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKCommitmentSignedBatch o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = CommitmentSignedBatch_hash(&o_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CommitmentSignedBatch_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKCommitmentSignedBatch a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKCommitmentSignedBatch b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = CommitmentSignedBatch_eq(&a_conv, &b_conv); + return ret_conv; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1free(JNIEnv *env, jclass clz, int64_t this_obj) { LDKCommitmentSigned this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -57810,7 +60295,34 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1htlc_1s CommitmentSigned_set_htlc_signatures(&this_ptr_conv, val_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1new(JNIEnv *env, jclass clz, int64_t channel_id_arg, int8_tArray signature_arg, jobjectArray htlc_signatures_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1batch(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKCommitmentSigned this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCommitmentSignedBatch ret_var = CommitmentSigned_get_batch(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1batch(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKCommitmentSigned this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCommitmentSignedBatch val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = CommitmentSignedBatch_clone(&val_conv); + CommitmentSigned_set_batch(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1new(JNIEnv *env, jclass clz, int64_t channel_id_arg, int8_tArray signature_arg, jobjectArray htlc_signatures_arg, int64_t batch_arg) { LDKChannelId channel_id_arg_conv; channel_id_arg_conv.inner = untag_ptr(channel_id_arg); channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); @@ -57832,7 +60344,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1new(JNIEn (*env)->GetByteArrayRegion(env, htlc_signatures_arg_conv_8, 0, 64, htlc_signatures_arg_conv_8_ref.compact_form); htlc_signatures_arg_constr.data[i] = htlc_signatures_arg_conv_8_ref; } - LDKCommitmentSigned ret_var = CommitmentSigned_new(channel_id_arg_conv, signature_arg_ref, htlc_signatures_arg_constr); + LDKCommitmentSignedBatch batch_arg_conv; + batch_arg_conv.inner = untag_ptr(batch_arg); + batch_arg_conv.is_owned = ptr_is_owned(batch_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(batch_arg_conv); + batch_arg_conv = CommitmentSignedBatch_clone(&batch_arg_conv); + LDKCommitmentSigned ret_var = CommitmentSigned_new(channel_id_arg_conv, signature_arg_ref, htlc_signatures_arg_constr, batch_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -59083,6 +61600,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1n void* addresses_arg_conv_15_ptr = untag_ptr(addresses_arg_conv_15); CHECK_ACCESS(addresses_arg_conv_15_ptr); LDKSocketAddress addresses_arg_conv_15_conv = *(LDKSocketAddress*)(addresses_arg_conv_15_ptr); + addresses_arg_conv_15_conv = SocketAddress_clone((LDKSocketAddress*)untag_ptr(addresses_arg_conv_15)); addresses_arg_constr.data[p] = addresses_arg_conv_15_conv; } (*env)->ReleaseLongArrayElements(env, addresses_arg, addresses_arg_vals, 0); @@ -59867,23 +62385,42 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1ti UnsignedChannelUpdate_set_timestamp(&this_ptr_conv, val); } -JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1flags(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1message_1flags(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedChannelUpdate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_t ret_conv = UnsignedChannelUpdate_get_message_flags(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1message_1flags(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) { + LDKUnsignedChannelUpdate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + UnsignedChannelUpdate_set_message_flags(&this_ptr_conv, val); +} + +JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1channel_1flags(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_t ret_conv = UnsignedChannelUpdate_get_flags(&this_ptr_conv); + int8_t ret_conv = UnsignedChannelUpdate_get_channel_flags(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1flags(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1channel_1flags(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) { LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - UnsignedChannelUpdate_set_flags(&this_ptr_conv, val); + UnsignedChannelUpdate_set_channel_flags(&this_ptr_conv, val); } JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -60007,7 +62544,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1ex UnsignedChannelUpdate_set_excess_data(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1new(JNIEnv *env, jclass clz, int8_tArray chain_hash_arg, int64_t short_channel_id_arg, int32_t timestamp_arg, int8_t flags_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg, int32_t fee_base_msat_arg, int32_t fee_proportional_millionths_arg, int8_tArray excess_data_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1new(JNIEnv *env, jclass clz, int8_tArray chain_hash_arg, int64_t short_channel_id_arg, int32_t timestamp_arg, int8_t message_flags_arg, int8_t channel_flags_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg, int32_t fee_base_msat_arg, int32_t fee_proportional_millionths_arg, int8_tArray excess_data_arg) { LDKThirtyTwoBytes chain_hash_arg_ref; CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32); (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data); @@ -60015,7 +62552,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1new( excess_data_arg_ref.datalen = (*env)->GetArrayLength(env, excess_data_arg); excess_data_arg_ref.data = MALLOC(excess_data_arg_ref.datalen, "LDKCVec_u8Z Bytes"); (*env)->GetByteArrayRegion(env, excess_data_arg, 0, excess_data_arg_ref.datalen, excess_data_arg_ref.data); - LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_new(chain_hash_arg_ref, short_channel_id_arg, timestamp_arg, flags_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, fee_base_msat_arg, fee_proportional_millionths_arg, excess_data_arg_ref); + LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_new(chain_hash_arg_ref, short_channel_id_arg, timestamp_arg, message_flags_arg, channel_flags_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, fee_base_msat_arg, fee_proportional_millionths_arg, excess_data_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -62055,25 +64592,25 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Stfu_1read(JNIEnv *env, jcl return tag_ptr(ret_conv, true); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Splice_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKSplice obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SpliceInit_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKSpliceInit obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = Splice_write(&obj_conv); + LDKCVec_u8Z ret_var = SpliceInit_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Splice_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpliceInit_1read(JNIEnv *env, jclass clz, int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_SpliceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceDecodeErrorZ), "LDKCResult_SpliceDecodeErrorZ"); - *ret_conv = Splice_read(ser_ref); + LDKCResult_SpliceInitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceInitDecodeErrorZ), "LDKCResult_SpliceInitDecodeErrorZ"); + *ret_conv = SpliceInit_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } @@ -62423,6 +64960,29 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1read return tag_ptr(ret_conv, true); } +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSignedBatch_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKCommitmentSignedBatch obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = CommitmentSignedBatch_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSignedBatch_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_CommitmentSignedBatchDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedBatchDecodeErrorZ), "LDKCResult_CommitmentSignedBatchDecodeErrorZ"); + *ret_conv = CommitmentSignedBatch_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); +} + JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1write(JNIEnv *env, jclass clz, int64_t obj) { LDKCommitmentSigned obj_conv; obj_conv.inner = untag_ptr(obj); @@ -63194,17 +65754,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1new return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1EventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKIgnoringMessageHandler this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); - *ret_ret = IgnoringMessageHandler_as_EventsProvider(&this_arg_conv); - return tag_ptr(ret_ret, true); -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) { LDKIgnoringMessageHandler this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -63249,6 +65798,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_ return tag_ptr(ret_ret, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1AsyncPaymentsMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKIgnoringMessageHandler this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKAsyncPaymentsMessageHandler* ret_ret = MALLOC(sizeof(LDKAsyncPaymentsMessageHandler), "LDKAsyncPaymentsMessageHandler"); + *ret_ret = IgnoringMessageHandler_as_AsyncPaymentsMessageHandler(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1CustomOnionMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) { LDKIgnoringMessageHandler this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -63612,6 +66172,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerDetails_1new(JNIEnv *en void* socket_address_arg_ptr = untag_ptr(socket_address_arg); CHECK_ACCESS(socket_address_arg_ptr); LDKCOption_SocketAddressZ socket_address_arg_conv = *(LDKCOption_SocketAddressZ*)(socket_address_arg_ptr); + socket_address_arg_conv = COption_SocketAddressZ_clone((LDKCOption_SocketAddressZ*)untag_ptr(socket_address_arg)); LDKInitFeatures init_features_arg_conv; init_features_arg_conv.inner = untag_ptr(init_features_arg); init_features_arg_conv.is_owned = ptr_is_owned(init_features_arg); @@ -63779,6 +66340,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1outbound_ void* remote_network_address_ptr = untag_ptr(remote_network_address); CHECK_ACCESS(remote_network_address_ptr); LDKCOption_SocketAddressZ remote_network_address_conv = *(LDKCOption_SocketAddressZ*)(remote_network_address_ptr); + remote_network_address_conv = COption_SocketAddressZ_clone((LDKCOption_SocketAddressZ*)untag_ptr(remote_network_address)); LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); *ret_conv = PeerManager_new_outbound_connection(&this_arg_conv, their_node_id_ref, descriptor_conv, remote_network_address_conv); return tag_ptr(ret_conv, true); @@ -63800,6 +66362,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1inbound_1 void* remote_network_address_ptr = untag_ptr(remote_network_address); CHECK_ACCESS(remote_network_address_ptr); LDKCOption_SocketAddressZ remote_network_address_conv = *(LDKCOption_SocketAddressZ*)(remote_network_address_ptr); + remote_network_address_conv = COption_SocketAddressZ_clone((LDKCOption_SocketAddressZ*)untag_ptr(remote_network_address)); LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); *ret_conv = PeerManager_new_inbound_connection(&this_arg_conv, descriptor_conv, remote_network_address_conv); return tag_ptr(ret_conv, true); @@ -63912,6 +66475,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1broadcast_1node_1 void* addresses_conv_15_ptr = untag_ptr(addresses_conv_15); CHECK_ACCESS(addresses_conv_15_ptr); LDKSocketAddress addresses_conv_15_conv = *(LDKSocketAddress*)(addresses_conv_15_ptr); + addresses_conv_15_conv = SocketAddress_clone((LDKSocketAddress*)untag_ptr(addresses_conv_15)); addresses_constr.data[p] = addresses_conv_15_conv; } (*env)->ReleaseLongArrayElements(env, addresses, addresses_vals, 0); @@ -64889,6 +67453,16 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1eq return ret_conv; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1to_1bitcoin_1amount(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKHTLCOutputInCommitment this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int64_t ret_conv = HTLCOutputInCommitment_to_bitcoin_amount(&this_arg_conv); + return ret_conv; +} + JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1write(JNIEnv *env, jclass clz, int64_t obj) { LDKHTLCOutputInCommitment obj_conv; obj_conv.inner = untag_ptr(obj); @@ -66391,7752 +68965,8409 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_get_1commitment_1transactio return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKInitFeatures a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKInitFeatures b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = InitFeatures_eq(&a_conv, &b_conv); - return ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InitFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKInitFeatures obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = InitFeatures_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKNodeFeatures a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKNodeFeatures b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_eq(&a_conv, &b_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); + *ret_conv = InitFeatures_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKChannelFeatures a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKChannelFeatures b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = ChannelFeatures_eq(&a_conv, &b_conv); - return ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelFeatures obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ChannelFeatures_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKBolt11InvoiceFeatures a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKBolt11InvoiceFeatures b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = Bolt11InvoiceFeatures_eq(&a_conv, &b_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); + *ret_conv = ChannelFeatures_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKOfferFeatures a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKOfferFeatures b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = OfferFeatures_eq(&a_conv, &b_conv); - return ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKNodeFeatures obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = NodeFeatures_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKInvoiceRequestFeatures a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKInvoiceRequestFeatures b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = InvoiceRequestFeatures_eq(&a_conv, &b_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); + *ret_conv = NodeFeatures_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKBolt12InvoiceFeatures a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKBolt12InvoiceFeatures b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = Bolt12InvoiceFeatures_eq(&a_conv, &b_conv); - return ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKBolt11InvoiceFeatures obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = Bolt11InvoiceFeatures_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKBlindedHopFeatures a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKBlindedHopFeatures b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = BlindedHopFeatures_eq(&a_conv, &b_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ"); + *ret_conv = Bolt11InvoiceFeatures_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKChannelTypeFeatures a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKChannelTypeFeatures b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_eq(&a_conv, &b_conv); - return ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKBolt12InvoiceFeatures obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = Bolt12InvoiceFeatures_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -static inline uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg) { - LDKInitFeatures ret_var = InitFeatures_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ"); + *ret_conv = Bolt12InvoiceFeatures_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKInitFeatures arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = InitFeatures_clone_ptr(&arg_conv); - return ret_conv; + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKBlindedHopFeatures obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = BlindedHopFeatures_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKInitFeatures orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKInitFeatures ret_var = InitFeatures_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ"); + *ret_conv = BlindedHopFeatures_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -static inline uint64_t NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg) { - LDKNodeFeatures ret_var = NodeFeatures_clone(arg); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelTypeFeatures obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ChannelTypeFeatures_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); + *ret_conv = ChannelTypeFeatures_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKShutdownScript this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ShutdownScript_free(this_obj_conv); +} + +static inline uint64_t ShutdownScript_clone_ptr(LDKShutdownScript *NONNULL_PTR arg) { + LDKShutdownScript ret_var = ShutdownScript_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKNodeFeatures arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKShutdownScript arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = NodeFeatures_clone_ptr(&arg_conv); + int64_t ret_conv = ShutdownScript_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKNodeFeatures orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKShutdownScript orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKNodeFeatures ret_var = NodeFeatures_clone(&orig_conv); + LDKShutdownScript ret_var = ShutdownScript_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg) { - LDKChannelFeatures ret_var = ChannelFeatures_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelFeatures arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = ChannelFeatures_clone_ptr(&arg_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKShutdownScript a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKShutdownScript b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ShutdownScript_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelFeatures orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKChannelFeatures ret_var = ChannelFeatures_clone(&orig_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInvalidShutdownScript this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InvalidShutdownScript_free(this_obj_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1get_1script(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInvalidShutdownScript this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u8Z ret_var = InvalidShutdownScript_get_script(&this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1set_1script(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKInvalidShutdownScript this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u8Z val_ref; + val_ref.datalen = (*env)->GetArrayLength(env, val); + val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data); + InvalidShutdownScript_set_script(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1new(JNIEnv *env, jclass clz, int8_tArray script_arg) { + LDKCVec_u8Z script_arg_ref; + script_arg_ref.datalen = (*env)->GetArrayLength(env, script_arg); + script_arg_ref.data = MALLOC(script_arg_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, script_arg, 0, script_arg_ref.datalen, script_arg_ref.data); + LDKInvalidShutdownScript ret_var = InvalidShutdownScript_new(script_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t Bolt11InvoiceFeatures_clone_ptr(LDKBolt11InvoiceFeatures *NONNULL_PTR arg) { - LDKBolt11InvoiceFeatures ret_var = Bolt11InvoiceFeatures_clone(arg); +static inline uint64_t InvalidShutdownScript_clone_ptr(LDKInvalidShutdownScript *NONNULL_PTR arg) { + LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKBolt11InvoiceFeatures arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInvalidShutdownScript arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Bolt11InvoiceFeatures_clone_ptr(&arg_conv); + int64_t ret_conv = InvalidShutdownScript_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBolt11InvoiceFeatures orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKInvalidShutdownScript orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBolt11InvoiceFeatures ret_var = Bolt11InvoiceFeatures_clone(&orig_conv); + LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t OfferFeatures_clone_ptr(LDKOfferFeatures *NONNULL_PTR arg) { - LDKOfferFeatures ret_var = OfferFeatures_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKShutdownScript obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ShutdownScript_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKOfferFeatures arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = OfferFeatures_clone_ptr(&arg_conv); - return ret_conv; + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); + *ret_conv = ShutdownScript_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKOfferFeatures orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKOfferFeatures ret_var = OfferFeatures_clone(&orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1p2wpkh(JNIEnv *env, jclass clz, int8_tArray pubkey_hash) { + uint8_t pubkey_hash_arr[20]; + CHECK((*env)->GetArrayLength(env, pubkey_hash) == 20); + (*env)->GetByteArrayRegion(env, pubkey_hash, 0, 20, pubkey_hash_arr); + uint8_t (*pubkey_hash_ref)[20] = &pubkey_hash_arr; + LDKShutdownScript ret_var = ShutdownScript_new_p2wpkh(pubkey_hash_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t InvoiceRequestFeatures_clone_ptr(LDKInvoiceRequestFeatures *NONNULL_PTR arg) { - LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_clone(arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1p2wsh(JNIEnv *env, jclass clz, int8_tArray script_hash) { + uint8_t script_hash_arr[32]; + CHECK((*env)->GetArrayLength(env, script_hash) == 32); + (*env)->GetByteArrayRegion(env, script_hash, 0, 32, script_hash_arr); + uint8_t (*script_hash_ref)[32] = &script_hash_arr; + LDKShutdownScript ret_var = ShutdownScript_new_p2wsh(script_hash_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKInvoiceRequestFeatures arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = InvoiceRequestFeatures_clone_ptr(&arg_conv); + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1witness_1program(JNIEnv *env, jclass clz, int64_t witness_program) { + void* witness_program_ptr = untag_ptr(witness_program); + CHECK_ACCESS(witness_program_ptr); + LDKWitnessProgram witness_program_conv = *(LDKWitnessProgram*)(witness_program_ptr); + witness_program_conv = WitnessProgram_clone((LDKWitnessProgram*)untag_ptr(witness_program)); + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); + *ret_conv = ShutdownScript_new_witness_program(witness_program_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1into_1inner(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKShutdownScript this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = ShutdownScript_clone(&this_arg_conv); + LDKCVec_u8Z ret_var = ShutdownScript_into_inner(this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1as_1legacy_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKShutdownScript this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ShutdownScript_as_legacy_pubkey(&this_arg_conv).compressed_form); + return ret_arr; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1is_1compatible(JNIEnv *env, jclass clz, int64_t this_arg, int64_t features) { + LDKShutdownScript this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKInitFeatures features_conv; + features_conv.inner = untag_ptr(features); + features_conv.is_owned = ptr_is_owned(features); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); + features_conv.is_owned = false; + jboolean ret_conv = ShutdownScript_is_compatible(&this_arg_conv, &features_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKInvoiceRequestFeatures orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_clone(&orig_conv); +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1to_1str(JNIEnv *env, jclass clz, int64_t o) { + LDKShutdownScript o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = ShutdownScript_to_str(&o_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelId_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelId this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelId_free(this_obj_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelId_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelId this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelId_get_a(&this_ptr_conv)); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelId_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKChannelId this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + ChannelId_set_a(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1new(JNIEnv *env, jclass clz, int8_tArray a_arg) { + LDKThirtyTwoBytes a_arg_ref; + CHECK((*env)->GetArrayLength(env, a_arg) == 32); + (*env)->GetByteArrayRegion(env, a_arg, 0, 32, a_arg_ref.data); + LDKChannelId ret_var = ChannelId_new(a_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t Bolt12InvoiceFeatures_clone_ptr(LDKBolt12InvoiceFeatures *NONNULL_PTR arg) { - LDKBolt12InvoiceFeatures ret_var = Bolt12InvoiceFeatures_clone(arg); +static inline uint64_t ChannelId_clone_ptr(LDKChannelId *NONNULL_PTR arg) { + LDKChannelId ret_var = ChannelId_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKBolt12InvoiceFeatures arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelId arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Bolt12InvoiceFeatures_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelId_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBolt12InvoiceFeatures orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelId orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBolt12InvoiceFeatures ret_var = Bolt12InvoiceFeatures_clone(&orig_conv); + LDKChannelId ret_var = ChannelId_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t BlindedHopFeatures_clone_ptr(LDKBlindedHopFeatures *NONNULL_PTR arg) { - LDKBlindedHopFeatures ret_var = BlindedHopFeatures_clone(arg); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelId_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKChannelId a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKChannelId b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ChannelId_eq(&a_conv, &b_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKChannelId o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = ChannelId_hash(&o_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1v1_1from_1funding_1txid(JNIEnv *env, jclass clz, int8_tArray txid, int16_t output_index) { + uint8_t txid_arr[32]; + CHECK((*env)->GetArrayLength(env, txid) == 32); + (*env)->GetByteArrayRegion(env, txid, 0, 32, txid_arr); + uint8_t (*txid_ref)[32] = &txid_arr; + LDKChannelId ret_var = ChannelId_v1_from_funding_txid(txid_ref, output_index); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKBlindedHopFeatures arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = BlindedHopFeatures_clone_ptr(&arg_conv); - return ret_conv; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBlindedHopFeatures orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKBlindedHopFeatures ret_var = BlindedHopFeatures_clone(&orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1v1_1from_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t outpoint) { + LDKOutPoint outpoint_conv; + outpoint_conv.inner = untag_ptr(outpoint); + outpoint_conv.is_owned = ptr_is_owned(outpoint); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv); + outpoint_conv = OutPoint_clone(&outpoint_conv); + LDKChannelId ret_var = ChannelId_v1_from_funding_outpoint(outpoint_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg) { - LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1temporary_1from_1entropy_1source(JNIEnv *env, jclass clz, int64_t entropy_source) { + void* entropy_source_ptr = untag_ptr(entropy_source); + if (ptr_is_owned(entropy_source)) { CHECK_ACCESS(entropy_source_ptr); } + LDKEntropySource* entropy_source_conv = (LDKEntropySource*)entropy_source_ptr; + LDKChannelId ret_var = ChannelId_temporary_from_entropy_source(entropy_source_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelTypeFeatures arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = ChannelTypeFeatures_clone_ptr(&arg_conv); - return ret_conv; + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1from_1bytes(JNIEnv *env, jclass clz, int8_tArray data) { + LDKThirtyTwoBytes data_ref; + CHECK((*env)->GetArrayLength(env, data) == 32); + (*env)->GetByteArrayRegion(env, data, 0, 32, data_ref.data); + LDKChannelId ret_var = ChannelId_from_bytes(data_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelTypeFeatures orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(&orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1new_1zero(JNIEnv *env, jclass clz) { + LDKChannelId ret_var = ChannelId_new_zero(); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKInitFeatures o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = InitFeatures_hash(&o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelId_1is_1zero(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelId this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelId_is_zero(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKNodeFeatures o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = NodeFeatures_hash(&o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1v2_1from_1revocation_1basepoints(JNIEnv *env, jclass clz, int64_t ours, int64_t theirs) { + LDKRevocationBasepoint ours_conv; + ours_conv.inner = untag_ptr(ours); + ours_conv.is_owned = ptr_is_owned(ours); + CHECK_INNER_FIELD_ACCESS_OR_NULL(ours_conv); + ours_conv.is_owned = false; + LDKRevocationBasepoint theirs_conv; + theirs_conv.inner = untag_ptr(theirs); + theirs_conv.is_owned = ptr_is_owned(theirs); + CHECK_INNER_FIELD_ACCESS_OR_NULL(theirs_conv); + theirs_conv.is_owned = false; + LDKChannelId ret_var = ChannelId_v2_from_revocation_basepoints(&ours_conv, &theirs_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKChannelFeatures o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = ChannelFeatures_hash(&o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1temporary_1v2_1from_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t our_revocation_basepoint) { + LDKRevocationBasepoint our_revocation_basepoint_conv; + our_revocation_basepoint_conv.inner = untag_ptr(our_revocation_basepoint); + our_revocation_basepoint_conv.is_owned = ptr_is_owned(our_revocation_basepoint); + CHECK_INNER_FIELD_ACCESS_OR_NULL(our_revocation_basepoint_conv); + our_revocation_basepoint_conv.is_owned = false; + LDKChannelId ret_var = ChannelId_temporary_v2_from_revocation_basepoint(&our_revocation_basepoint_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKBolt11InvoiceFeatures o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = Bolt11InvoiceFeatures_hash(&o_conv); - return ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelId_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelId obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ChannelId_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKOfferFeatures o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = OfferFeatures_hash(&o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_ChannelIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdDecodeErrorZ), "LDKCResult_ChannelIdDecodeErrorZ"); + *ret_conv = ChannelId_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKInvoiceRequestFeatures o_conv; +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ChannelId_1to_1str(JNIEnv *env, jclass clz, int64_t o) { + LDKChannelId o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv.is_owned = false; - int64_t ret_conv = InvoiceRequestFeatures_hash(&o_conv); + LDKStr ret_str = ChannelId_to_str(&o_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKBolt12InvoiceFeatures o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = Bolt12InvoiceFeatures_hash(&o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice(JNIEnv *env, jclass clz, int64_t amt_msat, int64_t payment_hash, jstring description, int32_t invoice_expiry_delta_secs, int64_tArray phantom_route_hints, int64_t entropy_source, int64_t node_signer, int64_t logger, jclass network, int64_t min_final_cltv_expiry_delta, int64_t duration_since_epoch) { + void* amt_msat_ptr = untag_ptr(amt_msat); + CHECK_ACCESS(amt_msat_ptr); + LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); + amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); + void* payment_hash_ptr = untag_ptr(payment_hash); + CHECK_ACCESS(payment_hash_ptr); + LDKCOption_ThirtyTwoBytesZ payment_hash_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_ptr); + payment_hash_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash)); + LDKStr description_conv = java_to_owned_str(env, description); + LDKCVec_PhantomRouteHintsZ phantom_route_hints_constr; + phantom_route_hints_constr.datalen = (*env)->GetArrayLength(env, phantom_route_hints); + if (phantom_route_hints_constr.datalen > 0) + phantom_route_hints_constr.data = MALLOC(phantom_route_hints_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements"); + else + phantom_route_hints_constr.data = NULL; + int64_t* phantom_route_hints_vals = (*env)->GetLongArrayElements (env, phantom_route_hints, NULL); + for (size_t t = 0; t < phantom_route_hints_constr.datalen; t++) { + int64_t phantom_route_hints_conv_19 = phantom_route_hints_vals[t]; + LDKPhantomRouteHints phantom_route_hints_conv_19_conv; + phantom_route_hints_conv_19_conv.inner = untag_ptr(phantom_route_hints_conv_19); + phantom_route_hints_conv_19_conv.is_owned = ptr_is_owned(phantom_route_hints_conv_19); + CHECK_INNER_FIELD_ACCESS_OR_NULL(phantom_route_hints_conv_19_conv); + phantom_route_hints_conv_19_conv = PhantomRouteHints_clone(&phantom_route_hints_conv_19_conv); + phantom_route_hints_constr.data[t] = phantom_route_hints_conv_19_conv; + } + (*env)->ReleaseLongArrayElements(env, phantom_route_hints, phantom_route_hints_vals, 0); + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKCurrency network_conv = LDKCurrency_from_java(env, network); + void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); + CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); + LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); + min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = create_phantom_invoice(amt_msat_conv, payment_hash_conv, description_conv, invoice_expiry_delta_secs, phantom_route_hints_constr, entropy_source_conv, node_signer_conv, logger_conv, network_conv, min_final_cltv_expiry_delta_conv, duration_since_epoch); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKBlindedHopFeatures o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = BlindedHopFeatures_hash(&o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice_1with_1description_1hash(JNIEnv *env, jclass clz, int64_t amt_msat, int64_t payment_hash, int32_t invoice_expiry_delta_secs, int64_t description_hash, int64_tArray phantom_route_hints, int64_t entropy_source, int64_t node_signer, int64_t logger, jclass network, int64_t min_final_cltv_expiry_delta, int64_t duration_since_epoch) { + void* amt_msat_ptr = untag_ptr(amt_msat); + CHECK_ACCESS(amt_msat_ptr); + LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); + amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); + void* payment_hash_ptr = untag_ptr(payment_hash); + CHECK_ACCESS(payment_hash_ptr); + LDKCOption_ThirtyTwoBytesZ payment_hash_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_ptr); + payment_hash_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash)); + LDKSha256 description_hash_conv; + description_hash_conv.inner = untag_ptr(description_hash); + description_hash_conv.is_owned = ptr_is_owned(description_hash); + CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv); + description_hash_conv = Sha256_clone(&description_hash_conv); + LDKCVec_PhantomRouteHintsZ phantom_route_hints_constr; + phantom_route_hints_constr.datalen = (*env)->GetArrayLength(env, phantom_route_hints); + if (phantom_route_hints_constr.datalen > 0) + phantom_route_hints_constr.data = MALLOC(phantom_route_hints_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements"); + else + phantom_route_hints_constr.data = NULL; + int64_t* phantom_route_hints_vals = (*env)->GetLongArrayElements (env, phantom_route_hints, NULL); + for (size_t t = 0; t < phantom_route_hints_constr.datalen; t++) { + int64_t phantom_route_hints_conv_19 = phantom_route_hints_vals[t]; + LDKPhantomRouteHints phantom_route_hints_conv_19_conv; + phantom_route_hints_conv_19_conv.inner = untag_ptr(phantom_route_hints_conv_19); + phantom_route_hints_conv_19_conv.is_owned = ptr_is_owned(phantom_route_hints_conv_19); + CHECK_INNER_FIELD_ACCESS_OR_NULL(phantom_route_hints_conv_19_conv); + phantom_route_hints_conv_19_conv = PhantomRouteHints_clone(&phantom_route_hints_conv_19_conv); + phantom_route_hints_constr.data[t] = phantom_route_hints_conv_19_conv; + } + (*env)->ReleaseLongArrayElements(env, phantom_route_hints, phantom_route_hints_vals, 0); + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKCurrency network_conv = LDKCurrency_from_java(env, network); + void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); + CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); + LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); + min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = create_phantom_invoice_with_description_hash(amt_msat_conv, payment_hash_conv, invoice_expiry_delta_secs, description_hash_conv, phantom_route_hints_constr, entropy_source_conv, node_signer_conv, logger_conv, network_conv, min_final_cltv_expiry_delta_conv, duration_since_epoch); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKChannelTypeFeatures o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = ChannelTypeFeatures_hash(&o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t node_signer, int64_t logger, jclass network, int64_t amt_msat, jstring description, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { + LDKChannelManager channelmanager_conv; + channelmanager_conv.inner = untag_ptr(channelmanager); + channelmanager_conv.is_owned = ptr_is_owned(channelmanager); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); + channelmanager_conv.is_owned = false; + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKCurrency network_conv = LDKCurrency_from_java(env, network); + void* amt_msat_ptr = untag_ptr(amt_msat); + CHECK_ACCESS(amt_msat_ptr); + LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); + amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); + LDKStr description_conv = java_to_owned_str(env, description); + void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); + CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); + LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); + min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = create_invoice_from_channelmanager(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_conv, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKInitFeatures this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InitFeatures_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1with_1description_1hash(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t node_signer, int64_t logger, jclass network, int64_t amt_msat, int64_t description_hash, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { + LDKChannelManager channelmanager_conv; + channelmanager_conv.inner = untag_ptr(channelmanager); + channelmanager_conv.is_owned = ptr_is_owned(channelmanager); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); + channelmanager_conv.is_owned = false; + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKCurrency network_conv = LDKCurrency_from_java(env, network); + void* amt_msat_ptr = untag_ptr(amt_msat); + CHECK_ACCESS(amt_msat_ptr); + LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); + amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); + LDKSha256 description_hash_conv; + description_hash_conv.inner = untag_ptr(description_hash); + description_hash_conv.is_owned = ptr_is_owned(description_hash); + CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv); + description_hash_conv = Sha256_clone(&description_hash_conv); + void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); + CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); + LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); + min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = create_invoice_from_channelmanager_with_description_hash(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_hash_conv, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKNodeFeatures this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - NodeFeatures_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1with_1description_1hash_1and_1duration_1since_1epoch(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t node_signer, int64_t logger, jclass network, int64_t amt_msat, int64_t description_hash, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { + LDKChannelManager channelmanager_conv; + channelmanager_conv.inner = untag_ptr(channelmanager); + channelmanager_conv.is_owned = ptr_is_owned(channelmanager); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); + channelmanager_conv.is_owned = false; + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKCurrency network_conv = LDKCurrency_from_java(env, network); + void* amt_msat_ptr = untag_ptr(amt_msat); + CHECK_ACCESS(amt_msat_ptr); + LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); + amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); + LDKSha256 description_hash_conv; + description_hash_conv.inner = untag_ptr(description_hash); + description_hash_conv.is_owned = ptr_is_owned(description_hash); + CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv); + description_hash_conv = Sha256_clone(&description_hash_conv); + void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); + CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); + LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); + min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_hash_conv, duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelFeatures this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelFeatures_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1and_1duration_1since_1epoch(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t node_signer, int64_t logger, jclass network, int64_t amt_msat, jstring description, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { + LDKChannelManager channelmanager_conv; + channelmanager_conv.inner = untag_ptr(channelmanager); + channelmanager_conv.is_owned = ptr_is_owned(channelmanager); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); + channelmanager_conv.is_owned = false; + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKCurrency network_conv = LDKCurrency_from_java(env, network); + void* amt_msat_ptr = untag_ptr(amt_msat); + CHECK_ACCESS(amt_msat_ptr); + LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); + amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); + LDKStr description_conv = java_to_owned_str(env, description); + void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); + CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); + LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); + min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = create_invoice_from_channelmanager_and_duration_since_epoch(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_conv, duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKBolt11InvoiceFeatures this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Bolt11InvoiceFeatures_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1and_1duration_1since_1epoch_1with_1payment_1hash(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t node_signer, int64_t logger, jclass network, int64_t amt_msat, jstring description, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs, int8_tArray payment_hash, int64_t min_final_cltv_expiry_delta) { + LDKChannelManager channelmanager_conv; + channelmanager_conv.inner = untag_ptr(channelmanager); + channelmanager_conv.is_owned = ptr_is_owned(channelmanager); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); + channelmanager_conv.is_owned = false; + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKCurrency network_conv = LDKCurrency_from_java(env, network); + void* amt_msat_ptr = untag_ptr(amt_msat); + CHECK_ACCESS(amt_msat_ptr); + LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); + amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); + LDKStr description_conv = java_to_owned_str(env, description); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); + CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); + LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); + min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_conv, duration_since_epoch, invoice_expiry_delta_secs, payment_hash_ref, min_final_cltv_expiry_delta_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKOfferFeatures this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - OfferFeatures_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_payment_1parameters_1from_1zero_1amount_1invoice(JNIEnv *env, jclass clz, int64_t invoice, int64_t amount_msat) { + LDKBolt11Invoice invoice_conv; + invoice_conv.inner = untag_ptr(invoice); + invoice_conv.is_owned = ptr_is_owned(invoice); + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); + invoice_conv.is_owned = false; + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); + *ret_conv = payment_parameters_from_zero_amount_invoice(&invoice_conv, amount_msat); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKInvoiceRequestFeatures this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InvoiceRequestFeatures_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_payment_1parameters_1from_1invoice(JNIEnv *env, jclass clz, int64_t invoice) { + LDKBolt11Invoice invoice_conv; + invoice_conv.inner = untag_ptr(invoice); + invoice_conv.is_owned = ptr_is_owned(invoice); + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); + invoice_conv.is_owned = false; + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); + *ret_conv = payment_parameters_from_invoice(&invoice_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKBolt12InvoiceFeatures this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Bolt12InvoiceFeatures_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Retry_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKRetry this_ptr_conv = *(LDKRetry*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Retry_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKBlindedHopFeatures this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BlindedHopFeatures_free(this_obj_conv); +static inline uint64_t Retry_clone_ptr(LDKRetry *NONNULL_PTR arg) { + LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); + *ret_copy = Retry_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRetry* arg_conv = (LDKRetry*)untag_ptr(arg); + int64_t ret_conv = Retry_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelTypeFeatures this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelTypeFeatures_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKRetry* orig_conv = (LDKRetry*)untag_ptr(orig); + LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); + *ret_copy = Retry_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1empty(JNIEnv *env, jclass clz) { - LDKInitFeatures ret_var = InitFeatures_empty(); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1attempts(JNIEnv *env, jclass clz, int32_t a) { + LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); + *ret_copy = Retry_attempts(a); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKInitFeatures other_conv; - other_conv.inner = untag_ptr(other); - other_conv.is_owned = ptr_is_owned(other); - CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); - other_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1timeout(JNIEnv *env, jclass clz, int64_t a) { + LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); + *ret_copy = Retry_timeout(a); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Retry_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKRetry* a_conv = (LDKRetry*)untag_ptr(a); + LDKRetry* b_conv = (LDKRetry*)untag_ptr(b); + jboolean ret_conv = Retry_eq(a_conv, b_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_unknown_bits(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKRetry* o_conv = (LDKRetry*)untag_ptr(o); + int64_t ret_conv = Retry_hash(o_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1required_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = InitFeatures_set_required_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Retry_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKRetry* obj_conv = (LDKRetry*)untag_ptr(obj); + LDKCVec_u8Z ret_var = Retry_write(obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1optional_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = InitFeatures_set_optional_feature_bit(&this_arg_conv, bit); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_RetryDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RetryDecodeErrorZ), "LDKCResult_RetryDecodeErrorZ"); + *ret_conv = Retry_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1required_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = InitFeatures_set_required_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKRetryableSendFailure* orig_conv = (LDKRetryableSendFailure*)untag_ptr(orig); + jclass ret_conv = LDKRetryableSendFailure_to_java(env, RetryableSendFailure_clone(orig_conv)); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1optional_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = InitFeatures_set_optional_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1payment_1expired(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKRetryableSendFailure_to_java(env, RetryableSendFailure_payment_expired()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1empty(JNIEnv *env, jclass clz) { - LDKNodeFeatures ret_var = NodeFeatures_empty(); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1route_1not_1found(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKRetryableSendFailure_to_java(env, RetryableSendFailure_route_not_found()); + return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeFeatures other_conv; - other_conv.inner = untag_ptr(other); - other_conv.is_owned = ptr_is_owned(other); - CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); - other_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1duplicate_1payment(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKRetryableSendFailure_to_java(env, RetryableSendFailure_duplicate_payment()); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_unknown_bits(&this_arg_conv); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1onion_1packet_1size_1exceeded(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKRetryableSendFailure_to_java(env, RetryableSendFailure_onion_packet_size_exceeded()); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1required_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = NodeFeatures_set_required_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1optional_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = NodeFeatures_set_optional_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1required_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = NodeFeatures_set_required_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKRetryableSendFailure* a_conv = (LDKRetryableSendFailure*)untag_ptr(a); + LDKRetryableSendFailure* b_conv = (LDKRetryableSendFailure*)untag_ptr(b); + jboolean ret_conv = RetryableSendFailure_eq(a_conv, b_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1optional_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = NodeFeatures_set_optional_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + PaymentSendFailure_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1empty(JNIEnv *env, jclass clz) { - LDKChannelFeatures ret_var = ChannelFeatures_empty(); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +static inline uint64_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg) { + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1requires_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { - LDKChannelFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelFeatures other_conv; - other_conv.inner = untag_ptr(other); - other_conv.is_owned = ptr_is_owned(other); - CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); - other_conv.is_owned = false; - jboolean ret_conv = ChannelFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPaymentSendFailure* arg_conv = (LDKPaymentSendFailure*)untag_ptr(arg); + int64_t ret_conv = PaymentSendFailure_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelFeatures_requires_unknown_bits(&this_arg_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPaymentSendFailure* orig_conv = (LDKPaymentSendFailure*)untag_ptr(orig); + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1set_1required_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKChannelFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = ChannelFeatures_set_required_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1parameter_1error(JNIEnv *env, jclass clz, int64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKAPIError a_conv = *(LDKAPIError*)(a_ptr); + a_conv = APIError_clone((LDKAPIError*)untag_ptr(a)); + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_parameter_error(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1set_1optional_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKChannelFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = ChannelFeatures_set_optional_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1path_1parameter_1error(JNIEnv *env, jclass clz, int64_tArray a) { + LDKCVec_CResult_NoneAPIErrorZZ a_constr; + a_constr.datalen = (*env)->GetArrayLength(env, a); + if (a_constr.datalen > 0) + a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements"); + else + a_constr.data = NULL; + int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL); + for (size_t w = 0; w < a_constr.datalen; w++) { + int64_t a_conv_22 = a_vals[w]; + void* a_conv_22_ptr = untag_ptr(a_conv_22); + CHECK_ACCESS(a_conv_22_ptr); + LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(a_conv_22_ptr); + a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)untag_ptr(a_conv_22)); + a_constr.data[w] = a_conv_22_conv; + } + (*env)->ReleaseLongArrayElements(env, a, a_vals, 0); + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_path_parameter_error(a_constr); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1set_1required_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKChannelFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = ChannelFeatures_set_required_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1all_1failed_1resend_1safe(JNIEnv *env, jclass clz, int64_tArray a) { + LDKCVec_APIErrorZ a_constr; + a_constr.datalen = (*env)->GetArrayLength(env, a); + if (a_constr.datalen > 0) + a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements"); + else + a_constr.data = NULL; + int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL); + for (size_t k = 0; k < a_constr.datalen; k++) { + int64_t a_conv_10 = a_vals[k]; + void* a_conv_10_ptr = untag_ptr(a_conv_10); + CHECK_ACCESS(a_conv_10_ptr); + LDKAPIError a_conv_10_conv = *(LDKAPIError*)(a_conv_10_ptr); + a_conv_10_conv = APIError_clone((LDKAPIError*)untag_ptr(a_conv_10)); + a_constr.data[k] = a_conv_10_conv; + } + (*env)->ReleaseLongArrayElements(env, a, a_vals, 0); + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_all_failed_resend_safe(a_constr); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1set_1optional_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKChannelFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = ChannelFeatures_set_optional_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1duplicate_1payment(JNIEnv *env, jclass clz) { + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_duplicate_payment(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1empty(JNIEnv *env, jclass clz) { - LDKBolt11InvoiceFeatures ret_var = Bolt11InvoiceFeatures_empty(); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1partial_1failure(JNIEnv *env, jclass clz, int64_tArray results, int64_t failed_paths_retry, int8_tArray payment_id) { + LDKCVec_CResult_NoneAPIErrorZZ results_constr; + results_constr.datalen = (*env)->GetArrayLength(env, results); + if (results_constr.datalen > 0) + results_constr.data = MALLOC(results_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements"); + else + results_constr.data = NULL; + int64_t* results_vals = (*env)->GetLongArrayElements (env, results, NULL); + for (size_t w = 0; w < results_constr.datalen; w++) { + int64_t results_conv_22 = results_vals[w]; + void* results_conv_22_ptr = untag_ptr(results_conv_22); + CHECK_ACCESS(results_conv_22_ptr); + LDKCResult_NoneAPIErrorZ results_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(results_conv_22_ptr); + results_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)untag_ptr(results_conv_22)); + results_constr.data[w] = results_conv_22_conv; + } + (*env)->ReleaseLongArrayElements(env, results, results_vals, 0); + LDKRouteParameters failed_paths_retry_conv; + failed_paths_retry_conv.inner = untag_ptr(failed_paths_retry); + failed_paths_retry_conv.is_owned = ptr_is_owned(failed_paths_retry); + CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_conv); + failed_paths_retry_conv = RouteParameters_clone(&failed_paths_retry_conv); + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_partial_failure(results_constr, failed_paths_retry_conv, payment_id_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { - LDKBolt11InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKBolt11InvoiceFeatures other_conv; - other_conv.inner = untag_ptr(other); - other_conv.is_owned = ptr_is_owned(other); - CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); - other_conv.is_owned = false; - jboolean ret_conv = Bolt11InvoiceFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKPaymentSendFailure* a_conv = (LDKPaymentSendFailure*)untag_ptr(a); + LDKPaymentSendFailure* b_conv = (LDKPaymentSendFailure*)untag_ptr(b); + jboolean ret_conv = PaymentSendFailure_eq(a_conv, b_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = Bolt11InvoiceFeatures_requires_unknown_bits(&this_arg_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12PaymentError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKBolt12PaymentError this_ptr_conv = *(LDKBolt12PaymentError*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Bolt12PaymentError_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1required_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKBolt11InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = Bolt11InvoiceFeatures_set_required_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +static inline uint64_t Bolt12PaymentError_clone_ptr(LDKBolt12PaymentError *NONNULL_PTR arg) { + LDKBolt12PaymentError *ret_copy = MALLOC(sizeof(LDKBolt12PaymentError), "LDKBolt12PaymentError"); + *ret_copy = Bolt12PaymentError_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12PaymentError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBolt12PaymentError* arg_conv = (LDKBolt12PaymentError*)untag_ptr(arg); + int64_t ret_conv = Bolt12PaymentError_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1optional_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKBolt11InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = Bolt11InvoiceFeatures_set_optional_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12PaymentError_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBolt12PaymentError* orig_conv = (LDKBolt12PaymentError*)untag_ptr(orig); + LDKBolt12PaymentError *ret_copy = MALLOC(sizeof(LDKBolt12PaymentError), "LDKBolt12PaymentError"); + *ret_copy = Bolt12PaymentError_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1required_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKBolt11InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = Bolt11InvoiceFeatures_set_required_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12PaymentError_1unexpected_1invoice(JNIEnv *env, jclass clz) { + LDKBolt12PaymentError *ret_copy = MALLOC(sizeof(LDKBolt12PaymentError), "LDKBolt12PaymentError"); + *ret_copy = Bolt12PaymentError_unexpected_invoice(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1optional_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKBolt11InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = Bolt11InvoiceFeatures_set_optional_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12PaymentError_1duplicate_1invoice(JNIEnv *env, jclass clz) { + LDKBolt12PaymentError *ret_copy = MALLOC(sizeof(LDKBolt12PaymentError), "LDKBolt12PaymentError"); + *ret_copy = Bolt12PaymentError_duplicate_invoice(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1empty(JNIEnv *env, jclass clz) { - LDKOfferFeatures ret_var = OfferFeatures_empty(); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12PaymentError_1unknown_1required_1features(JNIEnv *env, jclass clz) { + LDKBolt12PaymentError *ret_copy = MALLOC(sizeof(LDKBolt12PaymentError), "LDKBolt12PaymentError"); + *ret_copy = Bolt12PaymentError_unknown_required_features(); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1requires_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { - LDKOfferFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOfferFeatures other_conv; - other_conv.inner = untag_ptr(other); - other_conv.is_owned = ptr_is_owned(other); - CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); - other_conv.is_owned = false; - jboolean ret_conv = OfferFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12PaymentError_1sending_1failed(JNIEnv *env, jclass clz, jclass a) { + LDKRetryableSendFailure a_conv = LDKRetryableSendFailure_from_java(env, a); + LDKBolt12PaymentError *ret_copy = MALLOC(sizeof(LDKBolt12PaymentError), "LDKBolt12PaymentError"); + *ret_copy = Bolt12PaymentError_sending_failed(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOfferFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = OfferFeatures_requires_unknown_bits(&this_arg_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12PaymentError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKBolt12PaymentError* a_conv = (LDKBolt12PaymentError*)untag_ptr(a); + LDKBolt12PaymentError* b_conv = (LDKBolt12PaymentError*)untag_ptr(b); + jboolean ret_conv = Bolt12PaymentError_eq(a_conv, b_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1set_1required_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKOfferFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = OfferFeatures_set_required_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKProbeSendFailure this_ptr_conv = *(LDKProbeSendFailure*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + ProbeSendFailure_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1set_1optional_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKOfferFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = OfferFeatures_set_optional_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +static inline uint64_t ProbeSendFailure_clone_ptr(LDKProbeSendFailure *NONNULL_PTR arg) { + LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); + *ret_copy = ProbeSendFailure_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1set_1required_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKOfferFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = OfferFeatures_set_required_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKProbeSendFailure* arg_conv = (LDKProbeSendFailure*)untag_ptr(arg); + int64_t ret_conv = ProbeSendFailure_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1set_1optional_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKOfferFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = OfferFeatures_set_optional_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKProbeSendFailure* orig_conv = (LDKProbeSendFailure*)untag_ptr(orig); + LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); + *ret_copy = ProbeSendFailure_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1empty(JNIEnv *env, jclass clz) { - LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_empty(); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1route_1not_1found(JNIEnv *env, jclass clz) { + LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); + *ret_copy = ProbeSendFailure_route_not_found(); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1requires_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { - LDKInvoiceRequestFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKInvoiceRequestFeatures other_conv; - other_conv.inner = untag_ptr(other); - other_conv.is_owned = ptr_is_owned(other); - CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); - other_conv.is_owned = false; - jboolean ret_conv = InvoiceRequestFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1sending_1failed(JNIEnv *env, jclass clz, int64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKPaymentSendFailure a_conv = *(LDKPaymentSendFailure*)(a_ptr); + a_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(a)); + LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); + *ret_copy = ProbeSendFailure_sending_failed(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequestFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InvoiceRequestFeatures_requires_unknown_bits(&this_arg_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKProbeSendFailure* a_conv = (LDKProbeSendFailure*)untag_ptr(a); + LDKProbeSendFailure* b_conv = (LDKProbeSendFailure*)untag_ptr(b); + jboolean ret_conv = ProbeSendFailure_eq(a_conv, b_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1set_1required_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKInvoiceRequestFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = InvoiceRequestFeatures_set_required_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKRecipientOnionFields this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + RecipientOnionFields_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1set_1optional_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKInvoiceRequestFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = InvoiceRequestFeatures_set_optional_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1get_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRecipientOnionFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); + *ret_copy = RecipientOnionFields_get_payment_secret(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1set_1required_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKInvoiceRequestFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = InvoiceRequestFeatures_set_required_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1set_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKRecipientOnionFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_ThirtyTwoBytesZ val_conv = *(LDKCOption_ThirtyTwoBytesZ*)(val_ptr); + val_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(val)); + RecipientOnionFields_set_payment_secret(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1set_1optional_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKInvoiceRequestFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = InvoiceRequestFeatures_set_optional_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1get_1payment_1metadata(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRecipientOnionFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = RecipientOnionFields_get_payment_metadata(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1empty(JNIEnv *env, jclass clz) { - LDKBolt12InvoiceFeatures ret_var = Bolt12InvoiceFeatures_empty(); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1set_1payment_1metadata(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKRecipientOnionFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_CVec_u8ZZ val_conv = *(LDKCOption_CVec_u8ZZ*)(val_ptr); + val_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(val)); + RecipientOnionFields_set_payment_metadata(&this_ptr_conv, val_conv); +} + +static inline uint64_t RecipientOnionFields_clone_ptr(LDKRecipientOnionFields *NONNULL_PTR arg) { + LDKRecipientOnionFields ret_var = RecipientOnionFields_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1requires_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { - LDKBolt12InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKBolt12InvoiceFeatures other_conv; - other_conv.inner = untag_ptr(other); - other_conv.is_owned = ptr_is_owned(other); - CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); - other_conv.is_owned = false; - jboolean ret_conv = Bolt12InvoiceFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRecipientOnionFields arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = RecipientOnionFields_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = Bolt12InvoiceFeatures_requires_unknown_bits(&this_arg_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKRecipientOnionFields orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKRecipientOnionFields ret_var = RecipientOnionFields_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1required_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKBolt12InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = Bolt12InvoiceFeatures_set_required_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKRecipientOnionFields a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKRecipientOnionFields b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = RecipientOnionFields_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1optional_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKBolt12InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = Bolt12InvoiceFeatures_set_optional_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKRecipientOnionFields obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = RecipientOnionFields_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1required_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKBolt12InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = Bolt12InvoiceFeatures_set_required_custom_bit(&this_arg_conv, bit); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_RecipientOnionFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsDecodeErrorZ), "LDKCResult_RecipientOnionFieldsDecodeErrorZ"); + *ret_conv = RecipientOnionFields_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1optional_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKBolt12InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = Bolt12InvoiceFeatures_set_optional_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1secret_1only(JNIEnv *env, jclass clz, int8_tArray payment_secret) { + LDKThirtyTwoBytes payment_secret_ref; + CHECK((*env)->GetArrayLength(env, payment_secret) == 32); + (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data); + LDKRecipientOnionFields ret_var = RecipientOnionFields_secret_only(payment_secret_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1empty(JNIEnv *env, jclass clz) { - LDKBlindedHopFeatures ret_var = BlindedHopFeatures_empty(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1spontaneous_1empty(JNIEnv *env, jclass clz) { + LDKRecipientOnionFields ret_var = RecipientOnionFields_spontaneous_empty(); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1requires_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { - LDKBlindedHopFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1with_1custom_1tlvs(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray custom_tlvs) { + LDKRecipientOnionFields this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKBlindedHopFeatures other_conv; - other_conv.inner = untag_ptr(other); - other_conv.is_owned = ptr_is_owned(other); - CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); - other_conv.is_owned = false; - jboolean ret_conv = BlindedHopFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); - return ret_conv; + this_arg_conv = RecipientOnionFields_clone(&this_arg_conv); + LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs_constr; + custom_tlvs_constr.datalen = (*env)->GetArrayLength(env, custom_tlvs); + if (custom_tlvs_constr.datalen > 0) + custom_tlvs_constr.data = MALLOC(custom_tlvs_constr.datalen * sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKCVec_C2Tuple_u64CVec_u8ZZZ Elements"); + else + custom_tlvs_constr.data = NULL; + int64_t* custom_tlvs_vals = (*env)->GetLongArrayElements (env, custom_tlvs, NULL); + for (size_t x = 0; x < custom_tlvs_constr.datalen; x++) { + int64_t custom_tlvs_conv_23 = custom_tlvs_vals[x]; + void* custom_tlvs_conv_23_ptr = untag_ptr(custom_tlvs_conv_23); + CHECK_ACCESS(custom_tlvs_conv_23_ptr); + LDKC2Tuple_u64CVec_u8ZZ custom_tlvs_conv_23_conv = *(LDKC2Tuple_u64CVec_u8ZZ*)(custom_tlvs_conv_23_ptr); + custom_tlvs_conv_23_conv = C2Tuple_u64CVec_u8ZZ_clone((LDKC2Tuple_u64CVec_u8ZZ*)untag_ptr(custom_tlvs_conv_23)); + custom_tlvs_constr.data[x] = custom_tlvs_conv_23_conv; + } + (*env)->ReleaseLongArrayElements(env, custom_tlvs, custom_tlvs_vals, 0); + LDKCResult_RecipientOnionFieldsNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsNoneZ), "LDKCResult_RecipientOnionFieldsNoneZ"); + *ret_conv = RecipientOnionFields_with_custom_tlvs(this_arg_conv, custom_tlvs_constr); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBlindedHopFeatures this_arg_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1custom_1tlvs(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKRecipientOnionFields this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = BlindedHopFeatures_requires_unknown_bits(&this_arg_conv); + LDKCVec_C2Tuple_u64CVec_u8ZZZ ret_var = RecipientOnionFields_custom_tlvs(&this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t x = 0; x < ret_var.datalen; x++) { + LDKC2Tuple_u64CVec_u8ZZ* ret_conv_23_conv = MALLOC(sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKC2Tuple_u64CVec_u8ZZ"); + *ret_conv_23_conv = ret_var.data[x]; + ret_arr_ptr[x] = tag_ptr(ret_conv_23_conv, true); + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomMessageReader_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKCustomMessageReader this_ptr_conv = *(LDKCustomMessageReader*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + CustomMessageReader_free(this_ptr_conv); +} + +static inline uint64_t Type_clone_ptr(LDKType *NONNULL_PTR arg) { + LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType"); + *ret_ret = Type_clone(arg); + return tag_ptr(ret_ret, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Type_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + void* arg_ptr = untag_ptr(arg); + if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); } + LDKType* arg_conv = (LDKType*)arg_ptr; + int64_t ret_conv = Type_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1set_1required_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKBlindedHopFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = BlindedHopFeatures_set_required_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Type_1clone(JNIEnv *env, jclass clz, int64_t orig) { + void* orig_ptr = untag_ptr(orig); + if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); } + LDKType* orig_conv = (LDKType*)orig_ptr; + LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType"); + *ret_ret = Type_clone(orig_conv); + return tag_ptr(ret_ret, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1set_1optional_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKBlindedHopFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = BlindedHopFeatures_set_optional_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Type_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKType this_ptr_conv = *(LDKType*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Type_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1set_1required_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKBlindedHopFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = BlindedHopFeatures_set_required_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferId_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKOfferId this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OfferId_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1set_1optional_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKBlindedHopFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = BlindedHopFeatures_set_optional_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OfferId_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOfferId this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OfferId_get_a(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1empty(JNIEnv *env, jclass clz) { - LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_empty(); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferId_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKOfferId this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + OfferId_set_a(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferId_1new(JNIEnv *env, jclass clz, int8_tArray a_arg) { + LDKThirtyTwoBytes a_arg_ref; + CHECK((*env)->GetArrayLength(env, a_arg) == 32); + (*env)->GetByteArrayRegion(env, a_arg, 0, 32, a_arg_ref.data); + LDKOfferId ret_var = OfferId_new(a_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { - LDKChannelTypeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelTypeFeatures other_conv; - other_conv.inner = untag_ptr(other); - other_conv.is_owned = ptr_is_owned(other); - CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); - other_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); - return ret_conv; +static inline uint64_t OfferId_clone_ptr(LDKOfferId *NONNULL_PTR arg) { + LDKOfferId ret_var = OfferId_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_requires_unknown_bits(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferId_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKOfferId arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = OfferId_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1required_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKChannelTypeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = ChannelTypeFeatures_set_required_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1optional_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKChannelTypeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = ChannelTypeFeatures_set_optional_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1required_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKChannelTypeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = ChannelTypeFeatures_set_required_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferId_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKOfferId orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKOfferId ret_var = OfferId_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1optional_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKChannelTypeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = ChannelTypeFeatures_set_optional_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferId_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKOfferId a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKOfferId b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = OfferId_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InitFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKInitFeatures obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OfferId_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKOfferId obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = InitFeatures_write(&obj_conv); + LDKCVec_u8Z ret_var = OfferId_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferId_1read(JNIEnv *env, jclass clz, int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); - *ret_conv = InitFeatures_read(ser_ref); + LDKCResult_OfferIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferIdDecodeErrorZ), "LDKCResult_OfferIdDecodeErrorZ"); + *ret_conv = OfferId_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelFeatures obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ChannelFeatures_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKOfferWithExplicitMetadataBuilder this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OfferWithExplicitMetadataBuilder_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); - *ret_conv = ChannelFeatures_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +static inline uint64_t OfferWithExplicitMetadataBuilder_clone_ptr(LDKOfferWithExplicitMetadataBuilder *NONNULL_PTR arg) { + LDKOfferWithExplicitMetadataBuilder ret_var = OfferWithExplicitMetadataBuilder_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKNodeFeatures obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = NodeFeatures_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKOfferWithExplicitMetadataBuilder arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = OfferWithExplicitMetadataBuilder_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); - *ret_conv = NodeFeatures_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKOfferWithExplicitMetadataBuilder orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKOfferWithExplicitMetadataBuilder ret_var = OfferWithExplicitMetadataBuilder_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKBolt11InvoiceFeatures obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = Bolt11InvoiceFeatures_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKOfferWithDerivedMetadataBuilder this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OfferWithDerivedMetadataBuilder_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ"); - *ret_conv = Bolt11InvoiceFeatures_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +static inline uint64_t OfferWithDerivedMetadataBuilder_clone_ptr(LDKOfferWithDerivedMetadataBuilder *NONNULL_PTR arg) { + LDKOfferWithDerivedMetadataBuilder ret_var = OfferWithDerivedMetadataBuilder_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKOfferWithDerivedMetadataBuilder arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = OfferWithDerivedMetadataBuilder_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKBolt12InvoiceFeatures obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = Bolt12InvoiceFeatures_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ"); - *ret_conv = Bolt12InvoiceFeatures_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKBlindedHopFeatures obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = BlindedHopFeatures_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ"); - *ret_conv = BlindedHopFeatures_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelTypeFeatures obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ChannelTypeFeatures_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKOfferWithDerivedMetadataBuilder orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKOfferWithDerivedMetadataBuilder ret_var = OfferWithDerivedMetadataBuilder_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); - *ret_conv = ChannelTypeFeatures_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1new(JNIEnv *env, jclass clz, int8_tArray signing_pubkey) { + LDKPublicKey signing_pubkey_ref; + CHECK((*env)->GetArrayLength(env, signing_pubkey) == 33); + (*env)->GetByteArrayRegion(env, signing_pubkey, 0, 33, signing_pubkey_ref.compressed_form); + LDKOfferWithExplicitMetadataBuilder ret_var = OfferWithExplicitMetadataBuilder_new(signing_pubkey_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1data_1loss_1protect_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1metadata(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray metadata) { + LDKOfferWithExplicitMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_data_loss_protect_optional(&this_arg_conv); + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + LDKCVec_u8Z metadata_ref; + metadata_ref.datalen = (*env)->GetArrayLength(env, metadata); + metadata_ref.data = MALLOC(metadata_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, metadata, 0, metadata_ref.datalen, metadata_ref.data); + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = OfferWithExplicitMetadataBuilder_metadata(this_arg_conv, metadata_ref); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1data_1loss_1protect_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1chain(JNIEnv *env, jclass clz, int64_t this_arg, jclass network) { + LDKOfferWithExplicitMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_data_loss_protect_required(&this_arg_conv); + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + LDKNetwork network_conv = LDKNetwork_from_java(env, network); + OfferWithExplicitMetadataBuilder_chain(this_arg_conv, network_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg, int64_t amount_msats) { + LDKOfferWithExplicitMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_data_loss_protect(&this_arg_conv); - return ret_conv; + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + OfferWithExplicitMetadataBuilder_amount_msats(this_arg_conv, amount_msats); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1data_1loss_1protect_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg, int64_t absolute_expiry) { + LDKOfferWithExplicitMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - NodeFeatures_set_data_loss_protect_optional(&this_arg_conv); + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + OfferWithExplicitMetadataBuilder_absolute_expiry(this_arg_conv, absolute_expiry); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1data_1loss_1protect_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1description(JNIEnv *env, jclass clz, int64_t this_arg, jstring description) { + LDKOfferWithExplicitMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - NodeFeatures_set_data_loss_protect_required(&this_arg_conv); + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + LDKStr description_conv = java_to_owned_str(env, description); + OfferWithExplicitMetadataBuilder_description(this_arg_conv, description_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1issuer(JNIEnv *env, jclass clz, int64_t this_arg, jstring issuer) { + LDKOfferWithExplicitMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_data_loss_protect(&this_arg_conv); - return ret_conv; + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + LDKStr issuer_conv = java_to_owned_str(env, issuer); + OfferWithExplicitMetadataBuilder_issuer(this_arg_conv, issuer_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1path(JNIEnv *env, jclass clz, int64_t this_arg, int64_t path) { + LDKOfferWithExplicitMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_data_loss_protect(&this_arg_conv); - return ret_conv; + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + LDKBlindedMessagePath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv = BlindedMessagePath_clone(&path_conv); + OfferWithExplicitMetadataBuilder_path(this_arg_conv, path_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1supported_1quantity(JNIEnv *env, jclass clz, int64_t this_arg, int64_t quantity) { + LDKOfferWithExplicitMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_data_loss_protect(&this_arg_conv); - return ret_conv; + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + void* quantity_ptr = untag_ptr(quantity); + CHECK_ACCESS(quantity_ptr); + LDKQuantity quantity_conv = *(LDKQuantity*)(quantity_ptr); + quantity_conv = Quantity_clone((LDKQuantity*)untag_ptr(quantity)); + OfferWithExplicitMetadataBuilder_supported_quantity(this_arg_conv, quantity_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1initial_1routing_1sync_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1build(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOfferWithExplicitMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_initial_routing_sync_optional(&this_arg_conv); + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + LDKCResult_OfferBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferBolt12SemanticErrorZ), "LDKCResult_OfferBolt12SemanticErrorZ"); + *ret_conv = OfferWithExplicitMetadataBuilder_build(this_arg_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1initial_1routing_1sync_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_initial_routing_sync_required(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1deriving_1signing_1pubkey(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t expanded_key, int64_t nonce) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKExpandedKey expanded_key_conv; + expanded_key_conv.inner = untag_ptr(expanded_key); + expanded_key_conv.is_owned = ptr_is_owned(expanded_key); + CHECK_INNER_FIELD_ACCESS_OR_NULL(expanded_key_conv); + expanded_key_conv.is_owned = false; + LDKNonce nonce_conv; + nonce_conv.inner = untag_ptr(nonce); + nonce_conv.is_owned = ptr_is_owned(nonce); + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_conv); + nonce_conv = Nonce_clone(&nonce_conv); + LDKOfferWithDerivedMetadataBuilder ret_var = OfferWithDerivedMetadataBuilder_deriving_signing_pubkey(node_id_ref, &expanded_key_conv, nonce_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1initial_1routing_1sync(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1chain(JNIEnv *env, jclass clz, int64_t this_arg, jclass network) { + LDKOfferWithDerivedMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_initial_routing_sync(&this_arg_conv); - return ret_conv; + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKNetwork network_conv = LDKNetwork_from_java(env, network); + OfferWithDerivedMetadataBuilder_chain(this_arg_conv, network_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1upfront_1shutdown_1script_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg, int64_t amount_msats) { + LDKOfferWithDerivedMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_upfront_shutdown_script_optional(&this_arg_conv); + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + OfferWithDerivedMetadataBuilder_amount_msats(this_arg_conv, amount_msats); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1upfront_1shutdown_1script_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg, int64_t absolute_expiry) { + LDKOfferWithDerivedMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_upfront_shutdown_script_required(&this_arg_conv); + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + OfferWithDerivedMetadataBuilder_absolute_expiry(this_arg_conv, absolute_expiry); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1description(JNIEnv *env, jclass clz, int64_t this_arg, jstring description) { + LDKOfferWithDerivedMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_upfront_shutdown_script(&this_arg_conv); - return ret_conv; + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKStr description_conv = java_to_owned_str(env, description); + OfferWithDerivedMetadataBuilder_description(this_arg_conv, description_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1upfront_1shutdown_1script_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1issuer(JNIEnv *env, jclass clz, int64_t this_arg, jstring issuer) { + LDKOfferWithDerivedMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - NodeFeatures_set_upfront_shutdown_script_optional(&this_arg_conv); + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKStr issuer_conv = java_to_owned_str(env, issuer); + OfferWithDerivedMetadataBuilder_issuer(this_arg_conv, issuer_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1upfront_1shutdown_1script_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1path(JNIEnv *env, jclass clz, int64_t this_arg, int64_t path) { + LDKOfferWithDerivedMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - NodeFeatures_set_upfront_shutdown_script_required(&this_arg_conv); + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKBlindedMessagePath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv = BlindedMessagePath_clone(&path_conv); + OfferWithDerivedMetadataBuilder_path(this_arg_conv, path_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1supported_1quantity(JNIEnv *env, jclass clz, int64_t this_arg, int64_t quantity) { + LDKOfferWithDerivedMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_upfront_shutdown_script(&this_arg_conv); - return ret_conv; + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + void* quantity_ptr = untag_ptr(quantity); + CHECK_ACCESS(quantity_ptr); + LDKQuantity quantity_conv = *(LDKQuantity*)(quantity_ptr); + quantity_conv = Quantity_clone((LDKQuantity*)untag_ptr(quantity)); + OfferWithDerivedMetadataBuilder_supported_quantity(this_arg_conv, quantity_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1build(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOfferWithDerivedMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_upfront_shutdown_script(&this_arg_conv); - return ret_conv; + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKCResult_OfferBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferBolt12SemanticErrorZ), "LDKCResult_OfferBolt12SemanticErrorZ"); + *ret_conv = OfferWithDerivedMetadataBuilder_build(this_arg_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_upfront_shutdown_script(&this_arg_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Offer_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKOffer this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Offer_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1gossip_1queries_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_gossip_queries_optional(&this_arg_conv); +static inline uint64_t Offer_clone_ptr(LDKOffer *NONNULL_PTR arg) { + LDKOffer ret_var = Offer_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKOffer arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = Offer_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1gossip_1queries_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_gossip_queries_required(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKOffer orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKOffer ret_var = Offer_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_Offer_1chains(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_gossip_queries(&this_arg_conv); - return ret_conv; + LDKCVec_ThirtyTwoBytesZ ret_var = Offer_chains(&this_arg_conv); + jobjectArray ret_arr = NULL; + ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); + ; + for (size_t i = 0; i < ret_var.datalen; i++) { + int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 32, ret_var.data[i].data); + (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); + } + + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1gossip_1queries_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_gossip_queries_optional(&this_arg_conv); + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = Offer_metadata(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1gossip_1queries_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1amount(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_gossip_queries_required(&this_arg_conv); + LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); + *ret_copy = Offer_amount(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1description(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_gossip_queries(&this_arg_conv); - return ret_conv; + LDKPrintableString ret_var = Offer_description(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1offer_1features(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_gossip_queries(&this_arg_conv); - return ret_conv; + LDKOfferFeatures ret_var = Offer_offer_features(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_gossip_queries(&this_arg_conv); - return ret_conv; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = Offer_absolute_expiry(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1variable_1length_1onion_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1issuer(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_variable_length_onion_optional(&this_arg_conv); + LDKPrintableString ret_var = Offer_issuer(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1variable_1length_1onion_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Offer_1paths(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_variable_length_onion_required(&this_arg_conv); + LDKCVec_BlindedMessagePathZ ret_var = Offer_paths(&this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t u = 0; u < ret_var.datalen; u++) { + LDKBlindedMessagePath ret_conv_20_var = ret_var.data[u]; + int64_t ret_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_20_var); + ret_conv_20_ref = tag_ptr(ret_conv_20_var.inner, ret_conv_20_var.is_owned); + ret_arr_ptr[u] = ret_conv_20_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1supported_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_variable_length_onion(&this_arg_conv); - return ret_conv; + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = Offer_supported_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1variable_1length_1onion_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Offer_1signing_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_variable_length_onion_optional(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Offer_signing_pubkey(&this_arg_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1variable_1length_1onion_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_variable_length_onion_required(&this_arg_conv); + LDKOfferId ret_var = Offer_id(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1supports_1chain(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray chain) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_variable_length_onion(&this_arg_conv); + LDKThirtyTwoBytes chain_ref; + CHECK((*env)->GetArrayLength(env, chain) == 32); + (*env)->GetByteArrayRegion(env, chain, 0, 32, chain_ref.data); + jboolean ret_conv = Offer_supports_chain(&this_arg_conv, chain_ref); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1variable_1length_1onion_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1is_1expired(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - Bolt11InvoiceFeatures_set_variable_length_onion_optional(&this_arg_conv); + jboolean ret_conv = Offer_is_expired(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1variable_1length_1onion_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1is_1expired_1no_1std(JNIEnv *env, jclass clz, int64_t this_arg, int64_t duration_since_epoch) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - Bolt11InvoiceFeatures_set_variable_length_onion_required(&this_arg_conv); + jboolean ret_conv = Offer_is_expired_no_std(&this_arg_conv, duration_since_epoch); + return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1supports_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1is_1valid_1quantity(JNIEnv *env, jclass clz, int64_t this_arg, int64_t quantity) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = Bolt11InvoiceFeatures_supports_variable_length_onion(&this_arg_conv); + jboolean ret_conv = Offer_is_valid_quantity(&this_arg_conv, quantity); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1expects_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_variable_length_onion(&this_arg_conv); + jboolean ret_conv = Offer_expects_quantity(&this_arg_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1request_1invoice_1deriving_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg, int64_t expanded_key, int64_t nonce, int8_tArray payment_id) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_variable_length_onion(&this_arg_conv); - return ret_conv; + LDKExpandedKey expanded_key_conv; + expanded_key_conv.inner = untag_ptr(expanded_key); + expanded_key_conv.is_owned = ptr_is_owned(expanded_key); + CHECK_INNER_FIELD_ACCESS_OR_NULL(expanded_key_conv); + expanded_key_conv.is_owned = false; + LDKNonce nonce_conv; + nonce_conv.inner = untag_ptr(nonce); + nonce_conv.is_owned = ptr_is_owned(nonce); + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_conv); + nonce_conv = Nonce_clone(&nonce_conv); + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ"); + *ret_conv = Offer_request_invoice_deriving_payer_id(&this_arg_conv, &expanded_key_conv, nonce_conv, payment_id_ref); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1request_1invoice_1deriving_1metadata(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payer_id, int64_t expanded_key, int64_t nonce, int8_tArray payment_id) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = Bolt11InvoiceFeatures_requires_variable_length_onion(&this_arg_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1static_1remote_1key_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_static_remote_key_optional(&this_arg_conv); + LDKPublicKey payer_id_ref; + CHECK((*env)->GetArrayLength(env, payer_id) == 33); + (*env)->GetByteArrayRegion(env, payer_id, 0, 33, payer_id_ref.compressed_form); + LDKExpandedKey expanded_key_conv; + expanded_key_conv.inner = untag_ptr(expanded_key); + expanded_key_conv.is_owned = ptr_is_owned(expanded_key); + CHECK_INNER_FIELD_ACCESS_OR_NULL(expanded_key_conv); + expanded_key_conv.is_owned = false; + LDKNonce nonce_conv; + nonce_conv.inner = untag_ptr(nonce); + nonce_conv.is_owned = ptr_is_owned(nonce); + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_conv); + nonce_conv = Nonce_clone(&nonce_conv); + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ"); + *ret_conv = Offer_request_invoice_deriving_metadata(&this_arg_conv, payer_id_ref, &expanded_key_conv, nonce_conv, payment_id_ref); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1static_1remote_1key_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1request_1invoice(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray metadata, int8_tArray payer_id) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_static_remote_key_required(&this_arg_conv); + LDKCVec_u8Z metadata_ref; + metadata_ref.datalen = (*env)->GetArrayLength(env, metadata); + metadata_ref.data = MALLOC(metadata_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, metadata, 0, metadata_ref.datalen, metadata_ref.data); + LDKPublicKey payer_id_ref; + CHECK((*env)->GetArrayLength(env, payer_id) == 33); + (*env)->GetByteArrayRegion(env, payer_id, 0, 33, payer_id_ref.compressed_form); + LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ"); + *ret_conv = Offer_request_invoice(&this_arg_conv, metadata_ref, payer_id_ref); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_static_remote_key(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKOffer o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = Offer_hash(&o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1static_1remote_1key_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - NodeFeatures_set_static_remote_key_optional(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_OfferDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferDecodeErrorZ), "LDKCResult_OfferDecodeErrorZ"); + *ret_conv = Offer_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1static_1remote_1key_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - NodeFeatures_set_static_remote_key_required(&this_arg_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Offer_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKOffer obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = Offer_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_static_remote_key(&this_arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Amount_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKAmount this_ptr_conv = *(LDKAmount*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Amount_free(this_ptr_conv); +} + +static inline uint64_t Amount_clone_ptr(LDKAmount *NONNULL_PTR arg) { + LDKAmount *ret_copy = MALLOC(sizeof(LDKAmount), "LDKAmount"); + *ret_copy = Amount_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Amount_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKAmount* arg_conv = (LDKAmount*)untag_ptr(arg); + int64_t ret_conv = Amount_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1static_1remote_1key_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Amount_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKAmount* orig_conv = (LDKAmount*)untag_ptr(orig); + LDKAmount *ret_copy = MALLOC(sizeof(LDKAmount), "LDKAmount"); + *ret_copy = Amount_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Amount_1bitcoin(JNIEnv *env, jclass clz, int64_t amount_msats) { + LDKAmount *ret_copy = MALLOC(sizeof(LDKAmount), "LDKAmount"); + *ret_copy = Amount_bitcoin(amount_msats); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Amount_1currency(JNIEnv *env, jclass clz, int8_tArray iso4217_code, int64_t amount) { + LDKThreeBytes iso4217_code_ref; + CHECK((*env)->GetArrayLength(env, iso4217_code) == 3); + (*env)->GetByteArrayRegion(env, iso4217_code, 0, 3, iso4217_code_ref.data); + LDKAmount *ret_copy = MALLOC(sizeof(LDKAmount), "LDKAmount"); + *ret_copy = Amount_currency(iso4217_code_ref, amount); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Quantity_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKQuantity this_ptr_conv = *(LDKQuantity*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Quantity_free(this_ptr_conv); +} + +static inline uint64_t Quantity_clone_ptr(LDKQuantity *NONNULL_PTR arg) { + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = Quantity_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Quantity_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKQuantity* arg_conv = (LDKQuantity*)untag_ptr(arg); + int64_t ret_conv = Quantity_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Quantity_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKQuantity* orig_conv = (LDKQuantity*)untag_ptr(orig); + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = Quantity_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Quantity_1bounded(JNIEnv *env, jclass clz, int64_t a) { + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = Quantity_bounded(a); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Quantity_1unbounded(JNIEnv *env, jclass clz) { + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = Quantity_unbounded(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Quantity_1one(JNIEnv *env, jclass clz) { + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = Quantity_one(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1from_1str(JNIEnv *env, jclass clz, jstring s) { + LDKStr s_conv = java_to_owned_str(env, s); + LDKCResult_OfferBolt12ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferBolt12ParseErrorZ), "LDKCResult_OfferBolt12ParseErrorZ"); + *ret_conv = Offer_from_str(s_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Offer_1to_1str(JNIEnv *env, jclass clz, int64_t o) { + LDKOffer o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = Offer_to_str(&o_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInvoiceWithExplicitSigningPubkeyBuilder this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InvoiceWithExplicitSigningPubkeyBuilder_free(this_obj_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInvoiceWithDerivedSigningPubkeyBuilder this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InvoiceWithDerivedSigningPubkeyBuilder_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1build(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_static_remote_key_optional(&this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder + + LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ), "LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ"); + *ret_conv = InvoiceWithExplicitSigningPubkeyBuilder_build(this_arg_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1static_1remote_1key_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1relative_1expiry(JNIEnv *env, jclass clz, int64_t this_arg, int32_t relative_expiry_secs) { + LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_static_remote_key_required(&this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder + + InvoiceWithExplicitSigningPubkeyBuilder_relative_expiry(this_arg_conv, relative_expiry_secs); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1fallback_1v0_1p2wsh(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray script_hash) { + LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_supports_static_remote_key(&this_arg_conv); - return ret_conv; + // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder + + uint8_t script_hash_arr[32]; + CHECK((*env)->GetArrayLength(env, script_hash) == 32); + (*env)->GetByteArrayRegion(env, script_hash, 0, 32, script_hash_arr); + uint8_t (*script_hash_ref)[32] = &script_hash_arr; + InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wsh(this_arg_conv, script_hash_ref); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1fallback_1v0_1p2wpkh(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray pubkey_hash) { + LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_static_remote_key(&this_arg_conv); - return ret_conv; + // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder + + uint8_t pubkey_hash_arr[20]; + CHECK((*env)->GetArrayLength(env, pubkey_hash) == 20); + (*env)->GetByteArrayRegion(env, pubkey_hash, 0, 20, pubkey_hash_arr); + uint8_t (*pubkey_hash_ref)[20] = &pubkey_hash_arr; + InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wpkh(this_arg_conv, pubkey_hash_ref); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1fallback_1v1_1p2tr_1tweaked(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray utput_key) { + LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_static_remote_key(&this_arg_conv); - return ret_conv; + // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder + + LDKTweakedPublicKey utput_key_ref; + CHECK((*env)->GetArrayLength(env, utput_key) == 32); + (*env)->GetByteArrayRegion(env, utput_key, 0, 32, utput_key_ref.x_coordinate); + InvoiceWithExplicitSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(this_arg_conv, utput_key_ref); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1allow_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_requires_static_remote_key(&this_arg_conv); - return ret_conv; + // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder + + InvoiceWithExplicitSigningPubkeyBuilder_allow_mpp(this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1payment_1secret_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1build_1and_1sign(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_payment_secret_optional(&this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder + + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ), "LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ"); + *ret_conv = InvoiceWithDerivedSigningPubkeyBuilder_build_and_sign(this_arg_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1payment_1secret_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1relative_1expiry(JNIEnv *env, jclass clz, int64_t this_arg, int32_t relative_expiry_secs) { + LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_payment_secret_required(&this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder + + InvoiceWithDerivedSigningPubkeyBuilder_relative_expiry(this_arg_conv, relative_expiry_secs); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1fallback_1v0_1p2wsh(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray script_hash) { + LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_payment_secret(&this_arg_conv); - return ret_conv; + // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder + + uint8_t script_hash_arr[32]; + CHECK((*env)->GetArrayLength(env, script_hash) == 32); + (*env)->GetByteArrayRegion(env, script_hash, 0, 32, script_hash_arr); + uint8_t (*script_hash_ref)[32] = &script_hash_arr; + InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wsh(this_arg_conv, script_hash_ref); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1payment_1secret_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1fallback_1v0_1p2wpkh(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray pubkey_hash) { + LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - NodeFeatures_set_payment_secret_optional(&this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder + + uint8_t pubkey_hash_arr[20]; + CHECK((*env)->GetArrayLength(env, pubkey_hash) == 20); + (*env)->GetByteArrayRegion(env, pubkey_hash, 0, 20, pubkey_hash_arr); + uint8_t (*pubkey_hash_ref)[20] = &pubkey_hash_arr; + InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wpkh(this_arg_conv, pubkey_hash_ref); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1payment_1secret_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1fallback_1v1_1p2tr_1tweaked(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray utput_key) { + LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - NodeFeatures_set_payment_secret_required(&this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder + + LDKTweakedPublicKey utput_key_ref; + CHECK((*env)->GetArrayLength(env, utput_key) == 32); + (*env)->GetByteArrayRegion(env, utput_key, 0, 32, utput_key_ref.x_coordinate); + InvoiceWithDerivedSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(this_arg_conv, utput_key_ref); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1allow_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_payment_secret(&this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder + + InvoiceWithDerivedSigningPubkeyBuilder_allow_mpp(this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUnsignedBolt12Invoice this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + UnsignedBolt12Invoice_free(this_obj_conv); +} + +static inline uint64_t UnsignedBolt12Invoice_clone_ptr(LDKUnsignedBolt12Invoice *NONNULL_PTR arg) { + LDKUnsignedBolt12Invoice ret_var = UnsignedBolt12Invoice_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUnsignedBolt12Invoice arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = UnsignedBolt12Invoice_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1payment_1secret_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - Bolt11InvoiceFeatures_set_payment_secret_optional(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKUnsignedBolt12Invoice orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKUnsignedBolt12Invoice ret_var = UnsignedBolt12Invoice_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1payment_1secret_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - Bolt11InvoiceFeatures_set_payment_secret_required(&this_arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignBolt12InvoiceFn_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKSignBolt12InvoiceFn this_ptr_conv = *(LDKSignBolt12InvoiceFn*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + SignBolt12InvoiceFn_free(this_ptr_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1supports_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1tagged_1hash(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = Bolt11InvoiceFeatures_supports_payment_secret(&this_arg_conv); + LDKTaggedHash ret_var = UnsignedBolt12Invoice_tagged_hash(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBolt12Invoice this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Bolt12Invoice_free(this_obj_conv); +} + +static inline uint64_t Bolt12Invoice_clone_ptr(LDKBolt12Invoice *NONNULL_PTR arg) { + LDKBolt12Invoice ret_var = Bolt12Invoice_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBolt12Invoice arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = Bolt12Invoice_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBolt12Invoice orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKBolt12Invoice ret_var = Bolt12Invoice_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1created_1at(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_payment_secret(&this_arg_conv); + int64_t ret_conv = UnsignedBolt12Invoice_created_at(&this_arg_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1relative_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_payment_secret(&this_arg_conv); + int64_t ret_conv = UnsignedBolt12Invoice_relative_expiry(&this_arg_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1is_1expired(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = Bolt11InvoiceFeatures_requires_payment_secret(&this_arg_conv); + jboolean ret_conv = UnsignedBolt12Invoice_is_expired(&this_arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1basic_1mpp_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1fallbacks(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_basic_mpp_optional(&this_arg_conv); + LDKCVec_StrZ ret_var = UnsignedBolt12Invoice_fallbacks(&this_arg_conv); + jobjectArray ret_arr = NULL; + ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, String_clz, NULL); + ; + jstring *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t i = 0; i < ret_var.datalen; i++) { + LDKStr ret_conv_8_str = ret_var.data[i]; + jstring ret_conv_8_conv = str_ref_to_java(env, ret_conv_8_str.chars, ret_conv_8_str.len); + Str_free(ret_conv_8_str); + ret_arr_ptr[i] = ret_conv_8_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1basic_1mpp_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1invoice_1features(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_basic_mpp_required(&this_arg_conv); + LDKBolt12InvoiceFeatures ret_var = UnsignedBolt12Invoice_invoice_features(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1signing_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_basic_mpp(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedBolt12Invoice_signing_pubkey(&this_arg_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1basic_1mpp_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1offer_1chains(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_basic_mpp_optional(&this_arg_conv); + LDKCOption_CVec_ThirtyTwoBytesZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_ThirtyTwoBytesZZ), "LDKCOption_CVec_ThirtyTwoBytesZZ"); + *ret_copy = UnsignedBolt12Invoice_offer_chains(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1basic_1mpp_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1chain(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_basic_mpp_required(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, UnsignedBolt12Invoice_chain(&this_arg_conv).data); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_basic_mpp(&this_arg_conv); - return ret_conv; + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = UnsignedBolt12Invoice_metadata(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1basic_1mpp_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1amount(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - Bolt11InvoiceFeatures_set_basic_mpp_optional(&this_arg_conv); + LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); + *ret_copy = UnsignedBolt12Invoice_amount(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1basic_1mpp_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1offer_1features(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - Bolt11InvoiceFeatures_set_basic_mpp_required(&this_arg_conv); + LDKOfferFeatures ret_var = UnsignedBolt12Invoice_offer_features(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1supports_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1description(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = Bolt11InvoiceFeatures_supports_basic_mpp(&this_arg_conv); - return ret_conv; + LDKPrintableString ret_var = UnsignedBolt12Invoice_description(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1basic_1mpp_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12InvoiceFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - Bolt12InvoiceFeatures_set_basic_mpp_optional(&this_arg_conv); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = UnsignedBolt12Invoice_absolute_expiry(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1basic_1mpp_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12InvoiceFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1issuer(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - Bolt12InvoiceFeatures_set_basic_mpp_required(&this_arg_conv); + LDKPrintableString ret_var = UnsignedBolt12Invoice_issuer(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1supports_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12InvoiceFeatures this_arg_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1message_1paths(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = Bolt12InvoiceFeatures_supports_basic_mpp(&this_arg_conv); - return ret_conv; + LDKCVec_BlindedMessagePathZ ret_var = UnsignedBolt12Invoice_message_paths(&this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t u = 0; u < ret_var.datalen; u++) { + LDKBlindedMessagePath ret_conv_20_var = ret_var.data[u]; + int64_t ret_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_20_var); + ret_conv_20_ref = tag_ptr(ret_conv_20_var.inner, ret_conv_20_var.is_owned); + ret_arr_ptr[u] = ret_conv_20_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1supported_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_basic_mpp(&this_arg_conv); - return ret_conv; + LDKCOption_QuantityZ *ret_copy = MALLOC(sizeof(LDKCOption_QuantityZ), "LDKCOption_QuantityZ"); + *ret_copy = UnsignedBolt12Invoice_supported_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1payer_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_basic_mpp(&this_arg_conv); - return ret_conv; + LDKu8slice ret_var = UnsignedBolt12Invoice_payer_metadata(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1invoice_1request_1features(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = Bolt11InvoiceFeatures_requires_basic_mpp(&this_arg_conv); - return ret_conv; + LDKInvoiceRequestFeatures ret_var = UnsignedBolt12Invoice_invoice_request_features(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1requires_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12InvoiceFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = Bolt12InvoiceFeatures_requires_basic_mpp(&this_arg_conv); - return ret_conv; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = UnsignedBolt12Invoice_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1wumbo_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_wumbo_optional(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedBolt12Invoice_payer_id(&this_arg_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1wumbo_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_wumbo_required(&this_arg_conv); + LDKPrintableString ret_var = UnsignedBolt12Invoice_payer_note(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_wumbo(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, UnsignedBolt12Invoice_payment_hash(&this_arg_conv).data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1wumbo_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_wumbo_optional(&this_arg_conv); + int64_t ret_conv = UnsignedBolt12Invoice_amount_msats(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1wumbo_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1created_1at(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_wumbo_required(&this_arg_conv); + int64_t ret_conv = Bolt12Invoice_created_at(&this_arg_conv); + return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1relative_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_wumbo(&this_arg_conv); + int64_t ret_conv = Bolt12Invoice_relative_expiry(&this_arg_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1is_1expired(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_wumbo(&this_arg_conv); + jboolean ret_conv = Bolt12Invoice_is_expired(&this_arg_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1fallbacks(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_wumbo(&this_arg_conv); - return ret_conv; + LDKCVec_StrZ ret_var = Bolt12Invoice_fallbacks(&this_arg_conv); + jobjectArray ret_arr = NULL; + ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, String_clz, NULL); + ; + jstring *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t i = 0; i < ret_var.datalen; i++) { + LDKStr ret_conv_8_str = ret_var.data[i]; + jstring ret_conv_8_conv = str_ref_to_java(env, ret_conv_8_str.chars, ret_conv_8_str.len); + Str_free(ret_conv_8_str); + ret_arr_ptr[i] = ret_conv_8_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1anchors_1nonzero_1fee_1htlc_1tx_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1invoice_1features(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(&this_arg_conv); + LDKBolt12InvoiceFeatures ret_var = Bolt12Invoice_invoice_features(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1anchors_1nonzero_1fee_1htlc_1tx_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1signing_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Bolt12Invoice_signing_pubkey(&this_arg_conv).compressed_form); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1anchors_1nonzero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1offer_1chains(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_anchors_nonzero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + LDKCOption_CVec_ThirtyTwoBytesZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_ThirtyTwoBytesZZ), "LDKCOption_CVec_ThirtyTwoBytesZZ"); + *ret_copy = Bolt12Invoice_offer_chains(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1anchors_1nonzero_1fee_1htlc_1tx_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1chain(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, Bolt12Invoice_chain(&this_arg_conv).data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1anchors_1nonzero_1fee_1htlc_1tx_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(&this_arg_conv); + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = Bolt12Invoice_metadata(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1anchors_1nonzero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1amount(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); + *ret_copy = Bolt12Invoice_amount(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1anchors_1nonzero_1fee_1htlc_1tx_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1offer_1features(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(&this_arg_conv); + LDKOfferFeatures ret_var = Bolt12Invoice_offer_features(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1anchors_1nonzero_1fee_1htlc_1tx_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1description(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(&this_arg_conv); + LDKPrintableString ret_var = Bolt12Invoice_description(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1anchors_1nonzero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = Bolt12Invoice_absolute_expiry(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1anchors_1nonzero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1issuer(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_anchors_nonzero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + LDKPrintableString ret_var = Bolt12Invoice_issuer(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1anchors_1nonzero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1message_1paths(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + LDKCVec_BlindedMessagePathZ ret_var = Bolt12Invoice_message_paths(&this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t u = 0; u < ret_var.datalen; u++) { + LDKBlindedMessagePath ret_conv_20_var = ret_var.data[u]; + int64_t ret_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_20_var); + ret_conv_20_ref = tag_ptr(ret_conv_20_var.inner, ret_conv_20_var.is_owned); + ret_arr_ptr[u] = ret_conv_20_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1anchors_1nonzero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1supported_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + LDKCOption_QuantityZ *ret_copy = MALLOC(sizeof(LDKCOption_QuantityZ), "LDKCOption_QuantityZ"); + *ret_copy = Bolt12Invoice_supported_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1payer_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_anchors_zero_fee_htlc_tx_optional(&this_arg_conv); + LDKu8slice ret_var = Bolt12Invoice_payer_metadata(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1invoice_1request_1features(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_anchors_zero_fee_htlc_tx_required(&this_arg_conv); + LDKInvoiceRequestFeatures ret_var = Bolt12Invoice_invoice_request_features(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_anchors_zero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = Bolt12Invoice_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Bolt12Invoice_payer_id(&this_arg_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_anchors_zero_fee_htlc_tx_required(&this_arg_conv); + LDKPrintableString ret_var = Bolt12Invoice_payer_note(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_anchors_zero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, Bolt12Invoice_payment_hash(&this_arg_conv).data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(&this_arg_conv); + int64_t ret_conv = Bolt12Invoice_amount_msats(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1signature(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, Bolt12Invoice_signature(&this_arg_conv).compact_form); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1signable_1hash(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, Bolt12Invoice_signable_hash(&this_arg_conv).data); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1verify_1using_1metadata(JNIEnv *env, jclass clz, int64_t this_arg, int64_t key) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_anchors_zero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + LDKExpandedKey key_conv; + key_conv.inner = untag_ptr(key); + key_conv.is_owned = ptr_is_owned(key); + CHECK_INNER_FIELD_ACCESS_OR_NULL(key_conv); + key_conv.is_owned = false; + LDKCResult_ThirtyTwoBytesNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesNoneZ), "LDKCResult_ThirtyTwoBytesNoneZ"); + *ret_conv = Bolt12Invoice_verify_using_metadata(&this_arg_conv, &key_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1verify_1using_1payer_1data(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_id, int64_t nonce, int64_t key) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_anchors_zero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + LDKNonce nonce_conv; + nonce_conv.inner = untag_ptr(nonce); + nonce_conv.is_owned = ptr_is_owned(nonce); + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_conv); + nonce_conv = Nonce_clone(&nonce_conv); + LDKExpandedKey key_conv; + key_conv.inner = untag_ptr(key); + key_conv.is_owned = ptr_is_owned(key); + CHECK_INNER_FIELD_ACCESS_OR_NULL(key_conv); + key_conv.is_owned = false; + LDKCResult_ThirtyTwoBytesNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesNoneZ), "LDKCResult_ThirtyTwoBytesNoneZ"); + *ret_conv = Bolt12Invoice_verify_using_payer_data(&this_arg_conv, payment_id_ref, nonce_conv, &key_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKBolt12Invoice o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = Bolt12Invoice_hash(&o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1route_1blinding_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_route_blinding_optional(&this_arg_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKUnsignedBolt12Invoice obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = UnsignedBolt12Invoice_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1route_1blinding_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_route_blinding_required(&this_arg_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKBolt12Invoice obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = Bolt12Invoice_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1route_1blinding(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_route_blinding(&this_arg_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_Bolt12InvoiceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceDecodeErrorZ), "LDKCResult_Bolt12InvoiceDecodeErrorZ"); + *ret_conv = Bolt12Invoice_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1route_1blinding_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - NodeFeatures_set_route_blinding_optional(&this_arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceError_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInvoiceError this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InvoiceError_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1route_1blinding_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - NodeFeatures_set_route_blinding_required(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceError_1get_1erroneous_1field(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInvoiceError this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKErroneousField ret_var = InvoiceError_get_erroneous_field(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1route_1blinding(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_route_blinding(&this_arg_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceError_1set_1erroneous_1field(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKInvoiceError this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKErroneousField val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ErroneousField_clone(&val_conv); + InvoiceError_set_erroneous_field(&this_ptr_conv, val_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1route_1blinding(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_route_blinding(&this_arg_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceError_1get_1message(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInvoiceError this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKUntrustedString ret_var = InvoiceError_get_message(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1route_1blinding(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_route_blinding(&this_arg_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceError_1set_1message(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKInvoiceError this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKUntrustedString val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = UntrustedString_clone(&val_conv); + InvoiceError_set_message(&this_ptr_conv, val_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1shutdown_1any_1segwit_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_shutdown_any_segwit_optional(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceError_1new(JNIEnv *env, jclass clz, int64_t erroneous_field_arg, int64_t message_arg) { + LDKErroneousField erroneous_field_arg_conv; + erroneous_field_arg_conv.inner = untag_ptr(erroneous_field_arg); + erroneous_field_arg_conv.is_owned = ptr_is_owned(erroneous_field_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(erroneous_field_arg_conv); + erroneous_field_arg_conv = ErroneousField_clone(&erroneous_field_arg_conv); + LDKUntrustedString message_arg_conv; + message_arg_conv.inner = untag_ptr(message_arg); + message_arg_conv.is_owned = ptr_is_owned(message_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_arg_conv); + message_arg_conv = UntrustedString_clone(&message_arg_conv); + LDKInvoiceError ret_var = InvoiceError_new(erroneous_field_arg_conv, message_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1shutdown_1any_1segwit_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_shutdown_any_segwit_required(&this_arg_conv); +static inline uint64_t InvoiceError_clone_ptr(LDKInvoiceError *NONNULL_PTR arg) { + LDKInvoiceError ret_var = InvoiceError_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_shutdown_anysegwit(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInvoiceError arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = InvoiceError_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1shutdown_1any_1segwit_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - NodeFeatures_set_shutdown_any_segwit_optional(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceError_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKInvoiceError orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKInvoiceError ret_var = InvoiceError_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1shutdown_1any_1segwit_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - NodeFeatures_set_shutdown_any_segwit_required(&this_arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErroneousField_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKErroneousField this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ErroneousField_free(this_obj_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_shutdown_anysegwit(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroneousField_1get_1tlv_1fieldnum(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKErroneousField this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ErroneousField_get_tlv_fieldnum(&this_ptr_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_shutdown_anysegwit(&this_arg_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErroneousField_1set_1tlv_1fieldnum(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKErroneousField this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ErroneousField_set_tlv_fieldnum(&this_ptr_conv, val); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_shutdown_anysegwit(&this_arg_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroneousField_1get_1suggested_1value(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKErroneousField this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = ErroneousField_get_suggested_value(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1taproot_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_taproot_optional(&this_arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErroneousField_1set_1suggested_1value(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKErroneousField this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_CVec_u8ZZ val_conv = *(LDKCOption_CVec_u8ZZ*)(val_ptr); + val_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(val)); + ErroneousField_set_suggested_value(&this_ptr_conv, val_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1taproot_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_taproot_required(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroneousField_1new(JNIEnv *env, jclass clz, int64_t tlv_fieldnum_arg, int64_t suggested_value_arg) { + void* suggested_value_arg_ptr = untag_ptr(suggested_value_arg); + CHECK_ACCESS(suggested_value_arg_ptr); + LDKCOption_CVec_u8ZZ suggested_value_arg_conv = *(LDKCOption_CVec_u8ZZ*)(suggested_value_arg_ptr); + suggested_value_arg_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(suggested_value_arg)); + LDKErroneousField ret_var = ErroneousField_new(tlv_fieldnum_arg, suggested_value_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1taproot(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_taproot(&this_arg_conv); +static inline uint64_t ErroneousField_clone_ptr(LDKErroneousField *NONNULL_PTR arg) { + LDKErroneousField ret_var = ErroneousField_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroneousField_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKErroneousField arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = ErroneousField_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1taproot_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - NodeFeatures_set_taproot_optional(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroneousField_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKErroneousField orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKErroneousField ret_var = ErroneousField_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1taproot_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - NodeFeatures_set_taproot_required(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceError_1from_1string(JNIEnv *env, jclass clz, jstring s) { + LDKStr s_conv = java_to_owned_str(env, s); + LDKInvoiceError ret_var = InvoiceError_from_string(s_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1taproot(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_taproot(&this_arg_conv); +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_InvoiceError_1to_1str(JNIEnv *env, jclass clz, int64_t o) { + LDKInvoiceError o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = InvoiceError_to_str(&o_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1taproot_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_taproot_optional(&this_arg_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceError_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKInvoiceError obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = InvoiceError_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1taproot_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_taproot_required(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceError_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); + *ret_conv = InvoiceError_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1taproot(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_supports_taproot(&this_arg_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInvoiceRequestWithExplicitPayerIdBuilder this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InvoiceRequestWithExplicitPayerIdBuilder_free(this_obj_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1taproot(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_taproot(&this_arg_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInvoiceRequestWithDerivedPayerIdBuilder this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InvoiceRequestWithDerivedPayerIdBuilder_free(this_obj_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1taproot(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1build(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_taproot(&this_arg_conv); - return ret_conv; + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithExplicitPayerIdBuilder + + LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ), "LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequestWithExplicitPayerIdBuilder_build(this_arg_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1taproot(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1chain(JNIEnv *env, jclass clz, int64_t this_arg, jclass network) { + LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_requires_taproot(&this_arg_conv); - return ret_conv; + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithExplicitPayerIdBuilder + + LDKNetwork network_conv = LDKNetwork_from_java(env, network); + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequestWithExplicitPayerIdBuilder_chain(this_arg_conv, network_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1onion_1messages_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg, int64_t amount_msats) { + LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_onion_messages_optional(&this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithExplicitPayerIdBuilder + + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequestWithExplicitPayerIdBuilder_amount_msats(this_arg_conv, amount_msats); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1onion_1messages_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1quantity(JNIEnv *env, jclass clz, int64_t this_arg, int64_t quantity) { + LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_onion_messages_required(&this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithExplicitPayerIdBuilder + + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequestWithExplicitPayerIdBuilder_quantity(this_arg_conv, quantity); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1onion_1messages(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg, jstring payer_note) { + LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_onion_messages(&this_arg_conv); - return ret_conv; + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithExplicitPayerIdBuilder + + LDKStr payer_note_conv = java_to_owned_str(env, payer_note); + InvoiceRequestWithExplicitPayerIdBuilder_payer_note(this_arg_conv, payer_note_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1onion_1messages_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1build_1and_1sign(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - NodeFeatures_set_onion_messages_optional(&this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerIdBuilder + + LDKCResult_InvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequestWithDerivedPayerIdBuilder_build_and_sign(this_arg_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1onion_1messages_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1chain(JNIEnv *env, jclass clz, int64_t this_arg, jclass network) { + LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - NodeFeatures_set_onion_messages_required(&this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerIdBuilder + + LDKNetwork network_conv = LDKNetwork_from_java(env, network); + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequestWithDerivedPayerIdBuilder_chain(this_arg_conv, network_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1onion_1messages(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg, int64_t amount_msats) { + LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_onion_messages(&this_arg_conv); - return ret_conv; + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerIdBuilder + + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequestWithDerivedPayerIdBuilder_amount_msats(this_arg_conv, amount_msats); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1onion_1messages(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1quantity(JNIEnv *env, jclass clz, int64_t this_arg, int64_t quantity) { + LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_onion_messages(&this_arg_conv); - return ret_conv; + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerIdBuilder + + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequestWithDerivedPayerIdBuilder_quantity(this_arg_conv, quantity); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1onion_1messages(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg, jstring payer_note) { + LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_onion_messages(&this_arg_conv); - return ret_conv; + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerIdBuilder + + LDKStr payer_note_conv = java_to_owned_str(env, payer_note); + InvoiceRequestWithDerivedPayerIdBuilder_payer_note(this_arg_conv, payer_note_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1channel_1type_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_channel_type_optional(&this_arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUnsignedInvoiceRequest this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + UnsignedInvoiceRequest_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1channel_1type_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_channel_type_required(&this_arg_conv); +static inline uint64_t UnsignedInvoiceRequest_clone_ptr(LDKUnsignedInvoiceRequest *NONNULL_PTR arg) { + LDKUnsignedInvoiceRequest ret_var = UnsignedInvoiceRequest_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_channel_type(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUnsignedInvoiceRequest arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = UnsignedInvoiceRequest_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1channel_1type_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKUnsignedInvoiceRequest orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKUnsignedInvoiceRequest ret_var = UnsignedInvoiceRequest_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignInvoiceRequestFn_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKSignInvoiceRequestFn this_ptr_conv = *(LDKSignInvoiceRequestFn*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + SignInvoiceRequestFn_free(this_ptr_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1tagged_1hash(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_channel_type_optional(&this_arg_conv); + LDKTaggedHash ret_var = UnsignedInvoiceRequest_tagged_hash(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1channel_1type_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInvoiceRequest this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InvoiceRequest_free(this_obj_conv); +} + +static inline uint64_t InvoiceRequest_clone_ptr(LDKInvoiceRequest *NONNULL_PTR arg) { + LDKInvoiceRequest ret_var = InvoiceRequest_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInvoiceRequest arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = InvoiceRequest_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKInvoiceRequest orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKInvoiceRequest ret_var = InvoiceRequest_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKVerifiedInvoiceRequest this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + VerifiedInvoiceRequest_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1get_1offer_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKVerifiedInvoiceRequest this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKOfferId ret_var = VerifiedInvoiceRequest_get_offer_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1set_1offer_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKVerifiedInvoiceRequest this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKOfferId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = OfferId_clone(&val_conv); + VerifiedInvoiceRequest_set_offer_id(&this_ptr_conv, val_conv); +} + +static inline uint64_t VerifiedInvoiceRequest_clone_ptr(LDKVerifiedInvoiceRequest *NONNULL_PTR arg) { + LDKVerifiedInvoiceRequest ret_var = VerifiedInvoiceRequest_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKVerifiedInvoiceRequest arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = VerifiedInvoiceRequest_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKVerifiedInvoiceRequest orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKVerifiedInvoiceRequest ret_var = VerifiedInvoiceRequest_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1chains(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_channel_type_required(&this_arg_conv); + LDKCVec_ThirtyTwoBytesZ ret_var = UnsignedInvoiceRequest_chains(&this_arg_conv); + jobjectArray ret_arr = NULL; + ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); + ; + for (size_t i = 0; i < ret_var.datalen; i++) { + int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 32, ret_var.data[i].data); + (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); + } + + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_channel_type(&this_arg_conv); - return ret_conv; + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = UnsignedInvoiceRequest_metadata(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1amount(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_channel_type(&this_arg_conv); - return ret_conv; + LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); + *ret_copy = UnsignedInvoiceRequest_amount(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1description(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_channel_type(&this_arg_conv); - return ret_conv; + LDKPrintableString ret_var = UnsignedInvoiceRequest_description(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1scid_1privacy_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1offer_1features(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_scid_privacy_optional(&this_arg_conv); + LDKOfferFeatures ret_var = UnsignedInvoiceRequest_offer_features(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1scid_1privacy_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_scid_privacy_required(&this_arg_conv); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = UnsignedInvoiceRequest_absolute_expiry(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1issuer(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_scid_privacy(&this_arg_conv); - return ret_conv; + LDKPrintableString ret_var = UnsignedInvoiceRequest_issuer(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1scid_1privacy_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1paths(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_scid_privacy_optional(&this_arg_conv); + LDKCVec_BlindedMessagePathZ ret_var = UnsignedInvoiceRequest_paths(&this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t u = 0; u < ret_var.datalen; u++) { + LDKBlindedMessagePath ret_conv_20_var = ret_var.data[u]; + int64_t ret_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_20_var); + ret_conv_20_ref = tag_ptr(ret_conv_20_var.inner, ret_conv_20_var.is_owned); + ret_arr_ptr[u] = ret_conv_20_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1scid_1privacy_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1supported_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_scid_privacy_required(&this_arg_conv); + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = UnsignedInvoiceRequest_supported_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1signing_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_scid_privacy(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedInvoiceRequest_signing_pubkey(&this_arg_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1scid_1privacy_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1payer_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_scid_privacy_optional(&this_arg_conv); + LDKu8slice ret_var = UnsignedInvoiceRequest_payer_metadata(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1scid_1privacy_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1chain(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_scid_privacy_required(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, UnsignedInvoiceRequest_chain(&this_arg_conv).data); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_supports_scid_privacy(&this_arg_conv); - return ret_conv; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = UnsignedInvoiceRequest_amount_msats(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1invoice_1request_1features(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_scid_privacy(&this_arg_conv); - return ret_conv; + LDKInvoiceRequestFeatures ret_var = UnsignedInvoiceRequest_invoice_request_features(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_scid_privacy(&this_arg_conv); - return ret_conv; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = UnsignedInvoiceRequest_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_requires_scid_privacy(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedInvoiceRequest_payer_id(&this_arg_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1payment_1metadata_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - Bolt11InvoiceFeatures_set_payment_metadata_optional(&this_arg_conv); + LDKPrintableString ret_var = UnsignedInvoiceRequest_payer_note(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1payment_1metadata_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1chains(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - Bolt11InvoiceFeatures_set_payment_metadata_required(&this_arg_conv); + LDKCVec_ThirtyTwoBytesZ ret_var = InvoiceRequest_chains(&this_arg_conv); + jobjectArray ret_arr = NULL; + ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); + ; + for (size_t i = 0; i < ret_var.datalen; i++) { + int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 32, ret_var.data[i].data); + (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); + } + + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1supports_1payment_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = Bolt11InvoiceFeatures_supports_payment_metadata(&this_arg_conv); - return ret_conv; + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = InvoiceRequest_metadata(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1payment_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1amount(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = Bolt11InvoiceFeatures_requires_payment_metadata(&this_arg_conv); - return ret_conv; + LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); + *ret_copy = InvoiceRequest_amount(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1zero_1conf_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1description(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_zero_conf_optional(&this_arg_conv); + LDKPrintableString ret_var = InvoiceRequest_description(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1zero_1conf_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1offer_1features(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_zero_conf_required(&this_arg_conv); + LDKOfferFeatures ret_var = InvoiceRequest_offer_features(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_zero_conf(&this_arg_conv); - return ret_conv; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = InvoiceRequest_absolute_expiry(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1zero_1conf_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1issuer(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_zero_conf_optional(&this_arg_conv); + LDKPrintableString ret_var = InvoiceRequest_issuer(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1zero_1conf_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1paths(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_zero_conf_required(&this_arg_conv); + LDKCVec_BlindedMessagePathZ ret_var = InvoiceRequest_paths(&this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t u = 0; u < ret_var.datalen; u++) { + LDKBlindedMessagePath ret_conv_20_var = ret_var.data[u]; + int64_t ret_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_20_var); + ret_conv_20_ref = tag_ptr(ret_conv_20_var.inner, ret_conv_20_var.is_owned); + ret_arr_ptr[u] = ret_conv_20_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1supported_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_zero_conf(&this_arg_conv); - return ret_conv; + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = InvoiceRequest_supported_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1zero_1conf_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1signing_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_zero_conf_optional(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, InvoiceRequest_signing_pubkey(&this_arg_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1zero_1conf_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1payer_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_zero_conf_required(&this_arg_conv); + LDKu8slice ret_var = InvoiceRequest_payer_metadata(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1chain(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_supports_zero_conf(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, InvoiceRequest_chain(&this_arg_conv).data); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_zero_conf(&this_arg_conv); - return ret_conv; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = InvoiceRequest_amount_msats(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1invoice_1request_1features(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_zero_conf(&this_arg_conv); - return ret_conv; + LDKInvoiceRequestFeatures ret_var = InvoiceRequest_invoice_request_features(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_requires_zero_conf(&this_arg_conv); - return ret_conv; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = InvoiceRequest_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1keysend_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_keysend_optional(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, InvoiceRequest_payer_id(&this_arg_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1keysend_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_keysend_required(&this_arg_conv); + LDKPrintableString ret_var = InvoiceRequest_payer_note(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1keysend(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1respond_1with(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_keysend(&this_arg_conv); - return ret_conv; + LDKCVec_BlindedPaymentPathZ payment_paths_constr; + payment_paths_constr.datalen = (*env)->GetArrayLength(env, payment_paths); + if (payment_paths_constr.datalen > 0) + payment_paths_constr.data = MALLOC(payment_paths_constr.datalen * sizeof(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); + else + payment_paths_constr.data = NULL; + int64_t* payment_paths_vals = (*env)->GetLongArrayElements (env, payment_paths, NULL); + for (size_t u = 0; u < payment_paths_constr.datalen; u++) { + int64_t payment_paths_conv_20 = payment_paths_vals[u]; + LDKBlindedPaymentPath payment_paths_conv_20_conv; + payment_paths_conv_20_conv.inner = untag_ptr(payment_paths_conv_20); + payment_paths_conv_20_conv.is_owned = ptr_is_owned(payment_paths_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_paths_conv_20_conv); + payment_paths_conv_20_conv = BlindedPaymentPath_clone(&payment_paths_conv_20_conv); + payment_paths_constr.data[u] = payment_paths_conv_20_conv; + } + (*env)->ReleaseLongArrayElements(env, payment_paths, payment_paths_vals, 0); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequest_respond_with(&this_arg_conv, payment_paths_constr, payment_hash_ref); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1keysend(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1respond_1with_1no_1std(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash, int64_t created_at) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_keysend(&this_arg_conv); - return ret_conv; + LDKCVec_BlindedPaymentPathZ payment_paths_constr; + payment_paths_constr.datalen = (*env)->GetArrayLength(env, payment_paths); + if (payment_paths_constr.datalen > 0) + payment_paths_constr.data = MALLOC(payment_paths_constr.datalen * sizeof(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); + else + payment_paths_constr.data = NULL; + int64_t* payment_paths_vals = (*env)->GetLongArrayElements (env, payment_paths, NULL); + for (size_t u = 0; u < payment_paths_constr.datalen; u++) { + int64_t payment_paths_conv_20 = payment_paths_vals[u]; + LDKBlindedPaymentPath payment_paths_conv_20_conv; + payment_paths_conv_20_conv.inner = untag_ptr(payment_paths_conv_20); + payment_paths_conv_20_conv.is_owned = ptr_is_owned(payment_paths_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_paths_conv_20_conv); + payment_paths_conv_20_conv = BlindedPaymentPath_clone(&payment_paths_conv_20_conv); + payment_paths_constr.data[u] = payment_paths_conv_20_conv; + } + (*env)->ReleaseLongArrayElements(env, payment_paths, payment_paths_vals, 0); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequest_respond_with_no_std(&this_arg_conv, payment_paths_constr, payment_hash_ref, created_at); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1trampoline_1routing_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1verify_1using_1metadata(JNIEnv *env, jclass clz, int64_t this_arg, int64_t key) { + LDKInvoiceRequest this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = InvoiceRequest_clone(&this_arg_conv); + LDKExpandedKey key_conv; + key_conv.inner = untag_ptr(key); + key_conv.is_owned = ptr_is_owned(key); + CHECK_INNER_FIELD_ACCESS_OR_NULL(key_conv); + key_conv.is_owned = false; + LDKCResult_VerifiedInvoiceRequestNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_VerifiedInvoiceRequestNoneZ), "LDKCResult_VerifiedInvoiceRequestNoneZ"); + *ret_conv = InvoiceRequest_verify_using_metadata(this_arg_conv, &key_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1verify_1using_1recipient_1data(JNIEnv *env, jclass clz, int64_t this_arg, int64_t nonce, int64_t key) { + LDKInvoiceRequest this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = InvoiceRequest_clone(&this_arg_conv); + LDKNonce nonce_conv; + nonce_conv.inner = untag_ptr(nonce); + nonce_conv.is_owned = ptr_is_owned(nonce); + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_conv); + nonce_conv = Nonce_clone(&nonce_conv); + LDKExpandedKey key_conv; + key_conv.inner = untag_ptr(key); + key_conv.is_owned = ptr_is_owned(key); + CHECK_INNER_FIELD_ACCESS_OR_NULL(key_conv); + key_conv.is_owned = false; + LDKCResult_VerifiedInvoiceRequestNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_VerifiedInvoiceRequestNoneZ), "LDKCResult_VerifiedInvoiceRequestNoneZ"); + *ret_conv = InvoiceRequest_verify_using_recipient_data(this_arg_conv, nonce_conv, &key_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1signature(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_trampoline_routing_optional(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, InvoiceRequest_signature(&this_arg_conv).compact_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1trampoline_1routing_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1chains(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKVerifiedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_trampoline_routing_required(&this_arg_conv); + LDKCVec_ThirtyTwoBytesZ ret_var = VerifiedInvoiceRequest_chains(&this_arg_conv); + jobjectArray ret_arr = NULL; + ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); + ; + for (size_t i = 0; i < ret_var.datalen; i++) { + int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 32, ret_var.data[i].data); + (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); + } + + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1trampoline_1routing(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKVerifiedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_trampoline_routing(&this_arg_conv); - return ret_conv; + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = VerifiedInvoiceRequest_metadata(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1trampoline_1routing_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1amount(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKVerifiedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_trampoline_routing_optional(&this_arg_conv); + LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); + *ret_copy = VerifiedInvoiceRequest_amount(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1trampoline_1routing_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1description(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKVerifiedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_trampoline_routing_required(&this_arg_conv); + LDKPrintableString ret_var = VerifiedInvoiceRequest_description(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1trampoline_1routing(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1offer_1features(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKVerifiedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_trampoline_routing(&this_arg_conv); - return ret_conv; + LDKOfferFeatures ret_var = VerifiedInvoiceRequest_offer_features(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1trampoline_1routing_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKVerifiedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - Bolt11InvoiceFeatures_set_trampoline_routing_optional(&this_arg_conv); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = VerifiedInvoiceRequest_absolute_expiry(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1trampoline_1routing_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1issuer(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKVerifiedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - Bolt11InvoiceFeatures_set_trampoline_routing_required(&this_arg_conv); + LDKPrintableString ret_var = VerifiedInvoiceRequest_issuer(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1supports_1trampoline_1routing(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1paths(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKVerifiedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = Bolt11InvoiceFeatures_supports_trampoline_routing(&this_arg_conv); - return ret_conv; + LDKCVec_BlindedMessagePathZ ret_var = VerifiedInvoiceRequest_paths(&this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t u = 0; u < ret_var.datalen; u++) { + LDKBlindedMessagePath ret_conv_20_var = ret_var.data[u]; + int64_t ret_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_20_var); + ret_conv_20_ref = tag_ptr(ret_conv_20_var.inner, ret_conv_20_var.is_owned); + ret_arr_ptr[u] = ret_conv_20_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1trampoline_1routing(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1supported_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKVerifiedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_trampoline_routing(&this_arg_conv); - return ret_conv; + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = VerifiedInvoiceRequest_supported_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1trampoline_1routing(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1signing_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKVerifiedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_trampoline_routing(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, VerifiedInvoiceRequest_signing_pubkey(&this_arg_conv).compressed_form); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1trampoline_1routing(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1payer_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKVerifiedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = Bolt11InvoiceFeatures_requires_trampoline_routing(&this_arg_conv); - return ret_conv; + LDKu8slice ret_var = VerifiedInvoiceRequest_payer_metadata(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKShutdownScript this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ShutdownScript_free(this_obj_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1chain(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKVerifiedInvoiceRequest this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, VerifiedInvoiceRequest_chain(&this_arg_conv).data); + return ret_arr; } -static inline uint64_t ShutdownScript_clone_ptr(LDKShutdownScript *NONNULL_PTR arg) { - LDKShutdownScript ret_var = ShutdownScript_clone(arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKVerifiedInvoiceRequest this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = VerifiedInvoiceRequest_amount_msats(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1invoice_1request_1features(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKVerifiedInvoiceRequest this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKInvoiceRequestFeatures ret_var = VerifiedInvoiceRequest_invoice_request_features(&this_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKShutdownScript arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = ShutdownScript_clone_ptr(&arg_conv); - return ret_conv; + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKVerifiedInvoiceRequest this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = VerifiedInvoiceRequest_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKShutdownScript orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKShutdownScript ret_var = ShutdownScript_clone(&orig_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKVerifiedInvoiceRequest this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, VerifiedInvoiceRequest_payer_id(&this_arg_conv).compressed_form); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKVerifiedInvoiceRequest this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKPrintableString ret_var = VerifiedInvoiceRequest_payer_note(&this_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKShutdownScript a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKShutdownScript b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = ShutdownScript_eq(&a_conv, &b_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1respond_1with(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash) { + LDKVerifiedInvoiceRequest this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_BlindedPaymentPathZ payment_paths_constr; + payment_paths_constr.datalen = (*env)->GetArrayLength(env, payment_paths); + if (payment_paths_constr.datalen > 0) + payment_paths_constr.data = MALLOC(payment_paths_constr.datalen * sizeof(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); + else + payment_paths_constr.data = NULL; + int64_t* payment_paths_vals = (*env)->GetLongArrayElements (env, payment_paths, NULL); + for (size_t u = 0; u < payment_paths_constr.datalen; u++) { + int64_t payment_paths_conv_20 = payment_paths_vals[u]; + LDKBlindedPaymentPath payment_paths_conv_20_conv; + payment_paths_conv_20_conv.inner = untag_ptr(payment_paths_conv_20); + payment_paths_conv_20_conv.is_owned = ptr_is_owned(payment_paths_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_paths_conv_20_conv); + payment_paths_conv_20_conv = BlindedPaymentPath_clone(&payment_paths_conv_20_conv); + payment_paths_constr.data[u] = payment_paths_conv_20_conv; + } + (*env)->ReleaseLongArrayElements(env, payment_paths, payment_paths_vals, 0); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ"); + *ret_conv = VerifiedInvoiceRequest_respond_with(&this_arg_conv, payment_paths_constr, payment_hash_ref); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKInvalidShutdownScript this_obj_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1respond_1with_1no_1std(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash, int64_t created_at) { + LDKVerifiedInvoiceRequest this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_BlindedPaymentPathZ payment_paths_constr; + payment_paths_constr.datalen = (*env)->GetArrayLength(env, payment_paths); + if (payment_paths_constr.datalen > 0) + payment_paths_constr.data = MALLOC(payment_paths_constr.datalen * sizeof(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); + else + payment_paths_constr.data = NULL; + int64_t* payment_paths_vals = (*env)->GetLongArrayElements (env, payment_paths, NULL); + for (size_t u = 0; u < payment_paths_constr.datalen; u++) { + int64_t payment_paths_conv_20 = payment_paths_vals[u]; + LDKBlindedPaymentPath payment_paths_conv_20_conv; + payment_paths_conv_20_conv.inner = untag_ptr(payment_paths_conv_20); + payment_paths_conv_20_conv.is_owned = ptr_is_owned(payment_paths_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_paths_conv_20_conv); + payment_paths_conv_20_conv = BlindedPaymentPath_clone(&payment_paths_conv_20_conv); + payment_paths_constr.data[u] = payment_paths_conv_20_conv; + } + (*env)->ReleaseLongArrayElements(env, payment_paths, payment_paths_vals, 0); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ"); + *ret_conv = VerifiedInvoiceRequest_respond_with_no_std(&this_arg_conv, payment_paths_constr, payment_hash_ref, created_at); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1respond_1using_1derived_1keys(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash) { + LDKVerifiedInvoiceRequest this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_BlindedPaymentPathZ payment_paths_constr; + payment_paths_constr.datalen = (*env)->GetArrayLength(env, payment_paths); + if (payment_paths_constr.datalen > 0) + payment_paths_constr.data = MALLOC(payment_paths_constr.datalen * sizeof(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); + else + payment_paths_constr.data = NULL; + int64_t* payment_paths_vals = (*env)->GetLongArrayElements (env, payment_paths, NULL); + for (size_t u = 0; u < payment_paths_constr.datalen; u++) { + int64_t payment_paths_conv_20 = payment_paths_vals[u]; + LDKBlindedPaymentPath payment_paths_conv_20_conv; + payment_paths_conv_20_conv.inner = untag_ptr(payment_paths_conv_20); + payment_paths_conv_20_conv.is_owned = ptr_is_owned(payment_paths_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_paths_conv_20_conv); + payment_paths_conv_20_conv = BlindedPaymentPath_clone(&payment_paths_conv_20_conv); + payment_paths_constr.data[u] = payment_paths_conv_20_conv; + } + (*env)->ReleaseLongArrayElements(env, payment_paths, payment_paths_vals, 0); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ"); + *ret_conv = VerifiedInvoiceRequest_respond_using_derived_keys(&this_arg_conv, payment_paths_constr, payment_hash_ref); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1respond_1using_1derived_1keys_1no_1std(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash, int64_t created_at) { + LDKVerifiedInvoiceRequest this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_BlindedPaymentPathZ payment_paths_constr; + payment_paths_constr.datalen = (*env)->GetArrayLength(env, payment_paths); + if (payment_paths_constr.datalen > 0) + payment_paths_constr.data = MALLOC(payment_paths_constr.datalen * sizeof(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); + else + payment_paths_constr.data = NULL; + int64_t* payment_paths_vals = (*env)->GetLongArrayElements (env, payment_paths, NULL); + for (size_t u = 0; u < payment_paths_constr.datalen; u++) { + int64_t payment_paths_conv_20 = payment_paths_vals[u]; + LDKBlindedPaymentPath payment_paths_conv_20_conv; + payment_paths_conv_20_conv.inner = untag_ptr(payment_paths_conv_20); + payment_paths_conv_20_conv.is_owned = ptr_is_owned(payment_paths_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_paths_conv_20_conv); + payment_paths_conv_20_conv = BlindedPaymentPath_clone(&payment_paths_conv_20_conv); + payment_paths_constr.data[u] = payment_paths_conv_20_conv; + } + (*env)->ReleaseLongArrayElements(env, payment_paths, payment_paths_vals, 0); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ"); + *ret_conv = VerifiedInvoiceRequest_respond_using_derived_keys_no_std(&this_arg_conv, payment_paths_constr, payment_hash_ref, created_at); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKUnsignedInvoiceRequest obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = UnsignedInvoiceRequest_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKInvoiceRequest obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = InvoiceRequest_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInvoiceRequestFields this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InvalidShutdownScript_free(this_obj_conv); + InvoiceRequestFields_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1get_1script(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInvalidShutdownScript this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1get_1payer_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInvoiceRequestFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u8Z ret_var = InvalidShutdownScript_get_script(&this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, InvoiceRequestFields_get_payer_id(&this_ptr_conv).compressed_form); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1set_1script(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKInvalidShutdownScript this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1set_1payer_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKInvoiceRequestFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u8Z val_ref; - val_ref.datalen = (*env)->GetArrayLength(env, val); - val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data); - InvalidShutdownScript_set_script(&this_ptr_conv, val_ref); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + InvoiceRequestFields_set_payer_id(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1new(JNIEnv *env, jclass clz, int8_tArray script_arg) { - LDKCVec_u8Z script_arg_ref; - script_arg_ref.datalen = (*env)->GetArrayLength(env, script_arg); - script_arg_ref.data = MALLOC(script_arg_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, script_arg, 0, script_arg_ref.datalen, script_arg_ref.data); - LDKInvalidShutdownScript ret_var = InvalidShutdownScript_new(script_arg_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1get_1quantity(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInvoiceRequestFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = InvoiceRequestFields_get_quantity(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1set_1quantity(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKInvoiceRequestFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + InvoiceRequestFields_set_quantity(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1get_1payer_1note_1truncated(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInvoiceRequestFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKUntrustedString ret_var = InvoiceRequestFields_get_payer_note_truncated(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t InvalidShutdownScript_clone_ptr(LDKInvalidShutdownScript *NONNULL_PTR arg) { - LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(arg); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1set_1payer_1note_1truncated(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKInvoiceRequestFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKUntrustedString val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = UntrustedString_clone(&val_conv); + InvoiceRequestFields_set_payer_note_truncated(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1new(JNIEnv *env, jclass clz, int8_tArray payer_id_arg, int64_t quantity_arg, int64_t payer_note_truncated_arg) { + LDKPublicKey payer_id_arg_ref; + CHECK((*env)->GetArrayLength(env, payer_id_arg) == 33); + (*env)->GetByteArrayRegion(env, payer_id_arg, 0, 33, payer_id_arg_ref.compressed_form); + void* quantity_arg_ptr = untag_ptr(quantity_arg); + CHECK_ACCESS(quantity_arg_ptr); + LDKCOption_u64Z quantity_arg_conv = *(LDKCOption_u64Z*)(quantity_arg_ptr); + quantity_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(quantity_arg)); + LDKUntrustedString payer_note_truncated_arg_conv; + payer_note_truncated_arg_conv.inner = untag_ptr(payer_note_truncated_arg); + payer_note_truncated_arg_conv.is_owned = ptr_is_owned(payer_note_truncated_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payer_note_truncated_arg_conv); + payer_note_truncated_arg_conv = UntrustedString_clone(&payer_note_truncated_arg_conv); + LDKInvoiceRequestFields ret_var = InvoiceRequestFields_new(payer_id_arg_ref, quantity_arg_conv, payer_note_truncated_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKInvalidShutdownScript arg_conv; + +static inline uint64_t InvoiceRequestFields_clone_ptr(LDKInvoiceRequestFields *NONNULL_PTR arg) { + LDKInvoiceRequestFields ret_var = InvoiceRequestFields_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInvoiceRequestFields arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = InvalidShutdownScript_clone_ptr(&arg_conv); + int64_t ret_conv = InvoiceRequestFields_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKInvalidShutdownScript orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKInvoiceRequestFields orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(&orig_conv); + LDKInvoiceRequestFields ret_var = InvoiceRequestFields_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKShutdownScript obj_conv; - obj_conv.inner = untag_ptr(obj); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKInvoiceRequestFields a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKInvoiceRequestFields b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = InvoiceRequestFields_eq(&a_conv, &b_conv); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKInvoiceRequestFields obj_conv; + obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ShutdownScript_write(&obj_conv); + LDKCVec_u8Z ret_var = InvoiceRequestFields_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1read(JNIEnv *env, jclass clz, int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); - *ret_conv = ShutdownScript_read(ser_ref); + LDKCResult_InvoiceRequestFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestFieldsDecodeErrorZ), "LDKCResult_InvoiceRequestFieldsDecodeErrorZ"); + *ret_conv = InvoiceRequestFields_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1p2wpkh(JNIEnv *env, jclass clz, int8_tArray pubkey_hash) { - uint8_t pubkey_hash_arr[20]; - CHECK((*env)->GetArrayLength(env, pubkey_hash) == 20); - (*env)->GetByteArrayRegion(env, pubkey_hash, 0, 20, pubkey_hash_arr); - uint8_t (*pubkey_hash_ref)[20] = &pubkey_hash_arr; - LDKShutdownScript ret_var = ShutdownScript_new_p2wpkh(pubkey_hash_ref); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TaggedHash_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKTaggedHash this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + TaggedHash_free(this_obj_conv); +} + +static inline uint64_t TaggedHash_clone_ptr(LDKTaggedHash *NONNULL_PTR arg) { + LDKTaggedHash ret_var = TaggedHash_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TaggedHash_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKTaggedHash arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = TaggedHash_clone_ptr(&arg_conv); + return ret_conv; +} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1p2wsh(JNIEnv *env, jclass clz, int8_tArray script_hash) { - uint8_t script_hash_arr[32]; - CHECK((*env)->GetArrayLength(env, script_hash) == 32); - (*env)->GetByteArrayRegion(env, script_hash, 0, 32, script_hash_arr); - uint8_t (*script_hash_ref)[32] = &script_hash_arr; - LDKShutdownScript ret_var = ShutdownScript_new_p2wsh(script_hash_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TaggedHash_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKTaggedHash orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKTaggedHash ret_var = TaggedHash_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1witness_1program(JNIEnv *env, jclass clz, int64_t witness_program) { - void* witness_program_ptr = untag_ptr(witness_program); - CHECK_ACCESS(witness_program_ptr); - LDKWitnessProgram witness_program_conv = *(LDKWitnessProgram*)(witness_program_ptr); - witness_program_conv = WitnessProgram_clone((LDKWitnessProgram*)untag_ptr(witness_program)); - LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); - *ret_conv = ShutdownScript_new_witness_program(witness_program_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1into_1inner(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKShutdownScript this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TaggedHash_1as_1digest(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKTaggedHash this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = ShutdownScript_clone(&this_arg_conv); - LDKCVec_u8Z ret_var = ShutdownScript_into_inner(this_arg_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *TaggedHash_as_digest(&this_arg_conv)); return ret_arr; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1as_1legacy_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKShutdownScript this_arg_conv; +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_TaggedHash_1tag(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKTaggedHash this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ShutdownScript_as_legacy_pubkey(&this_arg_conv).compressed_form); - return ret_arr; + LDKStr ret_str = TaggedHash_tag(&this_arg_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1is_1compatible(JNIEnv *env, jclass clz, int64_t this_arg, int64_t features) { - LDKShutdownScript this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TaggedHash_1merkle_1root(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKTaggedHash this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKInitFeatures features_conv; - features_conv.inner = untag_ptr(features); - features_conv.is_owned = ptr_is_owned(features); - CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); - features_conv.is_owned = false; - jboolean ret_conv = ShutdownScript_is_compatible(&this_arg_conv, &features_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, TaggedHash_merkle_root(&this_arg_conv).data); + return ret_arr; } -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1to_1str(JNIEnv *env, jclass clz, int64_t o) { - LDKShutdownScript o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = ShutdownScript_to_str(&o_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKSignError this_ptr_conv = *(LDKSignError*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + SignError_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelId_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelId this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelId_free(this_obj_conv); +static inline uint64_t SignError_clone_ptr(LDKSignError *NONNULL_PTR arg) { + LDKSignError *ret_copy = MALLOC(sizeof(LDKSignError), "LDKSignError"); + *ret_copy = SignError_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKSignError* arg_conv = (LDKSignError*)untag_ptr(arg); + int64_t ret_conv = SignError_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelId_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelId this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelId_get_a(&this_ptr_conv)); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignError_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKSignError* orig_conv = (LDKSignError*)untag_ptr(orig); + LDKSignError *ret_copy = MALLOC(sizeof(LDKSignError), "LDKSignError"); + *ret_copy = SignError_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelId_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKChannelId this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - ChannelId_set_a(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignError_1signing(JNIEnv *env, jclass clz) { + LDKSignError *ret_copy = MALLOC(sizeof(LDKSignError), "LDKSignError"); + *ret_copy = SignError_signing(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1new(JNIEnv *env, jclass clz, int8_tArray a_arg) { - LDKThirtyTwoBytes a_arg_ref; - CHECK((*env)->GetArrayLength(env, a_arg) == 32); - (*env)->GetByteArrayRegion(env, a_arg, 0, 32, a_arg_ref.data); - LDKChannelId ret_var = ChannelId_new(a_arg_ref); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignError_1verification(JNIEnv *env, jclass clz, jclass a) { + LDKSecp256k1Error a_conv = LDKSecp256k1Error_from_java(env, a); + LDKSignError *ret_copy = MALLOC(sizeof(LDKSignError), "LDKSignError"); + *ret_copy = SignError_verification(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline uint64_t ChannelId_clone_ptr(LDKChannelId *NONNULL_PTR arg) { - LDKChannelId ret_var = ChannelId_clone(arg); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Nonce_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKNonce this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Nonce_free(this_obj_conv); +} + +static inline uint64_t Nonce_clone_ptr(LDKNonce *NONNULL_PTR arg) { + LDKNonce ret_var = Nonce_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelId arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Nonce_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNonce arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = ChannelId_clone_ptr(&arg_conv); + int64_t ret_conv = Nonce_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelId orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Nonce_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKNonce orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKChannelId ret_var = ChannelId_clone(&orig_conv); + LDKNonce ret_var = Nonce_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelId_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKChannelId a_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Nonce_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKNonce a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKChannelId b_conv; + LDKNonce b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = ChannelId_eq(&a_conv, &b_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKChannelId o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = ChannelId_hash(&o_conv); + jboolean ret_conv = Nonce_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1v1_1from_1funding_1txid(JNIEnv *env, jclass clz, int8_tArray txid, int16_t output_index) { - uint8_t txid_arr[32]; - CHECK((*env)->GetArrayLength(env, txid) == 32); - (*env)->GetByteArrayRegion(env, txid, 0, 32, txid_arr); - uint8_t (*txid_ref)[32] = &txid_arr; - LDKChannelId ret_var = ChannelId_v1_from_funding_txid(txid_ref, output_index); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1v1_1from_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t outpoint) { - LDKOutPoint outpoint_conv; - outpoint_conv.inner = untag_ptr(outpoint); - outpoint_conv.is_owned = ptr_is_owned(outpoint); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv); - outpoint_conv = OutPoint_clone(&outpoint_conv); - LDKChannelId ret_var = ChannelId_v1_from_funding_outpoint(outpoint_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1temporary_1from_1entropy_1source(JNIEnv *env, jclass clz, int64_t entropy_source) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Nonce_1from_1entropy_1source(JNIEnv *env, jclass clz, int64_t entropy_source) { void* entropy_source_ptr = untag_ptr(entropy_source); - if (ptr_is_owned(entropy_source)) { CHECK_ACCESS(entropy_source_ptr); } - LDKEntropySource* entropy_source_conv = (LDKEntropySource*)entropy_source_ptr; - LDKChannelId ret_var = ChannelId_temporary_from_entropy_source(entropy_source_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1from_1bytes(JNIEnv *env, jclass clz, int8_tArray data) { - LDKThirtyTwoBytes data_ref; - CHECK((*env)->GetArrayLength(env, data) == 32); - (*env)->GetByteArrayRegion(env, data, 0, 32, data_ref.data); - LDKChannelId ret_var = ChannelId_from_bytes(data_ref); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1new_1zero(JNIEnv *env, jclass clz) { - LDKChannelId ret_var = ChannelId_new_zero(); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + LDKNonce ret_var = Nonce_from_entropy_source(entropy_source_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelId_1is_1zero(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelId this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Nonce_1as_1slice(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNonce this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelId_is_zero(&this_arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1v2_1from_1revocation_1basepoints(JNIEnv *env, jclass clz, int64_t ours, int64_t theirs) { - LDKRevocationBasepoint ours_conv; - ours_conv.inner = untag_ptr(ours); - ours_conv.is_owned = ptr_is_owned(ours); - CHECK_INNER_FIELD_ACCESS_OR_NULL(ours_conv); - ours_conv.is_owned = false; - LDKRevocationBasepoint theirs_conv; - theirs_conv.inner = untag_ptr(theirs); - theirs_conv.is_owned = ptr_is_owned(theirs); - CHECK_INNER_FIELD_ACCESS_OR_NULL(theirs_conv); - theirs_conv.is_owned = false; - LDKChannelId ret_var = ChannelId_v2_from_revocation_basepoints(&ours_conv, &theirs_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1temporary_1v2_1from_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t our_revocation_basepoint) { - LDKRevocationBasepoint our_revocation_basepoint_conv; - our_revocation_basepoint_conv.inner = untag_ptr(our_revocation_basepoint); - our_revocation_basepoint_conv.is_owned = ptr_is_owned(our_revocation_basepoint); - CHECK_INNER_FIELD_ACCESS_OR_NULL(our_revocation_basepoint_conv); - our_revocation_basepoint_conv.is_owned = false; - LDKChannelId ret_var = ChannelId_temporary_v2_from_revocation_basepoint(&our_revocation_basepoint_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + LDKu8slice ret_var = Nonce_as_slice(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + return ret_arr; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelId_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelId obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Nonce_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKNonce obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ChannelId_write(&obj_conv); + LDKCVec_u8Z ret_var = Nonce_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Nonce_1read(JNIEnv *env, jclass clz, int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_ChannelIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdDecodeErrorZ), "LDKCResult_ChannelIdDecodeErrorZ"); - *ret_conv = ChannelId_read(ser_ref); + LDKCResult_NonceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonceDecodeErrorZ), "LDKCResult_NonceDecodeErrorZ"); + *ret_conv = Nonce_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ChannelId_1to_1str(JNIEnv *env, jclass clz, int64_t o) { - LDKChannelId o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = ChannelId_to_str(&o_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Retry_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKRetry this_ptr_conv = *(LDKRetry*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Retry_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12ParseError_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBolt12ParseError this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Bolt12ParseError_free(this_obj_conv); } -static inline uint64_t Retry_clone_ptr(LDKRetry *NONNULL_PTR arg) { - LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); - *ret_copy = Retry_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); +static inline uint64_t Bolt12ParseError_clone_ptr(LDKBolt12ParseError *NONNULL_PTR arg) { + LDKBolt12ParseError ret_var = Bolt12ParseError_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKRetry* arg_conv = (LDKRetry*)untag_ptr(arg); - int64_t ret_conv = Retry_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12ParseError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBolt12ParseError arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = Bolt12ParseError_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKRetry* orig_conv = (LDKRetry*)untag_ptr(orig); - LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); - *ret_copy = Retry_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12ParseError_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBolt12ParseError orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKBolt12ParseError ret_var = Bolt12ParseError_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1attempts(JNIEnv *env, jclass clz, int32_t a) { - LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); - *ret_copy = Retry_attempts(a); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBolt12SemanticError* orig_conv = (LDKBolt12SemanticError*)untag_ptr(orig); + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_clone(orig_conv)); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1timeout(JNIEnv *env, jclass clz, int64_t a) { - LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); - *ret_copy = Retry_timeout(a); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1already_1expired(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_already_expired()); + return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Retry_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKRetry* a_conv = (LDKRetry*)untag_ptr(a); - LDKRetry* b_conv = (LDKRetry*)untag_ptr(b); - jboolean ret_conv = Retry_eq(a_conv, b_conv); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unsupported_1chain(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unsupported_chain()); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKRetry* o_conv = (LDKRetry*)untag_ptr(o); - int64_t ret_conv = Retry_hash(o_conv); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1chain(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unexpected_chain()); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Retry_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKRetry* obj_conv = (LDKRetry*)untag_ptr(obj); - LDKCVec_u8Z ret_var = Retry_write(obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1amount(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_amount()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_RetryDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RetryDecodeErrorZ), "LDKCResult_RetryDecodeErrorZ"); - *ret_conv = Retry_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1invalid_1amount(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_invalid_amount()); + return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKRetryableSendFailure* orig_conv = (LDKRetryableSendFailure*)untag_ptr(orig); - jclass ret_conv = LDKRetryableSendFailure_to_java(env, RetryableSendFailure_clone(orig_conv)); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1insufficient_1amount(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_insufficient_amount()); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1payment_1expired(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKRetryableSendFailure_to_java(env, RetryableSendFailure_payment_expired()); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1amount(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unexpected_amount()); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1route_1not_1found(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKRetryableSendFailure_to_java(env, RetryableSendFailure_route_not_found()); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unsupported_1currency(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unsupported_currency()); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1duplicate_1payment(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKRetryableSendFailure_to_java(env, RetryableSendFailure_duplicate_payment()); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unknown_1required_1features(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unknown_required_features()); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKRetryableSendFailure* a_conv = (LDKRetryableSendFailure*)untag_ptr(a); - LDKRetryableSendFailure* b_conv = (LDKRetryableSendFailure*)untag_ptr(b); - jboolean ret_conv = RetryableSendFailure_eq(a_conv, b_conv); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1features(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unexpected_features()); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - PaymentSendFailure_free(this_ptr_conv); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1description(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_description()); + return ret_conv; } -static inline uint64_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg) { - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = PaymentSendFailure_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1signing_1pubkey(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_signing_pubkey()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKPaymentSendFailure* arg_conv = (LDKPaymentSendFailure*)untag_ptr(arg); - int64_t ret_conv = PaymentSendFailure_clone_ptr(arg_conv); + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1invalid_1signing_1pubkey(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_invalid_signing_pubkey()); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPaymentSendFailure* orig_conv = (LDKPaymentSendFailure*)untag_ptr(orig); - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = PaymentSendFailure_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1signing_1pubkey(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unexpected_signing_pubkey()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1parameter_1error(JNIEnv *env, jclass clz, int64_t a) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKAPIError a_conv = *(LDKAPIError*)(a_ptr); - a_conv = APIError_clone((LDKAPIError*)untag_ptr(a)); - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = PaymentSendFailure_parameter_error(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1quantity(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_quantity()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1path_1parameter_1error(JNIEnv *env, jclass clz, int64_tArray a) { - LDKCVec_CResult_NoneAPIErrorZZ a_constr; - a_constr.datalen = (*env)->GetArrayLength(env, a); - if (a_constr.datalen > 0) - a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements"); - else - a_constr.data = NULL; - int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL); - for (size_t w = 0; w < a_constr.datalen; w++) { - int64_t a_conv_22 = a_vals[w]; - void* a_conv_22_ptr = untag_ptr(a_conv_22); - CHECK_ACCESS(a_conv_22_ptr); - LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(a_conv_22_ptr); - a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)untag_ptr(a_conv_22)); - a_constr.data[w] = a_conv_22_conv; - } - (*env)->ReleaseLongArrayElements(env, a, a_vals, 0); - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = PaymentSendFailure_path_parameter_error(a_constr); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1invalid_1quantity(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_invalid_quantity()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1all_1failed_1resend_1safe(JNIEnv *env, jclass clz, int64_tArray a) { - LDKCVec_APIErrorZ a_constr; - a_constr.datalen = (*env)->GetArrayLength(env, a); - if (a_constr.datalen > 0) - a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements"); - else - a_constr.data = NULL; - int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL); - for (size_t k = 0; k < a_constr.datalen; k++) { - int64_t a_conv_10 = a_vals[k]; - void* a_conv_10_ptr = untag_ptr(a_conv_10); - CHECK_ACCESS(a_conv_10_ptr); - LDKAPIError a_conv_10_conv = *(LDKAPIError*)(a_conv_10_ptr); - a_conv_10_conv = APIError_clone((LDKAPIError*)untag_ptr(a_conv_10)); - a_constr.data[k] = a_conv_10_conv; - } - (*env)->ReleaseLongArrayElements(env, a, a_vals, 0); - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = PaymentSendFailure_all_failed_resend_safe(a_constr); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1duplicate_1payment(JNIEnv *env, jclass clz) { - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = PaymentSendFailure_duplicate_payment(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1quantity(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unexpected_quantity()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1partial_1failure(JNIEnv *env, jclass clz, int64_tArray results, int64_t failed_paths_retry, int8_tArray payment_id) { - LDKCVec_CResult_NoneAPIErrorZZ results_constr; - results_constr.datalen = (*env)->GetArrayLength(env, results); - if (results_constr.datalen > 0) - results_constr.data = MALLOC(results_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements"); - else - results_constr.data = NULL; - int64_t* results_vals = (*env)->GetLongArrayElements (env, results, NULL); - for (size_t w = 0; w < results_constr.datalen; w++) { - int64_t results_conv_22 = results_vals[w]; - void* results_conv_22_ptr = untag_ptr(results_conv_22); - CHECK_ACCESS(results_conv_22_ptr); - LDKCResult_NoneAPIErrorZ results_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(results_conv_22_ptr); - results_constr.data[w] = results_conv_22_conv; - } - (*env)->ReleaseLongArrayElements(env, results, results_vals, 0); - LDKRouteParameters failed_paths_retry_conv; - failed_paths_retry_conv.inner = untag_ptr(failed_paths_retry); - failed_paths_retry_conv.is_owned = ptr_is_owned(failed_paths_retry); - CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_conv); - failed_paths_retry_conv = RouteParameters_clone(&failed_paths_retry_conv); - LDKThirtyTwoBytes payment_id_ref; - CHECK((*env)->GetArrayLength(env, payment_id) == 32); - (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = PaymentSendFailure_partial_failure(results_constr, failed_paths_retry_conv, payment_id_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1invalid_1metadata(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_invalid_metadata()); + return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKPaymentSendFailure* a_conv = (LDKPaymentSendFailure*)untag_ptr(a); - LDKPaymentSendFailure* b_conv = (LDKPaymentSendFailure*)untag_ptr(b); - jboolean ret_conv = PaymentSendFailure_eq(a_conv, b_conv); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1metadata(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unexpected_metadata()); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKProbeSendFailure this_ptr_conv = *(LDKProbeSendFailure*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - ProbeSendFailure_free(this_ptr_conv); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1payer_1metadata(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_payer_metadata()); + return ret_conv; } -static inline uint64_t ProbeSendFailure_clone_ptr(LDKProbeSendFailure *NONNULL_PTR arg) { - LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); - *ret_copy = ProbeSendFailure_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKProbeSendFailure* arg_conv = (LDKProbeSendFailure*)untag_ptr(arg); - int64_t ret_conv = ProbeSendFailure_clone_ptr(arg_conv); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1payer_1id(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_payer_id()); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKProbeSendFailure* orig_conv = (LDKProbeSendFailure*)untag_ptr(orig); - LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); - *ret_copy = ProbeSendFailure_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1duplicate_1payment_1id(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_duplicate_payment_id()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1route_1not_1found(JNIEnv *env, jclass clz) { - LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); - *ret_copy = ProbeSendFailure_route_not_found(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1paths(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_paths()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1sending_1failed(JNIEnv *env, jclass clz, int64_t a) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKPaymentSendFailure a_conv = *(LDKPaymentSendFailure*)(a_ptr); - a_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(a)); - LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); - *ret_copy = ProbeSendFailure_sending_failed(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1paths(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unexpected_paths()); + return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKProbeSendFailure* a_conv = (LDKProbeSendFailure*)untag_ptr(a); - LDKProbeSendFailure* b_conv = (LDKProbeSendFailure*)untag_ptr(b); - jboolean ret_conv = ProbeSendFailure_eq(a_conv, b_conv); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1invalid_1pay_1info(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_invalid_pay_info()); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKRecipientOnionFields this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - RecipientOnionFields_free(this_obj_conv); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1creation_1time(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_creation_time()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1get_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRecipientOnionFields this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); - *ret_copy = RecipientOnionFields_get_payment_secret(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1payment_1hash(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_payment_hash()); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1set_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKRecipientOnionFields this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_ThirtyTwoBytesZ val_conv = *(LDKCOption_ThirtyTwoBytesZ*)(val_ptr); - val_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(val)); - RecipientOnionFields_set_payment_secret(&this_ptr_conv, val_conv); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1payment_1hash(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unexpected_payment_hash()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1get_1payment_1metadata(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRecipientOnionFields this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = RecipientOnionFields_get_payment_metadata(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1signature(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_signature()); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1set_1payment_1metadata(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKRecipientOnionFields this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_CVec_u8ZZ val_conv = *(LDKCOption_CVec_u8ZZ*)(val_ptr); - val_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(val)); - RecipientOnionFields_set_payment_metadata(&this_ptr_conv, val_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKRefundMaybeWithDerivedMetadataBuilder this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + RefundMaybeWithDerivedMetadataBuilder_free(this_obj_conv); } -static inline uint64_t RecipientOnionFields_clone_ptr(LDKRecipientOnionFields *NONNULL_PTR arg) { - LDKRecipientOnionFields ret_var = RecipientOnionFields_clone(arg); +static inline uint64_t RefundMaybeWithDerivedMetadataBuilder_clone_ptr(LDKRefundMaybeWithDerivedMetadataBuilder *NONNULL_PTR arg) { + LDKRefundMaybeWithDerivedMetadataBuilder ret_var = RefundMaybeWithDerivedMetadataBuilder_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKRecipientOnionFields arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRefundMaybeWithDerivedMetadataBuilder arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = RecipientOnionFields_clone_ptr(&arg_conv); + int64_t ret_conv = RefundMaybeWithDerivedMetadataBuilder_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKRecipientOnionFields orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKRefundMaybeWithDerivedMetadataBuilder orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKRecipientOnionFields ret_var = RecipientOnionFields_clone(&orig_conv); + LDKRefundMaybeWithDerivedMetadataBuilder ret_var = RefundMaybeWithDerivedMetadataBuilder_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKRecipientOnionFields a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKRecipientOnionFields b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = RecipientOnionFields_eq(&a_conv, &b_conv); - return ret_conv; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKRecipientOnionFields obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = RecipientOnionFields_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1new(JNIEnv *env, jclass clz, int8_tArray metadata, int8_tArray payer_id, int64_t amount_msats) { + LDKCVec_u8Z metadata_ref; + metadata_ref.datalen = (*env)->GetArrayLength(env, metadata); + metadata_ref.data = MALLOC(metadata_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, metadata, 0, metadata_ref.datalen, metadata_ref.data); + LDKPublicKey payer_id_ref; + CHECK((*env)->GetArrayLength(env, payer_id) == 33); + (*env)->GetByteArrayRegion(env, payer_id, 0, 33, payer_id_ref.compressed_form); + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ"); + *ret_conv = RefundMaybeWithDerivedMetadataBuilder_new(metadata_ref, payer_id_ref, amount_msats); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_RecipientOnionFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsDecodeErrorZ), "LDKCResult_RecipientOnionFieldsDecodeErrorZ"); - *ret_conv = RecipientOnionFields_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1deriving_1payer_1id(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t expanded_key, int64_t nonce, int64_t amount_msats, int8_tArray payment_id) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKExpandedKey expanded_key_conv; + expanded_key_conv.inner = untag_ptr(expanded_key); + expanded_key_conv.is_owned = ptr_is_owned(expanded_key); + CHECK_INNER_FIELD_ACCESS_OR_NULL(expanded_key_conv); + expanded_key_conv.is_owned = false; + LDKNonce nonce_conv; + nonce_conv.inner = untag_ptr(nonce); + nonce_conv.is_owned = ptr_is_owned(nonce); + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_conv); + nonce_conv = Nonce_clone(&nonce_conv); + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ"); + *ret_conv = RefundMaybeWithDerivedMetadataBuilder_deriving_payer_id(node_id_ref, &expanded_key_conv, nonce_conv, amount_msats, payment_id_ref); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1secret_1only(JNIEnv *env, jclass clz, int8_tArray payment_secret) { - LDKThirtyTwoBytes payment_secret_ref; - CHECK((*env)->GetArrayLength(env, payment_secret) == 32); - (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data); - LDKRecipientOnionFields ret_var = RecipientOnionFields_secret_only(payment_secret_ref); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1description(JNIEnv *env, jclass clz, int64_t this_arg, jstring description) { + LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKStr description_conv = java_to_owned_str(env, description); + RefundMaybeWithDerivedMetadataBuilder_description(this_arg_conv, description_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1spontaneous_1empty(JNIEnv *env, jclass clz) { - LDKRecipientOnionFields ret_var = RecipientOnionFields_spontaneous_empty(); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg, int64_t absolute_expiry) { + LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); + RefundMaybeWithDerivedMetadataBuilder_absolute_expiry(this_arg_conv, absolute_expiry); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1with_1custom_1tlvs(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray custom_tlvs) { - LDKRecipientOnionFields this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1issuer(JNIEnv *env, jclass clz, int64_t this_arg, jstring issuer) { + LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = RecipientOnionFields_clone(&this_arg_conv); - LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs_constr; - custom_tlvs_constr.datalen = (*env)->GetArrayLength(env, custom_tlvs); - if (custom_tlvs_constr.datalen > 0) - custom_tlvs_constr.data = MALLOC(custom_tlvs_constr.datalen * sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKCVec_C2Tuple_u64CVec_u8ZZZ Elements"); - else - custom_tlvs_constr.data = NULL; - int64_t* custom_tlvs_vals = (*env)->GetLongArrayElements (env, custom_tlvs, NULL); - for (size_t x = 0; x < custom_tlvs_constr.datalen; x++) { - int64_t custom_tlvs_conv_23 = custom_tlvs_vals[x]; - void* custom_tlvs_conv_23_ptr = untag_ptr(custom_tlvs_conv_23); - CHECK_ACCESS(custom_tlvs_conv_23_ptr); - LDKC2Tuple_u64CVec_u8ZZ custom_tlvs_conv_23_conv = *(LDKC2Tuple_u64CVec_u8ZZ*)(custom_tlvs_conv_23_ptr); - custom_tlvs_conv_23_conv = C2Tuple_u64CVec_u8ZZ_clone((LDKC2Tuple_u64CVec_u8ZZ*)untag_ptr(custom_tlvs_conv_23)); - custom_tlvs_constr.data[x] = custom_tlvs_conv_23_conv; - } - (*env)->ReleaseLongArrayElements(env, custom_tlvs, custom_tlvs_vals, 0); - LDKCResult_RecipientOnionFieldsNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsNoneZ), "LDKCResult_RecipientOnionFieldsNoneZ"); - *ret_conv = RecipientOnionFields_with_custom_tlvs(this_arg_conv, custom_tlvs_constr); - return tag_ptr(ret_conv, true); + this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKStr issuer_conv = java_to_owned_str(env, issuer); + RefundMaybeWithDerivedMetadataBuilder_issuer(this_arg_conv, issuer_conv); } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1custom_1tlvs(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKRecipientOnionFields this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1path(JNIEnv *env, jclass clz, int64_t this_arg, int64_t path) { + LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_C2Tuple_u64CVec_u8ZZZ ret_var = RecipientOnionFields_custom_tlvs(&this_arg_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t x = 0; x < ret_var.datalen; x++) { - LDKC2Tuple_u64CVec_u8ZZ* ret_conv_23_conv = MALLOC(sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKC2Tuple_u64CVec_u8ZZ"); - *ret_conv_23_conv = ret_var.data[x]; - ret_arr_ptr[x] = tag_ptr(ret_conv_23_conv, true); - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; + this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKBlindedMessagePath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv = BlindedMessagePath_clone(&path_conv); + RefundMaybeWithDerivedMetadataBuilder_path(this_arg_conv, path_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomMessageReader_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKCustomMessageReader this_ptr_conv = *(LDKCustomMessageReader*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - CustomMessageReader_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1chain(JNIEnv *env, jclass clz, int64_t this_arg, jclass network) { + LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKNetwork network_conv = LDKNetwork_from_java(env, network); + RefundMaybeWithDerivedMetadataBuilder_chain(this_arg_conv, network_conv); } -static inline uint64_t Type_clone_ptr(LDKType *NONNULL_PTR arg) { - LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType"); - *ret_ret = Type_clone(arg); - return tag_ptr(ret_ret, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Type_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - void* arg_ptr = untag_ptr(arg); - if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); } - LDKType* arg_conv = (LDKType*)arg_ptr; - int64_t ret_conv = Type_clone_ptr(arg_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1quantity(JNIEnv *env, jclass clz, int64_t this_arg, int64_t quantity) { + LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); + RefundMaybeWithDerivedMetadataBuilder_quantity(this_arg_conv, quantity); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Type_1clone(JNIEnv *env, jclass clz, int64_t orig) { - void* orig_ptr = untag_ptr(orig); - if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); } - LDKType* orig_conv = (LDKType*)orig_ptr; - LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType"); - *ret_ret = Type_clone(orig_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg, jstring payer_note) { + LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKStr payer_note_conv = java_to_owned_str(env, payer_note); + RefundMaybeWithDerivedMetadataBuilder_payer_note(this_arg_conv, payer_note_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Type_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKType this_ptr_conv = *(LDKType*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Type_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1build(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKCResult_RefundBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundBolt12SemanticErrorZ), "LDKCResult_RefundBolt12SemanticErrorZ"); + *ret_conv = RefundMaybeWithDerivedMetadataBuilder_build(this_arg_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferId_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKOfferId this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Refund_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKRefund this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - OfferId_free(this_obj_conv); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OfferId_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOfferId this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OfferId_get_a(&this_ptr_conv)); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferId_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKOfferId this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - OfferId_set_a(&this_ptr_conv, val_ref); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferId_1new(JNIEnv *env, jclass clz, int8_tArray a_arg) { - LDKThirtyTwoBytes a_arg_ref; - CHECK((*env)->GetArrayLength(env, a_arg) == 32); - (*env)->GetByteArrayRegion(env, a_arg, 0, 32, a_arg_ref.data); - LDKOfferId ret_var = OfferId_new(a_arg_ref); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + Refund_free(this_obj_conv); } -static inline uint64_t OfferId_clone_ptr(LDKOfferId *NONNULL_PTR arg) { - LDKOfferId ret_var = OfferId_clone(arg); +static inline uint64_t Refund_clone_ptr(LDKRefund *NONNULL_PTR arg) { + LDKRefund ret_var = Refund_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferId_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKOfferId arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRefund arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = OfferId_clone_ptr(&arg_conv); + int64_t ret_conv = Refund_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferId_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKOfferId orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKRefund orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKOfferId ret_var = OfferId_clone(&orig_conv); + LDKRefund ret_var = Refund_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferId_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKOfferId a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKOfferId b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = OfferId_eq(&a_conv, &b_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1description(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKRefund this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKPrintableString ret_var = Refund_description(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OfferId_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKOfferId obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = OfferId_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKRefund this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = Refund_absolute_expiry(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferId_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_OfferIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferIdDecodeErrorZ), "LDKCResult_OfferIdDecodeErrorZ"); - *ret_conv = OfferId_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKOfferWithExplicitMetadataBuilder this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - OfferWithExplicitMetadataBuilder_free(this_obj_conv); -} - -static inline uint64_t OfferWithExplicitMetadataBuilder_clone_ptr(LDKOfferWithExplicitMetadataBuilder *NONNULL_PTR arg) { - LDKOfferWithExplicitMetadataBuilder ret_var = OfferWithExplicitMetadataBuilder_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKOfferWithExplicitMetadataBuilder arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = OfferWithExplicitMetadataBuilder_clone_ptr(&arg_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Refund_1is_1expired(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKRefund this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Refund_is_expired(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKOfferWithExplicitMetadataBuilder orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKOfferWithExplicitMetadataBuilder ret_var = OfferWithExplicitMetadataBuilder_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKOfferWithDerivedMetadataBuilder this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - OfferWithDerivedMetadataBuilder_free(this_obj_conv); -} - -static inline uint64_t OfferWithDerivedMetadataBuilder_clone_ptr(LDKOfferWithDerivedMetadataBuilder *NONNULL_PTR arg) { - LDKOfferWithDerivedMetadataBuilder ret_var = OfferWithDerivedMetadataBuilder_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKOfferWithDerivedMetadataBuilder arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = OfferWithDerivedMetadataBuilder_clone_ptr(&arg_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Refund_1is_1expired_1no_1std(JNIEnv *env, jclass clz, int64_t this_arg, int64_t duration_since_epoch) { + LDKRefund this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Refund_is_expired_no_std(&this_arg_conv, duration_since_epoch); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKOfferWithDerivedMetadataBuilder orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKOfferWithDerivedMetadataBuilder ret_var = OfferWithDerivedMetadataBuilder_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1new(JNIEnv *env, jclass clz, int8_tArray signing_pubkey) { - LDKPublicKey signing_pubkey_ref; - CHECK((*env)->GetArrayLength(env, signing_pubkey) == 33); - (*env)->GetByteArrayRegion(env, signing_pubkey, 0, 33, signing_pubkey_ref.compressed_form); - LDKOfferWithExplicitMetadataBuilder ret_var = OfferWithExplicitMetadataBuilder_new(signing_pubkey_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1issuer(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKRefund this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKPrintableString ret_var = Refund_issuer(&this_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1metadata(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray metadata) { - LDKOfferWithExplicitMetadataBuilder this_arg_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Refund_1paths(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKRefund this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); - LDKCVec_u8Z metadata_ref; - metadata_ref.datalen = (*env)->GetArrayLength(env, metadata); - metadata_ref.data = MALLOC(metadata_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, metadata, 0, metadata_ref.datalen, metadata_ref.data); - LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); - *ret_conv = OfferWithExplicitMetadataBuilder_metadata(this_arg_conv, metadata_ref); - return tag_ptr(ret_conv, true); + this_arg_conv.is_owned = false; + LDKCVec_BlindedMessagePathZ ret_var = Refund_paths(&this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t u = 0; u < ret_var.datalen; u++) { + LDKBlindedMessagePath ret_conv_20_var = ret_var.data[u]; + int64_t ret_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_20_var); + ret_conv_20_ref = tag_ptr(ret_conv_20_var.inner, ret_conv_20_var.is_owned); + ret_arr_ptr[u] = ret_conv_20_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1chain(JNIEnv *env, jclass clz, int64_t this_arg, jclass network) { - LDKOfferWithExplicitMetadataBuilder this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Refund_1payer_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKRefund this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); - LDKNetwork network_conv = LDKNetwork_from_java(env, network); - OfferWithExplicitMetadataBuilder_chain(this_arg_conv, network_conv); + this_arg_conv.is_owned = false; + LDKu8slice ret_var = Refund_payer_metadata(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg, int64_t amount_msats) { - LDKOfferWithExplicitMetadataBuilder this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Refund_1chain(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKRefund this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); - OfferWithExplicitMetadataBuilder_amount_msats(this_arg_conv, amount_msats); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, Refund_chain(&this_arg_conv).data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg, int64_t absolute_expiry) { - LDKOfferWithExplicitMetadataBuilder this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKRefund this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); - OfferWithExplicitMetadataBuilder_absolute_expiry(this_arg_conv, absolute_expiry); + this_arg_conv.is_owned = false; + int64_t ret_conv = Refund_amount_msats(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1description(JNIEnv *env, jclass clz, int64_t this_arg, jstring description) { - LDKOfferWithExplicitMetadataBuilder this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1features(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKRefund this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); - LDKStr description_conv = java_to_owned_str(env, description); - OfferWithExplicitMetadataBuilder_description(this_arg_conv, description_conv); + this_arg_conv.is_owned = false; + LDKInvoiceRequestFeatures ret_var = Refund_features(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1issuer(JNIEnv *env, jclass clz, int64_t this_arg, jstring issuer) { - LDKOfferWithExplicitMetadataBuilder this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKRefund this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); - LDKStr issuer_conv = java_to_owned_str(env, issuer); - OfferWithExplicitMetadataBuilder_issuer(this_arg_conv, issuer_conv); + this_arg_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = Refund_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1path(JNIEnv *env, jclass clz, int64_t this_arg, int64_t path) { - LDKOfferWithExplicitMetadataBuilder this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Refund_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKRefund this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); - LDKBlindedPath path_conv; - path_conv.inner = untag_ptr(path); - path_conv.is_owned = ptr_is_owned(path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); - path_conv = BlindedPath_clone(&path_conv); - OfferWithExplicitMetadataBuilder_path(this_arg_conv, path_conv); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Refund_payer_id(&this_arg_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1supported_1quantity(JNIEnv *env, jclass clz, int64_t this_arg, int64_t quantity) { - LDKOfferWithExplicitMetadataBuilder this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKRefund this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); - void* quantity_ptr = untag_ptr(quantity); - CHECK_ACCESS(quantity_ptr); - LDKQuantity quantity_conv = *(LDKQuantity*)(quantity_ptr); - quantity_conv = Quantity_clone((LDKQuantity*)untag_ptr(quantity)); - OfferWithExplicitMetadataBuilder_supported_quantity(this_arg_conv, quantity_conv); + this_arg_conv.is_owned = false; + LDKPrintableString ret_var = Refund_payer_note(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1build(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOfferWithExplicitMetadataBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); - LDKCResult_OfferBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferBolt12SemanticErrorZ), "LDKCResult_OfferBolt12SemanticErrorZ"); - *ret_conv = OfferWithExplicitMetadataBuilder_build(this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKRefund o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = Refund_hash(&o_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_RefundDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundDecodeErrorZ), "LDKCResult_RefundDecodeErrorZ"); + *ret_conv = Refund_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1deriving_1signing_1pubkey(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t expanded_key, int64_t entropy_source) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKExpandedKey expanded_key_conv; - expanded_key_conv.inner = untag_ptr(expanded_key); - expanded_key_conv.is_owned = ptr_is_owned(expanded_key); - CHECK_INNER_FIELD_ACCESS_OR_NULL(expanded_key_conv); - expanded_key_conv.is_owned = false; - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - LDKOfferWithDerivedMetadataBuilder ret_var = OfferWithDerivedMetadataBuilder_deriving_signing_pubkey(node_id_ref, &expanded_key_conv, entropy_source_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Refund_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKRefund obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = Refund_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1chain(JNIEnv *env, jclass clz, int64_t this_arg, jclass network) { - LDKOfferWithDerivedMetadataBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); - LDKNetwork network_conv = LDKNetwork_from_java(env, network); - OfferWithDerivedMetadataBuilder_chain(this_arg_conv, network_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1from_1str(JNIEnv *env, jclass clz, jstring s) { + LDKStr s_conv = java_to_owned_str(env, s); + LDKCResult_RefundBolt12ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundBolt12ParseErrorZ), "LDKCResult_RefundBolt12ParseErrorZ"); + *ret_conv = Refund_from_str(s_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg, int64_t amount_msats) { - LDKOfferWithDerivedMetadataBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); - OfferWithDerivedMetadataBuilder_amount_msats(this_arg_conv, amount_msats); +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Refund_1to_1str(JNIEnv *env, jclass clz, int64_t o) { + LDKRefund o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = Refund_to_str(&o_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg, int64_t absolute_expiry) { - LDKOfferWithDerivedMetadataBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); - OfferWithDerivedMetadataBuilder_absolute_expiry(this_arg_conv, absolute_expiry); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_UtxoLookupError_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKUtxoLookupError* orig_conv = (LDKUtxoLookupError*)untag_ptr(orig); + jclass ret_conv = LDKUtxoLookupError_to_java(env, UtxoLookupError_clone(orig_conv)); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1description(JNIEnv *env, jclass clz, int64_t this_arg, jstring description) { - LDKOfferWithDerivedMetadataBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); - LDKStr description_conv = java_to_owned_str(env, description); - OfferWithDerivedMetadataBuilder_description(this_arg_conv, description_conv); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_UtxoLookupError_1unknown_1chain(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKUtxoLookupError_to_java(env, UtxoLookupError_unknown_chain()); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1issuer(JNIEnv *env, jclass clz, int64_t this_arg, jstring issuer) { - LDKOfferWithDerivedMetadataBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); - LDKStr issuer_conv = java_to_owned_str(env, issuer); - OfferWithDerivedMetadataBuilder_issuer(this_arg_conv, issuer_conv); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_UtxoLookupError_1unknown_1tx(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKUtxoLookupError_to_java(env, UtxoLookupError_unknown_tx()); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1path(JNIEnv *env, jclass clz, int64_t this_arg, int64_t path) { - LDKOfferWithDerivedMetadataBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); - LDKBlindedPath path_conv; - path_conv.inner = untag_ptr(path); - path_conv.is_owned = ptr_is_owned(path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); - path_conv = BlindedPath_clone(&path_conv); - OfferWithDerivedMetadataBuilder_path(this_arg_conv, path_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoResult_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKUtxoResult this_ptr_conv = *(LDKUtxoResult*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + UtxoResult_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1supported_1quantity(JNIEnv *env, jclass clz, int64_t this_arg, int64_t quantity) { - LDKOfferWithDerivedMetadataBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); - void* quantity_ptr = untag_ptr(quantity); - CHECK_ACCESS(quantity_ptr); - LDKQuantity quantity_conv = *(LDKQuantity*)(quantity_ptr); - quantity_conv = Quantity_clone((LDKQuantity*)untag_ptr(quantity)); - OfferWithDerivedMetadataBuilder_supported_quantity(this_arg_conv, quantity_conv); +static inline uint64_t UtxoResult_clone_ptr(LDKUtxoResult *NONNULL_PTR arg) { + LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult"); + *ret_copy = UtxoResult_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoResult_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUtxoResult* arg_conv = (LDKUtxoResult*)untag_ptr(arg); + int64_t ret_conv = UtxoResult_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1build(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOfferWithDerivedMetadataBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); - LDKCResult_OfferBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferBolt12SemanticErrorZ), "LDKCResult_OfferBolt12SemanticErrorZ"); - *ret_conv = OfferWithDerivedMetadataBuilder_build(this_arg_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoResult_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKUtxoResult* orig_conv = (LDKUtxoResult*)untag_ptr(orig); + LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult"); + *ret_copy = UtxoResult_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Offer_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKOffer this_obj_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoResult_1sync(JNIEnv *env, jclass clz, int64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKCResult_TxOutUtxoLookupErrorZ a_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(a_ptr); + a_conv = CResult_TxOutUtxoLookupErrorZ_clone((LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(a)); + LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult"); + *ret_copy = UtxoResult_sync(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoResult_1async(JNIEnv *env, jclass clz, int64_t a) { + LDKUtxoFuture a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = UtxoFuture_clone(&a_conv); + LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult"); + *ret_copy = UtxoResult_async(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoLookup_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKUtxoLookup this_ptr_conv = *(LDKUtxoLookup*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + UtxoLookup_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUtxoFuture this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Offer_free(this_obj_conv); + UtxoFuture_free(this_obj_conv); } -static inline uint64_t Offer_clone_ptr(LDKOffer *NONNULL_PTR arg) { - LDKOffer ret_var = Offer_clone(arg); +static inline uint64_t UtxoFuture_clone_ptr(LDKUtxoFuture *NONNULL_PTR arg) { + LDKUtxoFuture ret_var = UtxoFuture_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKOffer arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUtxoFuture arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Offer_clone_ptr(&arg_conv); + int64_t ret_conv = UtxoFuture_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKOffer orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKUtxoFuture orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKOffer ret_var = Offer_clone(&orig_conv); + LDKUtxoFuture ret_var = UtxoFuture_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_Offer_1chains(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOffer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_ThirtyTwoBytesZ ret_var = Offer_chains(&this_arg_conv); - jobjectArray ret_arr = NULL; - ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); - ; - for (size_t i = 0; i < ret_var.datalen; i++) { - int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 32, ret_var.data[i].data); - (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); - } - - FREE(ret_var.data); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1new(JNIEnv *env, jclass clz) { + LDKUtxoFuture ret_var = UtxoFuture_new(); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOffer this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1resolve_1without_1forwarding(JNIEnv *env, jclass clz, int64_t this_arg, int64_t graph, int64_t result) { + LDKUtxoFuture this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = Offer_metadata(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKNetworkGraph graph_conv; + graph_conv.inner = untag_ptr(graph); + graph_conv.is_owned = ptr_is_owned(graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(graph_conv); + graph_conv.is_owned = false; + void* result_ptr = untag_ptr(result); + CHECK_ACCESS(result_ptr); + LDKCResult_TxOutUtxoLookupErrorZ result_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(result_ptr); + result_conv = CResult_TxOutUtxoLookupErrorZ_clone((LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(result)); + UtxoFuture_resolve_without_forwarding(&this_arg_conv, &graph_conv, result_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1amount(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOffer this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1resolve(JNIEnv *env, jclass clz, int64_t this_arg, int64_t graph, int64_t gossip, int64_t result) { + LDKUtxoFuture this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); - *ret_copy = Offer_amount(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKNetworkGraph graph_conv; + graph_conv.inner = untag_ptr(graph); + graph_conv.is_owned = ptr_is_owned(graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(graph_conv); + graph_conv.is_owned = false; + LDKP2PGossipSync gossip_conv; + gossip_conv.inner = untag_ptr(gossip); + gossip_conv.is_owned = ptr_is_owned(gossip); + CHECK_INNER_FIELD_ACCESS_OR_NULL(gossip_conv); + gossip_conv.is_owned = false; + void* result_ptr = untag_ptr(result); + CHECK_ACCESS(result_ptr); + LDKCResult_TxOutUtxoLookupErrorZ result_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(result_ptr); + result_conv = CResult_TxOutUtxoLookupErrorZ_clone((LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(result)); + UtxoFuture_resolve(&this_arg_conv, &graph_conv, &gossip_conv, result_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1description(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOffer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = Offer_description(&this_arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeId_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKNodeId this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + NodeId_free(this_obj_conv); +} + +static inline uint64_t NodeId_clone_ptr(LDKNodeId *NONNULL_PTR arg) { + LDKNodeId ret_var = NodeId_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1offer_1features(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOffer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOfferFeatures ret_var = Offer_offer_features(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOffer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = Offer_absolute_expiry(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNodeId arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = NodeId_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1issuer(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOffer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = Offer_issuer(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKNodeId orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKNodeId ret_var = NodeId_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Offer_1paths(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOffer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_BlindedPathZ ret_var = Offer_paths(&this_arg_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t n = 0; n < ret_var.datalen; n++) { - LDKBlindedPath ret_conv_13_var = ret_var.data[n]; - int64_t ret_conv_13_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_13_var); - ret_conv_13_ref = tag_ptr(ret_conv_13_var.inner, ret_conv_13_var.is_owned); - ret_arr_ptr[n] = ret_conv_13_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1supported_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOffer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); - *ret_copy = Offer_supported_quantity(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Offer_1signing_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOffer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Offer_signing_pubkey(&this_arg_conv).compressed_form); - return ret_arr; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeId_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKNodeId a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKNodeId b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = NodeId_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOffer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOfferId ret_var = Offer_id(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1from_1pubkey(JNIEnv *env, jclass clz, int8_tArray pubkey) { + LDKPublicKey pubkey_ref; + CHECK((*env)->GetArrayLength(env, pubkey) == 33); + (*env)->GetByteArrayRegion(env, pubkey, 0, 33, pubkey_ref.compressed_form); + LDKNodeId ret_var = NodeId_from_pubkey(pubkey_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1supports_1chain(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray chain) { - LDKOffer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKThirtyTwoBytes chain_ref; - CHECK((*env)->GetArrayLength(env, chain) == 32); - (*env)->GetByteArrayRegion(env, chain, 0, 32, chain_ref.data); - jboolean ret_conv = Offer_supports_chain(&this_arg_conv, chain_ref); - return ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1is_1expired(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOffer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = Offer_is_expired(&this_arg_conv); - return ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1is_1expired_1no_1std(JNIEnv *env, jclass clz, int64_t this_arg, int64_t duration_since_epoch) { - LDKOffer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = Offer_is_expired_no_std(&this_arg_conv, duration_since_epoch); - return ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1is_1valid_1quantity(JNIEnv *env, jclass clz, int64_t this_arg, int64_t quantity) { - LDKOffer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = Offer_is_valid_quantity(&this_arg_conv, quantity); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1from_1slice(JNIEnv *env, jclass clz, int8_tArray bytes) { + LDKu8slice bytes_ref; + bytes_ref.datalen = (*env)->GetArrayLength(env, bytes); + bytes_ref.data = (*env)->GetByteArrayElements (env, bytes, NULL); + LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); + *ret_conv = NodeId_from_slice(bytes_ref); + (*env)->ReleaseByteArrayElements(env, bytes, (int8_t*)bytes_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1expects_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOffer this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeId_1as_1slice(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeId this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = Offer_expects_quantity(&this_arg_conv); - return ret_conv; + LDKu8slice ret_var = NodeId_as_slice(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1request_1invoice_1deriving_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg, int64_t expanded_key, int64_t entropy_source, int8_tArray payment_id) { - LDKOffer this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeId_1as_1array(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeId this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKExpandedKey expanded_key_conv; - expanded_key_conv.inner = untag_ptr(expanded_key); - expanded_key_conv.is_owned = ptr_is_owned(expanded_key); - CHECK_INNER_FIELD_ACCESS_OR_NULL(expanded_key_conv); - expanded_key_conv.is_owned = false; - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - LDKThirtyTwoBytes payment_id_ref; - CHECK((*env)->GetArrayLength(env, payment_id) == 32); - (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); - LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ"); - *ret_conv = Offer_request_invoice_deriving_payer_id(&this_arg_conv, &expanded_key_conv, entropy_source_conv, payment_id_ref); - return tag_ptr(ret_conv, true); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, *NodeId_as_array(&this_arg_conv)); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1request_1invoice_1deriving_1metadata(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payer_id, int64_t expanded_key, int64_t entropy_source, int8_tArray payment_id) { - LDKOffer this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1as_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeId this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKPublicKey payer_id_ref; - CHECK((*env)->GetArrayLength(env, payer_id) == 33); - (*env)->GetByteArrayRegion(env, payer_id, 0, 33, payer_id_ref.compressed_form); - LDKExpandedKey expanded_key_conv; - expanded_key_conv.inner = untag_ptr(expanded_key); - expanded_key_conv.is_owned = ptr_is_owned(expanded_key); - CHECK_INNER_FIELD_ACCESS_OR_NULL(expanded_key_conv); - expanded_key_conv.is_owned = false; - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - LDKThirtyTwoBytes payment_id_ref; - CHECK((*env)->GetArrayLength(env, payment_id) == 32); - (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); - LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ"); - *ret_conv = Offer_request_invoice_deriving_metadata(&this_arg_conv, payer_id_ref, &expanded_key_conv, entropy_source_conv, payment_id_ref); + LDKCResult_PublicKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecp256k1ErrorZ), "LDKCResult_PublicKeySecp256k1ErrorZ"); + *ret_conv = NodeId_as_pubkey(&this_arg_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1request_1invoice(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray metadata, int8_tArray payer_id) { - LDKOffer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_u8Z metadata_ref; - metadata_ref.datalen = (*env)->GetArrayLength(env, metadata); - metadata_ref.data = MALLOC(metadata_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, metadata, 0, metadata_ref.datalen, metadata_ref.data); - LDKPublicKey payer_id_ref; - CHECK((*env)->GetArrayLength(env, payer_id) == 33); - (*env)->GetByteArrayRegion(env, payer_id, 0, 33, payer_id_ref.compressed_form); - LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ"); - *ret_conv = Offer_request_invoice(&this_arg_conv, metadata_ref, payer_id_ref); - return tag_ptr(ret_conv, true); +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_NodeId_1to_1str(JNIEnv *env, jclass clz, int64_t o) { + LDKNodeId o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = NodeId_to_str(&o_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKOffer o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKNodeId o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv.is_owned = false; - int64_t ret_conv = Offer_hash(&o_conv); + int64_t ret_conv = NodeId_hash(&o_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Offer_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKOffer obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeId_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKNodeId obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = Offer_write(&obj_conv); + LDKCVec_u8Z ret_var = NodeId_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Amount_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKAmount this_ptr_conv = *(LDKAmount*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Amount_free(this_ptr_conv); -} - -static inline uint64_t Amount_clone_ptr(LDKAmount *NONNULL_PTR arg) { - LDKAmount *ret_copy = MALLOC(sizeof(LDKAmount), "LDKAmount"); - *ret_copy = Amount_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Amount_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKAmount* arg_conv = (LDKAmount*)untag_ptr(arg); - int64_t ret_conv = Amount_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Amount_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKAmount* orig_conv = (LDKAmount*)untag_ptr(orig); - LDKAmount *ret_copy = MALLOC(sizeof(LDKAmount), "LDKAmount"); - *ret_copy = Amount_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); + *ret_conv = NodeId_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Amount_1bitcoin(JNIEnv *env, jclass clz, int64_t amount_msats) { - LDKAmount *ret_copy = MALLOC(sizeof(LDKAmount), "LDKAmount"); - *ret_copy = Amount_bitcoin(amount_msats); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKNetworkGraph this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + NetworkGraph_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Amount_1currency(JNIEnv *env, jclass clz, int8_tArray iso4217_code, int64_t amount) { - LDKThreeBytes iso4217_code_ref; - CHECK((*env)->GetArrayLength(env, iso4217_code) == 3); - (*env)->GetByteArrayRegion(env, iso4217_code, 0, 3, iso4217_code_ref.data); - LDKAmount *ret_copy = MALLOC(sizeof(LDKAmount), "LDKAmount"); - *ret_copy = Amount_currency(iso4217_code_ref, amount); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKReadOnlyNetworkGraph this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ReadOnlyNetworkGraph_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Quantity_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); CHECK_ACCESS(this_ptr_ptr); - LDKQuantity this_ptr_conv = *(LDKQuantity*)(this_ptr_ptr); + LDKNetworkUpdate this_ptr_conv = *(LDKNetworkUpdate*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - Quantity_free(this_ptr_conv); + NetworkUpdate_free(this_ptr_conv); } -static inline uint64_t Quantity_clone_ptr(LDKQuantity *NONNULL_PTR arg) { - LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); - *ret_copy = Quantity_clone(arg); +static inline uint64_t NetworkUpdate_clone_ptr(LDKNetworkUpdate *NONNULL_PTR arg) { + LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); + *ret_copy = NetworkUpdate_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Quantity_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKQuantity* arg_conv = (LDKQuantity*)untag_ptr(arg); - int64_t ret_conv = Quantity_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNetworkUpdate* arg_conv = (LDKNetworkUpdate*)untag_ptr(arg); + int64_t ret_conv = NetworkUpdate_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Quantity_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKQuantity* orig_conv = (LDKQuantity*)untag_ptr(orig); - LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); - *ret_copy = Quantity_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKNetworkUpdate* orig_conv = (LDKNetworkUpdate*)untag_ptr(orig); + LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); + *ret_copy = NetworkUpdate_clone(orig_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Quantity_1bounded(JNIEnv *env, jclass clz, int64_t a) { - LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); - *ret_copy = Quantity_bounded(a); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1channel_1failure(JNIEnv *env, jclass clz, int64_t short_channel_id, jboolean is_permanent) { + LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); + *ret_copy = NetworkUpdate_channel_failure(short_channel_id, is_permanent); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Quantity_1unbounded(JNIEnv *env, jclass clz) { - LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); - *ret_copy = Quantity_unbounded(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1node_1failure(JNIEnv *env, jclass clz, int8_tArray node_id, jboolean is_permanent) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); + *ret_copy = NetworkUpdate_node_failure(node_id_ref, is_permanent); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Quantity_1one(JNIEnv *env, jclass clz) { - LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); - *ret_copy = Quantity_one(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKNetworkUpdate* a_conv = (LDKNetworkUpdate*)untag_ptr(a); + LDKNetworkUpdate* b_conv = (LDKNetworkUpdate*)untag_ptr(b); + jboolean ret_conv = NetworkUpdate_eq(a_conv, b_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1from_1str(JNIEnv *env, jclass clz, jstring s) { - LDKStr s_conv = java_to_owned_str(env, s); - LDKCResult_OfferBolt12ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferBolt12ParseErrorZ), "LDKCResult_OfferBolt12ParseErrorZ"); - *ret_conv = Offer_from_str(s_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKNetworkUpdate* obj_conv = (LDKNetworkUpdate*)untag_ptr(obj); + LDKCVec_u8Z ret_var = NetworkUpdate_write(obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Offer_1to_1str(JNIEnv *env, jclass clz, int64_t o) { - LDKOffer o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = Offer_to_str(&o_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = NetworkUpdate_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKInvoiceWithExplicitSigningPubkeyBuilder this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKP2PGossipSync this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InvoiceWithExplicitSigningPubkeyBuilder_free(this_obj_conv); + P2PGossipSync_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKInvoiceWithDerivedSigningPubkeyBuilder this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InvoiceWithDerivedSigningPubkeyBuilder_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1new(JNIEnv *env, jclass clz, int64_t network_graph, int64_t utxo_lookup, int64_t logger) { + LDKNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; + void* utxo_lookup_ptr = untag_ptr(utxo_lookup); + CHECK_ACCESS(utxo_lookup_ptr); + LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr); + // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ + if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) { + // Manually implement clone for Java trait instances + if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some); + } + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKP2PGossipSync ret_var = P2PGossipSync_new(&network_graph_conv, utxo_lookup_conv, logger_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1build(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1add_1utxo_1lookup(JNIEnv *env, jclass clz, int64_t this_arg, int64_t utxo_lookup) { + LDKP2PGossipSync this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder - - LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ), "LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ"); - *ret_conv = InvoiceWithExplicitSigningPubkeyBuilder_build(this_arg_conv); - return tag_ptr(ret_conv, true); + this_arg_conv.is_owned = false; + void* utxo_lookup_ptr = untag_ptr(utxo_lookup); + CHECK_ACCESS(utxo_lookup_ptr); + LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr); + // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ + if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) { + // Manually implement clone for Java trait instances + if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some); + } + } + P2PGossipSync_add_utxo_lookup(&this_arg_conv, utxo_lookup_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1relative_1expiry(JNIEnv *env, jclass clz, int64_t this_arg, int32_t relative_expiry_secs) { - LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1handle_1network_1update(JNIEnv *env, jclass clz, int64_t this_arg, int64_t network_update) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder - - InvoiceWithExplicitSigningPubkeyBuilder_relative_expiry(this_arg_conv, relative_expiry_secs); + this_arg_conv.is_owned = false; + LDKNetworkUpdate* network_update_conv = (LDKNetworkUpdate*)untag_ptr(network_update); + NetworkGraph_handle_network_update(&this_arg_conv, network_update_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1fallback_1v0_1p2wsh(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray script_hash) { - LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder - - uint8_t script_hash_arr[32]; - CHECK((*env)->GetArrayLength(env, script_hash) == 32); - (*env)->GetByteArrayRegion(env, script_hash, 0, 32, script_hash_arr); - uint8_t (*script_hash_ref)[32] = &script_hash_arr; - InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wsh(this_arg_conv, script_hash_ref); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, NetworkGraph_get_chain_hash(&this_arg_conv).data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1fallback_1v0_1p2wpkh(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray pubkey_hash) { - LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_verify_1node_1announcement(JNIEnv *env, jclass clz, int64_t msg) { + LDKNodeAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = verify_node_announcement(&msg_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_verify_1channel_1announcement(JNIEnv *env, jclass clz, int64_t msg) { + LDKChannelAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = verify_channel_announcement(&msg_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1as_1RoutingMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKP2PGossipSync this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder - - uint8_t pubkey_hash_arr[20]; - CHECK((*env)->GetArrayLength(env, pubkey_hash) == 20); - (*env)->GetByteArrayRegion(env, pubkey_hash, 0, 20, pubkey_hash_arr); - uint8_t (*pubkey_hash_ref)[20] = &pubkey_hash_arr; - InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wpkh(this_arg_conv, pubkey_hash_ref); + this_arg_conv.is_owned = false; + LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler"); + *ret_ret = P2PGossipSync_as_RoutingMessageHandler(&this_arg_conv); + return tag_ptr(ret_ret, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1fallback_1v1_1p2tr_1tweaked(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray utput_key) { - LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKP2PGossipSync this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder - - LDKTweakedPublicKey utput_key_ref; - CHECK((*env)->GetArrayLength(env, utput_key) == 32); - (*env)->GetByteArrayRegion(env, utput_key, 0, 32, utput_key_ref.x_coordinate); - InvoiceWithExplicitSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(this_arg_conv, utput_key_ref); + this_arg_conv.is_owned = false; + LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); + *ret_ret = P2PGossipSync_as_MessageSendEventsProvider(&this_arg_conv); + return tag_ptr(ret_ret, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1allow_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder - - InvoiceWithExplicitSigningPubkeyBuilder_allow_mpp(this_arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelUpdateInfo this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelUpdateInfo_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1build_1and_1sign(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder - - LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ), "LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ"); - *ret_conv = InvoiceWithDerivedSigningPubkeyBuilder_build_and_sign(this_arg_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ChannelUpdateInfo_get_htlc_minimum_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1relative_1expiry(JNIEnv *env, jclass clz, int64_t this_arg, int32_t relative_expiry_secs) { - LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder - - InvoiceWithDerivedSigningPubkeyBuilder_relative_expiry(this_arg_conv, relative_expiry_secs); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelUpdateInfo_set_htlc_minimum_msat(&this_ptr_conv, val); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1fallback_1v0_1p2wsh(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray script_hash) { - LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder - - uint8_t script_hash_arr[32]; - CHECK((*env)->GetArrayLength(env, script_hash) == 32); - (*env)->GetByteArrayRegion(env, script_hash, 0, 32, script_hash_arr); - uint8_t (*script_hash_ref)[32] = &script_hash_arr; - InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wsh(this_arg_conv, script_hash_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ChannelUpdateInfo_get_htlc_maximum_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1fallback_1v0_1p2wpkh(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray pubkey_hash) { - LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder - - uint8_t pubkey_hash_arr[20]; - CHECK((*env)->GetArrayLength(env, pubkey_hash) == 20); - (*env)->GetByteArrayRegion(env, pubkey_hash, 0, 20, pubkey_hash_arr); - uint8_t (*pubkey_hash_ref)[20] = &pubkey_hash_arr; - InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wpkh(this_arg_conv, pubkey_hash_ref); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelUpdateInfo_set_htlc_maximum_msat(&this_ptr_conv, val); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1fallback_1v1_1p2tr_1tweaked(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray utput_key) { - LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder - - LDKTweakedPublicKey utput_key_ref; - CHECK((*env)->GetArrayLength(env, utput_key) == 32); - (*env)->GetByteArrayRegion(env, utput_key, 0, 32, utput_key_ref.x_coordinate); - InvoiceWithDerivedSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(this_arg_conv, utput_key_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1fees(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKRoutingFees ret_var = ChannelUpdateInfo_get_fees(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1allow_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder - - InvoiceWithDerivedSigningPubkeyBuilder_allow_mpp(this_arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1fees(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKRoutingFees val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = RoutingFees_clone(&val_conv); + ChannelUpdateInfo_set_fees(&this_ptr_conv, val_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKUnsignedBolt12Invoice this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - UnsignedBolt12Invoice_free(this_obj_conv); +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1last_1update(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = ChannelUpdateInfo_get_last_update(&this_ptr_conv); + return ret_conv; } -static inline uint64_t UnsignedBolt12Invoice_clone_ptr(LDKUnsignedBolt12Invoice *NONNULL_PTR arg) { - LDKUnsignedBolt12Invoice ret_var = UnsignedBolt12Invoice_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1last_1update(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelUpdateInfo_set_last_update(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKUnsignedBolt12Invoice arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = UnsignedBolt12Invoice_clone_ptr(&arg_conv); + +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int16_t ret_conv = ChannelUpdateInfo_get_cltv_expiry_delta(&this_ptr_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKUnsignedBolt12Invoice orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKUnsignedBolt12Invoice ret_var = UnsignedBolt12Invoice_clone(&orig_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelUpdateInfo_set_cltv_expiry_delta(&this_ptr_conv, val); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1enabled(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + jboolean ret_conv = ChannelUpdateInfo_get_enabled(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1enabled(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelUpdateInfo_set_enabled(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1last_1update_1message(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelUpdate ret_var = ChannelUpdateInfo_get_last_update_message(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignBolt12InvoiceFn_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKSignBolt12InvoiceFn this_ptr_conv = *(LDKSignBolt12InvoiceFn*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - SignBolt12InvoiceFn_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1last_1update_1message(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelUpdate val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelUpdate_clone(&val_conv); + ChannelUpdateInfo_set_last_update_message(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1tagged_1hash(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKTaggedHash ret_var = UnsignedBolt12Invoice_tagged_hash(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1new(JNIEnv *env, jclass clz, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg, int64_t fees_arg, int32_t last_update_arg, int16_t cltv_expiry_delta_arg, jboolean enabled_arg, int64_t last_update_message_arg) { + LDKRoutingFees fees_arg_conv; + fees_arg_conv.inner = untag_ptr(fees_arg); + fees_arg_conv.is_owned = ptr_is_owned(fees_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv); + fees_arg_conv = RoutingFees_clone(&fees_arg_conv); + LDKChannelUpdate last_update_message_arg_conv; + last_update_message_arg_conv.inner = untag_ptr(last_update_message_arg); + last_update_message_arg_conv.is_owned = ptr_is_owned(last_update_message_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(last_update_message_arg_conv); + last_update_message_arg_conv = ChannelUpdate_clone(&last_update_message_arg_conv); + LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_new(htlc_minimum_msat_arg, htlc_maximum_msat_arg, fees_arg_conv, last_update_arg, cltv_expiry_delta_arg, enabled_arg, last_update_message_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKBolt12Invoice this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Bolt12Invoice_free(this_obj_conv); -} - -static inline uint64_t Bolt12Invoice_clone_ptr(LDKBolt12Invoice *NONNULL_PTR arg) { - LDKBolt12Invoice ret_var = Bolt12Invoice_clone(arg); +static inline uint64_t ChannelUpdateInfo_clone_ptr(LDKChannelUpdateInfo *NONNULL_PTR arg) { + LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKBolt12Invoice arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelUpdateInfo arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Bolt12Invoice_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelUpdateInfo_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBolt12Invoice orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelUpdateInfo orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBolt12Invoice ret_var = Bolt12Invoice_clone(&orig_conv); + LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1offer_1chains(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_CVec_ThirtyTwoBytesZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_ThirtyTwoBytesZZ), "LDKCOption_CVec_ThirtyTwoBytesZZ"); - *ret_copy = UnsignedBolt12Invoice_offer_chains(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKChannelUpdateInfo a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKChannelUpdateInfo b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ChannelUpdateInfo_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1chain(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, UnsignedBolt12Invoice_chain(&this_arg_conv).data); +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1to_1str(JNIEnv *env, jclass clz, int64_t o) { + LDKChannelUpdateInfo o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = ChannelUpdateInfo_to_str(&o_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelUpdateInfo obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ChannelUpdateInfo_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = UnsignedBolt12Invoice_metadata(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ"); + *ret_conv = ChannelUpdateInfo_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1amount(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); - *ret_copy = UnsignedBolt12Invoice_amount(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelInfo this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelInfo_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1offer_1features(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOfferFeatures ret_var = UnsignedBolt12Invoice_offer_features(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelFeatures ret_var = ChannelInfo_get_features(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1description(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = UnsignedBolt12Invoice_description(&this_arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelFeatures val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelFeatures_clone(&val_conv); + ChannelInfo_set_features(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1one(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKNodeId ret_var = ChannelInfo_get_node_one(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = UnsignedBolt12Invoice_absolute_expiry(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1one(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKNodeId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = NodeId_clone(&val_conv); + ChannelInfo_set_node_one(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1issuer(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = UnsignedBolt12Invoice_issuer(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1two(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKNodeId ret_var = ChannelInfo_get_node_two(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1message_1paths(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_BlindedPathZ ret_var = UnsignedBolt12Invoice_message_paths(&this_arg_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t n = 0; n < ret_var.datalen; n++) { - LDKBlindedPath ret_conv_13_var = ret_var.data[n]; - int64_t ret_conv_13_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_13_var); - ret_conv_13_ref = tag_ptr(ret_conv_13_var.inner, ret_conv_13_var.is_owned); - ret_arr_ptr[n] = ret_conv_13_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1two(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKNodeId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = NodeId_clone(&val_conv); + ChannelInfo_set_node_two(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1supported_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_QuantityZ *ret_copy = MALLOC(sizeof(LDKCOption_QuantityZ), "LDKCOption_QuantityZ"); - *ret_copy = UnsignedBolt12Invoice_supported_quantity(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1capacity_1sats(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelInfo_get_capacity_sats(&this_ptr_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1payer_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKu8slice ret_var = UnsignedBolt12Invoice_payer_metadata(&this_arg_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - return ret_arr; -} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1capacity_1sats(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + ChannelInfo_set_capacity_sats(&this_ptr_conv, val_conv); +} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1invoice_1request_1features(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKInvoiceRequestFeatures ret_var = UnsignedBolt12Invoice_invoice_request_features(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1one_1to_1two(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelUpdateInfo ret_var = ChannelInfo_get_one_to_two(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = UnsignedBolt12Invoice_quantity(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1one_1to_1two(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelUpdateInfo val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelUpdateInfo_clone(&val_conv); + ChannelInfo_set_one_to_two(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1two_1to_1one(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelUpdateInfo ret_var = ChannelInfo_get_two_to_one(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedBolt12Invoice_payer_id(&this_arg_conv).compressed_form); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1two_1to_1one(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelUpdateInfo val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelUpdateInfo_clone(&val_conv); + ChannelInfo_set_two_to_one(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = UnsignedBolt12Invoice_payer_note(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1announcement_1message(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelAnnouncement ret_var = ChannelInfo_get_announcement_message(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1created_1at(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = UnsignedBolt12Invoice_created_at(&this_arg_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1announcement_1message(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelAnnouncement val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelAnnouncement_clone(&val_conv); + ChannelInfo_set_announcement_message(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1relative_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = UnsignedBolt12Invoice_relative_expiry(&this_arg_conv); - return ret_conv; +static inline uint64_t ChannelInfo_clone_ptr(LDKChannelInfo *NONNULL_PTR arg) { + LDKChannelInfo ret_var = ChannelInfo_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1is_1expired(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = UnsignedBolt12Invoice_is_expired(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelInfo arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = ChannelInfo_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, UnsignedBolt12Invoice_payment_hash(&this_arg_conv).data); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelInfo orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKChannelInfo ret_var = ChannelInfo_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = UnsignedBolt12Invoice_amount_msats(&this_arg_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKChannelInfo a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKChannelInfo b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ChannelInfo_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1invoice_1features(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1directional_1info(JNIEnv *env, jclass clz, int64_t this_arg, int8_t channel_flags) { + LDKChannelInfo this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKBolt12InvoiceFeatures ret_var = UnsignedBolt12Invoice_invoice_features(&this_arg_conv); + LDKChannelUpdateInfo ret_var = ChannelInfo_get_directional_info(&this_arg_conv, channel_flags); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1signing_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedBolt12Invoice_signing_pubkey(&this_arg_conv).compressed_form); - return ret_arr; +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1to_1str(JNIEnv *env, jclass clz, int64_t o) { + LDKChannelInfo o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = ChannelInfo_to_str(&o_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1offer_1chains(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_CVec_ThirtyTwoBytesZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_ThirtyTwoBytesZZ), "LDKCOption_CVec_ThirtyTwoBytesZZ"); - *ret_copy = Bolt12Invoice_offer_chains(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelInfo obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ChannelInfo_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1chain(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, Bolt12Invoice_chain(&this_arg_conv).data); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); + *ret_conv = ChannelInfo_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = Bolt12Invoice_metadata(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKDirectedChannelInfo this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + DirectedChannelInfo_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1amount(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); - *ret_copy = Bolt12Invoice_amount(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +static inline uint64_t DirectedChannelInfo_clone_ptr(LDKDirectedChannelInfo *NONNULL_PTR arg) { + LDKDirectedChannelInfo ret_var = DirectedChannelInfo_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKDirectedChannelInfo arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = DirectedChannelInfo_clone_ptr(&arg_conv); + return ret_conv; +} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1offer_1features(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOfferFeatures ret_var = Bolt12Invoice_offer_features(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKDirectedChannelInfo orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKDirectedChannelInfo ret_var = DirectedChannelInfo_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1description(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1channel(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKDirectedChannelInfo this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKPrintableString ret_var = Bolt12Invoice_description(&this_arg_conv); + LDKChannelInfo ret_var = DirectedChannelInfo_channel(&this_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1effective_1capacity(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKDirectedChannelInfo this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = Bolt12Invoice_absolute_expiry(&this_arg_conv); + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = DirectedChannelInfo_effective_capacity(&this_arg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1issuer(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1source(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKDirectedChannelInfo this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKPrintableString ret_var = Bolt12Invoice_issuer(&this_arg_conv); + LDKNodeId ret_var = DirectedChannelInfo_source(&this_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1message_1paths(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1target(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKDirectedChannelInfo this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_BlindedPathZ ret_var = Bolt12Invoice_message_paths(&this_arg_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t n = 0; n < ret_var.datalen; n++) { - LDKBlindedPath ret_conv_13_var = ret_var.data[n]; - int64_t ret_conv_13_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_13_var); - ret_conv_13_ref = tag_ptr(ret_conv_13_var.inner, ret_conv_13_var.is_owned); - ret_arr_ptr[n] = ret_conv_13_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; + LDKNodeId ret_var = DirectedChannelInfo_target(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1supported_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_QuantityZ *ret_copy = MALLOC(sizeof(LDKCOption_QuantityZ), "LDKCOption_QuantityZ"); - *ret_copy = Bolt12Invoice_supported_quantity(&this_arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKEffectiveCapacity this_ptr_conv = *(LDKEffectiveCapacity*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + EffectiveCapacity_free(this_ptr_conv); +} + +static inline uint64_t EffectiveCapacity_clone_ptr(LDKEffectiveCapacity *NONNULL_PTR arg) { + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKEffectiveCapacity* arg_conv = (LDKEffectiveCapacity*)untag_ptr(arg); + int64_t ret_conv = EffectiveCapacity_clone_ptr(arg_conv); + return ret_conv; +} -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1payer_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKu8slice ret_var = Bolt12Invoice_payer_metadata(&this_arg_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKEffectiveCapacity* orig_conv = (LDKEffectiveCapacity*)untag_ptr(orig); + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1invoice_1request_1features(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKInvoiceRequestFeatures ret_var = Bolt12Invoice_invoice_request_features(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1exact_1liquidity(JNIEnv *env, jclass clz, int64_t liquidity_msat) { + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_exact_liquidity(liquidity_msat); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = Bolt12Invoice_quantity(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1advertised_1max_1htlc(JNIEnv *env, jclass clz, int64_t amount_msat) { + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_advertised_max_htlc(amount_msat); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Bolt12Invoice_payer_id(&this_arg_conv).compressed_form); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1total(JNIEnv *env, jclass clz, int64_t capacity_msat, int64_t htlc_maximum_msat) { + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_total(capacity_msat, htlc_maximum_msat); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = Bolt12Invoice_payer_note(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1infinite(JNIEnv *env, jclass clz) { + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_infinite(); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1created_1at(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = Bolt12Invoice_created_at(&this_arg_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1hint_1max_1htlc(JNIEnv *env, jclass clz, int64_t amount_msat) { + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_hint_max_htlc(amount_msat); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1relative_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = Bolt12Invoice_relative_expiry(&this_arg_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1unknown(JNIEnv *env, jclass clz) { + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_unknown(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1is_1expired(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = Bolt12Invoice_is_expired(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1as_1msat(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKEffectiveCapacity* this_arg_conv = (LDKEffectiveCapacity*)untag_ptr(this_arg); + int64_t ret_conv = EffectiveCapacity_as_msat(this_arg_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, Bolt12Invoice_payment_hash(&this_arg_conv).data); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RoutingFees_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKRoutingFees obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = RoutingFees_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = Bolt12Invoice_amount_msats(&this_arg_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); + *ret_conv = RoutingFees_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1invoice_1features(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKBolt12InvoiceFeatures ret_var = Bolt12Invoice_invoice_features(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1signing_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Bolt12Invoice_signing_pubkey(&this_arg_conv).compressed_form); - return ret_arr; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1signature(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, Bolt12Invoice_signature(&this_arg_conv).compact_form); - return ret_arr; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1signable_1hash(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, Bolt12Invoice_signable_hash(&this_arg_conv).data); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1verify(JNIEnv *env, jclass clz, int64_t this_arg, int64_t key) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKExpandedKey key_conv; - key_conv.inner = untag_ptr(key); - key_conv.is_owned = ptr_is_owned(key); - CHECK_INNER_FIELD_ACCESS_OR_NULL(key_conv); - key_conv.is_owned = false; - LDKCResult_ThirtyTwoBytesNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesNoneZ), "LDKCResult_ThirtyTwoBytesNoneZ"); - *ret_conv = Bolt12Invoice_verify(&this_arg_conv, &key_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKBolt12Invoice o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = Bolt12Invoice_hash(&o_conv); - return ret_conv; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKUnsignedBolt12Invoice obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = UnsignedBolt12Invoice_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKBolt12Invoice obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = Bolt12Invoice_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKBlindedPayInfo this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKNodeAnnouncementDetails this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BlindedPayInfo_free(this_obj_conv); -} - -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBlindedPayInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int32_t ret_conv = BlindedPayInfo_get_fee_base_msat(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKBlindedPayInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - BlindedPayInfo_set_fee_base_msat(&this_ptr_conv, val); + NodeAnnouncementDetails_free(this_obj_conv); } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBlindedPayInfo this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int32_t ret_conv = BlindedPayInfo_get_fee_proportional_millionths(&this_ptr_conv); - return ret_conv; + LDKNodeFeatures ret_var = NodeAnnouncementDetails_get_features(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKBlindedPayInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - BlindedPayInfo_set_fee_proportional_millionths(&this_ptr_conv, val); + LDKNodeFeatures val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = NodeFeatures_clone(&val_conv); + NodeAnnouncementDetails_set_features(&this_ptr_conv, val_conv); } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBlindedPayInfo this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1get_1last_1update(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int16_t ret_conv = BlindedPayInfo_get_cltv_expiry_delta(&this_ptr_conv); + int32_t ret_conv = NodeAnnouncementDetails_get_last_update(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKBlindedPayInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1set_1last_1update(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - BlindedPayInfo_set_cltv_expiry_delta(&this_ptr_conv, val); + NodeAnnouncementDetails_set_last_update(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBlindedPayInfo this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1get_1rgb(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = BlindedPayInfo_get_htlc_minimum_msat(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 3); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 3, *NodeAnnouncementDetails_get_rgb(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKBlindedPayInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1set_1rgb(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - BlindedPayInfo_set_htlc_minimum_msat(&this_ptr_conv, val); + LDKThreeBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 3); + (*env)->GetByteArrayRegion(env, val, 0, 3, val_ref.data); + NodeAnnouncementDetails_set_rgb(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBlindedPayInfo this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1get_1alias(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = BlindedPayInfo_get_htlc_maximum_msat(&this_ptr_conv); - return ret_conv; + LDKNodeAlias ret_var = NodeAnnouncementDetails_get_alias(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKBlindedPayInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1set_1alias(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - BlindedPayInfo_set_htlc_maximum_msat(&this_ptr_conv, val); + LDKNodeAlias val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = NodeAlias_clone(&val_conv); + NodeAnnouncementDetails_set_alias(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBlindedPayInfo this_ptr_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1get_1addresses(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKBlindedHopFeatures ret_var = BlindedPayInfo_get_features(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + LDKCVec_SocketAddressZ ret_var = NodeAnnouncementDetails_get_addresses(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t p = 0; p < ret_var.datalen; p++) { + LDKSocketAddress *ret_conv_15_copy = MALLOC(sizeof(LDKSocketAddress), "LDKSocketAddress"); + *ret_conv_15_copy = ret_var.data[p]; + int64_t ret_conv_15_ref = tag_ptr(ret_conv_15_copy, true); + ret_arr_ptr[p] = ret_conv_15_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKBlindedPayInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1set_1addresses(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKBlindedHopFeatures val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = BlindedHopFeatures_clone(&val_conv); - BlindedPayInfo_set_features(&this_ptr_conv, val_conv); + LDKCVec_SocketAddressZ val_constr; + val_constr.datalen = (*env)->GetArrayLength(env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSocketAddress), "LDKCVec_SocketAddressZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); + for (size_t p = 0; p < val_constr.datalen; p++) { + int64_t val_conv_15 = val_vals[p]; + void* val_conv_15_ptr = untag_ptr(val_conv_15); + CHECK_ACCESS(val_conv_15_ptr); + LDKSocketAddress val_conv_15_conv = *(LDKSocketAddress*)(val_conv_15_ptr); + val_conv_15_conv = SocketAddress_clone((LDKSocketAddress*)untag_ptr(val_conv_15)); + val_constr.data[p] = val_conv_15_conv; + } + (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); + NodeAnnouncementDetails_set_addresses(&this_ptr_conv, val_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1new(JNIEnv *env, jclass clz, int32_t fee_base_msat_arg, int32_t fee_proportional_millionths_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg, int64_t features_arg) { - LDKBlindedHopFeatures features_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1new(JNIEnv *env, jclass clz, int64_t features_arg, int32_t last_update_arg, int8_tArray rgb_arg, int64_t alias_arg, int64_tArray addresses_arg) { + LDKNodeFeatures features_arg_conv; features_arg_conv.inner = untag_ptr(features_arg); features_arg_conv.is_owned = ptr_is_owned(features_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); - features_arg_conv = BlindedHopFeatures_clone(&features_arg_conv); - LDKBlindedPayInfo ret_var = BlindedPayInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, features_arg_conv); + features_arg_conv = NodeFeatures_clone(&features_arg_conv); + LDKThreeBytes rgb_arg_ref; + CHECK((*env)->GetArrayLength(env, rgb_arg) == 3); + (*env)->GetByteArrayRegion(env, rgb_arg, 0, 3, rgb_arg_ref.data); + LDKNodeAlias alias_arg_conv; + alias_arg_conv.inner = untag_ptr(alias_arg); + alias_arg_conv.is_owned = ptr_is_owned(alias_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(alias_arg_conv); + alias_arg_conv = NodeAlias_clone(&alias_arg_conv); + LDKCVec_SocketAddressZ addresses_arg_constr; + addresses_arg_constr.datalen = (*env)->GetArrayLength(env, addresses_arg); + if (addresses_arg_constr.datalen > 0) + addresses_arg_constr.data = MALLOC(addresses_arg_constr.datalen * sizeof(LDKSocketAddress), "LDKCVec_SocketAddressZ Elements"); + else + addresses_arg_constr.data = NULL; + int64_t* addresses_arg_vals = (*env)->GetLongArrayElements (env, addresses_arg, NULL); + for (size_t p = 0; p < addresses_arg_constr.datalen; p++) { + int64_t addresses_arg_conv_15 = addresses_arg_vals[p]; + void* addresses_arg_conv_15_ptr = untag_ptr(addresses_arg_conv_15); + CHECK_ACCESS(addresses_arg_conv_15_ptr); + LDKSocketAddress addresses_arg_conv_15_conv = *(LDKSocketAddress*)(addresses_arg_conv_15_ptr); + addresses_arg_conv_15_conv = SocketAddress_clone((LDKSocketAddress*)untag_ptr(addresses_arg_conv_15)); + addresses_arg_constr.data[p] = addresses_arg_conv_15_conv; + } + (*env)->ReleaseLongArrayElements(env, addresses_arg, addresses_arg_vals, 0); + LDKNodeAnnouncementDetails ret_var = NodeAnnouncementDetails_new(features_arg_conv, last_update_arg, rgb_arg_ref, alias_arg_conv, addresses_arg_constr); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t BlindedPayInfo_clone_ptr(LDKBlindedPayInfo *NONNULL_PTR arg) { - LDKBlindedPayInfo ret_var = BlindedPayInfo_clone(arg); +static inline uint64_t NodeAnnouncementDetails_clone_ptr(LDKNodeAnnouncementDetails *NONNULL_PTR arg) { + LDKNodeAnnouncementDetails ret_var = NodeAnnouncementDetails_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKBlindedPayInfo arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNodeAnnouncementDetails arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = BlindedPayInfo_clone_ptr(&arg_conv); + int64_t ret_conv = NodeAnnouncementDetails_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBlindedPayInfo orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKNodeAnnouncementDetails orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBlindedPayInfo ret_var = BlindedPayInfo_clone(&orig_conv); + LDKNodeAnnouncementDetails ret_var = NodeAnnouncementDetails_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKBlindedPayInfo o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = BlindedPayInfo_hash(&o_conv); - return ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKBlindedPayInfo a_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKNodeAnnouncementDetails a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKBlindedPayInfo b_conv; + LDKNodeAnnouncementDetails b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = BlindedPayInfo_eq(&a_conv, &b_conv); + jboolean ret_conv = NodeAnnouncementDetails_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKBlindedPayInfo obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = BlindedPayInfo_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKNodeAnnouncementInfo this_ptr_conv = *(LDKNodeAnnouncementInfo*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + NodeAnnouncementInfo_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); - *ret_conv = BlindedPayInfo_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +static inline uint64_t NodeAnnouncementInfo_clone_ptr(LDKNodeAnnouncementInfo *NONNULL_PTR arg) { + LDKNodeAnnouncementInfo *ret_copy = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo"); + *ret_copy = NodeAnnouncementInfo_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceError_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKInvoiceError this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InvoiceError_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNodeAnnouncementInfo* arg_conv = (LDKNodeAnnouncementInfo*)untag_ptr(arg); + int64_t ret_conv = NodeAnnouncementInfo_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceError_1get_1erroneous_1field(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInvoiceError this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKErroneousField ret_var = InvoiceError_get_erroneous_field(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKNodeAnnouncementInfo* orig_conv = (LDKNodeAnnouncementInfo*)untag_ptr(orig); + LDKNodeAnnouncementInfo *ret_copy = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo"); + *ret_copy = NodeAnnouncementInfo_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceError_1set_1erroneous_1field(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKInvoiceError this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKErroneousField val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ErroneousField_clone(&val_conv); - InvoiceError_set_erroneous_field(&this_ptr_conv, val_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1relayed(JNIEnv *env, jclass clz, int64_t a) { + LDKNodeAnnouncement a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = NodeAnnouncement_clone(&a_conv); + LDKNodeAnnouncementInfo *ret_copy = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo"); + *ret_copy = NodeAnnouncementInfo_relayed(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceError_1get_1message(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInvoiceError this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKUntrustedString ret_var = InvoiceError_get_message(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1local(JNIEnv *env, jclass clz, int64_t a) { + LDKNodeAnnouncementDetails a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = NodeAnnouncementDetails_clone(&a_conv); + LDKNodeAnnouncementInfo *ret_copy = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo"); + *ret_copy = NodeAnnouncementInfo_local(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceError_1set_1message(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKInvoiceError this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKUntrustedString val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = UntrustedString_clone(&val_conv); - InvoiceError_set_message(&this_ptr_conv, val_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKNodeAnnouncementInfo* a_conv = (LDKNodeAnnouncementInfo*)untag_ptr(a); + LDKNodeAnnouncementInfo* b_conv = (LDKNodeAnnouncementInfo*)untag_ptr(b); + jboolean ret_conv = NodeAnnouncementInfo_eq(a_conv, b_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceError_1new(JNIEnv *env, jclass clz, int64_t erroneous_field_arg, int64_t message_arg) { - LDKErroneousField erroneous_field_arg_conv; - erroneous_field_arg_conv.inner = untag_ptr(erroneous_field_arg); - erroneous_field_arg_conv.is_owned = ptr_is_owned(erroneous_field_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(erroneous_field_arg_conv); - erroneous_field_arg_conv = ErroneousField_clone(&erroneous_field_arg_conv); - LDKUntrustedString message_arg_conv; - message_arg_conv.inner = untag_ptr(message_arg); - message_arg_conv.is_owned = ptr_is_owned(message_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(message_arg_conv); - message_arg_conv = UntrustedString_clone(&message_arg_conv); - LDKInvoiceError ret_var = InvoiceError_new(erroneous_field_arg_conv, message_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1features(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeAnnouncementInfo* this_arg_conv = (LDKNodeAnnouncementInfo*)untag_ptr(this_arg); + LDKNodeFeatures ret_var = NodeAnnouncementInfo_features(this_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t InvoiceError_clone_ptr(LDKInvoiceError *NONNULL_PTR arg) { - LDKInvoiceError ret_var = InvoiceError_clone(arg); +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1last_1update(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeAnnouncementInfo* this_arg_conv = (LDKNodeAnnouncementInfo*)untag_ptr(this_arg); + int32_t ret_conv = NodeAnnouncementInfo_last_update(this_arg_conv); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1rgb(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeAnnouncementInfo* this_arg_conv = (LDKNodeAnnouncementInfo*)untag_ptr(this_arg); + int8_tArray ret_arr = (*env)->NewByteArray(env, 3); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 3, NodeAnnouncementInfo_rgb(this_arg_conv).data); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1alias(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeAnnouncementInfo* this_arg_conv = (LDKNodeAnnouncementInfo*)untag_ptr(this_arg); + LDKNodeAlias ret_var = NodeAnnouncementInfo_alias(this_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKInvoiceError arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = InvoiceError_clone_ptr(&arg_conv); - return ret_conv; + +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1addresses(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeAnnouncementInfo* this_arg_conv = (LDKNodeAnnouncementInfo*)untag_ptr(this_arg); + LDKCVec_SocketAddressZ ret_var = NodeAnnouncementInfo_addresses(this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t p = 0; p < ret_var.datalen; p++) { + LDKSocketAddress *ret_conv_15_copy = MALLOC(sizeof(LDKSocketAddress), "LDKSocketAddress"); + *ret_conv_15_copy = ret_var.data[p]; + int64_t ret_conv_15_ref = tag_ptr(ret_conv_15_copy, true); + ret_arr_ptr[p] = ret_conv_15_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceError_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKInvoiceError orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKInvoiceError ret_var = InvoiceError_clone(&orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1announcement_1message(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeAnnouncementInfo* this_arg_conv = (LDKNodeAnnouncementInfo*)untag_ptr(this_arg); + LDKNodeAnnouncement ret_var = NodeAnnouncementInfo_announcement_message(this_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErroneousField_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKErroneousField this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ErroneousField_free(this_obj_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKNodeAnnouncementInfo* obj_conv = (LDKNodeAnnouncementInfo*)untag_ptr(obj); + LDKCVec_u8Z ret_var = NodeAnnouncementInfo_write(obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroneousField_1get_1tlv_1fieldnum(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKErroneousField this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = ErroneousField_get_tlv_fieldnum(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); + *ret_conv = NodeAnnouncementInfo_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErroneousField_1set_1tlv_1fieldnum(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKErroneousField this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ErroneousField_set_tlv_fieldnum(&this_ptr_conv, val); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAlias_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKNodeAlias this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + NodeAlias_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroneousField_1get_1suggested_1value(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKErroneousField this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAlias_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKNodeAlias this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = ErroneousField_get_suggested_value(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *NodeAlias_get_a(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErroneousField_1set_1suggested_1value(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKErroneousField this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAlias_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKNodeAlias this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_CVec_u8ZZ val_conv = *(LDKCOption_CVec_u8ZZ*)(val_ptr); - val_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(val)); - ErroneousField_set_suggested_value(&this_ptr_conv, val_conv); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + NodeAlias_set_a(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroneousField_1new(JNIEnv *env, jclass clz, int64_t tlv_fieldnum_arg, int64_t suggested_value_arg) { - void* suggested_value_arg_ptr = untag_ptr(suggested_value_arg); - CHECK_ACCESS(suggested_value_arg_ptr); - LDKCOption_CVec_u8ZZ suggested_value_arg_conv = *(LDKCOption_CVec_u8ZZ*)(suggested_value_arg_ptr); - suggested_value_arg_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(suggested_value_arg)); - LDKErroneousField ret_var = ErroneousField_new(tlv_fieldnum_arg, suggested_value_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAlias_1new(JNIEnv *env, jclass clz, int8_tArray a_arg) { + LDKThirtyTwoBytes a_arg_ref; + CHECK((*env)->GetArrayLength(env, a_arg) == 32); + (*env)->GetByteArrayRegion(env, a_arg, 0, 32, a_arg_ref.data); + LDKNodeAlias ret_var = NodeAlias_new(a_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t ErroneousField_clone_ptr(LDKErroneousField *NONNULL_PTR arg) { - LDKErroneousField ret_var = ErroneousField_clone(arg); +static inline uint64_t NodeAlias_clone_ptr(LDKNodeAlias *NONNULL_PTR arg) { + LDKNodeAlias ret_var = NodeAlias_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroneousField_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKErroneousField arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAlias_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNodeAlias arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = ErroneousField_clone_ptr(&arg_conv); + int64_t ret_conv = NodeAlias_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroneousField_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKErroneousField orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAlias_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKNodeAlias orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKErroneousField ret_var = ErroneousField_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceError_1from_1string(JNIEnv *env, jclass clz, jstring s) { - LDKStr s_conv = java_to_owned_str(env, s); - LDKInvoiceError ret_var = InvoiceError_from_string(s_conv); + LDKNodeAlias ret_var = NodeAlias_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_InvoiceError_1to_1str(JNIEnv *env, jclass clz, int64_t o) { - LDKInvoiceError o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAlias_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKNodeAlias o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv.is_owned = false; - LDKStr ret_str = InvoiceError_to_str(&o_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); + int64_t ret_conv = NodeAlias_hash(&o_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceError_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKInvoiceError obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = InvoiceError_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeAlias_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKNodeAlias a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKNodeAlias b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = NodeAlias_eq(&a_conv, &b_conv); + return ret_conv; +} + +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_NodeAlias_1to_1str(JNIEnv *env, jclass clz, int64_t o) { + LDKNodeAlias o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = NodeAlias_to_str(&o_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAlias_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKNodeAlias obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = NodeAlias_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceError_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAlias_1read(JNIEnv *env, jclass clz, int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); - *ret_conv = InvoiceError_read(ser_ref); + LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ"); + *ret_conv = NodeAlias_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKInvoiceRequestWithExplicitPayerIdBuilder this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InvoiceRequestWithExplicitPayerIdBuilder_free(this_obj_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKInvoiceRequestWithDerivedPayerIdBuilder this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InvoiceRequestWithDerivedPayerIdBuilder_free(this_obj_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1build(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithExplicitPayerIdBuilder - - LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ), "LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ"); - *ret_conv = InvoiceRequestWithExplicitPayerIdBuilder_build(this_arg_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1chain(JNIEnv *env, jclass clz, int64_t this_arg, jclass network) { - LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithExplicitPayerIdBuilder - - LDKNetwork network_conv = LDKNetwork_from_java(env, network); - LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); - *ret_conv = InvoiceRequestWithExplicitPayerIdBuilder_chain(this_arg_conv, network_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg, int64_t amount_msats) { - LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithExplicitPayerIdBuilder - - LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); - *ret_conv = InvoiceRequestWithExplicitPayerIdBuilder_amount_msats(this_arg_conv, amount_msats); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1quantity(JNIEnv *env, jclass clz, int64_t this_arg, int64_t quantity) { - LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithExplicitPayerIdBuilder - - LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); - *ret_conv = InvoiceRequestWithExplicitPayerIdBuilder_quantity(this_arg_conv, quantity); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg, jstring payer_note) { - LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithExplicitPayerIdBuilder - - LDKStr payer_note_conv = java_to_owned_str(env, payer_note); - InvoiceRequestWithExplicitPayerIdBuilder_payer_note(this_arg_conv, payer_note_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1build_1and_1sign(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerIdBuilder - - LDKCResult_InvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestBolt12SemanticErrorZ"); - *ret_conv = InvoiceRequestWithDerivedPayerIdBuilder_build_and_sign(this_arg_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1chain(JNIEnv *env, jclass clz, int64_t this_arg, jclass network) { - LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerIdBuilder - - LDKNetwork network_conv = LDKNetwork_from_java(env, network); - LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); - *ret_conv = InvoiceRequestWithDerivedPayerIdBuilder_chain(this_arg_conv, network_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg, int64_t amount_msats) { - LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerIdBuilder - - LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); - *ret_conv = InvoiceRequestWithDerivedPayerIdBuilder_amount_msats(this_arg_conv, amount_msats); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1quantity(JNIEnv *env, jclass clz, int64_t this_arg, int64_t quantity) { - LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerIdBuilder - - LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); - *ret_conv = InvoiceRequestWithDerivedPayerIdBuilder_quantity(this_arg_conv, quantity); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg, jstring payer_note) { - LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerIdBuilder - - LDKStr payer_note_conv = java_to_owned_str(env, payer_note); - InvoiceRequestWithDerivedPayerIdBuilder_payer_note(this_arg_conv, payer_note_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKUnsignedInvoiceRequest this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - UnsignedInvoiceRequest_free(this_obj_conv); -} - -static inline uint64_t UnsignedInvoiceRequest_clone_ptr(LDKUnsignedInvoiceRequest *NONNULL_PTR arg) { - LDKUnsignedInvoiceRequest ret_var = UnsignedInvoiceRequest_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKUnsignedInvoiceRequest arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = UnsignedInvoiceRequest_clone_ptr(&arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKUnsignedInvoiceRequest orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKUnsignedInvoiceRequest ret_var = UnsignedInvoiceRequest_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignInvoiceRequestFn_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKSignInvoiceRequestFn this_ptr_conv = *(LDKSignInvoiceRequestFn*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - SignInvoiceRequestFn_free(this_ptr_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1tagged_1hash(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKTaggedHash ret_var = UnsignedInvoiceRequest_tagged_hash(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKInvoiceRequest this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InvoiceRequest_free(this_obj_conv); -} - -static inline uint64_t InvoiceRequest_clone_ptr(LDKInvoiceRequest *NONNULL_PTR arg) { - LDKInvoiceRequest ret_var = InvoiceRequest_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKInvoiceRequest arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = InvoiceRequest_clone_ptr(&arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKInvoiceRequest orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKInvoiceRequest ret_var = InvoiceRequest_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKVerifiedInvoiceRequest this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKNodeInfo this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - VerifiedInvoiceRequest_free(this_obj_conv); + NodeInfo_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1get_1offer_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKVerifiedInvoiceRequest this_ptr_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKOfferId ret_var = VerifiedInvoiceRequest_get_offer_id(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + LDKCVec_u64Z ret_var = NodeInfo_get_channels(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1set_1offer_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKVerifiedInvoiceRequest this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { + LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKOfferId val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = OfferId_clone(&val_conv); - VerifiedInvoiceRequest_set_offer_id(&this_ptr_conv, val_conv); + LDKCVec_u64Z val_constr; + val_constr.datalen = (*env)->GetArrayLength(env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); + for (size_t g = 0; g < val_constr.datalen; g++) { + int64_t val_conv_6 = val_vals[g]; + val_constr.data[g] = val_conv_6; + } + (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); + NodeInfo_set_channels(&this_ptr_conv, val_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1get_1keys(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKVerifiedInvoiceRequest this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1announcement_1info(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_SecretKeyZ *ret_copy = MALLOC(sizeof(LDKCOption_SecretKeyZ), "LDKCOption_SecretKeyZ"); - *ret_copy = VerifiedInvoiceRequest_get_keys(&this_ptr_conv); + LDKCOption_NodeAnnouncementInfoZ *ret_copy = MALLOC(sizeof(LDKCOption_NodeAnnouncementInfoZ), "LDKCOption_NodeAnnouncementInfoZ"); + *ret_copy = NodeInfo_get_announcement_info(&this_ptr_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1set_1keys(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKVerifiedInvoiceRequest this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1announcement_1info(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; void* val_ptr = untag_ptr(val); CHECK_ACCESS(val_ptr); - LDKCOption_SecretKeyZ val_conv = *(LDKCOption_SecretKeyZ*)(val_ptr); - val_conv = COption_SecretKeyZ_clone((LDKCOption_SecretKeyZ*)untag_ptr(val)); - VerifiedInvoiceRequest_set_keys(&this_ptr_conv, val_conv); + LDKCOption_NodeAnnouncementInfoZ val_conv = *(LDKCOption_NodeAnnouncementInfoZ*)(val_ptr); + val_conv = COption_NodeAnnouncementInfoZ_clone((LDKCOption_NodeAnnouncementInfoZ*)untag_ptr(val)); + NodeInfo_set_announcement_info(&this_ptr_conv, val_conv); } -static inline uint64_t VerifiedInvoiceRequest_clone_ptr(LDKVerifiedInvoiceRequest *NONNULL_PTR arg) { - LDKVerifiedInvoiceRequest ret_var = VerifiedInvoiceRequest_clone(arg); +static inline uint64_t NodeInfo_clone_ptr(LDKNodeInfo *NONNULL_PTR arg) { + LDKNodeInfo ret_var = NodeInfo_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKVerifiedInvoiceRequest arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNodeInfo arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = VerifiedInvoiceRequest_clone_ptr(&arg_conv); + int64_t ret_conv = NodeInfo_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKVerifiedInvoiceRequest orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKNodeInfo orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKVerifiedInvoiceRequest ret_var = VerifiedInvoiceRequest_clone(&orig_conv); + LDKNodeInfo ret_var = NodeInfo_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1chains(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKNodeInfo a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKNodeInfo b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = NodeInfo_eq(&a_conv, &b_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeInfo_1is_1tor_1only(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeInfo this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_ThirtyTwoBytesZ ret_var = UnsignedInvoiceRequest_chains(&this_arg_conv); - jobjectArray ret_arr = NULL; - ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); - ; - for (size_t i = 0; i < ret_var.datalen; i++) { - int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 32, ret_var.data[i].data); - (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); - } - - FREE(ret_var.data); + jboolean ret_conv = NodeInfo_is_tor_only(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_NodeInfo_1to_1str(JNIEnv *env, jclass clz, int64_t o) { + LDKNodeInfo o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = NodeInfo_to_str(&o_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeInfo_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKNodeInfo obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = NodeInfo_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = UnsignedInvoiceRequest_metadata(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); + *ret_conv = NodeInfo_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1amount(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); - *ret_copy = UnsignedInvoiceRequest_amount(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKNetworkGraph obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = NetworkGraph_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1description(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = UnsignedInvoiceRequest_description(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + void* arg_ptr = untag_ptr(arg); + CHECK_ACCESS(arg_ptr); + LDKLogger arg_conv = *(LDKLogger*)(arg_ptr); + if (arg_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&arg_conv); + } + LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); + *ret_conv = NetworkGraph_read(ser_ref, arg_conv); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1to_1str(JNIEnv *env, jclass clz, int64_t o) { + LDKNetworkGraph o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = NetworkGraph_to_str(&o_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1new(JNIEnv *env, jclass clz, jclass network, int64_t logger) { + LDKNetwork network_conv = LDKNetwork_from_java(env, network); + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKNetworkGraph ret_var = NetworkGraph_new(network_conv, logger_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1offer_1features(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read_1only(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKOfferFeatures ret_var = UnsignedInvoiceRequest_offer_features(&this_arg_conv); + LDKReadOnlyNetworkGraph ret_var = NetworkGraph_read_only(&this_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1get_1last_1rapid_1gossip_1sync_1timestamp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = UnsignedInvoiceRequest_absolute_expiry(&this_arg_conv); + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = NetworkGraph_get_last_rapid_gossip_sync_timestamp(&this_arg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1issuer(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1set_1last_1rapid_1gossip_1sync_1timestamp(JNIEnv *env, jclass clz, int64_t this_arg, int32_t last_rapid_gossip_sync_timestamp) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKPrintableString ret_var = UnsignedInvoiceRequest_issuer(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + NetworkGraph_set_last_rapid_gossip_sync_timestamp(&this_arg_conv, last_rapid_gossip_sync_timestamp); } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1paths(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_BlindedPathZ ret_var = UnsignedInvoiceRequest_paths(&this_arg_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t n = 0; n < ret_var.datalen; n++) { - LDKBlindedPath ret_conv_13_var = ret_var.data[n]; - int64_t ret_conv_13_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_13_var); - ret_conv_13_ref = tag_ptr(ret_conv_13_var.inner, ret_conv_13_var.is_owned); - ret_arr_ptr[n] = ret_conv_13_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1supported_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1node_1from_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); - *ret_copy = UnsignedInvoiceRequest_supported_quantity(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKNodeAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_node_from_announcement(&this_arg_conv, &msg_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1signing_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1node_1from_1unsigned_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedInvoiceRequest_signing_pubkey(&this_arg_conv).compressed_form); - return ret_arr; + LDKUnsignedNodeAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_node_from_unsigned_announcement(&this_arg_conv, &msg_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1payer_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel_1from_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg, int64_t utxo_lookup) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKu8slice ret_var = UnsignedInvoiceRequest_payer_metadata(&this_arg_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - return ret_arr; + LDKChannelAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + void* utxo_lookup_ptr = untag_ptr(utxo_lookup); + CHECK_ACCESS(utxo_lookup_ptr); + LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr); + // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ + if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) { + // Manually implement clone for Java trait instances + if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some); + } + } + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_channel_from_announcement(&this_arg_conv, &msg_conv, utxo_lookup_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1chain(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel_1from_1announcement_1no_1lookup(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, UnsignedInvoiceRequest_chain(&this_arg_conv).data); - return ret_arr; + LDKChannelAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_channel_from_announcement_no_lookup(&this_arg_conv, &msg_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel_1from_1unsigned_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg, int64_t utxo_lookup) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = UnsignedInvoiceRequest_amount_msats(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKUnsignedChannelAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + void* utxo_lookup_ptr = untag_ptr(utxo_lookup); + CHECK_ACCESS(utxo_lookup_ptr); + LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr); + // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ + if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) { + // Manually implement clone for Java trait instances + if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some); + } + } + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_channel_from_unsigned_announcement(&this_arg_conv, &msg_conv, utxo_lookup_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1invoice_1request_1features(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1add_1channel_1from_1partial_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t short_channel_id, int64_t timestamp, int64_t features, int8_tArray node_id_1, int8_tArray node_id_2) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKInvoiceRequestFeatures ret_var = UnsignedInvoiceRequest_invoice_request_features(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + LDKChannelFeatures features_conv; + features_conv.inner = untag_ptr(features); + features_conv.is_owned = ptr_is_owned(features); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); + features_conv = ChannelFeatures_clone(&features_conv); + LDKPublicKey node_id_1_ref; + CHECK((*env)->GetArrayLength(env, node_id_1) == 33); + (*env)->GetByteArrayRegion(env, node_id_1, 0, 33, node_id_1_ref.compressed_form); + LDKPublicKey node_id_2_ref; + CHECK((*env)->GetArrayLength(env, node_id_2) == 33); + (*env)->GetByteArrayRegion(env, node_id_2, 0, 33, node_id_2_ref.compressed_form); + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_add_channel_from_partial_announcement(&this_arg_conv, short_channel_id, timestamp, features_conv, node_id_1_ref, node_id_2_ref); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1channel_1failed_1permanent(JNIEnv *env, jclass clz, int64_t this_arg, int64_t short_channel_id) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = UnsignedInvoiceRequest_quantity(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + NetworkGraph_channel_failed_permanent(&this_arg_conv, short_channel_id); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1node_1failed_1permanent(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray node_id) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedInvoiceRequest_payer_id(&this_arg_conv).compressed_form); - return ret_arr; + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + NetworkGraph_node_failed_permanent(&this_arg_conv, node_id_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1remove_1stale_1channels_1and_1tracking(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKPrintableString ret_var = UnsignedInvoiceRequest_payer_note(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + NetworkGraph_remove_stale_channels_and_tracking(&this_arg_conv); } -JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1chains(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1remove_1stale_1channels_1and_1tracking_1with_1time(JNIEnv *env, jclass clz, int64_t this_arg, int64_t current_time_unix) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_ThirtyTwoBytesZ ret_var = InvoiceRequest_chains(&this_arg_conv); - jobjectArray ret_arr = NULL; - ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); - ; - for (size_t i = 0; i < ret_var.datalen; i++) { - int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 32, ret_var.data[i].data); - (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); - } - - FREE(ret_var.data); - return ret_arr; + NetworkGraph_remove_stale_channels_and_tracking_with_time(&this_arg_conv, current_time_unix); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = InvoiceRequest_metadata(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKChannelUpdate msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_channel(&this_arg_conv, &msg_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1amount(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel_1unsigned(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); - *ret_copy = InvoiceRequest_amount(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKUnsignedChannelUpdate msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_channel_unsigned(&this_arg_conv, &msg_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1description(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1verify_1channel_1update(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKPrintableString ret_var = InvoiceRequest_description(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + LDKChannelUpdate msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_verify_channel_update(&this_arg_conv, &msg_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1offer_1features(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t short_channel_id) { + LDKReadOnlyNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKOfferFeatures ret_var = InvoiceRequest_offer_features(&this_arg_conv); + LDKChannelInfo ret_var = ReadOnlyNetworkGraph_channel(&this_arg_conv, short_channel_id); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1list_1channels(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKReadOnlyNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = InvoiceRequest_absolute_expiry(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKCVec_u64Z ret_var = ReadOnlyNetworkGraph_list_channels(&this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1issuer(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1node(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_id) { + LDKReadOnlyNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKPrintableString ret_var = InvoiceRequest_issuer(&this_arg_conv); + LDKNodeId node_id_conv; + node_id_conv.inner = untag_ptr(node_id); + node_id_conv.is_owned = ptr_is_owned(node_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); + node_id_conv.is_owned = false; + LDKNodeInfo ret_var = ReadOnlyNetworkGraph_node(&this_arg_conv, &node_id_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1paths(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1list_1nodes(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKReadOnlyNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_BlindedPathZ ret_var = InvoiceRequest_paths(&this_arg_conv); + LDKCVec_NodeIdZ ret_var = ReadOnlyNetworkGraph_list_nodes(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t n = 0; n < ret_var.datalen; n++) { - LDKBlindedPath ret_conv_13_var = ret_var.data[n]; - int64_t ret_conv_13_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_13_var); - ret_conv_13_ref = tag_ptr(ret_conv_13_var.inner, ret_conv_13_var.is_owned); - ret_arr_ptr[n] = ret_conv_13_ref; + for (size_t i = 0; i < ret_var.datalen; i++) { + LDKNodeId ret_conv_8_var = ret_var.data[i]; + int64_t ret_conv_8_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_8_var); + ret_conv_8_ref = tag_ptr(ret_conv_8_var.inner, ret_conv_8_var.is_owned); + ret_arr_ptr[i] = ret_conv_8_ref; } (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); FREE(ret_var.data); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1supported_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1get_1addresses(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray pubkey) { + LDKReadOnlyNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); - *ret_copy = InvoiceRequest_supported_quantity(&this_arg_conv); + LDKPublicKey pubkey_ref; + CHECK((*env)->GetArrayLength(env, pubkey) == 33); + (*env)->GetByteArrayRegion(env, pubkey, 0, 33, pubkey_ref.compressed_form); + LDKCOption_CVec_SocketAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_SocketAddressZZ), "LDKCOption_CVec_SocketAddressZZ"); + *ret_copy = ReadOnlyNetworkGraph_get_addresses(&this_arg_conv, pubkey_ref); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1signing_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, InvoiceRequest_signing_pubkey(&this_arg_conv).compressed_form); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKDefaultRouter this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + DefaultRouter_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1payer_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKu8slice ret_var = InvoiceRequest_payer_metadata(&this_arg_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1new(JNIEnv *env, jclass clz, int64_t network_graph, int64_t logger, int64_t entropy_source, int64_t scorer, int64_t score_params) { + LDKNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + void* scorer_ptr = untag_ptr(scorer); + CHECK_ACCESS(scorer_ptr); + LDKLockableScore scorer_conv = *(LDKLockableScore*)(scorer_ptr); + if (scorer_conv.free == LDKLockableScore_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLockableScore_JCalls_cloned(&scorer_conv); + } + LDKProbabilisticScoringFeeParameters score_params_conv; + score_params_conv.inner = untag_ptr(score_params); + score_params_conv.is_owned = ptr_is_owned(score_params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(score_params_conv); + score_params_conv = ProbabilisticScoringFeeParameters_clone(&score_params_conv); + LDKDefaultRouter ret_var = DefaultRouter_new(&network_graph_conv, logger_conv, entropy_source_conv, scorer_conv, score_params_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1chain(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1as_1Router(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKDefaultRouter this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, InvoiceRequest_chain(&this_arg_conv).data); - return ret_arr; + LDKRouter* ret_ret = MALLOC(sizeof(LDKRouter), "LDKRouter"); + *ret_ret = DefaultRouter_as_Router(&this_arg_conv); + return tag_ptr(ret_ret, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1as_1MessageRouter(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKDefaultRouter this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = InvoiceRequest_amount_msats(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKMessageRouter* ret_ret = MALLOC(sizeof(LDKMessageRouter), "LDKMessageRouter"); + *ret_ret = DefaultRouter_as_MessageRouter(&this_arg_conv); + return tag_ptr(ret_ret, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1invoice_1request_1features(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKInvoiceRequestFeatures ret_var = InvoiceRequest_invoice_request_features(&this_arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Router_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKRouter this_ptr_conv = *(LDKRouter*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Router_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKScorerAccountingForInFlightHtlcs this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ScorerAccountingForInFlightHtlcs_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1new(JNIEnv *env, jclass clz, int64_t scorer, int64_t inflight_htlcs) { + void* scorer_ptr = untag_ptr(scorer); + CHECK_ACCESS(scorer_ptr); + LDKScoreLookUp scorer_conv = *(LDKScoreLookUp*)(scorer_ptr); + if (scorer_conv.free == LDKScoreLookUp_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKScoreLookUp_JCalls_cloned(&scorer_conv); + } + LDKInFlightHtlcs inflight_htlcs_conv; + inflight_htlcs_conv.inner = untag_ptr(inflight_htlcs); + inflight_htlcs_conv.is_owned = ptr_is_owned(inflight_htlcs); + CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_conv); + inflight_htlcs_conv.is_owned = false; + LDKScorerAccountingForInFlightHtlcs ret_var = ScorerAccountingForInFlightHtlcs_new(scorer_conv, &inflight_htlcs_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1as_1ScoreLookUp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKScorerAccountingForInFlightHtlcs this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = InvoiceRequest_quantity(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); + LDKScoreLookUp* ret_ret = MALLOC(sizeof(LDKScoreLookUp), "LDKScoreLookUp"); + *ret_ret = ScorerAccountingForInFlightHtlcs_as_ScoreLookUp(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInFlightHtlcs this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InFlightHtlcs_free(this_obj_conv); +} + +static inline uint64_t InFlightHtlcs_clone_ptr(LDKInFlightHtlcs *NONNULL_PTR arg) { + LDKInFlightHtlcs ret_var = InFlightHtlcs_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInFlightHtlcs arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = InFlightHtlcs_clone_ptr(&arg_conv); + return ret_conv; +} -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, InvoiceRequest_payer_id(&this_arg_conv).compressed_form); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKInFlightHtlcs orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKInFlightHtlcs ret_var = InFlightHtlcs_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = InvoiceRequest_payer_note(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1new(JNIEnv *env, jclass clz) { + LDKInFlightHtlcs ret_var = InFlightHtlcs_new(); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1respond_1with(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash) { - LDKInvoiceRequest this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1process_1path(JNIEnv *env, jclass clz, int64_t this_arg, int64_t path, int8_tArray payer_node_id) { + LDKInFlightHtlcs this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths_constr; - payment_paths_constr.datalen = (*env)->GetArrayLength(env, payment_paths); - if (payment_paths_constr.datalen > 0) - payment_paths_constr.data = MALLOC(payment_paths_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); - else - payment_paths_constr.data = NULL; - int64_t* payment_paths_vals = (*env)->GetLongArrayElements (env, payment_paths, NULL); - for (size_t l = 0; l < payment_paths_constr.datalen; l++) { - int64_t payment_paths_conv_37 = payment_paths_vals[l]; - void* payment_paths_conv_37_ptr = untag_ptr(payment_paths_conv_37); - CHECK_ACCESS(payment_paths_conv_37_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ payment_paths_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(payment_paths_conv_37_ptr); - payment_paths_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(payment_paths_conv_37)); - payment_paths_constr.data[l] = payment_paths_conv_37_conv; - } - (*env)->ReleaseLongArrayElements(env, payment_paths, payment_paths_vals, 0); - LDKThirtyTwoBytes payment_hash_ref; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ"); - *ret_conv = InvoiceRequest_respond_with(&this_arg_conv, payment_paths_constr, payment_hash_ref); - return tag_ptr(ret_conv, true); + LDKPath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv.is_owned = false; + LDKPublicKey payer_node_id_ref; + CHECK((*env)->GetArrayLength(env, payer_node_id) == 33); + (*env)->GetByteArrayRegion(env, payer_node_id, 0, 33, payer_node_id_ref.compressed_form); + InFlightHtlcs_process_path(&this_arg_conv, &path_conv, payer_node_id_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1respond_1with_1no_1std(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash, int64_t created_at) { - LDKInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths_constr; - payment_paths_constr.datalen = (*env)->GetArrayLength(env, payment_paths); - if (payment_paths_constr.datalen > 0) - payment_paths_constr.data = MALLOC(payment_paths_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); - else - payment_paths_constr.data = NULL; - int64_t* payment_paths_vals = (*env)->GetLongArrayElements (env, payment_paths, NULL); - for (size_t l = 0; l < payment_paths_constr.datalen; l++) { - int64_t payment_paths_conv_37 = payment_paths_vals[l]; - void* payment_paths_conv_37_ptr = untag_ptr(payment_paths_conv_37); - CHECK_ACCESS(payment_paths_conv_37_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ payment_paths_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(payment_paths_conv_37_ptr); - payment_paths_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(payment_paths_conv_37)); - payment_paths_constr.data[l] = payment_paths_conv_37_conv; - } - (*env)->ReleaseLongArrayElements(env, payment_paths, payment_paths_vals, 0); - LDKThirtyTwoBytes payment_hash_ref; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ"); - *ret_conv = InvoiceRequest_respond_with_no_std(&this_arg_conv, payment_paths_constr, payment_hash_ref, created_at); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1verify(JNIEnv *env, jclass clz, int64_t this_arg, int64_t key) { - LDKInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = InvoiceRequest_clone(&this_arg_conv); - LDKExpandedKey key_conv; - key_conv.inner = untag_ptr(key); - key_conv.is_owned = ptr_is_owned(key); - CHECK_INNER_FIELD_ACCESS_OR_NULL(key_conv); - key_conv.is_owned = false; - LDKCResult_VerifiedInvoiceRequestNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_VerifiedInvoiceRequestNoneZ), "LDKCResult_VerifiedInvoiceRequestNoneZ"); - *ret_conv = InvoiceRequest_verify(this_arg_conv, &key_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1signature(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, InvoiceRequest_signature(&this_arg_conv).compact_form); - return ret_arr; -} - -JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1chains(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_ThirtyTwoBytesZ ret_var = VerifiedInvoiceRequest_chains(&this_arg_conv); - jobjectArray ret_arr = NULL; - ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); - ; - for (size_t i = 0; i < ret_var.datalen; i++) { - int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 32, ret_var.data[i].data); - (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); - } - - FREE(ret_var.data); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = VerifiedInvoiceRequest_metadata(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1amount(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); - *ret_copy = VerifiedInvoiceRequest_amount(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1description(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = VerifiedInvoiceRequest_description(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1offer_1features(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOfferFeatures ret_var = VerifiedInvoiceRequest_offer_features(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = VerifiedInvoiceRequest_absolute_expiry(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1issuer(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = VerifiedInvoiceRequest_issuer(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1paths(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_BlindedPathZ ret_var = VerifiedInvoiceRequest_paths(&this_arg_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t n = 0; n < ret_var.datalen; n++) { - LDKBlindedPath ret_conv_13_var = ret_var.data[n]; - int64_t ret_conv_13_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_13_var); - ret_conv_13_ref = tag_ptr(ret_conv_13_var.inner, ret_conv_13_var.is_owned); - ret_arr_ptr[n] = ret_conv_13_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1supported_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); - *ret_copy = VerifiedInvoiceRequest_supported_quantity(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1signing_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, VerifiedInvoiceRequest_signing_pubkey(&this_arg_conv).compressed_form); - return ret_arr; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1payer_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKu8slice ret_var = VerifiedInvoiceRequest_payer_metadata(&this_arg_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - return ret_arr; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1chain(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, VerifiedInvoiceRequest_chain(&this_arg_conv).data); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = VerifiedInvoiceRequest_amount_msats(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1invoice_1request_1features(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKVerifiedInvoiceRequest this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1add_1inflight_1htlc(JNIEnv *env, jclass clz, int64_t this_arg, int64_t source, int64_t target, int64_t channel_scid, int64_t used_msat) { + LDKInFlightHtlcs this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKInvoiceRequestFeatures ret_var = VerifiedInvoiceRequest_invoice_request_features(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + LDKNodeId source_conv; + source_conv.inner = untag_ptr(source); + source_conv.is_owned = ptr_is_owned(source); + CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv); + source_conv.is_owned = false; + LDKNodeId target_conv; + target_conv.inner = untag_ptr(target); + target_conv.is_owned = ptr_is_owned(target); + CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); + target_conv.is_owned = false; + InFlightHtlcs_add_inflight_htlc(&this_arg_conv, &source_conv, &target_conv, channel_scid, used_msat); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKVerifiedInvoiceRequest this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1used_1liquidity_1msat(JNIEnv *env, jclass clz, int64_t this_arg, int64_t source, int64_t target, int64_t channel_scid) { + LDKInFlightHtlcs this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; + LDKNodeId source_conv; + source_conv.inner = untag_ptr(source); + source_conv.is_owned = ptr_is_owned(source); + CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv); + source_conv.is_owned = false; + LDKNodeId target_conv; + target_conv.inner = untag_ptr(target); + target_conv.is_owned = ptr_is_owned(target); + CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); + target_conv.is_owned = false; LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = VerifiedInvoiceRequest_quantity(&this_arg_conv); + *ret_copy = InFlightHtlcs_used_liquidity_msat(&this_arg_conv, &source_conv, &target_conv, channel_scid); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, VerifiedInvoiceRequest_payer_id(&this_arg_conv).compressed_form); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = VerifiedInvoiceRequest_payer_note(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1respond_1with(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths_constr; - payment_paths_constr.datalen = (*env)->GetArrayLength(env, payment_paths); - if (payment_paths_constr.datalen > 0) - payment_paths_constr.data = MALLOC(payment_paths_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); - else - payment_paths_constr.data = NULL; - int64_t* payment_paths_vals = (*env)->GetLongArrayElements (env, payment_paths, NULL); - for (size_t l = 0; l < payment_paths_constr.datalen; l++) { - int64_t payment_paths_conv_37 = payment_paths_vals[l]; - void* payment_paths_conv_37_ptr = untag_ptr(payment_paths_conv_37); - CHECK_ACCESS(payment_paths_conv_37_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ payment_paths_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(payment_paths_conv_37_ptr); - payment_paths_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(payment_paths_conv_37)); - payment_paths_constr.data[l] = payment_paths_conv_37_conv; - } - (*env)->ReleaseLongArrayElements(env, payment_paths, payment_paths_vals, 0); - LDKThirtyTwoBytes payment_hash_ref; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ"); - *ret_conv = VerifiedInvoiceRequest_respond_with(&this_arg_conv, payment_paths_constr, payment_hash_ref); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1respond_1with_1no_1std(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash, int64_t created_at) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths_constr; - payment_paths_constr.datalen = (*env)->GetArrayLength(env, payment_paths); - if (payment_paths_constr.datalen > 0) - payment_paths_constr.data = MALLOC(payment_paths_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); - else - payment_paths_constr.data = NULL; - int64_t* payment_paths_vals = (*env)->GetLongArrayElements (env, payment_paths, NULL); - for (size_t l = 0; l < payment_paths_constr.datalen; l++) { - int64_t payment_paths_conv_37 = payment_paths_vals[l]; - void* payment_paths_conv_37_ptr = untag_ptr(payment_paths_conv_37); - CHECK_ACCESS(payment_paths_conv_37_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ payment_paths_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(payment_paths_conv_37_ptr); - payment_paths_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(payment_paths_conv_37)); - payment_paths_constr.data[l] = payment_paths_conv_37_conv; - } - (*env)->ReleaseLongArrayElements(env, payment_paths, payment_paths_vals, 0); - LDKThirtyTwoBytes payment_hash_ref; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ"); - *ret_conv = VerifiedInvoiceRequest_respond_with_no_std(&this_arg_conv, payment_paths_constr, payment_hash_ref, created_at); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1respond_1using_1derived_1keys(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths_constr; - payment_paths_constr.datalen = (*env)->GetArrayLength(env, payment_paths); - if (payment_paths_constr.datalen > 0) - payment_paths_constr.data = MALLOC(payment_paths_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); - else - payment_paths_constr.data = NULL; - int64_t* payment_paths_vals = (*env)->GetLongArrayElements (env, payment_paths, NULL); - for (size_t l = 0; l < payment_paths_constr.datalen; l++) { - int64_t payment_paths_conv_37 = payment_paths_vals[l]; - void* payment_paths_conv_37_ptr = untag_ptr(payment_paths_conv_37); - CHECK_ACCESS(payment_paths_conv_37_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ payment_paths_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(payment_paths_conv_37_ptr); - payment_paths_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(payment_paths_conv_37)); - payment_paths_constr.data[l] = payment_paths_conv_37_conv; - } - (*env)->ReleaseLongArrayElements(env, payment_paths, payment_paths_vals, 0); - LDKThirtyTwoBytes payment_hash_ref; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ"); - *ret_conv = VerifiedInvoiceRequest_respond_using_derived_keys(&this_arg_conv, payment_paths_constr, payment_hash_ref); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1respond_1using_1derived_1keys_1no_1std(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash, int64_t created_at) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths_constr; - payment_paths_constr.datalen = (*env)->GetArrayLength(env, payment_paths); - if (payment_paths_constr.datalen > 0) - payment_paths_constr.data = MALLOC(payment_paths_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); - else - payment_paths_constr.data = NULL; - int64_t* payment_paths_vals = (*env)->GetLongArrayElements (env, payment_paths, NULL); - for (size_t l = 0; l < payment_paths_constr.datalen; l++) { - int64_t payment_paths_conv_37 = payment_paths_vals[l]; - void* payment_paths_conv_37_ptr = untag_ptr(payment_paths_conv_37); - CHECK_ACCESS(payment_paths_conv_37_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ payment_paths_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(payment_paths_conv_37_ptr); - payment_paths_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(payment_paths_conv_37)); - payment_paths_constr.data[l] = payment_paths_conv_37_conv; - } - (*env)->ReleaseLongArrayElements(env, payment_paths, payment_paths_vals, 0); - LDKThirtyTwoBytes payment_hash_ref; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ"); - *ret_conv = VerifiedInvoiceRequest_respond_using_derived_keys_no_std(&this_arg_conv, payment_paths_constr, payment_hash_ref, created_at); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKUnsignedInvoiceRequest obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKInFlightHtlcs obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = UnsignedInvoiceRequest_write(&obj_conv); + LDKCVec_u8Z ret_var = InFlightHtlcs_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKInvoiceRequest obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = InvoiceRequest_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ"); + *ret_conv = InFlightHtlcs_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKInvoiceRequestFields this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKRouteHop this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InvoiceRequestFields_free(this_obj_conv); + RouteHop_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1get_1payer_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInvoiceRequestFields this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRouteHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, InvoiceRequestFields_get_payer_id(&this_ptr_conv).compressed_form); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RouteHop_get_pubkey(&this_ptr_conv).compressed_form); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1set_1payer_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKInvoiceRequestFields this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKRouteHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -74144,1273 +77375,2007 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1set_1pay LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - InvoiceRequestFields_set_payer_id(&this_ptr_conv, val_ref); + RouteHop_set_pubkey(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1get_1quantity(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInvoiceRequestFields this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1node_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRouteHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = InvoiceRequestFields_get_quantity(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); + LDKNodeFeatures ret_var = RouteHop_get_node_features(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1set_1quantity(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKInvoiceRequestFields this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1node_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKRouteHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - InvoiceRequestFields_set_quantity(&this_ptr_conv, val_conv); + LDKNodeFeatures val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = NodeFeatures_clone(&val_conv); + RouteHop_set_node_features(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1get_1payer_1note_1truncated(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInvoiceRequestFields this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRouteHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKUntrustedString ret_var = InvoiceRequestFields_get_payer_note_truncated(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + int64_t ret_conv = RouteHop_get_short_channel_id(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1set_1payer_1note_1truncated(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKInvoiceRequestFields this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKRouteHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKUntrustedString val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = UntrustedString_clone(&val_conv); - InvoiceRequestFields_set_payer_note_truncated(&this_ptr_conv, val_conv); + RouteHop_set_short_channel_id(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1new(JNIEnv *env, jclass clz, int8_tArray payer_id_arg, int64_t quantity_arg, int64_t payer_note_truncated_arg) { - LDKPublicKey payer_id_arg_ref; - CHECK((*env)->GetArrayLength(env, payer_id_arg) == 33); - (*env)->GetByteArrayRegion(env, payer_id_arg, 0, 33, payer_id_arg_ref.compressed_form); - void* quantity_arg_ptr = untag_ptr(quantity_arg); - CHECK_ACCESS(quantity_arg_ptr); - LDKCOption_u64Z quantity_arg_conv = *(LDKCOption_u64Z*)(quantity_arg_ptr); - quantity_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(quantity_arg)); - LDKUntrustedString payer_note_truncated_arg_conv; - payer_note_truncated_arg_conv.inner = untag_ptr(payer_note_truncated_arg); - payer_note_truncated_arg_conv.is_owned = ptr_is_owned(payer_note_truncated_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(payer_note_truncated_arg_conv); - payer_note_truncated_arg_conv = UntrustedString_clone(&payer_note_truncated_arg_conv); - LDKInvoiceRequestFields ret_var = InvoiceRequestFields_new(payer_id_arg_ref, quantity_arg_conv, payer_note_truncated_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1channel_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRouteHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelFeatures ret_var = RouteHop_get_channel_features(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t InvoiceRequestFields_clone_ptr(LDKInvoiceRequestFields *NONNULL_PTR arg) { - LDKInvoiceRequestFields ret_var = InvoiceRequestFields_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1channel_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKRouteHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelFeatures val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelFeatures_clone(&val_conv); + RouteHop_set_channel_features(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKInvoiceRequestFields arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = InvoiceRequestFields_clone_ptr(&arg_conv); + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1fee_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRouteHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = RouteHop_get_fee_msat(&this_ptr_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKInvoiceRequestFields orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1fee_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKRouteHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + RouteHop_set_fee_msat(&this_ptr_conv, val); +} + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRouteHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = RouteHop_get_cltv_expiry_delta(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKRouteHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + RouteHop_set_cltv_expiry_delta(&this_ptr_conv, val); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1maybe_1announced_1channel(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRouteHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + jboolean ret_conv = RouteHop_get_maybe_announced_channel(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1maybe_1announced_1channel(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKRouteHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + RouteHop_set_maybe_announced_channel(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1new(JNIEnv *env, jclass clz, int8_tArray pubkey_arg, int64_t node_features_arg, int64_t short_channel_id_arg, int64_t channel_features_arg, int64_t fee_msat_arg, int32_t cltv_expiry_delta_arg, jboolean maybe_announced_channel_arg) { + LDKPublicKey pubkey_arg_ref; + CHECK((*env)->GetArrayLength(env, pubkey_arg) == 33); + (*env)->GetByteArrayRegion(env, pubkey_arg, 0, 33, pubkey_arg_ref.compressed_form); + LDKNodeFeatures node_features_arg_conv; + node_features_arg_conv.inner = untag_ptr(node_features_arg); + node_features_arg_conv.is_owned = ptr_is_owned(node_features_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_features_arg_conv); + node_features_arg_conv = NodeFeatures_clone(&node_features_arg_conv); + LDKChannelFeatures channel_features_arg_conv; + channel_features_arg_conv.inner = untag_ptr(channel_features_arg); + channel_features_arg_conv.is_owned = ptr_is_owned(channel_features_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_features_arg_conv); + channel_features_arg_conv = ChannelFeatures_clone(&channel_features_arg_conv); + LDKRouteHop ret_var = RouteHop_new(pubkey_arg_ref, node_features_arg_conv, short_channel_id_arg, channel_features_arg_conv, fee_msat_arg, cltv_expiry_delta_arg, maybe_announced_channel_arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t RouteHop_clone_ptr(LDKRouteHop *NONNULL_PTR arg) { + LDKRouteHop ret_var = RouteHop_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRouteHop arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = RouteHop_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKRouteHop orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKInvoiceRequestFields ret_var = InvoiceRequestFields_clone(&orig_conv); + LDKRouteHop ret_var = RouteHop_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKInvoiceRequestFields a_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKRouteHop o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = RouteHop_hash(&o_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHop_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKRouteHop a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKInvoiceRequestFields b_conv; + LDKRouteHop b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = InvoiceRequestFields_eq(&a_conv, &b_conv); + jboolean ret_conv = RouteHop_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKInvoiceRequestFields obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHop_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKRouteHop obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = InvoiceRequestFields_write(&obj_conv); + LDKCVec_u8Z ret_var = RouteHop_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1read(JNIEnv *env, jclass clz, int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_InvoiceRequestFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestFieldsDecodeErrorZ), "LDKCResult_InvoiceRequestFieldsDecodeErrorZ"); - *ret_conv = InvoiceRequestFields_read(ser_ref); + LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); + *ret_conv = RouteHop_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TaggedHash_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKTaggedHash this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedTail_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBlindedTail this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - TaggedHash_free(this_obj_conv); + BlindedTail_free(this_obj_conv); } -static inline uint64_t TaggedHash_clone_ptr(LDKTaggedHash *NONNULL_PTR arg) { - LDKTaggedHash ret_var = TaggedHash_clone(arg); +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_BlindedTail_1get_1hops(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBlindedTail this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_BlindedHopZ ret_var = BlindedTail_get_hops(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t m = 0; m < ret_var.datalen; m++) { + LDKBlindedHop ret_conv_12_var = ret_var.data[m]; + int64_t ret_conv_12_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_var); + ret_conv_12_ref = tag_ptr(ret_conv_12_var.inner, ret_conv_12_var.is_owned); + ret_arr_ptr[m] = ret_conv_12_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedTail_1set_1hops(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { + LDKBlindedTail this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_BlindedHopZ val_constr; + val_constr.datalen = (*env)->GetArrayLength(env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKBlindedHop), "LDKCVec_BlindedHopZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); + for (size_t m = 0; m < val_constr.datalen; m++) { + int64_t val_conv_12 = val_vals[m]; + LDKBlindedHop val_conv_12_conv; + val_conv_12_conv.inner = untag_ptr(val_conv_12); + val_conv_12_conv.is_owned = ptr_is_owned(val_conv_12); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_12_conv); + val_conv_12_conv = BlindedHop_clone(&val_conv_12_conv); + val_constr.data[m] = val_conv_12_conv; + } + (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); + BlindedTail_set_hops(&this_ptr_conv, val_constr); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedTail_1get_1blinding_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBlindedTail this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, BlindedTail_get_blinding_point(&this_ptr_conv).compressed_form); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedTail_1set_1blinding_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKBlindedTail this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + BlindedTail_set_blinding_point(&this_ptr_conv, val_ref); +} + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_BlindedTail_1get_1excess_1final_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBlindedTail this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = BlindedTail_get_excess_final_cltv_expiry_delta(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedTail_1set_1excess_1final_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKBlindedTail this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + BlindedTail_set_excess_final_cltv_expiry_delta(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedTail_1get_1final_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBlindedTail this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = BlindedTail_get_final_value_msat(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedTail_1set_1final_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKBlindedTail this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + BlindedTail_set_final_value_msat(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedTail_1new(JNIEnv *env, jclass clz, int64_tArray hops_arg, int8_tArray blinding_point_arg, int32_t excess_final_cltv_expiry_delta_arg, int64_t final_value_msat_arg) { + LDKCVec_BlindedHopZ hops_arg_constr; + hops_arg_constr.datalen = (*env)->GetArrayLength(env, hops_arg); + if (hops_arg_constr.datalen > 0) + hops_arg_constr.data = MALLOC(hops_arg_constr.datalen * sizeof(LDKBlindedHop), "LDKCVec_BlindedHopZ Elements"); + else + hops_arg_constr.data = NULL; + int64_t* hops_arg_vals = (*env)->GetLongArrayElements (env, hops_arg, NULL); + for (size_t m = 0; m < hops_arg_constr.datalen; m++) { + int64_t hops_arg_conv_12 = hops_arg_vals[m]; + LDKBlindedHop hops_arg_conv_12_conv; + hops_arg_conv_12_conv.inner = untag_ptr(hops_arg_conv_12); + hops_arg_conv_12_conv.is_owned = ptr_is_owned(hops_arg_conv_12); + CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_arg_conv_12_conv); + hops_arg_conv_12_conv = BlindedHop_clone(&hops_arg_conv_12_conv); + hops_arg_constr.data[m] = hops_arg_conv_12_conv; + } + (*env)->ReleaseLongArrayElements(env, hops_arg, hops_arg_vals, 0); + LDKPublicKey blinding_point_arg_ref; + CHECK((*env)->GetArrayLength(env, blinding_point_arg) == 33); + (*env)->GetByteArrayRegion(env, blinding_point_arg, 0, 33, blinding_point_arg_ref.compressed_form); + LDKBlindedTail ret_var = BlindedTail_new(hops_arg_constr, blinding_point_arg_ref, excess_final_cltv_expiry_delta_arg, final_value_msat_arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TaggedHash_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKTaggedHash arg_conv; + +static inline uint64_t BlindedTail_clone_ptr(LDKBlindedTail *NONNULL_PTR arg) { + LDKBlindedTail ret_var = BlindedTail_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedTail_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBlindedTail arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = TaggedHash_clone_ptr(&arg_conv); + int64_t ret_conv = BlindedTail_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TaggedHash_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKTaggedHash orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedTail_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBlindedTail orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKTaggedHash ret_var = TaggedHash_clone(&orig_conv); + LDKBlindedTail ret_var = BlindedTail_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TaggedHash_1as_1digest(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKTaggedHash this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *TaggedHash_as_digest(&this_arg_conv)); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedTail_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKBlindedTail o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = BlindedTail_hash(&o_conv); + return ret_conv; } -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_TaggedHash_1tag(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKTaggedHash this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKStr ret_str = TaggedHash_tag(&this_arg_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedTail_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKBlindedTail a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKBlindedTail b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = BlindedTail_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TaggedHash_1merkle_1root(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKTaggedHash this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, TaggedHash_merkle_root(&this_arg_conv).data); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedTail_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKBlindedTail obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = BlindedTail_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKSignError this_ptr_conv = *(LDKSignError*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - SignError_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedTail_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_BlindedTailDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedTailDecodeErrorZ), "LDKCResult_BlindedTailDecodeErrorZ"); + *ret_conv = BlindedTail_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -static inline uint64_t SignError_clone_ptr(LDKSignError *NONNULL_PTR arg) { - LDKSignError *ret_copy = MALLOC(sizeof(LDKSignError), "LDKSignError"); - *ret_copy = SignError_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Path_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPath this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Path_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKSignError* arg_conv = (LDKSignError*)untag_ptr(arg); - int64_t ret_conv = SignError_clone_ptr(arg_conv); - return ret_conv; + +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Path_1get_1hops(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPath this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_RouteHopZ ret_var = Path_get_hops(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t k = 0; k < ret_var.datalen; k++) { + LDKRouteHop ret_conv_10_var = ret_var.data[k]; + int64_t ret_conv_10_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_10_var); + ret_conv_10_ref = tag_ptr(ret_conv_10_var.inner, ret_conv_10_var.is_owned); + ret_arr_ptr[k] = ret_conv_10_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignError_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKSignError* orig_conv = (LDKSignError*)untag_ptr(orig); - LDKSignError *ret_copy = MALLOC(sizeof(LDKSignError), "LDKSignError"); - *ret_copy = SignError_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Path_1set_1hops(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { + LDKPath this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_RouteHopZ val_constr; + val_constr.datalen = (*env)->GetArrayLength(env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); + for (size_t k = 0; k < val_constr.datalen; k++) { + int64_t val_conv_10 = val_vals[k]; + LDKRouteHop val_conv_10_conv; + val_conv_10_conv.inner = untag_ptr(val_conv_10); + val_conv_10_conv.is_owned = ptr_is_owned(val_conv_10); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_10_conv); + val_conv_10_conv = RouteHop_clone(&val_conv_10_conv); + val_constr.data[k] = val_conv_10_conv; + } + (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); + Path_set_hops(&this_ptr_conv, val_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignError_1signing(JNIEnv *env, jclass clz) { - LDKSignError *ret_copy = MALLOC(sizeof(LDKSignError), "LDKSignError"); - *ret_copy = SignError_signing(); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1get_1blinded_1tail(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPath this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBlindedTail ret_var = Path_get_blinded_tail(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignError_1verification(JNIEnv *env, jclass clz, jclass a) { - LDKSecp256k1Error a_conv = LDKSecp256k1Error_from_java(env, a); - LDKSignError *ret_copy = MALLOC(sizeof(LDKSignError), "LDKSignError"); - *ret_copy = SignError_verification(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Path_1set_1blinded_1tail(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKPath this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBlindedTail val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = BlindedTail_clone(&val_conv); + Path_set_blinded_tail(&this_ptr_conv, val_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12ParseError_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKBolt12ParseError this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Bolt12ParseError_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1new(JNIEnv *env, jclass clz, int64_tArray hops_arg, int64_t blinded_tail_arg) { + LDKCVec_RouteHopZ hops_arg_constr; + hops_arg_constr.datalen = (*env)->GetArrayLength(env, hops_arg); + if (hops_arg_constr.datalen > 0) + hops_arg_constr.data = MALLOC(hops_arg_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); + else + hops_arg_constr.data = NULL; + int64_t* hops_arg_vals = (*env)->GetLongArrayElements (env, hops_arg, NULL); + for (size_t k = 0; k < hops_arg_constr.datalen; k++) { + int64_t hops_arg_conv_10 = hops_arg_vals[k]; + LDKRouteHop hops_arg_conv_10_conv; + hops_arg_conv_10_conv.inner = untag_ptr(hops_arg_conv_10); + hops_arg_conv_10_conv.is_owned = ptr_is_owned(hops_arg_conv_10); + CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_arg_conv_10_conv); + hops_arg_conv_10_conv = RouteHop_clone(&hops_arg_conv_10_conv); + hops_arg_constr.data[k] = hops_arg_conv_10_conv; + } + (*env)->ReleaseLongArrayElements(env, hops_arg, hops_arg_vals, 0); + LDKBlindedTail blinded_tail_arg_conv; + blinded_tail_arg_conv.inner = untag_ptr(blinded_tail_arg); + blinded_tail_arg_conv.is_owned = ptr_is_owned(blinded_tail_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_tail_arg_conv); + blinded_tail_arg_conv = BlindedTail_clone(&blinded_tail_arg_conv); + LDKPath ret_var = Path_new(hops_arg_constr, blinded_tail_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -static inline uint64_t Bolt12ParseError_clone_ptr(LDKBolt12ParseError *NONNULL_PTR arg) { - LDKBolt12ParseError ret_var = Bolt12ParseError_clone(arg); +static inline uint64_t Path_clone_ptr(LDKPath *NONNULL_PTR arg) { + LDKPath ret_var = Path_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12ParseError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKBolt12ParseError arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPath arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Bolt12ParseError_clone_ptr(&arg_conv); + int64_t ret_conv = Path_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12ParseError_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBolt12ParseError orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPath orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBolt12ParseError ret_var = Bolt12ParseError_clone(&orig_conv); + LDKPath ret_var = Path_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBolt12SemanticError* orig_conv = (LDKBolt12SemanticError*)untag_ptr(orig); - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_clone(orig_conv)); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKPath o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = Path_hash(&o_conv); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1already_1expired(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_already_expired()); - return ret_conv; -} - -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unsupported_1chain(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unsupported_chain()); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Path_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKPath a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKPath b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = Path_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1chain(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unexpected_chain()); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1fee_1msat(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKPath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int64_t ret_conv = Path_fee_msat(&this_arg_conv); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1amount(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_amount()); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1final_1value_1msat(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKPath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int64_t ret_conv = Path_final_value_msat(&this_arg_conv); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1invalid_1amount(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_invalid_amount()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1final_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKPath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = Path_final_cltv_expiry_delta(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1insufficient_1amount(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_insufficient_amount()); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKRoute this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Route_free(this_obj_conv); } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1amount(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unexpected_amount()); - return ret_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Route_1get_1paths(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRoute this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_PathZ ret_var = Route_get_paths(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t g = 0; g < ret_var.datalen; g++) { + LDKPath ret_conv_6_var = ret_var.data[g]; + int64_t ret_conv_6_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_6_var); + ret_conv_6_ref = tag_ptr(ret_conv_6_var.inner, ret_conv_6_var.is_owned); + ret_arr_ptr[g] = ret_conv_6_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unsupported_1currency(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unsupported_currency()); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1paths(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { + LDKRoute this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_PathZ val_constr; + val_constr.datalen = (*env)->GetArrayLength(env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKPath), "LDKCVec_PathZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); + for (size_t g = 0; g < val_constr.datalen; g++) { + int64_t val_conv_6 = val_vals[g]; + LDKPath val_conv_6_conv; + val_conv_6_conv.inner = untag_ptr(val_conv_6); + val_conv_6_conv.is_owned = ptr_is_owned(val_conv_6); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_6_conv); + val_conv_6_conv = Path_clone(&val_conv_6_conv); + val_constr.data[g] = val_conv_6_conv; + } + (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); + Route_set_paths(&this_ptr_conv, val_constr); } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unknown_1required_1features(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unknown_required_features()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1route_1params(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRoute this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKRouteParameters ret_var = Route_get_route_params(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1features(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unexpected_features()); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1route_1params(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKRoute this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKRouteParameters val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = RouteParameters_clone(&val_conv); + Route_set_route_params(&this_ptr_conv, val_conv); } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1description(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_description()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1new(JNIEnv *env, jclass clz, int64_tArray paths_arg, int64_t route_params_arg) { + LDKCVec_PathZ paths_arg_constr; + paths_arg_constr.datalen = (*env)->GetArrayLength(env, paths_arg); + if (paths_arg_constr.datalen > 0) + paths_arg_constr.data = MALLOC(paths_arg_constr.datalen * sizeof(LDKPath), "LDKCVec_PathZ Elements"); + else + paths_arg_constr.data = NULL; + int64_t* paths_arg_vals = (*env)->GetLongArrayElements (env, paths_arg, NULL); + for (size_t g = 0; g < paths_arg_constr.datalen; g++) { + int64_t paths_arg_conv_6 = paths_arg_vals[g]; + LDKPath paths_arg_conv_6_conv; + paths_arg_conv_6_conv.inner = untag_ptr(paths_arg_conv_6); + paths_arg_conv_6_conv.is_owned = ptr_is_owned(paths_arg_conv_6); + CHECK_INNER_FIELD_ACCESS_OR_NULL(paths_arg_conv_6_conv); + paths_arg_conv_6_conv = Path_clone(&paths_arg_conv_6_conv); + paths_arg_constr.data[g] = paths_arg_conv_6_conv; + } + (*env)->ReleaseLongArrayElements(env, paths_arg, paths_arg_vals, 0); + LDKRouteParameters route_params_arg_conv; + route_params_arg_conv.inner = untag_ptr(route_params_arg); + route_params_arg_conv.is_owned = ptr_is_owned(route_params_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_arg_conv); + route_params_arg_conv = RouteParameters_clone(&route_params_arg_conv); + LDKRoute ret_var = Route_new(paths_arg_constr, route_params_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1signing_1pubkey(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_signing_pubkey()); - return ret_conv; +static inline uint64_t Route_clone_ptr(LDKRoute *NONNULL_PTR arg) { + LDKRoute ret_var = Route_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } - -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1invalid_1signing_1pubkey(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_invalid_signing_pubkey()); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRoute arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = Route_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1signing_1pubkey(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unexpected_signing_pubkey()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKRoute orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKRoute ret_var = Route_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1quantity(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_quantity()); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKRoute o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = Route_hash(&o_conv); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1invalid_1quantity(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_invalid_quantity()); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Route_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKRoute a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKRoute b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = Route_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1quantity(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unexpected_quantity()); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1total_1fees(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKRoute this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int64_t ret_conv = Route_get_total_fees(&this_arg_conv); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1invalid_1metadata(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_invalid_metadata()); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1total_1amount(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKRoute this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int64_t ret_conv = Route_get_total_amount(&this_arg_conv); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1metadata(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unexpected_metadata()); +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Route_1to_1str(JNIEnv *env, jclass clz, int64_t o) { + LDKRoute o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = Route_to_str(&o_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1payer_1metadata(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_payer_metadata()); - return ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Route_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKRoute obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = Route_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1payer_1id(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_payer_id()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); + *ret_conv = Route_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1duplicate_1payment_1id(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_duplicate_payment_id()); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKRouteParameters this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + RouteParameters_free(this_obj_conv); } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1paths(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_paths()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1payment_1params(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRouteParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPaymentParameters ret_var = RouteParameters_get_payment_params(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1paths(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unexpected_paths()); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1payment_1params(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKRouteParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPaymentParameters val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = PaymentParameters_clone(&val_conv); + RouteParameters_set_payment_params(&this_ptr_conv, val_conv); } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1invalid_1pay_1info(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_invalid_pay_info()); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1final_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRouteParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = RouteParameters_get_final_value_msat(&this_ptr_conv); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1creation_1time(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_creation_time()); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1final_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKRouteParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + RouteParameters_set_final_value_msat(&this_ptr_conv, val); } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1payment_1hash(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_payment_hash()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1max_1total_1routing_1fee_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRouteParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = RouteParameters_get_max_total_routing_fee_msat(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1signature(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_signature()); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1max_1total_1routing_1fee_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKRouteParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + RouteParameters_set_max_total_routing_fee_msat(&this_ptr_conv, val_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKRefundMaybeWithDerivedMetadataBuilder this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - RefundMaybeWithDerivedMetadataBuilder_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1new(JNIEnv *env, jclass clz, int64_t payment_params_arg, int64_t final_value_msat_arg, int64_t max_total_routing_fee_msat_arg) { + LDKPaymentParameters payment_params_arg_conv; + payment_params_arg_conv.inner = untag_ptr(payment_params_arg); + payment_params_arg_conv.is_owned = ptr_is_owned(payment_params_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_params_arg_conv); + payment_params_arg_conv = PaymentParameters_clone(&payment_params_arg_conv); + void* max_total_routing_fee_msat_arg_ptr = untag_ptr(max_total_routing_fee_msat_arg); + CHECK_ACCESS(max_total_routing_fee_msat_arg_ptr); + LDKCOption_u64Z max_total_routing_fee_msat_arg_conv = *(LDKCOption_u64Z*)(max_total_routing_fee_msat_arg_ptr); + max_total_routing_fee_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(max_total_routing_fee_msat_arg)); + LDKRouteParameters ret_var = RouteParameters_new(payment_params_arg_conv, final_value_msat_arg, max_total_routing_fee_msat_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -static inline uint64_t RefundMaybeWithDerivedMetadataBuilder_clone_ptr(LDKRefundMaybeWithDerivedMetadataBuilder *NONNULL_PTR arg) { - LDKRefundMaybeWithDerivedMetadataBuilder ret_var = RefundMaybeWithDerivedMetadataBuilder_clone(arg); +static inline uint64_t RouteParameters_clone_ptr(LDKRouteParameters *NONNULL_PTR arg) { + LDKRouteParameters ret_var = RouteParameters_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKRefundMaybeWithDerivedMetadataBuilder arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRouteParameters arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = RefundMaybeWithDerivedMetadataBuilder_clone_ptr(&arg_conv); + int64_t ret_conv = RouteParameters_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKRefundMaybeWithDerivedMetadataBuilder orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKRouteParameters orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKRefundMaybeWithDerivedMetadataBuilder ret_var = RefundMaybeWithDerivedMetadataBuilder_clone(&orig_conv); + LDKRouteParameters ret_var = RouteParameters_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1new(JNIEnv *env, jclass clz, int8_tArray metadata, int8_tArray payer_id, int64_t amount_msats) { - LDKCVec_u8Z metadata_ref; - metadata_ref.datalen = (*env)->GetArrayLength(env, metadata); - metadata_ref.data = MALLOC(metadata_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, metadata, 0, metadata_ref.datalen, metadata_ref.data); - LDKPublicKey payer_id_ref; - CHECK((*env)->GetArrayLength(env, payer_id) == 33); - (*env)->GetByteArrayRegion(env, payer_id, 0, 33, payer_id_ref.compressed_form); - LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ"); - *ret_conv = RefundMaybeWithDerivedMetadataBuilder_new(metadata_ref, payer_id_ref, amount_msats); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1deriving_1payer_1id(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t expanded_key, int64_t entropy_source, int64_t amount_msats, int8_tArray payment_id) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKExpandedKey expanded_key_conv; - expanded_key_conv.inner = untag_ptr(expanded_key); - expanded_key_conv.is_owned = ptr_is_owned(expanded_key); - CHECK_INNER_FIELD_ACCESS_OR_NULL(expanded_key_conv); - expanded_key_conv.is_owned = false; - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - LDKThirtyTwoBytes payment_id_ref; - CHECK((*env)->GetArrayLength(env, payment_id) == 32); - (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); - LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ"); - *ret_conv = RefundMaybeWithDerivedMetadataBuilder_deriving_payer_id(node_id_ref, &expanded_key_conv, entropy_source_conv, amount_msats, payment_id_ref); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKRouteParameters o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = RouteParameters_hash(&o_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1description(JNIEnv *env, jclass clz, int64_t this_arg, jstring description) { - LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); - LDKStr description_conv = java_to_owned_str(env, description); - RefundMaybeWithDerivedMetadataBuilder_description(this_arg_conv, description_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteParameters_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKRouteParameters a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKRouteParameters b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = RouteParameters_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg, int64_t absolute_expiry) { - LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); - RefundMaybeWithDerivedMetadataBuilder_absolute_expiry(this_arg_conv, absolute_expiry); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1from_1payment_1params_1and_1value(JNIEnv *env, jclass clz, int64_t payment_params, int64_t final_value_msat) { + LDKPaymentParameters payment_params_conv; + payment_params_conv.inner = untag_ptr(payment_params); + payment_params_conv.is_owned = ptr_is_owned(payment_params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_params_conv); + payment_params_conv = PaymentParameters_clone(&payment_params_conv); + LDKRouteParameters ret_var = RouteParameters_from_payment_params_and_value(payment_params_conv, final_value_msat); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1issuer(JNIEnv *env, jclass clz, int64_t this_arg, jstring issuer) { - LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1max_1path_1length(JNIEnv *env, jclass clz, int64_t this_arg, int64_t recipient_onion, jboolean is_keysend, int32_t best_block_height) { + LDKRouteParameters this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); - LDKStr issuer_conv = java_to_owned_str(env, issuer); - RefundMaybeWithDerivedMetadataBuilder_issuer(this_arg_conv, issuer_conv); + this_arg_conv.is_owned = false; + LDKRecipientOnionFields recipient_onion_conv; + recipient_onion_conv.inner = untag_ptr(recipient_onion); + recipient_onion_conv.is_owned = ptr_is_owned(recipient_onion); + CHECK_INNER_FIELD_ACCESS_OR_NULL(recipient_onion_conv); + recipient_onion_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = RouteParameters_set_max_path_length(&this_arg_conv, &recipient_onion_conv, is_keysend, best_block_height); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1path(JNIEnv *env, jclass clz, int64_t this_arg, int64_t path) { - LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); - LDKBlindedPath path_conv; - path_conv.inner = untag_ptr(path); - path_conv.is_owned = ptr_is_owned(path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); - path_conv = BlindedPath_clone(&path_conv); - RefundMaybeWithDerivedMetadataBuilder_path(this_arg_conv, path_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteParameters_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKRouteParameters obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = RouteParameters_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1chain(JNIEnv *env, jclass clz, int64_t this_arg, jclass network) { - LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); - LDKNetwork network_conv = LDKNetwork_from_java(env, network); - RefundMaybeWithDerivedMetadataBuilder_chain(this_arg_conv, network_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); + *ret_conv = RouteParameters_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1quantity(JNIEnv *env, jclass clz, int64_t this_arg, int64_t quantity) { - LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); - RefundMaybeWithDerivedMetadataBuilder_quantity(this_arg_conv, quantity); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPaymentParameters this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + PaymentParameters_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg, jstring payer_note) { - LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); - LDKStr payer_note_conv = java_to_owned_str(env, payer_note); - RefundMaybeWithDerivedMetadataBuilder_payer_note(this_arg_conv, payer_note_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1payee(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); + *ret_copy = PaymentParameters_get_payee(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1build(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); - LDKCResult_RefundBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundBolt12SemanticErrorZ), "LDKCResult_RefundBolt12SemanticErrorZ"); - *ret_conv = RefundMaybeWithDerivedMetadataBuilder_build(this_arg_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1payee(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKPayee val_conv = *(LDKPayee*)(val_ptr); + val_conv = Payee_clone((LDKPayee*)untag_ptr(val)); + PaymentParameters_set_payee(&this_ptr_conv, val_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Refund_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKRefund this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Refund_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1expiry_1time(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = PaymentParameters_get_expiry_time(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -static inline uint64_t Refund_clone_ptr(LDKRefund *NONNULL_PTR arg) { - LDKRefund ret_var = Refund_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1expiry_1time(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + PaymentParameters_set_expiry_time(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKRefund arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = Refund_clone_ptr(&arg_conv); + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1max_1total_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = PaymentParameters_get_max_total_cltv_expiry_delta(&this_ptr_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKRefund orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKRefund ret_var = Refund_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1max_1total_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + PaymentParameters_set_max_total_cltv_expiry_delta(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1description(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = Refund_description(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1max_1path_1count(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_t ret_conv = PaymentParameters_get_max_path_count(&this_ptr_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = Refund_absolute_expiry(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1max_1path_1count(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + PaymentParameters_set_max_path_count(&this_ptr_conv, val); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Refund_1is_1expired(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = Refund_is_expired(&this_arg_conv); +JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1max_1path_1length(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_t ret_conv = PaymentParameters_get_max_path_length(&this_ptr_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Refund_1is_1expired_1no_1std(JNIEnv *env, jclass clz, int64_t this_arg, int64_t duration_since_epoch) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = Refund_is_expired_no_std(&this_arg_conv, duration_since_epoch); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1max_1path_1length(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + PaymentParameters_set_max_path_length(&this_ptr_conv, val); +} + +JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1max_1channel_1saturation_1power_1of_1half(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_t ret_conv = PaymentParameters_get_max_channel_saturation_power_of_half(&this_ptr_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1issuer(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = Refund_issuer(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1max_1channel_1saturation_1power_1of_1half(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + PaymentParameters_set_max_channel_saturation_power_of_half(&this_ptr_conv, val); } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Refund_1paths(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_BlindedPathZ ret_var = Refund_paths(&this_arg_conv); +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1previously_1failed_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u64Z ret_var = PaymentParameters_get_previously_failed_channels(&this_ptr_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t n = 0; n < ret_var.datalen; n++) { - LDKBlindedPath ret_conv_13_var = ret_var.data[n]; - int64_t ret_conv_13_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_13_var); - ret_conv_13_ref = tag_ptr(ret_conv_13_var.inner, ret_conv_13_var.is_owned); - ret_arr_ptr[n] = ret_conv_13_ref; + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; } (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); FREE(ret_var.data); return ret_arr; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Refund_1payer_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKu8slice ret_var = Refund_payer_metadata(&this_arg_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1previously_1failed_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u64Z val_constr; + val_constr.datalen = (*env)->GetArrayLength(env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); + for (size_t g = 0; g < val_constr.datalen; g++) { + int64_t val_conv_6 = val_vals[g]; + val_constr.data[g] = val_conv_6; + } + (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); + PaymentParameters_set_previously_failed_channels(&this_ptr_conv, val_constr); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Refund_1chain(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, Refund_chain(&this_arg_conv).data); +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1previously_1failed_1blinded_1path_1idxs(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u64Z ret_var = PaymentParameters_get_previously_failed_blinded_path_idxs(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = Refund_amount_msats(&this_arg_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1previously_1failed_1blinded_1path_1idxs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u64Z val_constr; + val_constr.datalen = (*env)->GetArrayLength(env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); + for (size_t g = 0; g < val_constr.datalen; g++) { + int64_t val_conv_6 = val_vals[g]; + val_constr.data[g] = val_conv_6; + } + (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); + PaymentParameters_set_previously_failed_blinded_path_idxs(&this_ptr_conv, val_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1features(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKInvoiceRequestFeatures ret_var = Refund_features(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1new(JNIEnv *env, jclass clz, int64_t payee_arg, int64_t expiry_time_arg, int32_t max_total_cltv_expiry_delta_arg, int8_t max_path_count_arg, int8_t max_path_length_arg, int8_t max_channel_saturation_power_of_half_arg, int64_tArray previously_failed_channels_arg, int64_tArray previously_failed_blinded_path_idxs_arg) { + void* payee_arg_ptr = untag_ptr(payee_arg); + CHECK_ACCESS(payee_arg_ptr); + LDKPayee payee_arg_conv = *(LDKPayee*)(payee_arg_ptr); + payee_arg_conv = Payee_clone((LDKPayee*)untag_ptr(payee_arg)); + void* expiry_time_arg_ptr = untag_ptr(expiry_time_arg); + CHECK_ACCESS(expiry_time_arg_ptr); + LDKCOption_u64Z expiry_time_arg_conv = *(LDKCOption_u64Z*)(expiry_time_arg_ptr); + expiry_time_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(expiry_time_arg)); + LDKCVec_u64Z previously_failed_channels_arg_constr; + previously_failed_channels_arg_constr.datalen = (*env)->GetArrayLength(env, previously_failed_channels_arg); + if (previously_failed_channels_arg_constr.datalen > 0) + previously_failed_channels_arg_constr.data = MALLOC(previously_failed_channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + else + previously_failed_channels_arg_constr.data = NULL; + int64_t* previously_failed_channels_arg_vals = (*env)->GetLongArrayElements (env, previously_failed_channels_arg, NULL); + for (size_t g = 0; g < previously_failed_channels_arg_constr.datalen; g++) { + int64_t previously_failed_channels_arg_conv_6 = previously_failed_channels_arg_vals[g]; + previously_failed_channels_arg_constr.data[g] = previously_failed_channels_arg_conv_6; + } + (*env)->ReleaseLongArrayElements(env, previously_failed_channels_arg, previously_failed_channels_arg_vals, 0); + LDKCVec_u64Z previously_failed_blinded_path_idxs_arg_constr; + previously_failed_blinded_path_idxs_arg_constr.datalen = (*env)->GetArrayLength(env, previously_failed_blinded_path_idxs_arg); + if (previously_failed_blinded_path_idxs_arg_constr.datalen > 0) + previously_failed_blinded_path_idxs_arg_constr.data = MALLOC(previously_failed_blinded_path_idxs_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + else + previously_failed_blinded_path_idxs_arg_constr.data = NULL; + int64_t* previously_failed_blinded_path_idxs_arg_vals = (*env)->GetLongArrayElements (env, previously_failed_blinded_path_idxs_arg, NULL); + for (size_t g = 0; g < previously_failed_blinded_path_idxs_arg_constr.datalen; g++) { + int64_t previously_failed_blinded_path_idxs_arg_conv_6 = previously_failed_blinded_path_idxs_arg_vals[g]; + previously_failed_blinded_path_idxs_arg_constr.data[g] = previously_failed_blinded_path_idxs_arg_conv_6; + } + (*env)->ReleaseLongArrayElements(env, previously_failed_blinded_path_idxs_arg, previously_failed_blinded_path_idxs_arg_vals, 0); + LDKPaymentParameters ret_var = PaymentParameters_new(payee_arg_conv, expiry_time_arg_conv, max_total_cltv_expiry_delta_arg, max_path_count_arg, max_path_length_arg, max_channel_saturation_power_of_half_arg, previously_failed_channels_arg_constr, previously_failed_blinded_path_idxs_arg_constr); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = Refund_quantity(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +static inline uint64_t PaymentParameters_clone_ptr(LDKPaymentParameters *NONNULL_PTR arg) { + LDKPaymentParameters ret_var = PaymentParameters_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Refund_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Refund_payer_id(&this_arg_conv).compressed_form); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPaymentParameters arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = PaymentParameters_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = Refund_payer_note(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPaymentParameters orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKPaymentParameters ret_var = PaymentParameters_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKRefund o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKPaymentParameters o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv.is_owned = false; - int64_t ret_conv = Refund_hash(&o_conv); + int64_t ret_conv = PaymentParameters_hash(&o_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Refund_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKRefund obj_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKPaymentParameters a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKPaymentParameters b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = PaymentParameters_eq(&a_conv, &b_conv); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKPaymentParameters obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = Refund_write(&obj_conv); + LDKCVec_u8Z ret_var = PaymentParameters_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1from_1str(JNIEnv *env, jclass clz, jstring s) { - LDKStr s_conv = java_to_owned_str(env, s); - LDKCResult_RefundBolt12ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundBolt12ParseErrorZ), "LDKCResult_RefundBolt12ParseErrorZ"); - *ret_conv = Refund_from_str(s_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1read(JNIEnv *env, jclass clz, int8_tArray ser, int32_t arg) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ"); + *ret_conv = PaymentParameters_read(ser_ref, arg); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Refund_1to_1str(JNIEnv *env, jclass clz, int64_t o) { - LDKRefund o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = Refund_to_str(&o_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1from_1node_1id(JNIEnv *env, jclass clz, int8_tArray payee_pubkey, int32_t final_cltv_expiry_delta) { + LDKPublicKey payee_pubkey_ref; + CHECK((*env)->GetArrayLength(env, payee_pubkey) == 33); + (*env)->GetByteArrayRegion(env, payee_pubkey, 0, 33, payee_pubkey_ref.compressed_form); + LDKPaymentParameters ret_var = PaymentParameters_from_node_id(payee_pubkey_ref, final_cltv_expiry_delta); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_UtxoLookupError_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKUtxoLookupError* orig_conv = (LDKUtxoLookupError*)untag_ptr(orig); - jclass ret_conv = LDKUtxoLookupError_to_java(env, UtxoLookupError_clone(orig_conv)); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1for_1keysend(JNIEnv *env, jclass clz, int8_tArray payee_pubkey, int32_t final_cltv_expiry_delta, jboolean allow_mpp) { + LDKPublicKey payee_pubkey_ref; + CHECK((*env)->GetArrayLength(env, payee_pubkey) == 33); + (*env)->GetByteArrayRegion(env, payee_pubkey, 0, 33, payee_pubkey_ref.compressed_form); + LDKPaymentParameters ret_var = PaymentParameters_for_keysend(payee_pubkey_ref, final_cltv_expiry_delta, allow_mpp); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_UtxoLookupError_1unknown_1chain(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKUtxoLookupError_to_java(env, UtxoLookupError_unknown_chain()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1from_1bolt12_1invoice(JNIEnv *env, jclass clz, int64_t invoice) { + LDKBolt12Invoice invoice_conv; + invoice_conv.inner = untag_ptr(invoice); + invoice_conv.is_owned = ptr_is_owned(invoice); + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); + invoice_conv.is_owned = false; + LDKPaymentParameters ret_var = PaymentParameters_from_bolt12_invoice(&invoice_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_UtxoLookupError_1unknown_1tx(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKUtxoLookupError_to_java(env, UtxoLookupError_unknown_tx()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1blinded(JNIEnv *env, jclass clz, int64_tArray blinded_route_hints) { + LDKCVec_BlindedPaymentPathZ blinded_route_hints_constr; + blinded_route_hints_constr.datalen = (*env)->GetArrayLength(env, blinded_route_hints); + if (blinded_route_hints_constr.datalen > 0) + blinded_route_hints_constr.data = MALLOC(blinded_route_hints_constr.datalen * sizeof(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); + else + blinded_route_hints_constr.data = NULL; + int64_t* blinded_route_hints_vals = (*env)->GetLongArrayElements (env, blinded_route_hints, NULL); + for (size_t u = 0; u < blinded_route_hints_constr.datalen; u++) { + int64_t blinded_route_hints_conv_20 = blinded_route_hints_vals[u]; + LDKBlindedPaymentPath blinded_route_hints_conv_20_conv; + blinded_route_hints_conv_20_conv.inner = untag_ptr(blinded_route_hints_conv_20); + blinded_route_hints_conv_20_conv.is_owned = ptr_is_owned(blinded_route_hints_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_route_hints_conv_20_conv); + blinded_route_hints_conv_20_conv = BlindedPaymentPath_clone(&blinded_route_hints_conv_20_conv); + blinded_route_hints_constr.data[u] = blinded_route_hints_conv_20_conv; + } + (*env)->ReleaseLongArrayElements(env, blinded_route_hints, blinded_route_hints_vals, 0); + LDKPaymentParameters ret_var = PaymentParameters_blinded(blinded_route_hints_constr); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoResult_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); CHECK_ACCESS(this_ptr_ptr); - LDKUtxoResult this_ptr_conv = *(LDKUtxoResult*)(this_ptr_ptr); + LDKPayee this_ptr_conv = *(LDKPayee*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - UtxoResult_free(this_ptr_conv); + Payee_free(this_ptr_conv); } -static inline uint64_t UtxoResult_clone_ptr(LDKUtxoResult *NONNULL_PTR arg) { - LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult"); - *ret_copy = UtxoResult_clone(arg); +static inline uint64_t Payee_clone_ptr(LDKPayee *NONNULL_PTR arg) { + LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); + *ret_copy = Payee_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoResult_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKUtxoResult* arg_conv = (LDKUtxoResult*)untag_ptr(arg); - int64_t ret_conv = UtxoResult_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPayee* arg_conv = (LDKPayee*)untag_ptr(arg); + int64_t ret_conv = Payee_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoResult_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKUtxoResult* orig_conv = (LDKUtxoResult*)untag_ptr(orig); - LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult"); - *ret_copy = UtxoResult_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPayee* orig_conv = (LDKPayee*)untag_ptr(orig); + LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); + *ret_copy = Payee_clone(orig_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoResult_1sync(JNIEnv *env, jclass clz, int64_t a) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKCResult_TxOutUtxoLookupErrorZ a_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(a_ptr); - a_conv = CResult_TxOutUtxoLookupErrorZ_clone((LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(a)); - LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult"); - *ret_copy = UtxoResult_sync(a_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1blinded(JNIEnv *env, jclass clz, int64_tArray route_hints, int64_t features) { + LDKCVec_BlindedPaymentPathZ route_hints_constr; + route_hints_constr.datalen = (*env)->GetArrayLength(env, route_hints); + if (route_hints_constr.datalen > 0) + route_hints_constr.data = MALLOC(route_hints_constr.datalen * sizeof(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); + else + route_hints_constr.data = NULL; + int64_t* route_hints_vals = (*env)->GetLongArrayElements (env, route_hints, NULL); + for (size_t u = 0; u < route_hints_constr.datalen; u++) { + int64_t route_hints_conv_20 = route_hints_vals[u]; + LDKBlindedPaymentPath route_hints_conv_20_conv; + route_hints_conv_20_conv.inner = untag_ptr(route_hints_conv_20); + route_hints_conv_20_conv.is_owned = ptr_is_owned(route_hints_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_hints_conv_20_conv); + route_hints_conv_20_conv = BlindedPaymentPath_clone(&route_hints_conv_20_conv); + route_hints_constr.data[u] = route_hints_conv_20_conv; + } + (*env)->ReleaseLongArrayElements(env, route_hints, route_hints_vals, 0); + LDKBolt12InvoiceFeatures features_conv; + features_conv.inner = untag_ptr(features); + features_conv.is_owned = ptr_is_owned(features); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); + features_conv = Bolt12InvoiceFeatures_clone(&features_conv); + LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); + *ret_copy = Payee_blinded(route_hints_constr, features_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoResult_1async(JNIEnv *env, jclass clz, int64_t a) { - LDKUtxoFuture a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = UtxoFuture_clone(&a_conv); - LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult"); - *ret_copy = UtxoResult_async(a_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1clear(JNIEnv *env, jclass clz, int8_tArray node_id, int64_tArray route_hints, int64_t features, int32_t final_cltv_expiry_delta) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKCVec_RouteHintZ route_hints_constr; + route_hints_constr.datalen = (*env)->GetArrayLength(env, route_hints); + if (route_hints_constr.datalen > 0) + route_hints_constr.data = MALLOC(route_hints_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements"); + else + route_hints_constr.data = NULL; + int64_t* route_hints_vals = (*env)->GetLongArrayElements (env, route_hints, NULL); + for (size_t l = 0; l < route_hints_constr.datalen; l++) { + int64_t route_hints_conv_11 = route_hints_vals[l]; + LDKRouteHint route_hints_conv_11_conv; + route_hints_conv_11_conv.inner = untag_ptr(route_hints_conv_11); + route_hints_conv_11_conv.is_owned = ptr_is_owned(route_hints_conv_11); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_hints_conv_11_conv); + route_hints_conv_11_conv = RouteHint_clone(&route_hints_conv_11_conv); + route_hints_constr.data[l] = route_hints_conv_11_conv; + } + (*env)->ReleaseLongArrayElements(env, route_hints, route_hints_vals, 0); + LDKBolt11InvoiceFeatures features_conv; + features_conv.inner = untag_ptr(features); + features_conv.is_owned = ptr_is_owned(features); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); + features_conv = Bolt11InvoiceFeatures_clone(&features_conv); + LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); + *ret_copy = Payee_clear(node_id_ref, route_hints_constr, features_conv, final_cltv_expiry_delta); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoLookup_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKUtxoLookup this_ptr_conv = *(LDKUtxoLookup*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - UtxoLookup_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKPayee* o_conv = (LDKPayee*)untag_ptr(o); + int64_t ret_conv = Payee_hash(o_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKUtxoFuture this_obj_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Payee_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKPayee* a_conv = (LDKPayee*)untag_ptr(a); + LDKPayee* b_conv = (LDKPayee*)untag_ptr(b); + jboolean ret_conv = Payee_eq(a_conv, b_conv); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKRouteHint obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = RouteHint_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); + *ret_conv = RouteHint_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKRouteHintHop obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = RouteHintHop_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); + *ret_conv = RouteHintHop_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FirstHopCandidate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKFirstHopCandidate this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - UtxoFuture_free(this_obj_conv); + FirstHopCandidate_free(this_obj_conv); } -static inline uint64_t UtxoFuture_clone_ptr(LDKUtxoFuture *NONNULL_PTR arg) { - LDKUtxoFuture ret_var = UtxoFuture_clone(arg); +static inline uint64_t FirstHopCandidate_clone_ptr(LDKFirstHopCandidate *NONNULL_PTR arg) { + LDKFirstHopCandidate ret_var = FirstHopCandidate_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKUtxoFuture arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FirstHopCandidate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKFirstHopCandidate arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = UtxoFuture_clone_ptr(&arg_conv); + int64_t ret_conv = FirstHopCandidate_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKUtxoFuture orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FirstHopCandidate_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKFirstHopCandidate orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKUtxoFuture ret_var = UtxoFuture_clone(&orig_conv); + LDKFirstHopCandidate ret_var = FirstHopCandidate_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1new(JNIEnv *env, jclass clz) { - LDKUtxoFuture ret_var = UtxoFuture_new(); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PublicHopCandidate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPublicHopCandidate this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + PublicHopCandidate_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PublicHopCandidate_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPublicHopCandidate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = PublicHopCandidate_get_short_channel_id(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PublicHopCandidate_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKPublicHopCandidate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + PublicHopCandidate_set_short_channel_id(&this_ptr_conv, val); +} + +static inline uint64_t PublicHopCandidate_clone_ptr(LDKPublicHopCandidate *NONNULL_PTR arg) { + LDKPublicHopCandidate ret_var = PublicHopCandidate_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1resolve_1without_1forwarding(JNIEnv *env, jclass clz, int64_t this_arg, int64_t graph, int64_t result) { - LDKUtxoFuture this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNetworkGraph graph_conv; - graph_conv.inner = untag_ptr(graph); - graph_conv.is_owned = ptr_is_owned(graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(graph_conv); - graph_conv.is_owned = false; - void* result_ptr = untag_ptr(result); - CHECK_ACCESS(result_ptr); - LDKCResult_TxOutUtxoLookupErrorZ result_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(result_ptr); - UtxoFuture_resolve_without_forwarding(&this_arg_conv, &graph_conv, result_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PublicHopCandidate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPublicHopCandidate arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = PublicHopCandidate_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1resolve(JNIEnv *env, jclass clz, int64_t this_arg, int64_t graph, int64_t gossip, int64_t result) { - LDKUtxoFuture this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNetworkGraph graph_conv; - graph_conv.inner = untag_ptr(graph); - graph_conv.is_owned = ptr_is_owned(graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(graph_conv); - graph_conv.is_owned = false; - LDKP2PGossipSync gossip_conv; - gossip_conv.inner = untag_ptr(gossip); - gossip_conv.is_owned = ptr_is_owned(gossip); - CHECK_INNER_FIELD_ACCESS_OR_NULL(gossip_conv); - gossip_conv.is_owned = false; - void* result_ptr = untag_ptr(result); - CHECK_ACCESS(result_ptr); - LDKCResult_TxOutUtxoLookupErrorZ result_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(result_ptr); - UtxoFuture_resolve(&this_arg_conv, &graph_conv, &gossip_conv, result_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PublicHopCandidate_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPublicHopCandidate orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKPublicHopCandidate ret_var = PublicHopCandidate_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeId_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKNodeId this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PrivateHopCandidate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPrivateHopCandidate this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - NodeId_free(this_obj_conv); + PrivateHopCandidate_free(this_obj_conv); } -static inline uint64_t NodeId_clone_ptr(LDKNodeId *NONNULL_PTR arg) { - LDKNodeId ret_var = NodeId_clone(arg); +static inline uint64_t PrivateHopCandidate_clone_ptr(LDKPrivateHopCandidate *NONNULL_PTR arg) { + LDKPrivateHopCandidate ret_var = PrivateHopCandidate_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKNodeId arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateHopCandidate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPrivateHopCandidate arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = NodeId_clone_ptr(&arg_conv); + int64_t ret_conv = PrivateHopCandidate_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKNodeId orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateHopCandidate_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPrivateHopCandidate orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKNodeId ret_var = NodeId_clone(&orig_conv); + LDKPrivateHopCandidate ret_var = PrivateHopCandidate_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1from_1pubkey(JNIEnv *env, jclass clz, int8_tArray pubkey) { - LDKPublicKey pubkey_ref; - CHECK((*env)->GetArrayLength(env, pubkey) == 33); - (*env)->GetByteArrayRegion(env, pubkey, 0, 33, pubkey_ref.compressed_form); - LDKNodeId ret_var = NodeId_from_pubkey(pubkey_ref); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPathCandidate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBlindedPathCandidate this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + BlindedPathCandidate_free(this_obj_conv); +} + +static inline uint64_t BlindedPathCandidate_clone_ptr(LDKBlindedPathCandidate *NONNULL_PTR arg) { + LDKBlindedPathCandidate ret_var = BlindedPathCandidate_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1from_1slice(JNIEnv *env, jclass clz, int8_tArray bytes) { - LDKu8slice bytes_ref; - bytes_ref.datalen = (*env)->GetArrayLength(env, bytes); - bytes_ref.data = (*env)->GetByteArrayElements (env, bytes, NULL); - LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); - *ret_conv = NodeId_from_slice(bytes_ref); - (*env)->ReleaseByteArrayElements(env, bytes, (int8_t*)bytes_ref.data, 0); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeId_1as_1slice(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeId this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKu8slice ret_var = NodeId_as_slice(&this_arg_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - return ret_arr; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeId_1as_1array(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeId this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, *NodeId_as_array(&this_arg_conv)); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1as_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeId this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_PublicKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecp256k1ErrorZ), "LDKCResult_PublicKeySecp256k1ErrorZ"); - *ret_conv = NodeId_as_pubkey(&this_arg_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_NodeId_1to_1str(JNIEnv *env, jclass clz, int64_t o) { - LDKNodeId o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = NodeId_to_str(&o_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKNodeId o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = NodeId_hash(&o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPathCandidate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBlindedPathCandidate arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = BlindedPathCandidate_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeId_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKNodeId obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = NodeId_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); - *ret_conv = NodeId_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPathCandidate_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBlindedPathCandidate orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKBlindedPathCandidate ret_var = BlindedPathCandidate_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKNetworkGraph this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OneHopBlindedPathCandidate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKOneHopBlindedPathCandidate this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - NetworkGraph_free(this_obj_conv); + OneHopBlindedPathCandidate_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKReadOnlyNetworkGraph this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ReadOnlyNetworkGraph_free(this_obj_conv); +static inline uint64_t OneHopBlindedPathCandidate_clone_ptr(LDKOneHopBlindedPathCandidate *NONNULL_PTR arg) { + LDKOneHopBlindedPathCandidate ret_var = OneHopBlindedPathCandidate_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OneHopBlindedPathCandidate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKOneHopBlindedPathCandidate arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = OneHopBlindedPathCandidate_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OneHopBlindedPathCandidate_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKOneHopBlindedPathCandidate orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKOneHopBlindedPathCandidate ret_var = OneHopBlindedPathCandidate_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); CHECK_ACCESS(this_ptr_ptr); - LDKNetworkUpdate this_ptr_conv = *(LDKNetworkUpdate*)(this_ptr_ptr); + LDKCandidateRouteHop this_ptr_conv = *(LDKCandidateRouteHop*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - NetworkUpdate_free(this_ptr_conv); + CandidateRouteHop_free(this_ptr_conv); } -static inline uint64_t NetworkUpdate_clone_ptr(LDKNetworkUpdate *NONNULL_PTR arg) { - LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); - *ret_copy = NetworkUpdate_clone(arg); +static inline uint64_t CandidateRouteHop_clone_ptr(LDKCandidateRouteHop *NONNULL_PTR arg) { + LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); + *ret_copy = CandidateRouteHop_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKNetworkUpdate* arg_conv = (LDKNetworkUpdate*)untag_ptr(arg); - int64_t ret_conv = NetworkUpdate_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCandidateRouteHop* arg_conv = (LDKCandidateRouteHop*)untag_ptr(arg); + int64_t ret_conv = CandidateRouteHop_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKNetworkUpdate* orig_conv = (LDKNetworkUpdate*)untag_ptr(orig); - LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); - *ret_copy = NetworkUpdate_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCandidateRouteHop* orig_conv = (LDKCandidateRouteHop*)untag_ptr(orig); + LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); + *ret_copy = CandidateRouteHop_clone(orig_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1channel_1update_1message(JNIEnv *env, jclass clz, int64_t msg) { - LDKChannelUpdate msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ChannelUpdate_clone(&msg_conv); - LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); - *ret_copy = NetworkUpdate_channel_update_message(msg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1first_1hop(JNIEnv *env, jclass clz, int64_t a) { + LDKFirstHopCandidate a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = FirstHopCandidate_clone(&a_conv); + LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); + *ret_copy = CandidateRouteHop_first_hop(a_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1channel_1failure(JNIEnv *env, jclass clz, int64_t short_channel_id, jboolean is_permanent) { - LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); - *ret_copy = NetworkUpdate_channel_failure(short_channel_id, is_permanent); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1public_1hop(JNIEnv *env, jclass clz, int64_t a) { + LDKPublicHopCandidate a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = PublicHopCandidate_clone(&a_conv); + LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); + *ret_copy = CandidateRouteHop_public_hop(a_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1node_1failure(JNIEnv *env, jclass clz, int8_tArray node_id, jboolean is_permanent) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); - *ret_copy = NetworkUpdate_node_failure(node_id_ref, is_permanent); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1private_1hop(JNIEnv *env, jclass clz, int64_t a) { + LDKPrivateHopCandidate a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = PrivateHopCandidate_clone(&a_conv); + LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); + *ret_copy = CandidateRouteHop_private_hop(a_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKNetworkUpdate* a_conv = (LDKNetworkUpdate*)untag_ptr(a); - LDKNetworkUpdate* b_conv = (LDKNetworkUpdate*)untag_ptr(b); - jboolean ret_conv = NetworkUpdate_eq(a_conv, b_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1blinded(JNIEnv *env, jclass clz, int64_t a) { + LDKBlindedPathCandidate a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = BlindedPathCandidate_clone(&a_conv); + LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); + *ret_copy = CandidateRouteHop_blinded(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKNetworkUpdate* obj_conv = (LDKNetworkUpdate*)untag_ptr(obj); - LDKCVec_u8Z ret_var = NetworkUpdate_write(obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1one_1hop_1blinded(JNIEnv *env, jclass clz, int64_t a) { + LDKOneHopBlindedPathCandidate a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = OneHopBlindedPathCandidate_clone(&a_conv); + LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); + *ret_copy = CandidateRouteHop_one_hop_blinded(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); - *ret_conv = NetworkUpdate_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1globally_1unique_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = CandidateRouteHop_globally_unique_short_channel_id(this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKP2PGossipSync this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - P2PGossipSync_free(this_obj_conv); +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); + int32_t ret_conv = CandidateRouteHop_cltv_expiry_delta(this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1new(JNIEnv *env, jclass clz, int64_t network_graph, int64_t utxo_lookup, int64_t logger) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); + int64_t ret_conv = CandidateRouteHop_htlc_minimum_msat(this_arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1fees(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); + LDKRoutingFees ret_var = CandidateRouteHop_fees(this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1source(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); + LDKNodeId ret_var = CandidateRouteHop_source(this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1target(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); + LDKNodeId ret_var = CandidateRouteHop_target(this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_find_1route(JNIEnv *env, jclass clz, int8_tArray our_node_pubkey, int64_t route_params, int64_t network_graph, int64_tArray first_hops, int64_t logger, int64_t scorer, int64_t score_params, int8_tArray random_seed_bytes) { + LDKPublicKey our_node_pubkey_ref; + CHECK((*env)->GetArrayLength(env, our_node_pubkey) == 33); + (*env)->GetByteArrayRegion(env, our_node_pubkey, 0, 33, our_node_pubkey_ref.compressed_form); + LDKRouteParameters route_params_conv; + route_params_conv.inner = untag_ptr(route_params); + route_params_conv.is_owned = ptr_is_owned(route_params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); + route_params_conv.is_owned = false; LDKNetworkGraph network_graph_conv; network_graph_conv.inner = untag_ptr(network_graph); network_graph_conv.is_owned = ptr_is_owned(network_graph); CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); network_graph_conv.is_owned = false; - void* utxo_lookup_ptr = untag_ptr(utxo_lookup); - CHECK_ACCESS(utxo_lookup_ptr); - LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr); - // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ - if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) { - // Manually implement clone for Java trait instances - if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some); + LDKCVec_ChannelDetailsZ first_hops_constr; + LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL; + if (first_hops != NULL) { + first_hops_constr.datalen = (*env)->GetArrayLength(env, first_hops); + if (first_hops_constr.datalen > 0) + first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); + else + first_hops_constr.data = NULL; + int64_t* first_hops_vals = (*env)->GetLongArrayElements (env, first_hops, NULL); + for (size_t q = 0; q < first_hops_constr.datalen; q++) { + int64_t first_hops_conv_16 = first_hops_vals[q]; + LDKChannelDetails first_hops_conv_16_conv; + first_hops_conv_16_conv.inner = untag_ptr(first_hops_conv_16); + first_hops_conv_16_conv.is_owned = ptr_is_owned(first_hops_conv_16); + CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv); + first_hops_conv_16_conv.is_owned = false; + first_hops_constr.data[q] = first_hops_conv_16_conv; } + (*env)->ReleaseLongArrayElements(env, first_hops, first_hops_vals, 0); + first_hops_ptr = &first_hops_constr; } void* logger_ptr = untag_ptr(logger); CHECK_ACCESS(logger_ptr); @@ -75419,1206 +79384,1376 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1new(JNIEnv * // If this_arg is a JCalls struct, then we need to increment the refcnt in it. LDKLogger_JCalls_cloned(&logger_conv); } - LDKP2PGossipSync ret_var = P2PGossipSync_new(&network_graph_conv, utxo_lookup_conv, logger_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + void* scorer_ptr = untag_ptr(scorer); + if (ptr_is_owned(scorer)) { CHECK_ACCESS(scorer_ptr); } + LDKScoreLookUp* scorer_conv = (LDKScoreLookUp*)scorer_ptr; + LDKProbabilisticScoringFeeParameters score_params_conv; + score_params_conv.inner = untag_ptr(score_params); + score_params_conv.is_owned = ptr_is_owned(score_params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(score_params_conv); + score_params_conv.is_owned = false; + uint8_t random_seed_bytes_arr[32]; + CHECK((*env)->GetArrayLength(env, random_seed_bytes) == 32); + (*env)->GetByteArrayRegion(env, random_seed_bytes, 0, 32, random_seed_bytes_arr); + uint8_t (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr; + LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); + *ret_conv = find_route(our_node_pubkey_ref, &route_params_conv, &network_graph_conv, first_hops_ptr, logger_conv, scorer_conv, &score_params_conv, random_seed_bytes_ref); + if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); } + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1add_1utxo_1lookup(JNIEnv *env, jclass clz, int64_t this_arg, int64_t utxo_lookup) { - LDKP2PGossipSync this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - void* utxo_lookup_ptr = untag_ptr(utxo_lookup); - CHECK_ACCESS(utxo_lookup_ptr); - LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr); - // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ - if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) { - // Manually implement clone for Java trait instances - if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some); - } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_build_1route_1from_1hops(JNIEnv *env, jclass clz, int8_tArray our_node_pubkey, jobjectArray hops, int64_t route_params, int64_t network_graph, int64_t logger, int8_tArray random_seed_bytes) { + LDKPublicKey our_node_pubkey_ref; + CHECK((*env)->GetArrayLength(env, our_node_pubkey) == 33); + (*env)->GetByteArrayRegion(env, our_node_pubkey, 0, 33, our_node_pubkey_ref.compressed_form); + LDKCVec_PublicKeyZ hops_constr; + hops_constr.datalen = (*env)->GetArrayLength(env, hops); + if (hops_constr.datalen > 0) + hops_constr.data = MALLOC(hops_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); + else + hops_constr.data = NULL; + for (size_t i = 0; i < hops_constr.datalen; i++) { + int8_tArray hops_conv_8 = (*env)->GetObjectArrayElement(env, hops, i); + LDKPublicKey hops_conv_8_ref; + CHECK((*env)->GetArrayLength(env, hops_conv_8) == 33); + (*env)->GetByteArrayRegion(env, hops_conv_8, 0, 33, hops_conv_8_ref.compressed_form); + hops_constr.data[i] = hops_conv_8_ref; } - P2PGossipSync_add_utxo_lookup(&this_arg_conv, utxo_lookup_conv); + LDKRouteParameters route_params_conv; + route_params_conv.inner = untag_ptr(route_params); + route_params_conv.is_owned = ptr_is_owned(route_params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); + route_params_conv.is_owned = false; + LDKNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + uint8_t random_seed_bytes_arr[32]; + CHECK((*env)->GetArrayLength(env, random_seed_bytes) == 32); + (*env)->GetByteArrayRegion(env, random_seed_bytes, 0, 32, random_seed_bytes_arr); + uint8_t (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr; + LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); + *ret_conv = build_route_from_hops(our_node_pubkey_ref, hops_constr, &route_params_conv, &network_graph_conv, logger_conv, random_seed_bytes_ref); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1handle_1network_1update(JNIEnv *env, jclass clz, int64_t this_arg, int64_t network_update) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNetworkUpdate* network_update_conv = (LDKNetworkUpdate*)untag_ptr(network_update); - NetworkGraph_handle_network_update(&this_arg_conv, network_update_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoreLookUp_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKScoreLookUp this_ptr_conv = *(LDKScoreLookUp*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + ScoreLookUp_free(this_ptr_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, NetworkGraph_get_chain_hash(&this_arg_conv).data); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoreUpdate_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKScoreUpdate this_ptr_conv = *(LDKScoreUpdate*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + ScoreUpdate_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_verify_1node_1announcement(JNIEnv *env, jclass clz, int64_t msg) { - LDKNodeAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = verify_node_announcement(&msg_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKScore this_ptr_conv = *(LDKScore*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Score_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_verify_1channel_1announcement(JNIEnv *env, jclass clz, int64_t msg) { - LDKChannelAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = verify_channel_announcement(&msg_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockableScore_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKLockableScore this_ptr_conv = *(LDKLockableScore*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + LockableScore_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1as_1RoutingMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKP2PGossipSync this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WriteableScore_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKWriteableScore this_ptr_conv = *(LDKWriteableScore*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + WriteableScore_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKMultiThreadedLockableScore this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + MultiThreadedLockableScore_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1as_1LockableScore(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKMultiThreadedLockableScore this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler"); - *ret_ret = P2PGossipSync_as_RoutingMessageHandler(&this_arg_conv); + LDKLockableScore* ret_ret = MALLOC(sizeof(LDKLockableScore), "LDKLockableScore"); + *ret_ret = MultiThreadedLockableScore_as_LockableScore(&this_arg_conv); return tag_ptr(ret_ret, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKP2PGossipSync this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKMultiThreadedLockableScore obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = MultiThreadedLockableScore_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1as_1WriteableScore(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKMultiThreadedLockableScore this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); - *ret_ret = P2PGossipSync_as_MessageSendEventsProvider(&this_arg_conv); + LDKWriteableScore* ret_ret = MALLOC(sizeof(LDKWriteableScore), "LDKWriteableScore"); + *ret_ret = MultiThreadedLockableScore_as_WriteableScore(&this_arg_conv); return tag_ptr(ret_ret, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelUpdateInfo this_obj_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1new(JNIEnv *env, jclass clz, int64_t score) { + void* score_ptr = untag_ptr(score); + CHECK_ACCESS(score_ptr); + LDKScore score_conv = *(LDKScore*)(score_ptr); + if (score_conv.free == LDKScore_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKScore_JCalls_cloned(&score_conv); + } + LDKMultiThreadedLockableScore ret_var = MultiThreadedLockableScore_new(score_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLockRead_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKMultiThreadedScoreLockRead this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelUpdateInfo_free(this_obj_conv); -} - -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1last_1update(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelUpdateInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int32_t ret_conv = ChannelUpdateInfo_get_last_update(&this_ptr_conv); - return ret_conv; + MultiThreadedScoreLockRead_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1last_1update(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKChannelUpdateInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelUpdateInfo_set_last_update(&this_ptr_conv, val); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLockWrite_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKMultiThreadedScoreLockWrite this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + MultiThreadedScoreLockWrite_free(this_obj_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1enabled(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelUpdateInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - jboolean ret_conv = ChannelUpdateInfo_get_enabled(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLockRead_1as_1ScoreLookUp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKMultiThreadedScoreLockRead this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKScoreLookUp* ret_ret = MALLOC(sizeof(LDKScoreLookUp), "LDKScoreLookUp"); + *ret_ret = MultiThreadedScoreLockRead_as_ScoreLookUp(&this_arg_conv); + return tag_ptr(ret_ret, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1enabled(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKChannelUpdateInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelUpdateInfo_set_enabled(&this_ptr_conv, val); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLockWrite_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKMultiThreadedScoreLockWrite obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = MultiThreadedScoreLockWrite_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelUpdateInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int16_t ret_conv = ChannelUpdateInfo_get_cltv_expiry_delta(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLockWrite_1as_1ScoreUpdate(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKMultiThreadedScoreLockWrite this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKScoreUpdate* ret_ret = MALLOC(sizeof(LDKScoreUpdate), "LDKScoreUpdate"); + *ret_ret = MultiThreadedScoreLockWrite_as_ScoreUpdate(&this_arg_conv); + return tag_ptr(ret_ret, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKChannelUpdateInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelUpdateInfo_set_cltv_expiry_delta(&this_ptr_conv, val); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelUsage this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelUsage_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelUpdateInfo this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelUsage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelUpdateInfo_get_htlc_minimum_msat(&this_ptr_conv); + int64_t ret_conv = ChannelUsage_get_amount_msat(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelUpdateInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelUsage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelUpdateInfo_set_htlc_minimum_msat(&this_ptr_conv, val); + ChannelUsage_set_amount_msat(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelUpdateInfo this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1inflight_1htlc_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelUsage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelUpdateInfo_get_htlc_maximum_msat(&this_ptr_conv); + int64_t ret_conv = ChannelUsage_get_inflight_htlc_msat(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelUpdateInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelUpdateInfo_set_htlc_maximum_msat(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1fees(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelUpdateInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKRoutingFees ret_var = ChannelUpdateInfo_get_fees(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1fees(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelUpdateInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1inflight_1htlc_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelUsage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKRoutingFees val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = RoutingFees_clone(&val_conv); - ChannelUpdateInfo_set_fees(&this_ptr_conv, val_conv); + ChannelUsage_set_inflight_htlc_msat(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1last_1update_1message(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelUpdateInfo this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1effective_1capacity(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelUsage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelUpdate ret_var = ChannelUpdateInfo_get_last_update_message(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = ChannelUsage_get_effective_capacity(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1last_1update_1message(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelUpdateInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1effective_1capacity(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelUsage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelUpdate val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelUpdate_clone(&val_conv); - ChannelUpdateInfo_set_last_update_message(&this_ptr_conv, val_conv); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKEffectiveCapacity val_conv = *(LDKEffectiveCapacity*)(val_ptr); + val_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(val)); + ChannelUsage_set_effective_capacity(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1new(JNIEnv *env, jclass clz, int32_t last_update_arg, jboolean enabled_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg, int64_t fees_arg, int64_t last_update_message_arg) { - LDKRoutingFees fees_arg_conv; - fees_arg_conv.inner = untag_ptr(fees_arg); - fees_arg_conv.is_owned = ptr_is_owned(fees_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv); - fees_arg_conv = RoutingFees_clone(&fees_arg_conv); - LDKChannelUpdate last_update_message_arg_conv; - last_update_message_arg_conv.inner = untag_ptr(last_update_message_arg); - last_update_message_arg_conv.is_owned = ptr_is_owned(last_update_message_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(last_update_message_arg_conv); - last_update_message_arg_conv = ChannelUpdate_clone(&last_update_message_arg_conv); - LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_new(last_update_arg, enabled_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, fees_arg_conv, last_update_message_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1new(JNIEnv *env, jclass clz, int64_t amount_msat_arg, int64_t inflight_htlc_msat_arg, int64_t effective_capacity_arg) { + void* effective_capacity_arg_ptr = untag_ptr(effective_capacity_arg); + CHECK_ACCESS(effective_capacity_arg_ptr); + LDKEffectiveCapacity effective_capacity_arg_conv = *(LDKEffectiveCapacity*)(effective_capacity_arg_ptr); + effective_capacity_arg_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(effective_capacity_arg)); + LDKChannelUsage ret_var = ChannelUsage_new(amount_msat_arg, inflight_htlc_msat_arg, effective_capacity_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t ChannelUpdateInfo_clone_ptr(LDKChannelUpdateInfo *NONNULL_PTR arg) { - LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_clone(arg); +static inline uint64_t ChannelUsage_clone_ptr(LDKChannelUsage *NONNULL_PTR arg) { + LDKChannelUsage ret_var = ChannelUsage_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelUpdateInfo arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelUsage arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = ChannelUpdateInfo_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelUsage_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelUpdateInfo orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelUsage orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_clone(&orig_conv); + LDKChannelUsage ret_var = ChannelUsage_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKChannelUpdateInfo a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKChannelUpdateInfo b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = ChannelUpdateInfo_eq(&a_conv, &b_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKFixedPenaltyScorer this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + FixedPenaltyScorer_free(this_obj_conv); } -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1to_1str(JNIEnv *env, jclass clz, int64_t o) { - LDKChannelUpdateInfo o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = ChannelUpdateInfo_to_str(&o_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); +static inline uint64_t FixedPenaltyScorer_clone_ptr(LDKFixedPenaltyScorer *NONNULL_PTR arg) { + LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKFixedPenaltyScorer arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = FixedPenaltyScorer_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelUpdateInfo obj_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKFixedPenaltyScorer orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1with_1penalty(JNIEnv *env, jclass clz, int64_t penalty_msat) { + LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_with_penalty(penalty_msat); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1as_1ScoreLookUp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKFixedPenaltyScorer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKScoreLookUp* ret_ret = MALLOC(sizeof(LDKScoreLookUp), "LDKScoreLookUp"); + *ret_ret = FixedPenaltyScorer_as_ScoreLookUp(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1as_1ScoreUpdate(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKFixedPenaltyScorer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKScoreUpdate* ret_ret = MALLOC(sizeof(LDKScoreUpdate), "LDKScoreUpdate"); + *ret_ret = FixedPenaltyScorer_as_ScoreUpdate(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKFixedPenaltyScorer obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ChannelUpdateInfo_write(&obj_conv); + LDKCVec_u8Z ret_var = FixedPenaltyScorer_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ"); - *ret_conv = ChannelUpdateInfo_read(ser_ref); + LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); + *ret_conv = FixedPenaltyScorer_read(ser_ref, arg); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelInfo this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKProbabilisticScorer this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelInfo_free(this_obj_conv); + ProbabilisticScorer_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKProbabilisticScoringFeeParameters this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ProbabilisticScoringFeeParameters_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1base_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelFeatures ret_var = ChannelInfo_get_features(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + int64_t ret_conv = ProbabilisticScoringFeeParameters_get_base_penalty_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1base_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelFeatures val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelFeatures_clone(&val_conv); - ChannelInfo_set_features(&this_ptr_conv, val_conv); + ProbabilisticScoringFeeParameters_set_base_penalty_msat(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1one(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelInfo this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1base_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeId ret_var = ChannelInfo_get_node_one(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + int64_t ret_conv = ProbabilisticScoringFeeParameters_get_base_penalty_amount_multiplier_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1one(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1base_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeId val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = NodeId_clone(&val_conv); - ChannelInfo_set_node_one(&this_ptr_conv, val_conv); + ProbabilisticScoringFeeParameters_set_base_penalty_amount_multiplier_msat(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1one_1to_1two(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelInfo this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1liquidity_1penalty_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelUpdateInfo ret_var = ChannelInfo_get_one_to_two(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + int64_t ret_conv = ProbabilisticScoringFeeParameters_get_liquidity_penalty_multiplier_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1one_1to_1two(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1liquidity_1penalty_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelUpdateInfo val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelUpdateInfo_clone(&val_conv); - ChannelInfo_set_one_to_two(&this_ptr_conv, val_conv); + ProbabilisticScoringFeeParameters_set_liquidity_penalty_multiplier_msat(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1two(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelInfo this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1liquidity_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeId ret_var = ChannelInfo_get_node_two(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + int64_t ret_conv = ProbabilisticScoringFeeParameters_get_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1two(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1liquidity_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeId val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = NodeId_clone(&val_conv); - ChannelInfo_set_node_two(&this_ptr_conv, val_conv); + ProbabilisticScoringFeeParameters_set_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1two_1to_1one(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelInfo this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1historical_1liquidity_1penalty_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelUpdateInfo ret_var = ChannelInfo_get_two_to_one(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + int64_t ret_conv = ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_multiplier_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1two_1to_1one(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1historical_1liquidity_1penalty_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelUpdateInfo val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelUpdateInfo_clone(&val_conv); - ChannelInfo_set_two_to_one(&this_ptr_conv, val_conv); + ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_multiplier_msat(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1capacity_1sats(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelInfo this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1historical_1liquidity_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelInfo_get_capacity_sats(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + int64_t ret_conv = ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1capacity_1sats(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1historical_1liquidity_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - ChannelInfo_set_capacity_sats(&this_ptr_conv, val_conv); + ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1announcement_1message(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelInfo this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1anti_1probing_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelAnnouncement ret_var = ChannelInfo_get_announcement_message(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + int64_t ret_conv = ProbabilisticScoringFeeParameters_get_anti_probing_penalty_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1announcement_1message(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1anti_1probing_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelAnnouncement val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelAnnouncement_clone(&val_conv); - ChannelInfo_set_announcement_message(&this_ptr_conv, val_conv); -} - -static inline uint64_t ChannelInfo_clone_ptr(LDKChannelInfo *NONNULL_PTR arg) { - LDKChannelInfo ret_var = ChannelInfo_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelInfo arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = ChannelInfo_clone_ptr(&arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelInfo orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKChannelInfo ret_var = ChannelInfo_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + ProbabilisticScoringFeeParameters_set_anti_probing_penalty_msat(&this_ptr_conv, val); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKChannelInfo a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKChannelInfo b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = ChannelInfo_eq(&a_conv, &b_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1considered_1impossible_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ProbabilisticScoringFeeParameters_get_considered_impossible_penalty_msat(&this_ptr_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1directional_1info(JNIEnv *env, jclass clz, int64_t this_arg, int8_t channel_flags) { - LDKChannelInfo this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelUpdateInfo ret_var = ChannelInfo_get_directional_info(&this_arg_conv, channel_flags); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1considered_1impossible_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ProbabilisticScoringFeeParameters_set_considered_impossible_penalty_msat(&this_ptr_conv, val); } -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1to_1str(JNIEnv *env, jclass clz, int64_t o) { - LDKChannelInfo o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = ChannelInfo_to_str(&o_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1linear_1success_1probability(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + jboolean ret_conv = ProbabilisticScoringFeeParameters_get_linear_success_probability(&this_ptr_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelInfo obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ChannelInfo_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); - *ret_conv = ChannelInfo_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKDirectedChannelInfo this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - DirectedChannelInfo_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1linear_1success_1probability(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ProbabilisticScoringFeeParameters_set_linear_success_probability(&this_ptr_conv, val); } -static inline uint64_t DirectedChannelInfo_clone_ptr(LDKDirectedChannelInfo *NONNULL_PTR arg) { - LDKDirectedChannelInfo ret_var = DirectedChannelInfo_clone(arg); +static inline uint64_t ProbabilisticScoringFeeParameters_clone_ptr(LDKProbabilisticScoringFeeParameters *NONNULL_PTR arg) { + LDKProbabilisticScoringFeeParameters ret_var = ProbabilisticScoringFeeParameters_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKDirectedChannelInfo arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKProbabilisticScoringFeeParameters arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = DirectedChannelInfo_clone_ptr(&arg_conv); + int64_t ret_conv = ProbabilisticScoringFeeParameters_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKDirectedChannelInfo orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKProbabilisticScoringFeeParameters orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKDirectedChannelInfo ret_var = DirectedChannelInfo_clone(&orig_conv); + LDKProbabilisticScoringFeeParameters ret_var = ProbabilisticScoringFeeParameters_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1channel(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKDirectedChannelInfo this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelInfo ret_var = DirectedChannelInfo_channel(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1default(JNIEnv *env, jclass clz) { + LDKProbabilisticScoringFeeParameters ret_var = ProbabilisticScoringFeeParameters_default(); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1effective_1capacity(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKDirectedChannelInfo this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1add_1banned(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_id) { + LDKProbabilisticScoringFeeParameters this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = DirectedChannelInfo_effective_capacity(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKNodeId node_id_conv; + node_id_conv.inner = untag_ptr(node_id); + node_id_conv.is_owned = ptr_is_owned(node_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); + node_id_conv.is_owned = false; + ProbabilisticScoringFeeParameters_add_banned(&this_arg_conv, &node_id_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1source(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKDirectedChannelInfo this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1add_1banned_1from_1list(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray node_ids) { + LDKProbabilisticScoringFeeParameters this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKNodeId ret_var = DirectedChannelInfo_source(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + LDKCVec_NodeIdZ node_ids_constr; + node_ids_constr.datalen = (*env)->GetArrayLength(env, node_ids); + if (node_ids_constr.datalen > 0) + node_ids_constr.data = MALLOC(node_ids_constr.datalen * sizeof(LDKNodeId), "LDKCVec_NodeIdZ Elements"); + else + node_ids_constr.data = NULL; + int64_t* node_ids_vals = (*env)->GetLongArrayElements (env, node_ids, NULL); + for (size_t i = 0; i < node_ids_constr.datalen; i++) { + int64_t node_ids_conv_8 = node_ids_vals[i]; + LDKNodeId node_ids_conv_8_conv; + node_ids_conv_8_conv.inner = untag_ptr(node_ids_conv_8); + node_ids_conv_8_conv.is_owned = ptr_is_owned(node_ids_conv_8); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_ids_conv_8_conv); + node_ids_conv_8_conv = NodeId_clone(&node_ids_conv_8_conv); + node_ids_constr.data[i] = node_ids_conv_8_conv; + } + (*env)->ReleaseLongArrayElements(env, node_ids, node_ids_vals, 0); + ProbabilisticScoringFeeParameters_add_banned_from_list(&this_arg_conv, node_ids_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1target(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKDirectedChannelInfo this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1remove_1banned(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_id) { + LDKProbabilisticScoringFeeParameters this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKNodeId ret_var = DirectedChannelInfo_target(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + LDKNodeId node_id_conv; + node_id_conv.inner = untag_ptr(node_id); + node_id_conv.is_owned = ptr_is_owned(node_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); + node_id_conv.is_owned = false; + ProbabilisticScoringFeeParameters_remove_banned(&this_arg_conv, &node_id_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKEffectiveCapacity this_ptr_conv = *(LDKEffectiveCapacity*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - EffectiveCapacity_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1manual_1penalty(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_id, int64_t penalty) { + LDKProbabilisticScoringFeeParameters this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeId node_id_conv; + node_id_conv.inner = untag_ptr(node_id); + node_id_conv.is_owned = ptr_is_owned(node_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); + node_id_conv.is_owned = false; + ProbabilisticScoringFeeParameters_set_manual_penalty(&this_arg_conv, &node_id_conv, penalty); } -static inline uint64_t EffectiveCapacity_clone_ptr(LDKEffectiveCapacity *NONNULL_PTR arg) { - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1remove_1manual_1penalty(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_id) { + LDKProbabilisticScoringFeeParameters this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeId node_id_conv; + node_id_conv.inner = untag_ptr(node_id); + node_id_conv.is_owned = ptr_is_owned(node_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); + node_id_conv.is_owned = false; + ProbabilisticScoringFeeParameters_remove_manual_penalty(&this_arg_conv, &node_id_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKEffectiveCapacity* arg_conv = (LDKEffectiveCapacity*)untag_ptr(arg); - int64_t ret_conv = EffectiveCapacity_clone_ptr(arg_conv); - return ret_conv; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1clear_1manual_1penalties(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKProbabilisticScoringFeeParameters this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ProbabilisticScoringFeeParameters_clear_manual_penalties(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKEffectiveCapacity* orig_conv = (LDKEffectiveCapacity*)untag_ptr(orig); - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1exact_1liquidity(JNIEnv *env, jclass clz, int64_t liquidity_msat) { - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_exact_liquidity(liquidity_msat); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1advertised_1max_1htlc(JNIEnv *env, jclass clz, int64_t amount_msat) { - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_advertised_max_htlc(amount_msat); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1total(JNIEnv *env, jclass clz, int64_t capacity_msat, int64_t htlc_maximum_msat) { - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_total(capacity_msat, htlc_maximum_msat); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1infinite(JNIEnv *env, jclass clz) { - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_infinite(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1hint_1max_1htlc(JNIEnv *env, jclass clz, int64_t amount_msat) { - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_hint_max_htlc(amount_msat); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1unknown(JNIEnv *env, jclass clz) { - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_unknown(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1as_1msat(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKEffectiveCapacity* this_arg_conv = (LDKEffectiveCapacity*)untag_ptr(this_arg); - int64_t ret_conv = EffectiveCapacity_as_msat(this_arg_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKRoutingFees this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKProbabilisticScoringDecayParameters this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - RoutingFees_free(this_obj_conv); + ProbabilisticScoringDecayParameters_free(this_obj_conv); } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRoutingFees this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1get_1historical_1no_1updates_1half_1life(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKProbabilisticScoringDecayParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int32_t ret_conv = RoutingFees_get_base_msat(&this_ptr_conv); + int64_t ret_conv = ProbabilisticScoringDecayParameters_get_historical_no_updates_half_life(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKRoutingFees this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1set_1historical_1no_1updates_1half_1life(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringDecayParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - RoutingFees_set_base_msat(&this_ptr_conv, val); + ProbabilisticScoringDecayParameters_set_historical_no_updates_half_life(&this_ptr_conv, val); } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRoutingFees this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1get_1liquidity_1offset_1half_1life(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKProbabilisticScoringDecayParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int32_t ret_conv = RoutingFees_get_proportional_millionths(&this_ptr_conv); + int64_t ret_conv = ProbabilisticScoringDecayParameters_get_liquidity_offset_half_life(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKRoutingFees this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1set_1liquidity_1offset_1half_1life(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringDecayParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - RoutingFees_set_proportional_millionths(&this_ptr_conv, val); + ProbabilisticScoringDecayParameters_set_liquidity_offset_half_life(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1new(JNIEnv *env, jclass clz, int32_t base_msat_arg, int32_t proportional_millionths_arg) { - LDKRoutingFees ret_var = RoutingFees_new(base_msat_arg, proportional_millionths_arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1new(JNIEnv *env, jclass clz, int64_t historical_no_updates_half_life_arg, int64_t liquidity_offset_half_life_arg) { + LDKProbabilisticScoringDecayParameters ret_var = ProbabilisticScoringDecayParameters_new(historical_no_updates_half_life_arg, liquidity_offset_half_life_arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RoutingFees_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKRoutingFees a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKRoutingFees b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = RoutingFees_eq(&a_conv, &b_conv); - return ret_conv; -} - -static inline uint64_t RoutingFees_clone_ptr(LDKRoutingFees *NONNULL_PTR arg) { - LDKRoutingFees ret_var = RoutingFees_clone(arg); +static inline uint64_t ProbabilisticScoringDecayParameters_clone_ptr(LDKProbabilisticScoringDecayParameters *NONNULL_PTR arg) { + LDKProbabilisticScoringDecayParameters ret_var = ProbabilisticScoringDecayParameters_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKRoutingFees arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKProbabilisticScoringDecayParameters arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = RoutingFees_clone_ptr(&arg_conv); + int64_t ret_conv = ProbabilisticScoringDecayParameters_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKRoutingFees orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKProbabilisticScoringDecayParameters orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKRoutingFees ret_var = RoutingFees_clone(&orig_conv); + LDKProbabilisticScoringDecayParameters ret_var = ProbabilisticScoringDecayParameters_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKRoutingFees o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = RoutingFees_hash(&o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1default(JNIEnv *env, jclass clz) { + LDKProbabilisticScoringDecayParameters ret_var = ProbabilisticScoringDecayParameters_default(); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RoutingFees_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKRoutingFees obj_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1new(JNIEnv *env, jclass clz, int64_t decay_params, int64_t network_graph, int64_t logger) { + LDKProbabilisticScoringDecayParameters decay_params_conv; + decay_params_conv.inner = untag_ptr(decay_params); + decay_params_conv.is_owned = ptr_is_owned(decay_params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(decay_params_conv); + decay_params_conv = ProbabilisticScoringDecayParameters_clone(&decay_params_conv); + LDKNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKProbabilisticScorer ret_var = ProbabilisticScorer_new(decay_params_conv, &network_graph_conv, logger_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1debug_1log_1liquidity_1stats(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKProbabilisticScorer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ProbabilisticScorer_debug_log_liquidity_stats(&this_arg_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1estimated_1channel_1liquidity_1range(JNIEnv *env, jclass clz, int64_t this_arg, int64_t scid, int64_t target) { + LDKProbabilisticScorer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeId target_conv; + target_conv.inner = untag_ptr(target); + target_conv.is_owned = ptr_is_owned(target); + CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); + target_conv.is_owned = false; + LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ"); + *ret_copy = ProbabilisticScorer_estimated_channel_liquidity_range(&this_arg_conv, scid, &target_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1historical_1estimated_1channel_1liquidity_1probabilities(JNIEnv *env, jclass clz, int64_t this_arg, int64_t scid, int64_t target) { + LDKProbabilisticScorer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeId target_conv; + target_conv.inner = untag_ptr(target); + target_conv.is_owned = ptr_is_owned(target); + CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); + target_conv.is_owned = false; + LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ), "LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ"); + *ret_copy = ProbabilisticScorer_historical_estimated_channel_liquidity_probabilities(&this_arg_conv, scid, &target_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1historical_1estimated_1payment_1success_1probability(JNIEnv *env, jclass clz, int64_t this_arg, int64_t scid, int64_t target, int64_t amount_msat, int64_t params) { + LDKProbabilisticScorer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeId target_conv; + target_conv.inner = untag_ptr(target); + target_conv.is_owned = ptr_is_owned(target); + CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); + target_conv.is_owned = false; + LDKProbabilisticScoringFeeParameters params_conv; + params_conv.inner = untag_ptr(params); + params_conv.is_owned = ptr_is_owned(params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); + params_conv.is_owned = false; + LDKCOption_f64Z *ret_copy = MALLOC(sizeof(LDKCOption_f64Z), "LDKCOption_f64Z"); + *ret_copy = ProbabilisticScorer_historical_estimated_payment_success_probability(&this_arg_conv, scid, &target_conv, amount_msat, ¶ms_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1as_1ScoreLookUp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKProbabilisticScorer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKScoreLookUp* ret_ret = MALLOC(sizeof(LDKScoreLookUp), "LDKScoreLookUp"); + *ret_ret = ProbabilisticScorer_as_ScoreLookUp(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1as_1ScoreUpdate(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKProbabilisticScorer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKScoreUpdate* ret_ret = MALLOC(sizeof(LDKScoreUpdate), "LDKScoreUpdate"); + *ret_ret = ProbabilisticScorer_as_ScoreUpdate(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1as_1Score(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKProbabilisticScorer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore"); + *ret_ret = ProbabilisticScorer_as_Score(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKProbabilisticScorer obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = RoutingFees_write(&obj_conv); + LDKCVec_u8Z ret_var = ProbabilisticScorer_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg_a, int64_t arg_b, int64_t arg_c) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); - *ret_conv = RoutingFees_read(ser_ref); + LDKProbabilisticScoringDecayParameters arg_a_conv; + arg_a_conv.inner = untag_ptr(arg_a); + arg_a_conv.is_owned = ptr_is_owned(arg_a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_a_conv); + arg_a_conv = ProbabilisticScoringDecayParameters_clone(&arg_a_conv); + LDKNetworkGraph arg_b_conv; + arg_b_conv.inner = untag_ptr(arg_b); + arg_b_conv.is_owned = ptr_is_owned(arg_b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_b_conv); + arg_b_conv.is_owned = false; + void* arg_c_ptr = untag_ptr(arg_c); + CHECK_ACCESS(arg_c_ptr); + LDKLogger arg_c_conv = *(LDKLogger*)(arg_c_ptr); + if (arg_c_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&arg_c_conv); + } + LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ"); + *ret_conv = ProbabilisticScorer_read(ser_ref, arg_a_conv, &arg_b_conv, arg_c_conv); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKNodeAnnouncementInfo this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKDelayedPaymentOutputDescriptor this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - NodeAnnouncementInfo_free(this_obj_conv); + DelayedPaymentOutputDescriptor_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKNodeAnnouncementInfo this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeFeatures ret_var = NodeAnnouncementInfo_get_features(&this_ptr_conv); + LDKOutPoint ret_var = DelayedPaymentOutputDescriptor_get_outpoint(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKNodeAnnouncementInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeFeatures val_conv; + LDKOutPoint val_conv; val_conv.inner = untag_ptr(val); val_conv.is_owned = ptr_is_owned(val); CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = NodeFeatures_clone(&val_conv); - NodeAnnouncementInfo_set_features(&this_ptr_conv, val_conv); + val_conv = OutPoint_clone(&val_conv); + DelayedPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DelayedPaymentOutputDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + DelayedPaymentOutputDescriptor_set_per_commitment_point(&this_ptr_conv, val_ref); } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1last_1update(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKNodeAnnouncementInfo this_ptr_conv; +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int32_t ret_conv = NodeAnnouncementInfo_get_last_update(&this_ptr_conv); + int16_t ret_conv = DelayedPaymentOutputDescriptor_get_to_self_delay(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1last_1update(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKNodeAnnouncementInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - NodeAnnouncementInfo_set_last_update(&this_ptr_conv, val); + DelayedPaymentOutputDescriptor_set_to_self_delay(&this_ptr_conv, val); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1rgb(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKNodeAnnouncementInfo this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1output(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 3); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 3, *NodeAnnouncementInfo_get_rgb(&this_ptr_conv)); - return ret_arr; + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = DelayedPaymentOutputDescriptor_get_output(&this_ptr_conv); + return tag_ptr(ret_ref, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1rgb(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKNodeAnnouncementInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1output(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThreeBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 3); - (*env)->GetByteArrayRegion(env, val, 0, 3, val_ref.data); - NodeAnnouncementInfo_set_rgb(&this_ptr_conv, val_ref); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); + val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val)); + DelayedPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1alias(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKNodeAnnouncementInfo this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1revocation_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeAlias ret_var = NodeAnnouncementInfo_get_alias(&this_ptr_conv); + LDKRevocationKey ret_var = DelayedPaymentOutputDescriptor_get_revocation_pubkey(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1alias(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKNodeAnnouncementInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1revocation_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeAlias val_conv; + LDKRevocationKey val_conv; val_conv.inner = untag_ptr(val); val_conv.is_owned = ptr_is_owned(val); CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = NodeAlias_clone(&val_conv); - NodeAnnouncementInfo_set_alias(&this_ptr_conv, val_conv); + val_conv = RevocationKey_clone(&val_conv); + DelayedPaymentOutputDescriptor_set_revocation_pubkey(&this_ptr_conv, val_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *DelayedPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv)); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + DelayedPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = DelayedPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + DelayedPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1announcement_1message(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKNodeAnnouncementInfo this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1transaction_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeAnnouncement ret_var = NodeAnnouncementInfo_get_announcement_message(&this_ptr_conv); + LDKChannelTransactionParameters ret_var = DelayedPaymentOutputDescriptor_get_channel_transaction_parameters(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1announcement_1message(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKNodeAnnouncementInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1transaction_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeAnnouncement val_conv; + LDKChannelTransactionParameters val_conv; val_conv.inner = untag_ptr(val); val_conv.is_owned = ptr_is_owned(val); CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = NodeAnnouncement_clone(&val_conv); - NodeAnnouncementInfo_set_announcement_message(&this_ptr_conv, val_conv); + val_conv = ChannelTransactionParameters_clone(&val_conv); + DelayedPaymentOutputDescriptor_set_channel_transaction_parameters(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1new(JNIEnv *env, jclass clz, int64_t features_arg, int32_t last_update_arg, int8_tArray rgb_arg, int64_t alias_arg, int64_t announcement_message_arg) { - LDKNodeFeatures features_arg_conv; - features_arg_conv.inner = untag_ptr(features_arg); - features_arg_conv.is_owned = ptr_is_owned(features_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); - features_arg_conv = NodeFeatures_clone(&features_arg_conv); - LDKThreeBytes rgb_arg_ref; - CHECK((*env)->GetArrayLength(env, rgb_arg) == 3); - (*env)->GetByteArrayRegion(env, rgb_arg, 0, 3, rgb_arg_ref.data); - LDKNodeAlias alias_arg_conv; - alias_arg_conv.inner = untag_ptr(alias_arg); - alias_arg_conv.is_owned = ptr_is_owned(alias_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(alias_arg_conv); - alias_arg_conv = NodeAlias_clone(&alias_arg_conv); - LDKNodeAnnouncement announcement_message_arg_conv; - announcement_message_arg_conv.inner = untag_ptr(announcement_message_arg); - announcement_message_arg_conv.is_owned = ptr_is_owned(announcement_message_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_message_arg_conv); - announcement_message_arg_conv = NodeAnnouncement_clone(&announcement_message_arg_conv); - LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_new(features_arg_conv, last_update_arg, rgb_arg_ref, alias_arg_conv, announcement_message_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1new(JNIEnv *env, jclass clz, int64_t outpoint_arg, int8_tArray per_commitment_point_arg, int16_t to_self_delay_arg, int64_t output_arg, int64_t revocation_pubkey_arg, int8_tArray channel_keys_id_arg, int64_t channel_value_satoshis_arg, int64_t channel_transaction_parameters_arg) { + LDKOutPoint outpoint_arg_conv; + outpoint_arg_conv.inner = untag_ptr(outpoint_arg); + outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); + outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); + LDKPublicKey per_commitment_point_arg_ref; + CHECK((*env)->GetArrayLength(env, per_commitment_point_arg) == 33); + (*env)->GetByteArrayRegion(env, per_commitment_point_arg, 0, 33, per_commitment_point_arg_ref.compressed_form); + void* output_arg_ptr = untag_ptr(output_arg); + CHECK_ACCESS(output_arg_ptr); + LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr); + output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg)); + LDKRevocationKey revocation_pubkey_arg_conv; + revocation_pubkey_arg_conv.inner = untag_ptr(revocation_pubkey_arg); + revocation_pubkey_arg_conv.is_owned = ptr_is_owned(revocation_pubkey_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(revocation_pubkey_arg_conv); + revocation_pubkey_arg_conv = RevocationKey_clone(&revocation_pubkey_arg_conv); + LDKThirtyTwoBytes channel_keys_id_arg_ref; + CHECK((*env)->GetArrayLength(env, channel_keys_id_arg) == 32); + (*env)->GetByteArrayRegion(env, channel_keys_id_arg, 0, 32, channel_keys_id_arg_ref.data); + LDKChannelTransactionParameters channel_transaction_parameters_arg_conv; + channel_transaction_parameters_arg_conv.inner = untag_ptr(channel_transaction_parameters_arg); + channel_transaction_parameters_arg_conv.is_owned = ptr_is_owned(channel_transaction_parameters_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_transaction_parameters_arg_conv); + channel_transaction_parameters_arg_conv = ChannelTransactionParameters_clone(&channel_transaction_parameters_arg_conv); + LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_new(outpoint_arg_conv, per_commitment_point_arg_ref, to_self_delay_arg, output_arg_conv, revocation_pubkey_arg_conv, channel_keys_id_arg_ref, channel_value_satoshis_arg, channel_transaction_parameters_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t NodeAnnouncementInfo_clone_ptr(LDKNodeAnnouncementInfo *NONNULL_PTR arg) { - LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(arg); +static inline uint64_t DelayedPaymentOutputDescriptor_clone_ptr(LDKDelayedPaymentOutputDescriptor *NONNULL_PTR arg) { + LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKNodeAnnouncementInfo arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKDelayedPaymentOutputDescriptor arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = NodeAnnouncementInfo_clone_ptr(&arg_conv); + int64_t ret_conv = DelayedPaymentOutputDescriptor_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKNodeAnnouncementInfo orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKDelayedPaymentOutputDescriptor orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(&orig_conv); + LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKNodeAnnouncementInfo a_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKDelayedPaymentOutputDescriptor o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = DelayedPaymentOutputDescriptor_hash(&o_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKDelayedPaymentOutputDescriptor a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKNodeAnnouncementInfo b_conv; + LDKDelayedPaymentOutputDescriptor b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = NodeAnnouncementInfo_eq(&a_conv, &b_conv); + jboolean ret_conv = DelayedPaymentOutputDescriptor_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1addresses(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeAnnouncementInfo this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_SocketAddressZ ret_var = NodeAnnouncementInfo_addresses(&this_arg_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t p = 0; p < ret_var.datalen; p++) { - LDKSocketAddress *ret_conv_15_copy = MALLOC(sizeof(LDKSocketAddress), "LDKSocketAddress"); - *ret_conv_15_copy = ret_var.data[p]; - int64_t ret_conv_15_ref = tag_ptr(ret_conv_15_copy, true); - ret_arr_ptr[p] = ret_conv_15_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKNodeAnnouncementInfo obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKDelayedPaymentOutputDescriptor obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = NodeAnnouncementInfo_write(&obj_conv); + LDKCVec_u8Z ret_var = DelayedPaymentOutputDescriptor_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); - *ret_conv = NodeAnnouncementInfo_read(ser_ref); + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = DelayedPaymentOutputDescriptor_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAlias_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKNodeAlias this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKStaticPaymentOutputDescriptor this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - NodeAlias_free(this_obj_conv); + StaticPaymentOutputDescriptor_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAlias_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKNodeAlias this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *NodeAlias_get_a(&this_ptr_conv)); + LDKOutPoint ret_var = StaticPaymentOutputDescriptor_get_outpoint(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKOutPoint val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = OutPoint_clone(&val_conv); + StaticPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1output(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = StaticPaymentOutputDescriptor_get_output(&this_ptr_conv); + return tag_ptr(ret_ref, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1output(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); + val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val)); + StaticPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *StaticPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAlias_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKNodeAlias this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -76626,11943 +80761,13267 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAlias_1set_1a(JNIEnv *env, LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - NodeAlias_set_a(&this_ptr_conv, val_ref); + StaticPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAlias_1new(JNIEnv *env, jclass clz, int8_tArray a_arg) { - LDKThirtyTwoBytes a_arg_ref; - CHECK((*env)->GetArrayLength(env, a_arg) == 32); - (*env)->GetByteArrayRegion(env, a_arg, 0, 32, a_arg_ref.data); - LDKNodeAlias ret_var = NodeAlias_new(a_arg_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = StaticPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + StaticPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1transaction_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelTransactionParameters ret_var = StaticPaymentOutputDescriptor_get_channel_transaction_parameters(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t NodeAlias_clone_ptr(LDKNodeAlias *NONNULL_PTR arg) { - LDKNodeAlias ret_var = NodeAlias_clone(arg); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1transaction_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelTransactionParameters val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelTransactionParameters_clone(&val_conv); + StaticPaymentOutputDescriptor_set_channel_transaction_parameters(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1new(JNIEnv *env, jclass clz, int64_t outpoint_arg, int64_t output_arg, int8_tArray channel_keys_id_arg, int64_t channel_value_satoshis_arg, int64_t channel_transaction_parameters_arg) { + LDKOutPoint outpoint_arg_conv; + outpoint_arg_conv.inner = untag_ptr(outpoint_arg); + outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); + outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); + void* output_arg_ptr = untag_ptr(output_arg); + CHECK_ACCESS(output_arg_ptr); + LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr); + output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg)); + LDKThirtyTwoBytes channel_keys_id_arg_ref; + CHECK((*env)->GetArrayLength(env, channel_keys_id_arg) == 32); + (*env)->GetByteArrayRegion(env, channel_keys_id_arg, 0, 32, channel_keys_id_arg_ref.data); + LDKChannelTransactionParameters channel_transaction_parameters_arg_conv; + channel_transaction_parameters_arg_conv.inner = untag_ptr(channel_transaction_parameters_arg); + channel_transaction_parameters_arg_conv.is_owned = ptr_is_owned(channel_transaction_parameters_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_transaction_parameters_arg_conv); + channel_transaction_parameters_arg_conv = ChannelTransactionParameters_clone(&channel_transaction_parameters_arg_conv); + LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_new(outpoint_arg_conv, output_arg_conv, channel_keys_id_arg_ref, channel_value_satoshis_arg, channel_transaction_parameters_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAlias_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKNodeAlias arg_conv; + +static inline uint64_t StaticPaymentOutputDescriptor_clone_ptr(LDKStaticPaymentOutputDescriptor *NONNULL_PTR arg) { + LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKStaticPaymentOutputDescriptor arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = NodeAlias_clone_ptr(&arg_conv); + int64_t ret_conv = StaticPaymentOutputDescriptor_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAlias_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKNodeAlias orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKStaticPaymentOutputDescriptor orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKNodeAlias ret_var = NodeAlias_clone(&orig_conv); + LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAlias_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKNodeAlias o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKStaticPaymentOutputDescriptor o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv.is_owned = false; - int64_t ret_conv = NodeAlias_hash(&o_conv); + int64_t ret_conv = StaticPaymentOutputDescriptor_hash(&o_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeAlias_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKNodeAlias a_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKStaticPaymentOutputDescriptor a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKNodeAlias b_conv; + LDKStaticPaymentOutputDescriptor b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = NodeAlias_eq(&a_conv, &b_conv); + jboolean ret_conv = StaticPaymentOutputDescriptor_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_NodeAlias_1to_1str(JNIEnv *env, jclass clz, int64_t o) { - LDKNodeAlias o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = NodeAlias_to_str(&o_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1witness_1script(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKStaticPaymentOutputDescriptor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = StaticPaymentOutputDescriptor_witness_script(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1max_1witness_1length(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKStaticPaymentOutputDescriptor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int64_t ret_conv = StaticPaymentOutputDescriptor_max_witness_length(&this_arg_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAlias_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKNodeAlias obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKStaticPaymentOutputDescriptor obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = NodeAlias_write(&obj_conv); + LDKCVec_u8Z ret_var = StaticPaymentOutputDescriptor_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAlias_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ"); - *ret_conv = NodeAlias_read(ser_ref); + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = StaticPaymentOutputDescriptor_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKNodeInfo this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + SpendableOutputDescriptor_free(this_ptr_conv); +} + +static inline uint64_t SpendableOutputDescriptor_clone_ptr(LDKSpendableOutputDescriptor *NONNULL_PTR arg) { + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = SpendableOutputDescriptor_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKSpendableOutputDescriptor* arg_conv = (LDKSpendableOutputDescriptor*)untag_ptr(arg); + int64_t ret_conv = SpendableOutputDescriptor_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKSpendableOutputDescriptor* orig_conv = (LDKSpendableOutputDescriptor*)untag_ptr(orig); + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = SpendableOutputDescriptor_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1static_1output(JNIEnv *env, jclass clz, int64_t outpoint, int64_t output, int8_tArray channel_keys_id) { + LDKOutPoint outpoint_conv; + outpoint_conv.inner = untag_ptr(outpoint); + outpoint_conv.is_owned = ptr_is_owned(outpoint); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv); + outpoint_conv = OutPoint_clone(&outpoint_conv); + void* output_ptr = untag_ptr(output); + CHECK_ACCESS(output_ptr); + LDKTxOut output_conv = *(LDKTxOut*)(output_ptr); + output_conv = TxOut_clone((LDKTxOut*)untag_ptr(output)); + LDKThirtyTwoBytes channel_keys_id_ref; + CHECK((*env)->GetArrayLength(env, channel_keys_id) == 32); + (*env)->GetByteArrayRegion(env, channel_keys_id, 0, 32, channel_keys_id_ref.data); + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = SpendableOutputDescriptor_static_output(outpoint_conv, output_conv, channel_keys_id_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1delayed_1payment_1output(JNIEnv *env, jclass clz, int64_t a) { + LDKDelayedPaymentOutputDescriptor a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = DelayedPaymentOutputDescriptor_clone(&a_conv); + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = SpendableOutputDescriptor_delayed_payment_output(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1static_1payment_1output(JNIEnv *env, jclass clz, int64_t a) { + LDKStaticPaymentOutputDescriptor a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = StaticPaymentOutputDescriptor_clone(&a_conv); + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = SpendableOutputDescriptor_static_payment_output(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKSpendableOutputDescriptor* o_conv = (LDKSpendableOutputDescriptor*)untag_ptr(o); + int64_t ret_conv = SpendableOutputDescriptor_hash(o_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKSpendableOutputDescriptor* a_conv = (LDKSpendableOutputDescriptor*)untag_ptr(a); + LDKSpendableOutputDescriptor* b_conv = (LDKSpendableOutputDescriptor*)untag_ptr(b); + jboolean ret_conv = SpendableOutputDescriptor_eq(a_conv, b_conv); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKSpendableOutputDescriptor* obj_conv = (LDKSpendableOutputDescriptor*)untag_ptr(obj); + LDKCVec_u8Z ret_var = SpendableOutputDescriptor_write(obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); + *ret_conv = SpendableOutputDescriptor_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1create_1spendable_1outputs_1psbt(JNIEnv *env, jclass clz, int64_tArray descriptors, int64_tArray outputs, int8_tArray change_destination_script, int32_t feerate_sat_per_1000_weight, int64_t locktime) { + LDKCVec_SpendableOutputDescriptorZ descriptors_constr; + descriptors_constr.datalen = (*env)->GetArrayLength(env, descriptors); + if (descriptors_constr.datalen > 0) + descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); + else + descriptors_constr.data = NULL; + int64_t* descriptors_vals = (*env)->GetLongArrayElements (env, descriptors, NULL); + for (size_t b = 0; b < descriptors_constr.datalen; b++) { + int64_t descriptors_conv_27 = descriptors_vals[b]; + void* descriptors_conv_27_ptr = untag_ptr(descriptors_conv_27); + CHECK_ACCESS(descriptors_conv_27_ptr); + LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr); + descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(descriptors_conv_27)); + descriptors_constr.data[b] = descriptors_conv_27_conv; + } + (*env)->ReleaseLongArrayElements(env, descriptors, descriptors_vals, 0); + LDKCVec_TxOutZ outputs_constr; + outputs_constr.datalen = (*env)->GetArrayLength(env, outputs); + if (outputs_constr.datalen > 0) + outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements"); + else + outputs_constr.data = NULL; + int64_t* outputs_vals = (*env)->GetLongArrayElements (env, outputs, NULL); + for (size_t h = 0; h < outputs_constr.datalen; h++) { + int64_t outputs_conv_7 = outputs_vals[h]; + void* outputs_conv_7_ptr = untag_ptr(outputs_conv_7); + CHECK_ACCESS(outputs_conv_7_ptr); + LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr); + outputs_conv_7_conv = TxOut_clone((LDKTxOut*)untag_ptr(outputs_conv_7)); + outputs_constr.data[h] = outputs_conv_7_conv; + } + (*env)->ReleaseLongArrayElements(env, outputs, outputs_vals, 0); + LDKCVec_u8Z change_destination_script_ref; + change_destination_script_ref.datalen = (*env)->GetArrayLength(env, change_destination_script); + change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, change_destination_script, 0, change_destination_script_ref.datalen, change_destination_script_ref.data); + void* locktime_ptr = untag_ptr(locktime); + CHECK_ACCESS(locktime_ptr); + LDKCOption_u32Z locktime_conv = *(LDKCOption_u32Z*)(locktime_ptr); + locktime_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(locktime)); + LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ), "LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ"); + *ret_conv = SpendableOutputDescriptor_create_spendable_outputs_psbt(descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight, locktime_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelDerivationParameters this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - NodeInfo_free(this_obj_conv); + ChannelDerivationParameters_free(this_obj_conv); } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKNodeInfo this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1get_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDerivationParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u64Z ret_var = NodeInfo_get_channels(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t g = 0; g < ret_var.datalen; g++) { - int64_t ret_conv_6_conv = ret_var.data[g]; - ret_arr_ptr[g] = ret_conv_6_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); + int64_t ret_conv = ChannelDerivationParameters_get_value_satoshis(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1set_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDerivationParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelDerivationParameters_set_value_satoshis(&this_ptr_conv, val); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1get_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDerivationParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelDerivationParameters_get_keys_id(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { - LDKNodeInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1set_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKChannelDerivationParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u64Z val_constr; - val_constr.datalen = (*env)->GetArrayLength(env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); - for (size_t g = 0; g < val_constr.datalen; g++) { - int64_t val_conv_6 = val_vals[g]; - val_constr.data[g] = val_conv_6; - } - (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); - NodeInfo_set_channels(&this_ptr_conv, val_constr); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + ChannelDerivationParameters_set_keys_id(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1announcement_1info(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKNodeInfo this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1get_1transaction_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDerivationParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeAnnouncementInfo ret_var = NodeInfo_get_announcement_info(&this_ptr_conv); + LDKChannelTransactionParameters ret_var = ChannelDerivationParameters_get_transaction_parameters(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1announcement_1info(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKNodeInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1set_1transaction_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDerivationParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeAnnouncementInfo val_conv; + LDKChannelTransactionParameters val_conv; val_conv.inner = untag_ptr(val); val_conv.is_owned = ptr_is_owned(val); CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = NodeAnnouncementInfo_clone(&val_conv); - NodeInfo_set_announcement_info(&this_ptr_conv, val_conv); + val_conv = ChannelTransactionParameters_clone(&val_conv); + ChannelDerivationParameters_set_transaction_parameters(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1new(JNIEnv *env, jclass clz, int64_tArray channels_arg, int64_t announcement_info_arg) { - LDKCVec_u64Z channels_arg_constr; - channels_arg_constr.datalen = (*env)->GetArrayLength(env, channels_arg); - if (channels_arg_constr.datalen > 0) - channels_arg_constr.data = MALLOC(channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); - else - channels_arg_constr.data = NULL; - int64_t* channels_arg_vals = (*env)->GetLongArrayElements (env, channels_arg, NULL); - for (size_t g = 0; g < channels_arg_constr.datalen; g++) { - int64_t channels_arg_conv_6 = channels_arg_vals[g]; - channels_arg_constr.data[g] = channels_arg_conv_6; - } - (*env)->ReleaseLongArrayElements(env, channels_arg, channels_arg_vals, 0); - LDKNodeAnnouncementInfo announcement_info_arg_conv; - announcement_info_arg_conv.inner = untag_ptr(announcement_info_arg); - announcement_info_arg_conv.is_owned = ptr_is_owned(announcement_info_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_info_arg_conv); - announcement_info_arg_conv = NodeAnnouncementInfo_clone(&announcement_info_arg_conv); - LDKNodeInfo ret_var = NodeInfo_new(channels_arg_constr, announcement_info_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1new(JNIEnv *env, jclass clz, int64_t value_satoshis_arg, int8_tArray keys_id_arg, int64_t transaction_parameters_arg) { + LDKThirtyTwoBytes keys_id_arg_ref; + CHECK((*env)->GetArrayLength(env, keys_id_arg) == 32); + (*env)->GetByteArrayRegion(env, keys_id_arg, 0, 32, keys_id_arg_ref.data); + LDKChannelTransactionParameters transaction_parameters_arg_conv; + transaction_parameters_arg_conv.inner = untag_ptr(transaction_parameters_arg); + transaction_parameters_arg_conv.is_owned = ptr_is_owned(transaction_parameters_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(transaction_parameters_arg_conv); + transaction_parameters_arg_conv = ChannelTransactionParameters_clone(&transaction_parameters_arg_conv); + LDKChannelDerivationParameters ret_var = ChannelDerivationParameters_new(value_satoshis_arg, keys_id_arg_ref, transaction_parameters_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t NodeInfo_clone_ptr(LDKNodeInfo *NONNULL_PTR arg) { - LDKNodeInfo ret_var = NodeInfo_clone(arg); +static inline uint64_t ChannelDerivationParameters_clone_ptr(LDKChannelDerivationParameters *NONNULL_PTR arg) { + LDKChannelDerivationParameters ret_var = ChannelDerivationParameters_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKNodeInfo arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelDerivationParameters arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = NodeInfo_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelDerivationParameters_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKNodeInfo orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelDerivationParameters orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKNodeInfo ret_var = NodeInfo_clone(&orig_conv); + LDKChannelDerivationParameters ret_var = ChannelDerivationParameters_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKNodeInfo a_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKChannelDerivationParameters a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKNodeInfo b_conv; + LDKChannelDerivationParameters b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = NodeInfo_eq(&a_conv, &b_conv); - return ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeInfo_1is_1tor_1only(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeInfo this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeInfo_is_tor_only(&this_arg_conv); - return ret_conv; -} - -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_NodeInfo_1to_1str(JNIEnv *env, jclass clz, int64_t o) { - LDKNodeInfo o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = NodeInfo_to_str(&o_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); + jboolean ret_conv = ChannelDerivationParameters_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeInfo_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKNodeInfo obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelDerivationParameters obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = NodeInfo_write(&obj_conv); + LDKCVec_u8Z ret_var = ChannelDerivationParameters_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1read(JNIEnv *env, jclass clz, int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); - *ret_conv = NodeInfo_read(ser_ref); + LDKCResult_ChannelDerivationParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDerivationParametersDecodeErrorZ), "LDKCResult_ChannelDerivationParametersDecodeErrorZ"); + *ret_conv = ChannelDerivationParameters_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKNetworkGraph obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = NetworkGraph_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; -} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKHTLCDescriptor this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + HTLCDescriptor_free(this_obj_conv); +} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - void* arg_ptr = untag_ptr(arg); - CHECK_ACCESS(arg_ptr); - LDKLogger arg_conv = *(LDKLogger*)(arg_ptr); - if (arg_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&arg_conv); - } - LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); - *ret_conv = NetworkGraph_read(ser_ref, arg_conv); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1channel_1derivation_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKHTLCDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelDerivationParameters ret_var = HTLCDescriptor_get_channel_derivation_parameters(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1to_1str(JNIEnv *env, jclass clz, int64_t o) { - LDKNetworkGraph o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = NetworkGraph_to_str(&o_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1channel_1derivation_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKHTLCDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelDerivationParameters val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelDerivationParameters_clone(&val_conv); + HTLCDescriptor_set_channel_derivation_parameters(&this_ptr_conv, val_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1commitment_1txid(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKHTLCDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *HTLCDescriptor_get_commitment_txid(&this_ptr_conv)); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1commitment_1txid(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKHTLCDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + HTLCDescriptor_set_commitment_txid(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1per_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKHTLCDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = HTLCDescriptor_get_per_commitment_number(&this_ptr_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1new(JNIEnv *env, jclass clz, jclass network, int64_t logger) { - LDKNetwork network_conv = LDKNetwork_from_java(env, network); - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKNetworkGraph ret_var = NetworkGraph_new(network_conv, logger_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1per_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKHTLCDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + HTLCDescriptor_set_per_commitment_number(&this_ptr_conv, val); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKHTLCDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, HTLCDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKHTLCDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + HTLCDescriptor_set_per_commitment_point(&this_ptr_conv, val_ref); +} + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKHTLCDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = HTLCDescriptor_get_feerate_per_kw(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKHTLCDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + HTLCDescriptor_set_feerate_per_kw(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1htlc(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKHTLCDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKHTLCOutputInCommitment ret_var = HTLCDescriptor_get_htlc(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read_1only(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKReadOnlyNetworkGraph ret_var = NetworkGraph_read_only(&this_arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1htlc(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKHTLCDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKHTLCOutputInCommitment val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = HTLCOutputInCommitment_clone(&val_conv); + HTLCDescriptor_set_htlc(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1preimage(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKHTLCDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); + *ret_copy = HTLCDescriptor_get_preimage(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1preimage(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKHTLCDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_ThirtyTwoBytesZ val_conv = *(LDKCOption_ThirtyTwoBytesZ*)(val_ptr); + val_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(val)); + HTLCDescriptor_set_preimage(&this_ptr_conv, val_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1counterparty_1sig(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKHTLCDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, HTLCDescriptor_get_counterparty_sig(&this_ptr_conv).compact_form); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1counterparty_1sig(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKHTLCDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKECDSASignature val_ref; + CHECK((*env)->GetArrayLength(env, val) == 64); + (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); + HTLCDescriptor_set_counterparty_sig(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1new(JNIEnv *env, jclass clz, int64_t channel_derivation_parameters_arg, int8_tArray commitment_txid_arg, int64_t per_commitment_number_arg, int8_tArray per_commitment_point_arg, int32_t feerate_per_kw_arg, int64_t htlc_arg, int64_t preimage_arg, int8_tArray counterparty_sig_arg) { + LDKChannelDerivationParameters channel_derivation_parameters_arg_conv; + channel_derivation_parameters_arg_conv.inner = untag_ptr(channel_derivation_parameters_arg); + channel_derivation_parameters_arg_conv.is_owned = ptr_is_owned(channel_derivation_parameters_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_derivation_parameters_arg_conv); + channel_derivation_parameters_arg_conv = ChannelDerivationParameters_clone(&channel_derivation_parameters_arg_conv); + LDKThirtyTwoBytes commitment_txid_arg_ref; + CHECK((*env)->GetArrayLength(env, commitment_txid_arg) == 32); + (*env)->GetByteArrayRegion(env, commitment_txid_arg, 0, 32, commitment_txid_arg_ref.data); + LDKPublicKey per_commitment_point_arg_ref; + CHECK((*env)->GetArrayLength(env, per_commitment_point_arg) == 33); + (*env)->GetByteArrayRegion(env, per_commitment_point_arg, 0, 33, per_commitment_point_arg_ref.compressed_form); + LDKHTLCOutputInCommitment htlc_arg_conv; + htlc_arg_conv.inner = untag_ptr(htlc_arg); + htlc_arg_conv.is_owned = ptr_is_owned(htlc_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_arg_conv); + htlc_arg_conv = HTLCOutputInCommitment_clone(&htlc_arg_conv); + void* preimage_arg_ptr = untag_ptr(preimage_arg); + CHECK_ACCESS(preimage_arg_ptr); + LDKCOption_ThirtyTwoBytesZ preimage_arg_conv = *(LDKCOption_ThirtyTwoBytesZ*)(preimage_arg_ptr); + preimage_arg_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(preimage_arg)); + LDKECDSASignature counterparty_sig_arg_ref; + CHECK((*env)->GetArrayLength(env, counterparty_sig_arg) == 64); + (*env)->GetByteArrayRegion(env, counterparty_sig_arg, 0, 64, counterparty_sig_arg_ref.compact_form); + LDKHTLCDescriptor ret_var = HTLCDescriptor_new(channel_derivation_parameters_arg_conv, commitment_txid_arg_ref, per_commitment_number_arg, per_commitment_point_arg_ref, feerate_per_kw_arg, htlc_arg_conv, preimage_arg_conv, counterparty_sig_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1get_1last_1rapid_1gossip_1sync_1timestamp(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); - *ret_copy = NetworkGraph_get_last_rapid_gossip_sync_timestamp(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +static inline uint64_t HTLCDescriptor_clone_ptr(LDKHTLCDescriptor *NONNULL_PTR arg) { + LDKHTLCDescriptor ret_var = HTLCDescriptor_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKHTLCDescriptor arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = HTLCDescriptor_clone_ptr(&arg_conv); + return ret_conv; +} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1set_1last_1rapid_1gossip_1sync_1timestamp(JNIEnv *env, jclass clz, int64_t this_arg, int32_t last_rapid_gossip_sync_timestamp) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - NetworkGraph_set_last_rapid_gossip_sync_timestamp(&this_arg_conv, last_rapid_gossip_sync_timestamp); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKHTLCDescriptor orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKHTLCDescriptor ret_var = HTLCDescriptor_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1node_1from_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_update_node_from_announcement(&this_arg_conv, &msg_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKHTLCDescriptor a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKHTLCDescriptor b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = HTLCDescriptor_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1node_1from_1unsigned_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKUnsignedNodeAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_update_node_from_unsigned_announcement(&this_arg_conv, &msg_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKHTLCDescriptor obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = HTLCDescriptor_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel_1from_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg, int64_t utxo_lookup) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - void* utxo_lookup_ptr = untag_ptr(utxo_lookup); - CHECK_ACCESS(utxo_lookup_ptr); - LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr); - // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ - if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) { - // Manually implement clone for Java trait instances - if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some); - } - } - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_update_channel_from_announcement(&this_arg_conv, &msg_conv, utxo_lookup_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_HTLCDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCDescriptorDecodeErrorZ), "LDKCResult_HTLCDescriptorDecodeErrorZ"); + *ret_conv = HTLCDescriptor_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel_1from_1announcement_1no_1lookup(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { - LDKNetworkGraph this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1outpoint(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKHTLCDescriptor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKChannelAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_update_channel_from_announcement_no_lookup(&this_arg_conv, &msg_conv); - return tag_ptr(ret_conv, true); + LDKOutPoint ret_var = HTLCDescriptor_outpoint(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel_1from_1unsigned_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg, int64_t utxo_lookup) { - LDKNetworkGraph this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1previous_1utxo(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKHTLCDescriptor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKUnsignedChannelAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - void* utxo_lookup_ptr = untag_ptr(utxo_lookup); - CHECK_ACCESS(utxo_lookup_ptr); - LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr); - // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ - if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) { - // Manually implement clone for Java trait instances - if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some); - } - } - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_update_channel_from_unsigned_announcement(&this_arg_conv, &msg_conv, utxo_lookup_conv); - return tag_ptr(ret_conv, true); + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = HTLCDescriptor_previous_utxo(&this_arg_conv); + return tag_ptr(ret_ref, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1add_1channel_1from_1partial_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t short_channel_id, int64_t timestamp, int64_t features, int8_tArray node_id_1, int8_tArray node_id_2) { - LDKNetworkGraph this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1unsigned_1tx_1input(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKHTLCDescriptor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKChannelFeatures features_conv; - features_conv.inner = untag_ptr(features); - features_conv.is_owned = ptr_is_owned(features); - CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); - features_conv = ChannelFeatures_clone(&features_conv); - LDKPublicKey node_id_1_ref; - CHECK((*env)->GetArrayLength(env, node_id_1) == 33); - (*env)->GetByteArrayRegion(env, node_id_1, 0, 33, node_id_1_ref.compressed_form); - LDKPublicKey node_id_2_ref; - CHECK((*env)->GetArrayLength(env, node_id_2) == 33); - (*env)->GetByteArrayRegion(env, node_id_2, 0, 33, node_id_2_ref.compressed_form); - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_add_channel_from_partial_announcement(&this_arg_conv, short_channel_id, timestamp, features_conv, node_id_1_ref, node_id_2_ref); - return tag_ptr(ret_conv, true); + LDKTxIn* ret_ref = MALLOC(sizeof(LDKTxIn), "LDKTxIn"); + *ret_ref = HTLCDescriptor_unsigned_tx_input(&this_arg_conv); + return tag_ptr(ret_ref, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1channel_1failed_1permanent(JNIEnv *env, jclass clz, int64_t this_arg, int64_t short_channel_id) { - LDKNetworkGraph this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1tx_1output(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKHTLCDescriptor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NetworkGraph_channel_failed_permanent(&this_arg_conv, short_channel_id); + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = HTLCDescriptor_tx_output(&this_arg_conv); + return tag_ptr(ret_ref, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1node_1failed_1permanent(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray node_id) { - LDKNetworkGraph this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1witness_1script(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKHTLCDescriptor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - NetworkGraph_node_failed_permanent(&this_arg_conv, node_id_ref); + LDKCVec_u8Z ret_var = HTLCDescriptor_witness_script(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1remove_1stale_1channels_1and_1tracking(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNetworkGraph this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1tx_1input_1witness(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray signature, int8_tArray witness_script) { + LDKHTLCDescriptor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NetworkGraph_remove_stale_channels_and_tracking(&this_arg_conv); + LDKECDSASignature signature_ref; + CHECK((*env)->GetArrayLength(env, signature) == 64); + (*env)->GetByteArrayRegion(env, signature, 0, 64, signature_ref.compact_form); + LDKu8slice witness_script_ref; + witness_script_ref.datalen = (*env)->GetArrayLength(env, witness_script); + witness_script_ref.data = (*env)->GetByteArrayElements (env, witness_script, NULL); + LDKWitness ret_var = HTLCDescriptor_tx_input_witness(&this_arg_conv, signature_ref, witness_script_ref); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + Witness_free(ret_var); + (*env)->ReleaseByteArrayElements(env, witness_script, (int8_t*)witness_script_ref.data, 0); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1remove_1stale_1channels_1and_1tracking_1with_1time(JNIEnv *env, jclass clz, int64_t this_arg, int64_t current_time_unix) { - LDKNetworkGraph this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1derive_1channel_1signer(JNIEnv *env, jclass clz, int64_t this_arg, int64_t signer_provider) { + LDKHTLCDescriptor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NetworkGraph_remove_stale_channels_and_tracking_with_time(&this_arg_conv, current_time_unix); + void* signer_provider_ptr = untag_ptr(signer_provider); + if (ptr_is_owned(signer_provider)) { CHECK_ACCESS(signer_provider_ptr); } + LDKSignerProvider* signer_provider_conv = (LDKSignerProvider*)signer_provider_ptr; + LDKEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner"); + *ret_ret = HTLCDescriptor_derive_channel_signer(&this_arg_conv, signer_provider_conv); + return tag_ptr(ret_ret, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelUpdate msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_update_channel(&this_arg_conv, &msg_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelSigner_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKChannelSigner this_ptr_conv = *(LDKChannelSigner*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + ChannelSigner_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel_1unsigned(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKUnsignedChannelUpdate msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_update_channel_unsigned(&this_arg_conv, &msg_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1verify_1channel_1update(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelUpdate msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_verify_channel_update(&this_arg_conv, &msg_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t short_channel_id) { - LDKReadOnlyNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelInfo ret_var = ReadOnlyNetworkGraph_channel(&this_arg_conv, short_channel_id); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1list_1channels(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKReadOnlyNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_u64Z ret_var = ReadOnlyNetworkGraph_list_channels(&this_arg_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t g = 0; g < ret_var.datalen; g++) { - int64_t ret_conv_6_conv = ret_var.data[g]; - ret_arr_ptr[g] = ret_conv_6_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1node(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_id) { - LDKReadOnlyNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId node_id_conv; - node_id_conv.inner = untag_ptr(node_id); - node_id_conv.is_owned = ptr_is_owned(node_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); - node_id_conv.is_owned = false; - LDKNodeInfo ret_var = ReadOnlyNetworkGraph_node(&this_arg_conv, &node_id_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1list_1nodes(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKReadOnlyNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_NodeIdZ ret_var = ReadOnlyNetworkGraph_list_nodes(&this_arg_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t i = 0; i < ret_var.datalen; i++) { - LDKNodeId ret_conv_8_var = ret_var.data[i]; - int64_t ret_conv_8_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_8_var); - ret_conv_8_ref = tag_ptr(ret_conv_8_var.inner, ret_conv_8_var.is_owned); - ret_arr_ptr[i] = ret_conv_8_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1get_1addresses(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray pubkey) { - LDKReadOnlyNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPublicKey pubkey_ref; - CHECK((*env)->GetArrayLength(env, pubkey) == 33); - (*env)->GetByteArrayRegion(env, pubkey, 0, 33, pubkey_ref.compressed_form); - LDKCOption_CVec_SocketAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_SocketAddressZZ), "LDKCOption_CVec_SocketAddressZZ"); - *ret_copy = ReadOnlyNetworkGraph_get_addresses(&this_arg_conv, pubkey_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKDefaultRouter this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - DefaultRouter_free(this_obj_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1new(JNIEnv *env, jclass clz, int64_t network_graph, int64_t logger, int64_t entropy_source, int64_t scorer, int64_t score_params) { - LDKNetworkGraph network_graph_conv; - network_graph_conv.inner = untag_ptr(network_graph); - network_graph_conv.is_owned = ptr_is_owned(network_graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - network_graph_conv.is_owned = false; - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - void* scorer_ptr = untag_ptr(scorer); - CHECK_ACCESS(scorer_ptr); - LDKLockableScore scorer_conv = *(LDKLockableScore*)(scorer_ptr); - if (scorer_conv.free == LDKLockableScore_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLockableScore_JCalls_cloned(&scorer_conv); - } - LDKProbabilisticScoringFeeParameters score_params_conv; - score_params_conv.inner = untag_ptr(score_params); - score_params_conv.is_owned = ptr_is_owned(score_params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(score_params_conv); - score_params_conv = ProbabilisticScoringFeeParameters_clone(&score_params_conv); - LDKDefaultRouter ret_var = DefaultRouter_new(&network_graph_conv, logger_conv, entropy_source_conv, scorer_conv, score_params_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Recipient_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKRecipient* orig_conv = (LDKRecipient*)untag_ptr(orig); + jclass ret_conv = LDKRecipient_to_java(env, Recipient_clone(orig_conv)); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1as_1Router(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKDefaultRouter this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKRouter* ret_ret = MALLOC(sizeof(LDKRouter), "LDKRouter"); - *ret_ret = DefaultRouter_as_Router(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Recipient_1node(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKRecipient_to_java(env, Recipient_node()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1as_1MessageRouter(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKDefaultRouter this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKMessageRouter* ret_ret = MALLOC(sizeof(LDKMessageRouter), "LDKMessageRouter"); - *ret_ret = DefaultRouter_as_MessageRouter(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Recipient_1phantom_1node(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKRecipient_to_java(env, Recipient_phantom_node()); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Router_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EntropySource_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); CHECK_ACCESS(this_ptr_ptr); - LDKRouter this_ptr_conv = *(LDKRouter*)(this_ptr_ptr); + LDKEntropySource this_ptr_conv = *(LDKEntropySource*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - Router_free(this_ptr_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKScorerAccountingForInFlightHtlcs this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ScorerAccountingForInFlightHtlcs_free(this_obj_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1new(JNIEnv *env, jclass clz, int64_t scorer, int64_t inflight_htlcs) { - void* scorer_ptr = untag_ptr(scorer); - CHECK_ACCESS(scorer_ptr); - LDKScoreLookUp scorer_conv = *(LDKScoreLookUp*)(scorer_ptr); - if (scorer_conv.free == LDKScoreLookUp_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKScoreLookUp_JCalls_cloned(&scorer_conv); - } - LDKInFlightHtlcs inflight_htlcs_conv; - inflight_htlcs_conv.inner = untag_ptr(inflight_htlcs); - inflight_htlcs_conv.is_owned = ptr_is_owned(inflight_htlcs); - CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_conv); - inflight_htlcs_conv.is_owned = false; - LDKScorerAccountingForInFlightHtlcs ret_var = ScorerAccountingForInFlightHtlcs_new(scorer_conv, &inflight_htlcs_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1as_1ScoreLookUp(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKScorerAccountingForInFlightHtlcs this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKScoreLookUp* ret_ret = MALLOC(sizeof(LDKScoreLookUp), "LDKScoreLookUp"); - *ret_ret = ScorerAccountingForInFlightHtlcs_as_ScoreLookUp(&this_arg_conv); - return tag_ptr(ret_ret, true); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKInFlightHtlcs this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InFlightHtlcs_free(this_obj_conv); -} - -static inline uint64_t InFlightHtlcs_clone_ptr(LDKInFlightHtlcs *NONNULL_PTR arg) { - LDKInFlightHtlcs ret_var = InFlightHtlcs_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKInFlightHtlcs arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = InFlightHtlcs_clone_ptr(&arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKInFlightHtlcs orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKInFlightHtlcs ret_var = InFlightHtlcs_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1new(JNIEnv *env, jclass clz) { - LDKInFlightHtlcs ret_var = InFlightHtlcs_new(); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1process_1path(JNIEnv *env, jclass clz, int64_t this_arg, int64_t path, int8_tArray payer_node_id) { - LDKInFlightHtlcs this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPath path_conv; - path_conv.inner = untag_ptr(path); - path_conv.is_owned = ptr_is_owned(path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); - path_conv.is_owned = false; - LDKPublicKey payer_node_id_ref; - CHECK((*env)->GetArrayLength(env, payer_node_id) == 33); - (*env)->GetByteArrayRegion(env, payer_node_id, 0, 33, payer_node_id_ref.compressed_form); - InFlightHtlcs_process_path(&this_arg_conv, &path_conv, payer_node_id_ref); + EntropySource_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1add_1inflight_1htlc(JNIEnv *env, jclass clz, int64_t this_arg, int64_t source, int64_t target, int64_t channel_scid, int64_t used_msat) { - LDKInFlightHtlcs this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId source_conv; - source_conv.inner = untag_ptr(source); - source_conv.is_owned = ptr_is_owned(source); - CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv); - source_conv.is_owned = false; - LDKNodeId target_conv; - target_conv.inner = untag_ptr(target); - target_conv.is_owned = ptr_is_owned(target); - CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); - target_conv.is_owned = false; - InFlightHtlcs_add_inflight_htlc(&this_arg_conv, &source_conv, &target_conv, channel_scid, used_msat); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeSigner_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKNodeSigner this_ptr_conv = *(LDKNodeSigner*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + NodeSigner_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1used_1liquidity_1msat(JNIEnv *env, jclass clz, int64_t this_arg, int64_t source, int64_t target, int64_t channel_scid) { - LDKInFlightHtlcs this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId source_conv; - source_conv.inner = untag_ptr(source); - source_conv.is_owned = ptr_is_owned(source); - CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv); - source_conv.is_owned = false; - LDKNodeId target_conv; - target_conv.inner = untag_ptr(target); - target_conv.is_owned = ptr_is_owned(target); - CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); - target_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = InFlightHtlcs_used_liquidity_msat(&this_arg_conv, &source_conv, &target_conv, channel_scid); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutputSpender_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKOutputSpender this_ptr_conv = *(LDKOutputSpender*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + OutputSpender_free(this_ptr_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKInFlightHtlcs obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = InFlightHtlcs_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignerProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKSignerProvider this_ptr_conv = *(LDKSignerProvider*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + SignerProvider_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ"); - *ret_conv = InFlightHtlcs_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChangeDestinationSource_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKChangeDestinationSource this_ptr_conv = *(LDKChangeDestinationSource*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + ChangeDestinationSource_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKRouteHop this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInMemorySigner this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - RouteHop_free(this_obj_conv); + InMemorySigner_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRouteHop this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1funding_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RouteHop_get_pubkey(&this_ptr_conv).compressed_form); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_funding_key(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKRouteHop this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1funding_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - RouteHop_set_pubkey(&this_ptr_conv, val_ref); + LDKSecretKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); + InMemorySigner_set_funding_key(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1node_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRouteHop this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1revocation_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeFeatures ret_var = RouteHop_get_node_features(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_revocation_base_key(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1node_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKRouteHop this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1revocation_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeFeatures val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = NodeFeatures_clone(&val_conv); - RouteHop_set_node_features(&this_ptr_conv, val_conv); + LDKSecretKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); + InMemorySigner_set_revocation_base_key(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRouteHop this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = RouteHop_get_short_channel_id(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_payment_key(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKRouteHop this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - RouteHop_set_short_channel_id(&this_ptr_conv, val); + LDKSecretKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); + InMemorySigner_set_payment_key(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1channel_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRouteHop this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1delayed_1payment_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelFeatures ret_var = RouteHop_get_channel_features(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_delayed_payment_base_key(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1channel_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKRouteHop this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1delayed_1payment_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelFeatures val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelFeatures_clone(&val_conv); - RouteHop_set_channel_features(&this_ptr_conv, val_conv); + LDKSecretKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); + InMemorySigner_set_delayed_payment_base_key(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1fee_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRouteHop this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1htlc_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = RouteHop_get_fee_msat(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_htlc_base_key(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1fee_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKRouteHop this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1htlc_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - RouteHop_set_fee_msat(&this_ptr_conv, val); + LDKSecretKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); + InMemorySigner_set_htlc_base_key(&this_ptr_conv, val_ref); } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRouteHop this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1commitment_1seed(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int32_t ret_conv = RouteHop_get_cltv_expiry_delta(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_commitment_seed(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKRouteHop this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1commitment_1seed(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - RouteHop_set_cltv_expiry_delta(&this_ptr_conv, val); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + InMemorySigner_set_commitment_seed(&this_ptr_conv, val_ref); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1maybe_1announced_1channel(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRouteHop this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - jboolean ret_conv = RouteHop_get_maybe_announced_channel(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1maybe_1announced_1channel(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKRouteHop this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - RouteHop_set_maybe_announced_channel(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1new(JNIEnv *env, jclass clz, int8_tArray pubkey_arg, int64_t node_features_arg, int64_t short_channel_id_arg, int64_t channel_features_arg, int64_t fee_msat_arg, int32_t cltv_expiry_delta_arg, jboolean maybe_announced_channel_arg) { - LDKPublicKey pubkey_arg_ref; - CHECK((*env)->GetArrayLength(env, pubkey_arg) == 33); - (*env)->GetByteArrayRegion(env, pubkey_arg, 0, 33, pubkey_arg_ref.compressed_form); - LDKNodeFeatures node_features_arg_conv; - node_features_arg_conv.inner = untag_ptr(node_features_arg); - node_features_arg_conv.is_owned = ptr_is_owned(node_features_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(node_features_arg_conv); - node_features_arg_conv = NodeFeatures_clone(&node_features_arg_conv); - LDKChannelFeatures channel_features_arg_conv; - channel_features_arg_conv.inner = untag_ptr(channel_features_arg); - channel_features_arg_conv.is_owned = ptr_is_owned(channel_features_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_features_arg_conv); - channel_features_arg_conv = ChannelFeatures_clone(&channel_features_arg_conv); - LDKRouteHop ret_var = RouteHop_new(pubkey_arg_ref, node_features_arg_conv, short_channel_id_arg, channel_features_arg_conv, fee_msat_arg, cltv_expiry_delta_arg, maybe_announced_channel_arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline uint64_t RouteHop_clone_ptr(LDKRouteHop *NONNULL_PTR arg) { - LDKRouteHop ret_var = RouteHop_clone(arg); +static inline uint64_t InMemorySigner_clone_ptr(LDKInMemorySigner *NONNULL_PTR arg) { + LDKInMemorySigner ret_var = InMemorySigner_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKRouteHop arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInMemorySigner arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = RouteHop_clone_ptr(&arg_conv); + int64_t ret_conv = InMemorySigner_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKRouteHop orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKInMemorySigner orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKRouteHop ret_var = RouteHop_clone(&orig_conv); + LDKInMemorySigner ret_var = InMemorySigner_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKRouteHop o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = RouteHop_hash(&o_conv); - return ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHop_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKRouteHop a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKRouteHop b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = RouteHop_eq(&a_conv, &b_conv); - return ret_conv; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHop_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKRouteHop obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = RouteHop_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); - *ret_conv = RouteHop_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedTail_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKBlindedTail this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BlindedTail_free(this_obj_conv); -} - -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_BlindedTail_1get_1hops(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBlindedTail this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_BlindedHopZ ret_var = BlindedTail_get_hops(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t m = 0; m < ret_var.datalen; m++) { - LDKBlindedHop ret_conv_12_var = ret_var.data[m]; - int64_t ret_conv_12_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_var); - ret_conv_12_ref = tag_ptr(ret_conv_12_var.inner, ret_conv_12_var.is_owned); - ret_arr_ptr[m] = ret_conv_12_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedTail_1set_1hops(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { - LDKBlindedTail this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_BlindedHopZ val_constr; - val_constr.datalen = (*env)->GetArrayLength(env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKBlindedHop), "LDKCVec_BlindedHopZ Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); - for (size_t m = 0; m < val_constr.datalen; m++) { - int64_t val_conv_12 = val_vals[m]; - LDKBlindedHop val_conv_12_conv; - val_conv_12_conv.inner = untag_ptr(val_conv_12); - val_conv_12_conv.is_owned = ptr_is_owned(val_conv_12); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_12_conv); - val_conv_12_conv = BlindedHop_clone(&val_conv_12_conv); - val_constr.data[m] = val_conv_12_conv; - } - (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); - BlindedTail_set_hops(&this_ptr_conv, val_constr); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedTail_1get_1blinding_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBlindedTail this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, BlindedTail_get_blinding_point(&this_ptr_conv).compressed_form); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedTail_1set_1blinding_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKBlindedTail this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - BlindedTail_set_blinding_point(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1new(JNIEnv *env, jclass clz, int8_tArray funding_key, int8_tArray revocation_base_key, int8_tArray payment_key, int8_tArray delayed_payment_base_key, int8_tArray htlc_base_key, int8_tArray commitment_seed, int64_t channel_value_satoshis, int8_tArray channel_keys_id, int8_tArray rand_bytes_unique_start) { + LDKSecretKey funding_key_ref; + CHECK((*env)->GetArrayLength(env, funding_key) == 32); + (*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_ref.bytes); + LDKSecretKey revocation_base_key_ref; + CHECK((*env)->GetArrayLength(env, revocation_base_key) == 32); + (*env)->GetByteArrayRegion(env, revocation_base_key, 0, 32, revocation_base_key_ref.bytes); + LDKSecretKey payment_key_ref; + CHECK((*env)->GetArrayLength(env, payment_key) == 32); + (*env)->GetByteArrayRegion(env, payment_key, 0, 32, payment_key_ref.bytes); + LDKSecretKey delayed_payment_base_key_ref; + CHECK((*env)->GetArrayLength(env, delayed_payment_base_key) == 32); + (*env)->GetByteArrayRegion(env, delayed_payment_base_key, 0, 32, delayed_payment_base_key_ref.bytes); + LDKSecretKey htlc_base_key_ref; + CHECK((*env)->GetArrayLength(env, htlc_base_key) == 32); + (*env)->GetByteArrayRegion(env, htlc_base_key, 0, 32, htlc_base_key_ref.bytes); + LDKThirtyTwoBytes commitment_seed_ref; + CHECK((*env)->GetArrayLength(env, commitment_seed) == 32); + (*env)->GetByteArrayRegion(env, commitment_seed, 0, 32, commitment_seed_ref.data); + LDKThirtyTwoBytes channel_keys_id_ref; + CHECK((*env)->GetArrayLength(env, channel_keys_id) == 32); + (*env)->GetByteArrayRegion(env, channel_keys_id, 0, 32, channel_keys_id_ref.data); + LDKThirtyTwoBytes rand_bytes_unique_start_ref; + CHECK((*env)->GetArrayLength(env, rand_bytes_unique_start) == 32); + (*env)->GetByteArrayRegion(env, rand_bytes_unique_start, 0, 32, rand_bytes_unique_start_ref.data); + LDKInMemorySigner ret_var = InMemorySigner_new(funding_key_ref, revocation_base_key_ref, payment_key_ref, delayed_payment_base_key_ref, htlc_base_key_ref, commitment_seed_ref, channel_value_satoshis, channel_keys_id_ref, rand_bytes_unique_start_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_BlindedTail_1get_1excess_1final_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBlindedTail this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int32_t ret_conv = BlindedTail_get_excess_final_cltv_expiry_delta(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterparty_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelPublicKeys ret_var = InMemorySigner_counterparty_pubkeys(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedTail_1set_1excess_1final_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKBlindedTail this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - BlindedTail_set_excess_final_cltv_expiry_delta(&this_ptr_conv, val); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterparty_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); + *ret_copy = InMemorySigner_counterparty_selected_contest_delay(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedTail_1get_1final_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBlindedTail this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = BlindedTail_get_final_value_msat(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1holder_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); + *ret_copy = InMemorySigner_holder_selected_contest_delay(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedTail_1set_1final_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKBlindedTail this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - BlindedTail_set_final_value_msat(&this_ptr_conv, val); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCOption_boolZ *ret_copy = MALLOC(sizeof(LDKCOption_boolZ), "LDKCOption_boolZ"); + *ret_copy = InMemorySigner_is_outbound(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedTail_1new(JNIEnv *env, jclass clz, int64_tArray hops_arg, int8_tArray blinding_point_arg, int32_t excess_final_cltv_expiry_delta_arg, int64_t final_value_msat_arg) { - LDKCVec_BlindedHopZ hops_arg_constr; - hops_arg_constr.datalen = (*env)->GetArrayLength(env, hops_arg); - if (hops_arg_constr.datalen > 0) - hops_arg_constr.data = MALLOC(hops_arg_constr.datalen * sizeof(LDKBlindedHop), "LDKCVec_BlindedHopZ Elements"); - else - hops_arg_constr.data = NULL; - int64_t* hops_arg_vals = (*env)->GetLongArrayElements (env, hops_arg, NULL); - for (size_t m = 0; m < hops_arg_constr.datalen; m++) { - int64_t hops_arg_conv_12 = hops_arg_vals[m]; - LDKBlindedHop hops_arg_conv_12_conv; - hops_arg_conv_12_conv.inner = untag_ptr(hops_arg_conv_12); - hops_arg_conv_12_conv.is_owned = ptr_is_owned(hops_arg_conv_12); - CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_arg_conv_12_conv); - hops_arg_conv_12_conv = BlindedHop_clone(&hops_arg_conv_12_conv); - hops_arg_constr.data[m] = hops_arg_conv_12_conv; - } - (*env)->ReleaseLongArrayElements(env, hops_arg, hops_arg_vals, 0); - LDKPublicKey blinding_point_arg_ref; - CHECK((*env)->GetArrayLength(env, blinding_point_arg) == 33); - (*env)->GetByteArrayRegion(env, blinding_point_arg, 0, 33, blinding_point_arg_ref.compressed_form); - LDKBlindedTail ret_var = BlindedTail_new(hops_arg_constr, blinding_point_arg_ref, excess_final_cltv_expiry_delta_arg, final_value_msat_arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKOutPoint ret_var = InMemorySigner_funding_outpoint(&this_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t BlindedTail_clone_ptr(LDKBlindedTail *NONNULL_PTR arg) { - LDKBlindedTail ret_var = BlindedTail_clone(arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1channel_1parameters(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelTransactionParameters ret_var = InMemorySigner_get_channel_parameters(&this_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedTail_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKBlindedTail arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = BlindedTail_clone_ptr(&arg_conv); - return ret_conv; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedTail_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBlindedTail orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKBlindedTail ret_var = BlindedTail_clone(&orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1channel_1type_1features(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelTypeFeatures ret_var = InMemorySigner_channel_type_features(&this_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedTail_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKBlindedTail o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = BlindedTail_hash(&o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1counterparty_1payment_1input(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray spend_tx, int64_t input_idx, int64_t descriptor) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKTransaction spend_tx_ref; + spend_tx_ref.datalen = (*env)->GetArrayLength(env, spend_tx); + spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); + (*env)->GetByteArrayRegion(env, spend_tx, 0, spend_tx_ref.datalen, spend_tx_ref.data); + spend_tx_ref.data_is_owned = true; + LDKStaticPaymentOutputDescriptor descriptor_conv; + descriptor_conv.inner = untag_ptr(descriptor); + descriptor_conv.is_owned = ptr_is_owned(descriptor); + CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); + descriptor_conv.is_owned = false; + LDKCResult_WitnessNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_WitnessNoneZ), "LDKCResult_WitnessNoneZ"); + *ret_conv = InMemorySigner_sign_counterparty_payment_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedTail_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKBlindedTail a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKBlindedTail b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = BlindedTail_eq(&a_conv, &b_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1dynamic_1p2wsh_1input(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray spend_tx, int64_t input_idx, int64_t descriptor) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKTransaction spend_tx_ref; + spend_tx_ref.datalen = (*env)->GetArrayLength(env, spend_tx); + spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); + (*env)->GetByteArrayRegion(env, spend_tx, 0, spend_tx_ref.datalen, spend_tx_ref.data); + spend_tx_ref.data_is_owned = true; + LDKDelayedPaymentOutputDescriptor descriptor_conv; + descriptor_conv.inner = untag_ptr(descriptor); + descriptor_conv.is_owned = ptr_is_owned(descriptor); + CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); + descriptor_conv.is_owned = false; + LDKCResult_WitnessNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_WitnessNoneZ), "LDKCResult_WitnessNoneZ"); + *ret_conv = InMemorySigner_sign_dynamic_p2wsh_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedTail_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKBlindedTail obj_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1EntropySource(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource"); + *ret_ret = InMemorySigner_as_EntropySource(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1ChannelSigner(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelSigner* ret_ret = MALLOC(sizeof(LDKChannelSigner), "LDKChannelSigner"); + *ret_ret = InMemorySigner_as_ChannelSigner(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1EcdsaChannelSigner(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner"); + *ret_ret = InMemorySigner_as_EcdsaChannelSigner(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKInMemorySigner obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = BlindedTail_write(&obj_conv); + LDKCVec_u8Z ret_var = InMemorySigner_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedTail_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_BlindedTailDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedTailDecodeErrorZ), "LDKCResult_BlindedTailDecodeErrorZ"); - *ret_conv = BlindedTail_read(ser_ref); + void* arg_ptr = untag_ptr(arg); + CHECK_ACCESS(arg_ptr); + LDKEntropySource arg_conv = *(LDKEntropySource*)(arg_ptr); + if (arg_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&arg_conv); + } + LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); + *ret_conv = InMemorySigner_read(ser_ref, arg_conv); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Path_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKPath this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKKeysManager this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Path_free(this_obj_conv); + KeysManager_free(this_obj_conv); } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Path_1get_1hops(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_RouteHopZ ret_var = Path_get_hops(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t k = 0; k < ret_var.datalen; k++) { - LDKRouteHop ret_conv_10_var = ret_var.data[k]; - int64_t ret_conv_10_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_10_var); - ret_conv_10_ref = tag_ptr(ret_conv_10_var.inner, ret_conv_10_var.is_owned); - ret_arr_ptr[k] = ret_conv_10_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1new(JNIEnv *env, jclass clz, int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos) { + uint8_t seed_arr[32]; + CHECK((*env)->GetArrayLength(env, seed) == 32); + (*env)->GetByteArrayRegion(env, seed, 0, 32, seed_arr); + uint8_t (*seed_ref)[32] = &seed_arr; + LDKKeysManager ret_var = KeysManager_new(seed_ref, starting_time_secs, starting_time_nanos); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_KeysManager_1get_1node_1secret_1key(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKKeysManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, KeysManager_get_node_secret_key(&this_arg_conv).bytes); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Path_1set_1hops(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { - LDKPath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_RouteHopZ val_constr; - val_constr.datalen = (*env)->GetArrayLength(env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); - for (size_t k = 0; k < val_constr.datalen; k++) { - int64_t val_conv_10 = val_vals[k]; - LDKRouteHop val_conv_10_conv; - val_conv_10_conv.inner = untag_ptr(val_conv_10); - val_conv_10_conv.is_owned = ptr_is_owned(val_conv_10); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_10_conv); - val_conv_10_conv = RouteHop_clone(&val_conv_10_conv); - val_constr.data[k] = val_conv_10_conv; - } - (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); - Path_set_hops(&this_ptr_conv, val_constr); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1get_1blinded_1tail(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKBlindedTail ret_var = Path_get_blinded_tail(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1derive_1channel_1keys(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_value_satoshis, int8_tArray params) { + LDKKeysManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + uint8_t params_arr[32]; + CHECK((*env)->GetArrayLength(env, params) == 32); + (*env)->GetByteArrayRegion(env, params, 0, 32, params_arr); + uint8_t (*params_ref)[32] = ¶ms_arr; + LDKInMemorySigner ret_var = KeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Path_1set_1blinded_1tail(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKPath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKBlindedTail val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = BlindedTail_clone(&val_conv); - Path_set_blinded_tail(&this_ptr_conv, val_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1new(JNIEnv *env, jclass clz, int64_tArray hops_arg, int64_t blinded_tail_arg) { - LDKCVec_RouteHopZ hops_arg_constr; - hops_arg_constr.datalen = (*env)->GetArrayLength(env, hops_arg); - if (hops_arg_constr.datalen > 0) - hops_arg_constr.data = MALLOC(hops_arg_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1sign_1spendable_1outputs_1psbt(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray descriptors, int8_tArray psbt) { + LDKKeysManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_SpendableOutputDescriptorZ descriptors_constr; + descriptors_constr.datalen = (*env)->GetArrayLength(env, descriptors); + if (descriptors_constr.datalen > 0) + descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); else - hops_arg_constr.data = NULL; - int64_t* hops_arg_vals = (*env)->GetLongArrayElements (env, hops_arg, NULL); - for (size_t k = 0; k < hops_arg_constr.datalen; k++) { - int64_t hops_arg_conv_10 = hops_arg_vals[k]; - LDKRouteHop hops_arg_conv_10_conv; - hops_arg_conv_10_conv.inner = untag_ptr(hops_arg_conv_10); - hops_arg_conv_10_conv.is_owned = ptr_is_owned(hops_arg_conv_10); - CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_arg_conv_10_conv); - hops_arg_conv_10_conv = RouteHop_clone(&hops_arg_conv_10_conv); - hops_arg_constr.data[k] = hops_arg_conv_10_conv; + descriptors_constr.data = NULL; + int64_t* descriptors_vals = (*env)->GetLongArrayElements (env, descriptors, NULL); + for (size_t b = 0; b < descriptors_constr.datalen; b++) { + int64_t descriptors_conv_27 = descriptors_vals[b]; + void* descriptors_conv_27_ptr = untag_ptr(descriptors_conv_27); + CHECK_ACCESS(descriptors_conv_27_ptr); + LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr); + descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(descriptors_conv_27)); + descriptors_constr.data[b] = descriptors_conv_27_conv; } - (*env)->ReleaseLongArrayElements(env, hops_arg, hops_arg_vals, 0); - LDKBlindedTail blinded_tail_arg_conv; - blinded_tail_arg_conv.inner = untag_ptr(blinded_tail_arg); - blinded_tail_arg_conv.is_owned = ptr_is_owned(blinded_tail_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_tail_arg_conv); - blinded_tail_arg_conv = BlindedTail_clone(&blinded_tail_arg_conv); - LDKPath ret_var = Path_new(hops_arg_constr, blinded_tail_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + (*env)->ReleaseLongArrayElements(env, descriptors, descriptors_vals, 0); + LDKCVec_u8Z psbt_ref; + psbt_ref.datalen = (*env)->GetArrayLength(env, psbt); + psbt_ref.data = MALLOC(psbt_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, psbt, 0, psbt_ref.datalen, psbt_ref.data); + LDKCResult_CVec_u8ZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZNoneZ), "LDKCResult_CVec_u8ZNoneZ"); + *ret_conv = KeysManager_sign_spendable_outputs_psbt(&this_arg_conv, descriptors_constr, psbt_ref); + return tag_ptr(ret_conv, true); } -static inline uint64_t Path_clone_ptr(LDKPath *NONNULL_PTR arg) { - LDKPath ret_var = Path_clone(arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1EntropySource(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKKeysManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource"); + *ret_ret = KeysManager_as_EntropySource(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1NodeSigner(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKKeysManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeSigner* ret_ret = MALLOC(sizeof(LDKNodeSigner), "LDKNodeSigner"); + *ret_ret = KeysManager_as_NodeSigner(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1OutputSpender(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKKeysManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKOutputSpender* ret_ret = MALLOC(sizeof(LDKOutputSpender), "LDKOutputSpender"); + *ret_ret = KeysManager_as_OutputSpender(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1SignerProvider(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKKeysManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKSignerProvider* ret_ret = MALLOC(sizeof(LDKSignerProvider), "LDKSignerProvider"); + *ret_ret = KeysManager_as_SignerProvider(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPhantomKeysManager this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + PhantomKeysManager_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1as_1EntropySource(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKPhantomKeysManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource"); + *ret_ret = PhantomKeysManager_as_EntropySource(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1as_1NodeSigner(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKPhantomKeysManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeSigner* ret_ret = MALLOC(sizeof(LDKNodeSigner), "LDKNodeSigner"); + *ret_ret = PhantomKeysManager_as_NodeSigner(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1as_1OutputSpender(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKPhantomKeysManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKOutputSpender* ret_ret = MALLOC(sizeof(LDKOutputSpender), "LDKOutputSpender"); + *ret_ret = PhantomKeysManager_as_OutputSpender(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1as_1SignerProvider(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKPhantomKeysManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKSignerProvider* ret_ret = MALLOC(sizeof(LDKSignerProvider), "LDKSignerProvider"); + *ret_ret = PhantomKeysManager_as_SignerProvider(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1new(JNIEnv *env, jclass clz, int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos, int8_tArray cross_node_seed) { + uint8_t seed_arr[32]; + CHECK((*env)->GetArrayLength(env, seed) == 32); + (*env)->GetByteArrayRegion(env, seed, 0, 32, seed_arr); + uint8_t (*seed_ref)[32] = &seed_arr; + uint8_t cross_node_seed_arr[32]; + CHECK((*env)->GetArrayLength(env, cross_node_seed) == 32); + (*env)->GetByteArrayRegion(env, cross_node_seed, 0, 32, cross_node_seed_arr); + uint8_t (*cross_node_seed_ref)[32] = &cross_node_seed_arr; + LDKPhantomKeysManager ret_var = PhantomKeysManager_new(seed_ref, starting_time_secs, starting_time_nanos, cross_node_seed_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKPath arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = Path_clone_ptr(&arg_conv); - return ret_conv; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPath orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKPath ret_var = Path_clone(&orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1derive_1channel_1keys(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_value_satoshis, int8_tArray params) { + LDKPhantomKeysManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + uint8_t params_arr[32]; + CHECK((*env)->GetArrayLength(env, params) == 32); + (*env)->GetByteArrayRegion(env, params, 0, 32, params_arr); + uint8_t (*params_ref)[32] = ¶ms_arr; + LDKInMemorySigner ret_var = PhantomKeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKPath o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = Path_hash(&o_conv); - return ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Path_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKPath a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKPath b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = Path_eq(&a_conv, &b_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1fee_1msat(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKPath this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1get_1node_1secret_1key(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKPhantomKeysManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - int64_t ret_conv = Path_fee_msat(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, PhantomKeysManager_get_node_secret_key(&this_arg_conv).bytes); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1final_1value_1msat(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKPath this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1get_1phantom_1node_1secret_1key(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKPhantomKeysManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - int64_t ret_conv = Path_final_value_msat(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, PhantomKeysManager_get_phantom_node_secret_key(&this_arg_conv).bytes); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1final_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKPath this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RandomBytes_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKRandomBytes this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + RandomBytes_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RandomBytes_1new(JNIEnv *env, jclass clz, int8_tArray seed) { + LDKThirtyTwoBytes seed_ref; + CHECK((*env)->GetArrayLength(env, seed) == 32); + (*env)->GetByteArrayRegion(env, seed, 0, 32, seed_ref.data); + LDKRandomBytes ret_var = RandomBytes_new(seed_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RandomBytes_1as_1EntropySource(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKRandomBytes this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); - *ret_copy = Path_final_cltv_expiry_delta(&this_arg_conv); + LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource"); + *ret_ret = RandomBytes_as_EntropySource(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +static inline uint64_t EcdsaChannelSigner_clone_ptr(LDKEcdsaChannelSigner *NONNULL_PTR arg) { + LDKEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner"); + *ret_ret = EcdsaChannelSigner_clone(arg); + return tag_ptr(ret_ret, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EcdsaChannelSigner_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + void* arg_ptr = untag_ptr(arg); + if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); } + LDKEcdsaChannelSigner* arg_conv = (LDKEcdsaChannelSigner*)arg_ptr; + int64_t ret_conv = EcdsaChannelSigner_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EcdsaChannelSigner_1clone(JNIEnv *env, jclass clz, int64_t orig) { + void* orig_ptr = untag_ptr(orig); + if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); } + LDKEcdsaChannelSigner* orig_conv = (LDKEcdsaChannelSigner*)orig_ptr; + LDKEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner"); + *ret_ret = EcdsaChannelSigner_clone(orig_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EcdsaChannelSigner_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKEcdsaChannelSigner this_ptr_conv = *(LDKEcdsaChannelSigner*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + EcdsaChannelSigner_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKAsyncPaymentsMessageHandler this_ptr_conv = *(LDKAsyncPaymentsMessageHandler*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + AsyncPaymentsMessageHandler_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessage_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKAsyncPaymentsMessage this_ptr_conv = *(LDKAsyncPaymentsMessage*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + AsyncPaymentsMessage_free(this_ptr_conv); +} + +static inline uint64_t AsyncPaymentsMessage_clone_ptr(LDKAsyncPaymentsMessage *NONNULL_PTR arg) { + LDKAsyncPaymentsMessage *ret_copy = MALLOC(sizeof(LDKAsyncPaymentsMessage), "LDKAsyncPaymentsMessage"); + *ret_copy = AsyncPaymentsMessage_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKAsyncPaymentsMessage* arg_conv = (LDKAsyncPaymentsMessage*)untag_ptr(arg); + int64_t ret_conv = AsyncPaymentsMessage_clone_ptr(arg_conv); + return ret_conv; +} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKRoute this_obj_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessage_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKAsyncPaymentsMessage* orig_conv = (LDKAsyncPaymentsMessage*)untag_ptr(orig); + LDKAsyncPaymentsMessage *ret_copy = MALLOC(sizeof(LDKAsyncPaymentsMessage), "LDKAsyncPaymentsMessage"); + *ret_copy = AsyncPaymentsMessage_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessage_1held_1htlc_1available(JNIEnv *env, jclass clz, int64_t a) { + LDKHeldHtlcAvailable a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = HeldHtlcAvailable_clone(&a_conv); + LDKAsyncPaymentsMessage *ret_copy = MALLOC(sizeof(LDKAsyncPaymentsMessage), "LDKAsyncPaymentsMessage"); + *ret_copy = AsyncPaymentsMessage_held_htlc_available(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessage_1release_1held_1htlc(JNIEnv *env, jclass clz, int64_t a) { + LDKReleaseHeldHtlc a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = ReleaseHeldHtlc_clone(&a_conv); + LDKAsyncPaymentsMessage *ret_copy = MALLOC(sizeof(LDKAsyncPaymentsMessage), "LDKAsyncPaymentsMessage"); + *ret_copy = AsyncPaymentsMessage_release_held_htlc(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HeldHtlcAvailable_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKHeldHtlcAvailable this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Route_free(this_obj_conv); + HeldHtlcAvailable_free(this_obj_conv); } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Route_1get_1paths(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRoute this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HeldHtlcAvailable_1get_1payment_1release_1secret(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKHeldHtlcAvailable this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_PathZ ret_var = Route_get_paths(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t g = 0; g < ret_var.datalen; g++) { - LDKPath ret_conv_6_var = ret_var.data[g]; - int64_t ret_conv_6_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_6_var); - ret_conv_6_ref = tag_ptr(ret_conv_6_var.inner, ret_conv_6_var.is_owned); - ret_arr_ptr[g] = ret_conv_6_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *HeldHtlcAvailable_get_payment_release_secret(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1paths(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { - LDKRoute this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HeldHtlcAvailable_1set_1payment_1release_1secret(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKHeldHtlcAvailable this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_PathZ val_constr; - val_constr.datalen = (*env)->GetArrayLength(env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKPath), "LDKCVec_PathZ Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); - for (size_t g = 0; g < val_constr.datalen; g++) { - int64_t val_conv_6 = val_vals[g]; - LDKPath val_conv_6_conv; - val_conv_6_conv.inner = untag_ptr(val_conv_6); - val_conv_6_conv.is_owned = ptr_is_owned(val_conv_6); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_6_conv); - val_conv_6_conv = Path_clone(&val_conv_6_conv); - val_constr.data[g] = val_conv_6_conv; - } - (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); - Route_set_paths(&this_ptr_conv, val_constr); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + HeldHtlcAvailable_set_payment_release_secret(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1route_1params(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRoute this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKRouteParameters ret_var = Route_get_route_params(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HeldHtlcAvailable_1new(JNIEnv *env, jclass clz, int8_tArray payment_release_secret_arg) { + LDKThirtyTwoBytes payment_release_secret_arg_ref; + CHECK((*env)->GetArrayLength(env, payment_release_secret_arg) == 32); + (*env)->GetByteArrayRegion(env, payment_release_secret_arg, 0, 32, payment_release_secret_arg_ref.data); + LDKHeldHtlcAvailable ret_var = HeldHtlcAvailable_new(payment_release_secret_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1route_1params(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKRoute this_ptr_conv; +static inline uint64_t HeldHtlcAvailable_clone_ptr(LDKHeldHtlcAvailable *NONNULL_PTR arg) { + LDKHeldHtlcAvailable ret_var = HeldHtlcAvailable_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HeldHtlcAvailable_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKHeldHtlcAvailable arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = HeldHtlcAvailable_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HeldHtlcAvailable_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKHeldHtlcAvailable orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKHeldHtlcAvailable ret_var = HeldHtlcAvailable_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReleaseHeldHtlc_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKReleaseHeldHtlc this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ReleaseHeldHtlc_free(this_obj_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReleaseHeldHtlc_1get_1payment_1release_1secret(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKReleaseHeldHtlc this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKRouteParameters val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = RouteParameters_clone(&val_conv); - Route_set_route_params(&this_ptr_conv, val_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ReleaseHeldHtlc_get_payment_release_secret(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1new(JNIEnv *env, jclass clz, int64_tArray paths_arg, int64_t route_params_arg) { - LDKCVec_PathZ paths_arg_constr; - paths_arg_constr.datalen = (*env)->GetArrayLength(env, paths_arg); - if (paths_arg_constr.datalen > 0) - paths_arg_constr.data = MALLOC(paths_arg_constr.datalen * sizeof(LDKPath), "LDKCVec_PathZ Elements"); - else - paths_arg_constr.data = NULL; - int64_t* paths_arg_vals = (*env)->GetLongArrayElements (env, paths_arg, NULL); - for (size_t g = 0; g < paths_arg_constr.datalen; g++) { - int64_t paths_arg_conv_6 = paths_arg_vals[g]; - LDKPath paths_arg_conv_6_conv; - paths_arg_conv_6_conv.inner = untag_ptr(paths_arg_conv_6); - paths_arg_conv_6_conv.is_owned = ptr_is_owned(paths_arg_conv_6); - CHECK_INNER_FIELD_ACCESS_OR_NULL(paths_arg_conv_6_conv); - paths_arg_conv_6_conv = Path_clone(&paths_arg_conv_6_conv); - paths_arg_constr.data[g] = paths_arg_conv_6_conv; - } - (*env)->ReleaseLongArrayElements(env, paths_arg, paths_arg_vals, 0); - LDKRouteParameters route_params_arg_conv; - route_params_arg_conv.inner = untag_ptr(route_params_arg); - route_params_arg_conv.is_owned = ptr_is_owned(route_params_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_arg_conv); - route_params_arg_conv = RouteParameters_clone(&route_params_arg_conv); - LDKRoute ret_var = Route_new(paths_arg_constr, route_params_arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReleaseHeldHtlc_1set_1payment_1release_1secret(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKReleaseHeldHtlc this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + ReleaseHeldHtlc_set_payment_release_secret(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReleaseHeldHtlc_1new(JNIEnv *env, jclass clz, int8_tArray payment_release_secret_arg) { + LDKThirtyTwoBytes payment_release_secret_arg_ref; + CHECK((*env)->GetArrayLength(env, payment_release_secret_arg) == 32); + (*env)->GetByteArrayRegion(env, payment_release_secret_arg, 0, 32, payment_release_secret_arg_ref.data); + LDKReleaseHeldHtlc ret_var = ReleaseHeldHtlc_new(payment_release_secret_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t Route_clone_ptr(LDKRoute *NONNULL_PTR arg) { - LDKRoute ret_var = Route_clone(arg); +static inline uint64_t ReleaseHeldHtlc_clone_ptr(LDKReleaseHeldHtlc *NONNULL_PTR arg) { + LDKReleaseHeldHtlc ret_var = ReleaseHeldHtlc_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKRoute arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReleaseHeldHtlc_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKReleaseHeldHtlc arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Route_clone_ptr(&arg_conv); + int64_t ret_conv = ReleaseHeldHtlc_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKRoute orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReleaseHeldHtlc_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKReleaseHeldHtlc orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKRoute ret_var = Route_clone(&orig_conv); + LDKReleaseHeldHtlc ret_var = ReleaseHeldHtlc_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKRoute o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = Route_hash(&o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReleaseHeldHtlc_1as_1OnionMessageContents(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKReleaseHeldHtlc this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *ret_ret = ReleaseHeldHtlc_as_OnionMessageContents(&this_arg_conv); + return tag_ptr(ret_ret, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Route_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKRoute a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKRoute b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = Route_eq(&a_conv, &b_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1total_1fees(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKRoute this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = Route_get_total_fees(&this_arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1total_1amount(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKRoute this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = Route_get_total_amount(&this_arg_conv); - return ret_conv; -} - -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Route_1to_1str(JNIEnv *env, jclass clz, int64_t o) { - LDKRoute o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = Route_to_str(&o_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Route_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKRoute obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HeldHtlcAvailable_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKHeldHtlcAvailable obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = Route_write(&obj_conv); + LDKCVec_u8Z ret_var = HeldHtlcAvailable_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HeldHtlcAvailable_1read(JNIEnv *env, jclass clz, int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); - *ret_conv = Route_read(ser_ref); + LDKCResult_HeldHtlcAvailableDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HeldHtlcAvailableDecodeErrorZ), "LDKCResult_HeldHtlcAvailableDecodeErrorZ"); + *ret_conv = HeldHtlcAvailable_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKRouteParameters this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - RouteParameters_free(this_obj_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReleaseHeldHtlc_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKReleaseHeldHtlc obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ReleaseHeldHtlc_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1payment_1params(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRouteParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPaymentParameters ret_var = RouteParameters_get_payment_params(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReleaseHeldHtlc_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReleaseHeldHtlcDecodeErrorZ), "LDKCResult_ReleaseHeldHtlcDecodeErrorZ"); + *ret_conv = ReleaseHeldHtlc_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1payment_1params(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKRouteParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPaymentParameters val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = PaymentParameters_clone(&val_conv); - RouteParameters_set_payment_params(&this_ptr_conv, val_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessage_1is_1known_1type(JNIEnv *env, jclass clz, int64_t tlv_type) { + jboolean ret_conv = AsyncPaymentsMessage_is_known_type(tlv_type); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1final_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRouteParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = RouteParameters_get_final_value_msat(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessage_1as_1OnionMessageContents(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKAsyncPaymentsMessage* this_arg_conv = (LDKAsyncPaymentsMessage*)untag_ptr(this_arg); + LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *ret_ret = AsyncPaymentsMessage_as_OnionMessageContents(this_arg_conv); + return tag_ptr(ret_ret, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1final_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKRouteParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - RouteParameters_set_final_value_msat(&this_ptr_conv, val); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessage_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKAsyncPaymentsMessage* obj_conv = (LDKAsyncPaymentsMessage*)untag_ptr(obj); + LDKCVec_u8Z ret_var = AsyncPaymentsMessage_write(obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1max_1total_1routing_1fee_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRouteParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = RouteParameters_get_max_total_routing_fee_msat(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessage_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AsyncPaymentsMessageDecodeErrorZ), "LDKCResult_AsyncPaymentsMessageDecodeErrorZ"); + *ret_conv = AsyncPaymentsMessage_read(ser_ref, arg); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1max_1total_1routing_1fee_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKRouteParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - RouteParameters_set_max_total_routing_fee_msat(&this_ptr_conv, val_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKOnionMessenger this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OnionMessenger_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1new(JNIEnv *env, jclass clz, int64_t payment_params_arg, int64_t final_value_msat_arg, int64_t max_total_routing_fee_msat_arg) { - LDKPaymentParameters payment_params_arg_conv; - payment_params_arg_conv.inner = untag_ptr(payment_params_arg); - payment_params_arg_conv.is_owned = ptr_is_owned(payment_params_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_params_arg_conv); - payment_params_arg_conv = PaymentParameters_clone(&payment_params_arg_conv); - void* max_total_routing_fee_msat_arg_ptr = untag_ptr(max_total_routing_fee_msat_arg); - CHECK_ACCESS(max_total_routing_fee_msat_arg_ptr); - LDKCOption_u64Z max_total_routing_fee_msat_arg_conv = *(LDKCOption_u64Z*)(max_total_routing_fee_msat_arg_ptr); - max_total_routing_fee_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(max_total_routing_fee_msat_arg)); - LDKRouteParameters ret_var = RouteParameters_new(payment_params_arg_conv, final_value_msat_arg, max_total_routing_fee_msat_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Responder_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKResponder this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Responder_free(this_obj_conv); } -static inline uint64_t RouteParameters_clone_ptr(LDKRouteParameters *NONNULL_PTR arg) { - LDKRouteParameters ret_var = RouteParameters_clone(arg); +static inline uint64_t Responder_clone_ptr(LDKResponder *NONNULL_PTR arg) { + LDKResponder ret_var = Responder_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKRouteParameters arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Responder_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKResponder arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = RouteParameters_clone_ptr(&arg_conv); + int64_t ret_conv = Responder_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKRouteParameters orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Responder_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKResponder orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKRouteParameters ret_var = RouteParameters_clone(&orig_conv); + LDKResponder ret_var = Responder_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKRouteParameters o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = RouteParameters_hash(&o_conv); - return ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteParameters_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKRouteParameters a_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Responder_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKResponder a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKRouteParameters b_conv; + LDKResponder b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = RouteParameters_eq(&a_conv, &b_conv); + jboolean ret_conv = Responder_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1from_1payment_1params_1and_1value(JNIEnv *env, jclass clz, int64_t payment_params, int64_t final_value_msat) { - LDKPaymentParameters payment_params_conv; - payment_params_conv.inner = untag_ptr(payment_params); - payment_params_conv.is_owned = ptr_is_owned(payment_params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_params_conv); - payment_params_conv = PaymentParameters_clone(&payment_params_conv); - LDKRouteParameters ret_var = RouteParameters_from_payment_params_and_value(payment_params_conv, final_value_msat); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteParameters_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKRouteParameters obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Responder_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKResponder obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = RouteParameters_write(&obj_conv); + LDKCVec_u8Z ret_var = Responder_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Responder_1read(JNIEnv *env, jclass clz, int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); - *ret_conv = RouteParameters_read(ser_ref); + LDKCResult_ResponderDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ResponderDecodeErrorZ), "LDKCResult_ResponderDecodeErrorZ"); + *ret_conv = Responder_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKPaymentParameters this_obj_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Responder_1respond(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKResponder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = Responder_clone(&this_arg_conv); + LDKResponseInstruction ret_var = Responder_respond(this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Responder_1respond_1with_1reply_1path(JNIEnv *env, jclass clz, int64_t this_arg, int64_t context) { + LDKResponder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = Responder_clone(&this_arg_conv); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKMessageContext context_conv = *(LDKMessageContext*)(context_ptr); + context_conv = MessageContext_clone((LDKMessageContext*)untag_ptr(context)); + LDKResponseInstruction ret_var = Responder_respond_with_reply_path(this_arg_conv, context_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ResponseInstruction_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKResponseInstruction this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PaymentParameters_free(this_obj_conv); + ResponseInstruction_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1payee(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); - *ret_copy = PaymentParameters_get_payee(&this_ptr_conv); +static inline uint64_t ResponseInstruction_clone_ptr(LDKResponseInstruction *NONNULL_PTR arg) { + LDKResponseInstruction ret_var = ResponseInstruction_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ResponseInstruction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKResponseInstruction arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = ResponseInstruction_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ResponseInstruction_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKResponseInstruction orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKResponseInstruction ret_var = ResponseInstruction_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendInstructions_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKMessageSendInstructions this_ptr_conv = *(LDKMessageSendInstructions*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + MessageSendInstructions_free(this_ptr_conv); +} + +static inline uint64_t MessageSendInstructions_clone_ptr(LDKMessageSendInstructions *NONNULL_PTR arg) { + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = MessageSendInstructions_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendInstructions_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKMessageSendInstructions* arg_conv = (LDKMessageSendInstructions*)untag_ptr(arg); + int64_t ret_conv = MessageSendInstructions_clone_ptr(arg_conv); + return ret_conv; +} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1payee(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKPayee val_conv = *(LDKPayee*)(val_ptr); - val_conv = Payee_clone((LDKPayee*)untag_ptr(val)); - PaymentParameters_set_payee(&this_ptr_conv, val_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendInstructions_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKMessageSendInstructions* orig_conv = (LDKMessageSendInstructions*)untag_ptr(orig); + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = MessageSendInstructions_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1expiry_1time(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = PaymentParameters_get_expiry_time(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendInstructions_1with_1specified_1reply_1path(JNIEnv *env, jclass clz, int64_t destination, int64_t reply_path) { + void* destination_ptr = untag_ptr(destination); + CHECK_ACCESS(destination_ptr); + LDKDestination destination_conv = *(LDKDestination*)(destination_ptr); + destination_conv = Destination_clone((LDKDestination*)untag_ptr(destination)); + LDKBlindedMessagePath reply_path_conv; + reply_path_conv.inner = untag_ptr(reply_path); + reply_path_conv.is_owned = ptr_is_owned(reply_path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(reply_path_conv); + reply_path_conv = BlindedMessagePath_clone(&reply_path_conv); + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = MessageSendInstructions_with_specified_reply_path(destination_conv, reply_path_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1expiry_1time(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - PaymentParameters_set_expiry_time(&this_ptr_conv, val_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendInstructions_1with_1reply_1path(JNIEnv *env, jclass clz, int64_t destination, int64_t context) { + void* destination_ptr = untag_ptr(destination); + CHECK_ACCESS(destination_ptr); + LDKDestination destination_conv = *(LDKDestination*)(destination_ptr); + destination_conv = Destination_clone((LDKDestination*)untag_ptr(destination)); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKMessageContext context_conv = *(LDKMessageContext*)(context_ptr); + context_conv = MessageContext_clone((LDKMessageContext*)untag_ptr(context)); + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = MessageSendInstructions_with_reply_path(destination_conv, context_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1max_1total_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int32_t ret_conv = PaymentParameters_get_max_total_cltv_expiry_delta(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendInstructions_1without_1reply_1path(JNIEnv *env, jclass clz, int64_t destination) { + void* destination_ptr = untag_ptr(destination); + CHECK_ACCESS(destination_ptr); + LDKDestination destination_conv = *(LDKDestination*)(destination_ptr); + destination_conv = Destination_clone((LDKDestination*)untag_ptr(destination)); + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = MessageSendInstructions_without_reply_path(destination_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1max_1total_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - PaymentParameters_set_max_total_cltv_expiry_delta(&this_ptr_conv, val); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendInstructions_1for_1reply(JNIEnv *env, jclass clz, int64_t instructions) { + LDKResponseInstruction instructions_conv; + instructions_conv.inner = untag_ptr(instructions); + instructions_conv.is_owned = ptr_is_owned(instructions); + CHECK_INNER_FIELD_ACCESS_OR_NULL(instructions_conv); + instructions_conv = ResponseInstruction_clone(&instructions_conv); + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = MessageSendInstructions_for_reply(instructions_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1max_1path_1count(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_t ret_conv = PaymentParameters_get_max_path_count(&this_ptr_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageRouter_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKMessageRouter this_ptr_conv = *(LDKMessageRouter*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + MessageRouter_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1max_1path_1count(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - PaymentParameters_set_max_path_count(&this_ptr_conv, val); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DefaultMessageRouter_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKDefaultMessageRouter this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + DefaultMessageRouter_free(this_obj_conv); } -JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1max_1channel_1saturation_1power_1of_1half(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_t ret_conv = PaymentParameters_get_max_channel_saturation_power_of_half(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultMessageRouter_1new(JNIEnv *env, jclass clz, int64_t network_graph, int64_t entropy_source) { + LDKNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + LDKDefaultMessageRouter ret_var = DefaultMessageRouter_new(&network_graph_conv, entropy_source_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1max_1channel_1saturation_1power_1of_1half(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - PaymentParameters_set_max_channel_saturation_power_of_half(&this_ptr_conv, val); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultMessageRouter_1as_1MessageRouter(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKDefaultMessageRouter this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKMessageRouter* ret_ret = MALLOC(sizeof(LDKMessageRouter), "LDKMessageRouter"); + *ret_ret = DefaultMessageRouter_as_MessageRouter(&this_arg_conv); + return tag_ptr(ret_ret, true); } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1previously_1failed_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPaymentParameters this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKOnionMessagePath this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OnionMessagePath_free(this_obj_conv); +} + +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1get_1intermediate_1nodes(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOnionMessagePath this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u64Z ret_var = PaymentParameters_get_previously_failed_channels(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t g = 0; g < ret_var.datalen; g++) { - int64_t ret_conv_6_conv = ret_var.data[g]; - ret_arr_ptr[g] = ret_conv_6_conv; + LDKCVec_PublicKeyZ ret_var = OnionMessagePath_get_intermediate_nodes(&this_ptr_conv); + jobjectArray ret_arr = NULL; + ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); + ; + for (size_t i = 0; i < ret_var.datalen; i++) { + int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 33, ret_var.data[i].compressed_form); + (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1previously_1failed_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { - LDKPaymentParameters this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1set_1intermediate_1nodes(JNIEnv *env, jclass clz, int64_t this_ptr, jobjectArray val) { + LDKOnionMessagePath this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u64Z val_constr; + LDKCVec_PublicKeyZ val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); else val_constr.data = NULL; - int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); - for (size_t g = 0; g < val_constr.datalen; g++) { - int64_t val_conv_6 = val_vals[g]; - val_constr.data[g] = val_conv_6; + for (size_t i = 0; i < val_constr.datalen; i++) { + int8_tArray val_conv_8 = (*env)->GetObjectArrayElement(env, val, i); + LDKPublicKey val_conv_8_ref; + CHECK((*env)->GetArrayLength(env, val_conv_8) == 33); + (*env)->GetByteArrayRegion(env, val_conv_8, 0, 33, val_conv_8_ref.compressed_form); + val_constr.data[i] = val_conv_8_ref; } - (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); - PaymentParameters_set_previously_failed_channels(&this_ptr_conv, val_constr); + OnionMessagePath_set_intermediate_nodes(&this_ptr_conv, val_constr); } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1previously_1failed_1blinded_1path_1idxs(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPaymentParameters this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1get_1destination(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOnionMessagePath this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u64Z ret_var = PaymentParameters_get_previously_failed_blinded_path_idxs(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t g = 0; g < ret_var.datalen; g++) { - int64_t ret_conv_6_conv = ret_var.data[g]; - ret_arr_ptr[g] = ret_conv_6_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; + LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); + *ret_copy = OnionMessagePath_get_destination(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1previously_1failed_1blinded_1path_1idxs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { - LDKPaymentParameters this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1set_1destination(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKOnionMessagePath this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u64Z val_constr; - val_constr.datalen = (*env)->GetArrayLength(env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); - for (size_t g = 0; g < val_constr.datalen; g++) { - int64_t val_conv_6 = val_vals[g]; - val_constr.data[g] = val_conv_6; - } - (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); - PaymentParameters_set_previously_failed_blinded_path_idxs(&this_ptr_conv, val_constr); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKDestination val_conv = *(LDKDestination*)(val_ptr); + val_conv = Destination_clone((LDKDestination*)untag_ptr(val)); + OnionMessagePath_set_destination(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1new(JNIEnv *env, jclass clz, int64_t payee_arg, int64_t expiry_time_arg, int32_t max_total_cltv_expiry_delta_arg, int8_t max_path_count_arg, int8_t max_channel_saturation_power_of_half_arg, int64_tArray previously_failed_channels_arg, int64_tArray previously_failed_blinded_path_idxs_arg) { - void* payee_arg_ptr = untag_ptr(payee_arg); - CHECK_ACCESS(payee_arg_ptr); - LDKPayee payee_arg_conv = *(LDKPayee*)(payee_arg_ptr); - payee_arg_conv = Payee_clone((LDKPayee*)untag_ptr(payee_arg)); - void* expiry_time_arg_ptr = untag_ptr(expiry_time_arg); - CHECK_ACCESS(expiry_time_arg_ptr); - LDKCOption_u64Z expiry_time_arg_conv = *(LDKCOption_u64Z*)(expiry_time_arg_ptr); - expiry_time_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(expiry_time_arg)); - LDKCVec_u64Z previously_failed_channels_arg_constr; - previously_failed_channels_arg_constr.datalen = (*env)->GetArrayLength(env, previously_failed_channels_arg); - if (previously_failed_channels_arg_constr.datalen > 0) - previously_failed_channels_arg_constr.data = MALLOC(previously_failed_channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); - else - previously_failed_channels_arg_constr.data = NULL; - int64_t* previously_failed_channels_arg_vals = (*env)->GetLongArrayElements (env, previously_failed_channels_arg, NULL); - for (size_t g = 0; g < previously_failed_channels_arg_constr.datalen; g++) { - int64_t previously_failed_channels_arg_conv_6 = previously_failed_channels_arg_vals[g]; - previously_failed_channels_arg_constr.data[g] = previously_failed_channels_arg_conv_6; - } - (*env)->ReleaseLongArrayElements(env, previously_failed_channels_arg, previously_failed_channels_arg_vals, 0); - LDKCVec_u64Z previously_failed_blinded_path_idxs_arg_constr; - previously_failed_blinded_path_idxs_arg_constr.datalen = (*env)->GetArrayLength(env, previously_failed_blinded_path_idxs_arg); - if (previously_failed_blinded_path_idxs_arg_constr.datalen > 0) - previously_failed_blinded_path_idxs_arg_constr.data = MALLOC(previously_failed_blinded_path_idxs_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); - else - previously_failed_blinded_path_idxs_arg_constr.data = NULL; - int64_t* previously_failed_blinded_path_idxs_arg_vals = (*env)->GetLongArrayElements (env, previously_failed_blinded_path_idxs_arg, NULL); - for (size_t g = 0; g < previously_failed_blinded_path_idxs_arg_constr.datalen; g++) { - int64_t previously_failed_blinded_path_idxs_arg_conv_6 = previously_failed_blinded_path_idxs_arg_vals[g]; - previously_failed_blinded_path_idxs_arg_constr.data[g] = previously_failed_blinded_path_idxs_arg_conv_6; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1get_1first_1node_1addresses(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOnionMessagePath this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_CVec_SocketAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_SocketAddressZZ), "LDKCOption_CVec_SocketAddressZZ"); + *ret_copy = OnionMessagePath_get_first_node_addresses(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1set_1first_1node_1addresses(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKOnionMessagePath this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_CVec_SocketAddressZZ val_conv = *(LDKCOption_CVec_SocketAddressZZ*)(val_ptr); + val_conv = COption_CVec_SocketAddressZZ_clone((LDKCOption_CVec_SocketAddressZZ*)untag_ptr(val)); + OnionMessagePath_set_first_node_addresses(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1new(JNIEnv *env, jclass clz, jobjectArray intermediate_nodes_arg, int64_t destination_arg, int64_t first_node_addresses_arg) { + LDKCVec_PublicKeyZ intermediate_nodes_arg_constr; + intermediate_nodes_arg_constr.datalen = (*env)->GetArrayLength(env, intermediate_nodes_arg); + if (intermediate_nodes_arg_constr.datalen > 0) + intermediate_nodes_arg_constr.data = MALLOC(intermediate_nodes_arg_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); + else + intermediate_nodes_arg_constr.data = NULL; + for (size_t i = 0; i < intermediate_nodes_arg_constr.datalen; i++) { + int8_tArray intermediate_nodes_arg_conv_8 = (*env)->GetObjectArrayElement(env, intermediate_nodes_arg, i); + LDKPublicKey intermediate_nodes_arg_conv_8_ref; + CHECK((*env)->GetArrayLength(env, intermediate_nodes_arg_conv_8) == 33); + (*env)->GetByteArrayRegion(env, intermediate_nodes_arg_conv_8, 0, 33, intermediate_nodes_arg_conv_8_ref.compressed_form); + intermediate_nodes_arg_constr.data[i] = intermediate_nodes_arg_conv_8_ref; } - (*env)->ReleaseLongArrayElements(env, previously_failed_blinded_path_idxs_arg, previously_failed_blinded_path_idxs_arg_vals, 0); - LDKPaymentParameters ret_var = PaymentParameters_new(payee_arg_conv, expiry_time_arg_conv, max_total_cltv_expiry_delta_arg, max_path_count_arg, max_channel_saturation_power_of_half_arg, previously_failed_channels_arg_constr, previously_failed_blinded_path_idxs_arg_constr); + void* destination_arg_ptr = untag_ptr(destination_arg); + CHECK_ACCESS(destination_arg_ptr); + LDKDestination destination_arg_conv = *(LDKDestination*)(destination_arg_ptr); + destination_arg_conv = Destination_clone((LDKDestination*)untag_ptr(destination_arg)); + void* first_node_addresses_arg_ptr = untag_ptr(first_node_addresses_arg); + CHECK_ACCESS(first_node_addresses_arg_ptr); + LDKCOption_CVec_SocketAddressZZ first_node_addresses_arg_conv = *(LDKCOption_CVec_SocketAddressZZ*)(first_node_addresses_arg_ptr); + first_node_addresses_arg_conv = COption_CVec_SocketAddressZZ_clone((LDKCOption_CVec_SocketAddressZZ*)untag_ptr(first_node_addresses_arg)); + LDKOnionMessagePath ret_var = OnionMessagePath_new(intermediate_nodes_arg_constr, destination_arg_conv, first_node_addresses_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t PaymentParameters_clone_ptr(LDKPaymentParameters *NONNULL_PTR arg) { - LDKPaymentParameters ret_var = PaymentParameters_clone(arg); +static inline uint64_t OnionMessagePath_clone_ptr(LDKOnionMessagePath *NONNULL_PTR arg) { + LDKOnionMessagePath ret_var = OnionMessagePath_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKPaymentParameters arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKOnionMessagePath arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = PaymentParameters_clone_ptr(&arg_conv); + int64_t ret_conv = OnionMessagePath_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPaymentParameters orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKOnionMessagePath orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKPaymentParameters ret_var = PaymentParameters_clone(&orig_conv); + LDKOnionMessagePath ret_var = OnionMessagePath_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKPaymentParameters o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = PaymentParameters_hash(&o_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1first_1node(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOnionMessagePath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OnionMessagePath_first_node(&this_arg_conv).compressed_form); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Destination_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKDestination this_ptr_conv = *(LDKDestination*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Destination_free(this_ptr_conv); +} + +static inline uint64_t Destination_clone_ptr(LDKDestination *NONNULL_PTR arg) { + LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); + *ret_copy = Destination_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKDestination* arg_conv = (LDKDestination*)untag_ptr(arg); + int64_t ret_conv = Destination_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKPaymentParameters a_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKDestination* orig_conv = (LDKDestination*)untag_ptr(orig); + LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); + *ret_copy = Destination_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1node(JNIEnv *env, jclass clz, int8_tArray a) { + LDKPublicKey a_ref; + CHECK((*env)->GetArrayLength(env, a) == 33); + (*env)->GetByteArrayRegion(env, a, 0, 33, a_ref.compressed_form); + LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); + *ret_copy = Destination_node(a_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1blinded_1path(JNIEnv *env, jclass clz, int64_t a) { + LDKBlindedMessagePath a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKPaymentParameters b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = PaymentParameters_eq(&a_conv, &b_conv); + a_conv = BlindedMessagePath_clone(&a_conv); + LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); + *ret_copy = Destination_blinded_path(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKDestination* o_conv = (LDKDestination*)untag_ptr(o); + int64_t ret_conv = Destination_hash(o_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKPaymentParameters obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = PaymentParameters_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Destination_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKDestination* a_conv = (LDKDestination*)untag_ptr(a); + LDKDestination* b_conv = (LDKDestination*)untag_ptr(b); + jboolean ret_conv = Destination_eq(a_conv, b_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1read(JNIEnv *env, jclass clz, int8_tArray ser, int32_t arg) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ"); - *ret_conv = PaymentParameters_read(ser_ref, arg); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Destination_1resolve(JNIEnv *env, jclass clz, int64_t this_arg, int64_t network_graph) { + LDKDestination* this_arg_conv = (LDKDestination*)untag_ptr(this_arg); + LDKReadOnlyNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; + Destination_resolve(this_arg_conv, &network_graph_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1from_1node_1id(JNIEnv *env, jclass clz, int8_tArray payee_pubkey, int32_t final_cltv_expiry_delta) { - LDKPublicKey payee_pubkey_ref; - CHECK((*env)->GetArrayLength(env, payee_pubkey) == 33); - (*env)->GetByteArrayRegion(env, payee_pubkey, 0, 33, payee_pubkey_ref.compressed_form); - LDKPaymentParameters ret_var = PaymentParameters_from_node_id(payee_pubkey_ref, final_cltv_expiry_delta); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SendSuccess_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKSendSuccess this_ptr_conv = *(LDKSendSuccess*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + SendSuccess_free(this_ptr_conv); +} + +static inline uint64_t SendSuccess_clone_ptr(LDKSendSuccess *NONNULL_PTR arg) { + LDKSendSuccess *ret_copy = MALLOC(sizeof(LDKSendSuccess), "LDKSendSuccess"); + *ret_copy = SendSuccess_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendSuccess_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKSendSuccess* arg_conv = (LDKSendSuccess*)untag_ptr(arg); + int64_t ret_conv = SendSuccess_clone_ptr(arg_conv); + return ret_conv; +} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1for_1keysend(JNIEnv *env, jclass clz, int8_tArray payee_pubkey, int32_t final_cltv_expiry_delta, jboolean allow_mpp) { - LDKPublicKey payee_pubkey_ref; - CHECK((*env)->GetArrayLength(env, payee_pubkey) == 33); - (*env)->GetByteArrayRegion(env, payee_pubkey, 0, 33, payee_pubkey_ref.compressed_form); - LDKPaymentParameters ret_var = PaymentParameters_for_keysend(payee_pubkey_ref, final_cltv_expiry_delta, allow_mpp); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendSuccess_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKSendSuccess* orig_conv = (LDKSendSuccess*)untag_ptr(orig); + LDKSendSuccess *ret_copy = MALLOC(sizeof(LDKSendSuccess), "LDKSendSuccess"); + *ret_copy = SendSuccess_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1from_1bolt12_1invoice(JNIEnv *env, jclass clz, int64_t invoice) { - LDKBolt12Invoice invoice_conv; - invoice_conv.inner = untag_ptr(invoice); - invoice_conv.is_owned = ptr_is_owned(invoice); - CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); - invoice_conv.is_owned = false; - LDKPaymentParameters ret_var = PaymentParameters_from_bolt12_invoice(&invoice_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendSuccess_1buffered(JNIEnv *env, jclass clz) { + LDKSendSuccess *ret_copy = MALLOC(sizeof(LDKSendSuccess), "LDKSendSuccess"); + *ret_copy = SendSuccess_buffered(); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1blinded(JNIEnv *env, jclass clz, int64_tArray blinded_route_hints) { - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ blinded_route_hints_constr; - blinded_route_hints_constr.datalen = (*env)->GetArrayLength(env, blinded_route_hints); - if (blinded_route_hints_constr.datalen > 0) - blinded_route_hints_constr.data = MALLOC(blinded_route_hints_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); - else - blinded_route_hints_constr.data = NULL; - int64_t* blinded_route_hints_vals = (*env)->GetLongArrayElements (env, blinded_route_hints, NULL); - for (size_t l = 0; l < blinded_route_hints_constr.datalen; l++) { - int64_t blinded_route_hints_conv_37 = blinded_route_hints_vals[l]; - void* blinded_route_hints_conv_37_ptr = untag_ptr(blinded_route_hints_conv_37); - CHECK_ACCESS(blinded_route_hints_conv_37_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ blinded_route_hints_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(blinded_route_hints_conv_37_ptr); - blinded_route_hints_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(blinded_route_hints_conv_37)); - blinded_route_hints_constr.data[l] = blinded_route_hints_conv_37_conv; - } - (*env)->ReleaseLongArrayElements(env, blinded_route_hints, blinded_route_hints_vals, 0); - LDKPaymentParameters ret_var = PaymentParameters_blinded(blinded_route_hints_constr); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendSuccess_1buffered_1awaiting_1connection(JNIEnv *env, jclass clz, int8_tArray a) { + LDKPublicKey a_ref; + CHECK((*env)->GetArrayLength(env, a) == 33); + (*env)->GetByteArrayRegion(env, a, 0, 33, a_ref.compressed_form); + LDKSendSuccess *ret_copy = MALLOC(sizeof(LDKSendSuccess), "LDKSendSuccess"); + *ret_copy = SendSuccess_buffered_awaiting_connection(a_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendSuccess_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKSendSuccess* o_conv = (LDKSendSuccess*)untag_ptr(o); + int64_t ret_conv = SendSuccess_hash(o_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SendSuccess_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKSendSuccess* a_conv = (LDKSendSuccess*)untag_ptr(a); + LDKSendSuccess* b_conv = (LDKSendSuccess*)untag_ptr(b); + jboolean ret_conv = SendSuccess_eq(a_conv, b_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SendError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); CHECK_ACCESS(this_ptr_ptr); - LDKPayee this_ptr_conv = *(LDKPayee*)(this_ptr_ptr); + LDKSendError this_ptr_conv = *(LDKSendError*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - Payee_free(this_ptr_conv); + SendError_free(this_ptr_conv); } -static inline uint64_t Payee_clone_ptr(LDKPayee *NONNULL_PTR arg) { - LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); - *ret_copy = Payee_clone(arg); +static inline uint64_t SendError_clone_ptr(LDKSendError *NONNULL_PTR arg) { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKPayee* arg_conv = (LDKPayee*)untag_ptr(arg); - int64_t ret_conv = Payee_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKSendError* arg_conv = (LDKSendError*)untag_ptr(arg); + int64_t ret_conv = SendError_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPayee* orig_conv = (LDKPayee*)untag_ptr(orig); - LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); - *ret_copy = Payee_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKSendError* orig_conv = (LDKSendError*)untag_ptr(orig); + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_clone(orig_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1blinded(JNIEnv *env, jclass clz, int64_tArray route_hints, int64_t features) { - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ route_hints_constr; - route_hints_constr.datalen = (*env)->GetArrayLength(env, route_hints); - if (route_hints_constr.datalen > 0) - route_hints_constr.data = MALLOC(route_hints_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); - else - route_hints_constr.data = NULL; - int64_t* route_hints_vals = (*env)->GetLongArrayElements (env, route_hints, NULL); - for (size_t l = 0; l < route_hints_constr.datalen; l++) { - int64_t route_hints_conv_37 = route_hints_vals[l]; - void* route_hints_conv_37_ptr = untag_ptr(route_hints_conv_37); - CHECK_ACCESS(route_hints_conv_37_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ route_hints_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(route_hints_conv_37_ptr); - route_hints_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(route_hints_conv_37)); - route_hints_constr.data[l] = route_hints_conv_37_conv; - } - (*env)->ReleaseLongArrayElements(env, route_hints, route_hints_vals, 0); - LDKBolt12InvoiceFeatures features_conv; - features_conv.inner = untag_ptr(features); - features_conv.is_owned = ptr_is_owned(features); - CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); - features_conv = Bolt12InvoiceFeatures_clone(&features_conv); - LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); - *ret_copy = Payee_blinded(route_hints_constr, features_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1secp256k1(JNIEnv *env, jclass clz, jclass a) { + LDKSecp256k1Error a_conv = LDKSecp256k1Error_from_java(env, a); + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_secp256k1(a_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1clear(JNIEnv *env, jclass clz, int8_tArray node_id, int64_tArray route_hints, int64_t features, int32_t final_cltv_expiry_delta) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKCVec_RouteHintZ route_hints_constr; - route_hints_constr.datalen = (*env)->GetArrayLength(env, route_hints); - if (route_hints_constr.datalen > 0) - route_hints_constr.data = MALLOC(route_hints_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements"); - else - route_hints_constr.data = NULL; - int64_t* route_hints_vals = (*env)->GetLongArrayElements (env, route_hints, NULL); - for (size_t l = 0; l < route_hints_constr.datalen; l++) { - int64_t route_hints_conv_11 = route_hints_vals[l]; - LDKRouteHint route_hints_conv_11_conv; - route_hints_conv_11_conv.inner = untag_ptr(route_hints_conv_11); - route_hints_conv_11_conv.is_owned = ptr_is_owned(route_hints_conv_11); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_hints_conv_11_conv); - route_hints_conv_11_conv = RouteHint_clone(&route_hints_conv_11_conv); - route_hints_constr.data[l] = route_hints_conv_11_conv; - } - (*env)->ReleaseLongArrayElements(env, route_hints, route_hints_vals, 0); - LDKBolt11InvoiceFeatures features_conv; - features_conv.inner = untag_ptr(features); - features_conv.is_owned = ptr_is_owned(features); - CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); - features_conv = Bolt11InvoiceFeatures_clone(&features_conv); - LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); - *ret_copy = Payee_clear(node_id_ref, route_hints_constr, features_conv, final_cltv_expiry_delta); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1too_1big_1packet(JNIEnv *env, jclass clz) { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_too_big_packet(); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKPayee* o_conv = (LDKPayee*)untag_ptr(o); - int64_t ret_conv = Payee_hash(o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1too_1few_1blinded_1hops(JNIEnv *env, jclass clz) { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_too_few_blinded_hops(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Payee_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKPayee* a_conv = (LDKPayee*)untag_ptr(a); - LDKPayee* b_conv = (LDKPayee*)untag_ptr(b); - jboolean ret_conv = Payee_eq(a_conv, b_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1invalid_1first_1hop(JNIEnv *env, jclass clz, int8_tArray a) { + LDKPublicKey a_ref; + CHECK((*env)->GetArrayLength(env, a) == 33); + (*env)->GetByteArrayRegion(env, a, 0, 33, a_ref.compressed_form); + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_invalid_first_hop(a_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKRouteHint this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - RouteHint_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1path_1not_1found(JNIEnv *env, jclass clz) { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_path_not_found(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRouteHint this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_RouteHintHopZ ret_var = RouteHint_get_a(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t o = 0; o < ret_var.datalen; o++) { - LDKRouteHintHop ret_conv_14_var = ret_var.data[o]; - int64_t ret_conv_14_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var); - ret_conv_14_ref = tag_ptr(ret_conv_14_var.inner, ret_conv_14_var.is_owned); - ret_arr_ptr[o] = ret_conv_14_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1invalid_1message(JNIEnv *env, jclass clz) { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_invalid_message(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { - LDKRouteHint this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_RouteHintHopZ val_constr; - val_constr.datalen = (*env)->GetArrayLength(env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); - for (size_t o = 0; o < val_constr.datalen; o++) { - int64_t val_conv_14 = val_vals[o]; - LDKRouteHintHop val_conv_14_conv; - val_conv_14_conv.inner = untag_ptr(val_conv_14); - val_conv_14_conv.is_owned = ptr_is_owned(val_conv_14); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_14_conv); - val_conv_14_conv = RouteHintHop_clone(&val_conv_14_conv); - val_constr.data[o] = val_conv_14_conv; - } - (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); - RouteHint_set_a(&this_ptr_conv, val_constr); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1buffer_1full(JNIEnv *env, jclass clz) { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_buffer_full(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1new(JNIEnv *env, jclass clz, int64_tArray a_arg) { - LDKCVec_RouteHintHopZ a_arg_constr; - a_arg_constr.datalen = (*env)->GetArrayLength(env, a_arg); - if (a_arg_constr.datalen > 0) - a_arg_constr.data = MALLOC(a_arg_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements"); - else - a_arg_constr.data = NULL; - int64_t* a_arg_vals = (*env)->GetLongArrayElements (env, a_arg, NULL); - for (size_t o = 0; o < a_arg_constr.datalen; o++) { - int64_t a_arg_conv_14 = a_arg_vals[o]; - LDKRouteHintHop a_arg_conv_14_conv; - a_arg_conv_14_conv.inner = untag_ptr(a_arg_conv_14); - a_arg_conv_14_conv.is_owned = ptr_is_owned(a_arg_conv_14); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_arg_conv_14_conv); - a_arg_conv_14_conv = RouteHintHop_clone(&a_arg_conv_14_conv); - a_arg_constr.data[o] = a_arg_conv_14_conv; - } - (*env)->ReleaseLongArrayElements(env, a_arg, a_arg_vals, 0); - LDKRouteHint ret_var = RouteHint_new(a_arg_constr); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1get_1node_1id_1failed(JNIEnv *env, jclass clz) { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_get_node_id_failed(); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline uint64_t RouteHint_clone_ptr(LDKRouteHint *NONNULL_PTR arg) { - LDKRouteHint ret_var = RouteHint_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1unresolved_1introduction_1node(JNIEnv *env, jclass clz) { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_unresolved_introduction_node(); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKRouteHint arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = RouteHint_clone_ptr(&arg_conv); - return ret_conv; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKRouteHint orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKRouteHint ret_var = RouteHint_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1blinded_1path_1advance_1failed(JNIEnv *env, jclass clz) { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_blinded_path_advance_failed(); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKRouteHint o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = RouteHint_hash(&o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKSendError* o_conv = (LDKSendError*)untag_ptr(o); + int64_t ret_conv = SendError_hash(o_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHint_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKRouteHint a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKRouteHint b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = RouteHint_eq(&a_conv, &b_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SendError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKSendError* a_conv = (LDKSendError*)untag_ptr(a); + LDKSendError* b_conv = (LDKSendError*)untag_ptr(b); + jboolean ret_conv = SendError_eq(a_conv, b_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKRouteHint obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = RouteHint_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKCustomOnionMessageHandler this_ptr_conv = *(LDKCustomOnionMessageHandler*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + CustomOnionMessageHandler_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeeledOnion_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKPeeledOnion this_ptr_conv = *(LDKPeeledOnion*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + PeeledOnion_free(this_ptr_conv); +} + +static inline uint64_t PeeledOnion_clone_ptr(LDKPeeledOnion *NONNULL_PTR arg) { + LDKPeeledOnion *ret_copy = MALLOC(sizeof(LDKPeeledOnion), "LDKPeeledOnion"); + *ret_copy = PeeledOnion_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeeledOnion_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPeeledOnion* arg_conv = (LDKPeeledOnion*)untag_ptr(arg); + int64_t ret_conv = PeeledOnion_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeeledOnion_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPeeledOnion* orig_conv = (LDKPeeledOnion*)untag_ptr(orig); + LDKPeeledOnion *ret_copy = MALLOC(sizeof(LDKPeeledOnion), "LDKPeeledOnion"); + *ret_copy = PeeledOnion_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeeledOnion_1forward(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKNextMessageHop a_conv = *(LDKNextMessageHop*)(a_ptr); + a_conv = NextMessageHop_clone((LDKNextMessageHop*)untag_ptr(a)); + LDKOnionMessage b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv = OnionMessage_clone(&b_conv); + LDKPeeledOnion *ret_copy = MALLOC(sizeof(LDKPeeledOnion), "LDKPeeledOnion"); + *ret_copy = PeeledOnion_forward(a_conv, b_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeeledOnion_1receive(JNIEnv *env, jclass clz, int64_t a, int64_t b, int64_t c) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKParsedOnionMessageContents a_conv = *(LDKParsedOnionMessageContents*)(a_ptr); + a_conv = ParsedOnionMessageContents_clone((LDKParsedOnionMessageContents*)untag_ptr(a)); + void* b_ptr = untag_ptr(b); + CHECK_ACCESS(b_ptr); + LDKCOption_MessageContextZ b_conv = *(LDKCOption_MessageContextZ*)(b_ptr); + b_conv = COption_MessageContextZ_clone((LDKCOption_MessageContextZ*)untag_ptr(b)); + LDKBlindedMessagePath c_conv; + c_conv.inner = untag_ptr(c); + c_conv.is_owned = ptr_is_owned(c); + CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv); + c_conv = BlindedMessagePath_clone(&c_conv); + LDKPeeledOnion *ret_copy = MALLOC(sizeof(LDKPeeledOnion), "LDKPeeledOnion"); + *ret_copy = PeeledOnion_receive(a_conv, b_conv, c_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1onion_1message_1resolving_1destination(JNIEnv *env, jclass clz, int64_t entropy_source, int64_t node_signer, int64_t node_id_lookup, int64_t network_graph, int64_t path, int64_t contents, int64_t reply_path) { + void* entropy_source_ptr = untag_ptr(entropy_source); + if (ptr_is_owned(entropy_source)) { CHECK_ACCESS(entropy_source_ptr); } + LDKEntropySource* entropy_source_conv = (LDKEntropySource*)entropy_source_ptr; + void* node_signer_ptr = untag_ptr(node_signer); + if (ptr_is_owned(node_signer)) { CHECK_ACCESS(node_signer_ptr); } + LDKNodeSigner* node_signer_conv = (LDKNodeSigner*)node_signer_ptr; + void* node_id_lookup_ptr = untag_ptr(node_id_lookup); + if (ptr_is_owned(node_id_lookup)) { CHECK_ACCESS(node_id_lookup_ptr); } + LDKNodeIdLookUp* node_id_lookup_conv = (LDKNodeIdLookUp*)node_id_lookup_ptr; + LDKReadOnlyNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; + LDKOnionMessagePath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv = OnionMessagePath_clone(&path_conv); + void* contents_ptr = untag_ptr(contents); + CHECK_ACCESS(contents_ptr); + LDKOnionMessageContents contents_conv = *(LDKOnionMessageContents*)(contents_ptr); + if (contents_conv.free == LDKOnionMessageContents_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOnionMessageContents_JCalls_cloned(&contents_conv); + } + LDKBlindedMessagePath reply_path_conv; + reply_path_conv.inner = untag_ptr(reply_path); + reply_path_conv.is_owned = ptr_is_owned(reply_path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(reply_path_conv); + reply_path_conv = BlindedMessagePath_clone(&reply_path_conv); + LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ), "LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ"); + *ret_conv = create_onion_message_resolving_destination(entropy_source_conv, node_signer_conv, node_id_lookup_conv, &network_graph_conv, path_conv, contents_conv, reply_path_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1onion_1message(JNIEnv *env, jclass clz, int64_t entropy_source, int64_t node_signer, int64_t node_id_lookup, int64_t path, int64_t contents, int64_t reply_path) { + void* entropy_source_ptr = untag_ptr(entropy_source); + if (ptr_is_owned(entropy_source)) { CHECK_ACCESS(entropy_source_ptr); } + LDKEntropySource* entropy_source_conv = (LDKEntropySource*)entropy_source_ptr; + void* node_signer_ptr = untag_ptr(node_signer); + if (ptr_is_owned(node_signer)) { CHECK_ACCESS(node_signer_ptr); } + LDKNodeSigner* node_signer_conv = (LDKNodeSigner*)node_signer_ptr; + void* node_id_lookup_ptr = untag_ptr(node_id_lookup); + if (ptr_is_owned(node_id_lookup)) { CHECK_ACCESS(node_id_lookup_ptr); } + LDKNodeIdLookUp* node_id_lookup_conv = (LDKNodeIdLookUp*)node_id_lookup_ptr; + LDKOnionMessagePath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv = OnionMessagePath_clone(&path_conv); + void* contents_ptr = untag_ptr(contents); + CHECK_ACCESS(contents_ptr); + LDKOnionMessageContents contents_conv = *(LDKOnionMessageContents*)(contents_ptr); + if (contents_conv.free == LDKOnionMessageContents_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOnionMessageContents_JCalls_cloned(&contents_conv); + } + LDKBlindedMessagePath reply_path_conv; + reply_path_conv.inner = untag_ptr(reply_path); + reply_path_conv.is_owned = ptr_is_owned(reply_path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(reply_path_conv); + reply_path_conv = BlindedMessagePath_clone(&reply_path_conv); + LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ), "LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ"); + *ret_conv = create_onion_message(entropy_source_conv, node_signer_conv, node_id_lookup_conv, path_conv, contents_conv, reply_path_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_peel_1onion_1message(JNIEnv *env, jclass clz, int64_t msg, int64_t node_signer, int64_t logger, int64_t custom_handler) { + LDKOnionMessage msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + void* custom_handler_ptr = untag_ptr(custom_handler); + CHECK_ACCESS(custom_handler_ptr); + LDKCustomOnionMessageHandler custom_handler_conv = *(LDKCustomOnionMessageHandler*)(custom_handler_ptr); + if (custom_handler_conv.free == LDKCustomOnionMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKCustomOnionMessageHandler_JCalls_cloned(&custom_handler_conv); + } + LDKCResult_PeeledOnionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PeeledOnionNoneZ), "LDKCResult_PeeledOnionNoneZ"); + *ret_conv = peel_onion_message(&msg_conv, node_signer_conv, logger_conv, custom_handler_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1new(JNIEnv *env, jclass clz, int64_t entropy_source, int64_t node_signer, int64_t logger, int64_t node_id_lookup, int64_t message_router, int64_t offers_handler, int64_t async_payments_handler, int64_t custom_handler) { + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + void* node_id_lookup_ptr = untag_ptr(node_id_lookup); + CHECK_ACCESS(node_id_lookup_ptr); + LDKNodeIdLookUp node_id_lookup_conv = *(LDKNodeIdLookUp*)(node_id_lookup_ptr); + if (node_id_lookup_conv.free == LDKNodeIdLookUp_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeIdLookUp_JCalls_cloned(&node_id_lookup_conv); + } + void* message_router_ptr = untag_ptr(message_router); + CHECK_ACCESS(message_router_ptr); + LDKMessageRouter message_router_conv = *(LDKMessageRouter*)(message_router_ptr); + if (message_router_conv.free == LDKMessageRouter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKMessageRouter_JCalls_cloned(&message_router_conv); + } + void* offers_handler_ptr = untag_ptr(offers_handler); + CHECK_ACCESS(offers_handler_ptr); + LDKOffersMessageHandler offers_handler_conv = *(LDKOffersMessageHandler*)(offers_handler_ptr); + if (offers_handler_conv.free == LDKOffersMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOffersMessageHandler_JCalls_cloned(&offers_handler_conv); + } + void* async_payments_handler_ptr = untag_ptr(async_payments_handler); + CHECK_ACCESS(async_payments_handler_ptr); + LDKAsyncPaymentsMessageHandler async_payments_handler_conv = *(LDKAsyncPaymentsMessageHandler*)(async_payments_handler_ptr); + if (async_payments_handler_conv.free == LDKAsyncPaymentsMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKAsyncPaymentsMessageHandler_JCalls_cloned(&async_payments_handler_conv); + } + void* custom_handler_ptr = untag_ptr(custom_handler); + CHECK_ACCESS(custom_handler_ptr); + LDKCustomOnionMessageHandler custom_handler_conv = *(LDKCustomOnionMessageHandler*)(custom_handler_ptr); + if (custom_handler_conv.free == LDKCustomOnionMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKCustomOnionMessageHandler_JCalls_cloned(&custom_handler_conv); + } + LDKOnionMessenger ret_var = OnionMessenger_new(entropy_source_conv, node_signer_conv, logger_conv, node_id_lookup_conv, message_router_conv, offers_handler_conv, async_payments_handler_conv, custom_handler_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1new_1with_1offline_1peer_1interception(JNIEnv *env, jclass clz, int64_t entropy_source, int64_t node_signer, int64_t logger, int64_t node_id_lookup, int64_t message_router, int64_t offers_handler, int64_t async_payments_handler, int64_t custom_handler) { + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + void* node_id_lookup_ptr = untag_ptr(node_id_lookup); + CHECK_ACCESS(node_id_lookup_ptr); + LDKNodeIdLookUp node_id_lookup_conv = *(LDKNodeIdLookUp*)(node_id_lookup_ptr); + if (node_id_lookup_conv.free == LDKNodeIdLookUp_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeIdLookUp_JCalls_cloned(&node_id_lookup_conv); + } + void* message_router_ptr = untag_ptr(message_router); + CHECK_ACCESS(message_router_ptr); + LDKMessageRouter message_router_conv = *(LDKMessageRouter*)(message_router_ptr); + if (message_router_conv.free == LDKMessageRouter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKMessageRouter_JCalls_cloned(&message_router_conv); + } + void* offers_handler_ptr = untag_ptr(offers_handler); + CHECK_ACCESS(offers_handler_ptr); + LDKOffersMessageHandler offers_handler_conv = *(LDKOffersMessageHandler*)(offers_handler_ptr); + if (offers_handler_conv.free == LDKOffersMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOffersMessageHandler_JCalls_cloned(&offers_handler_conv); + } + void* async_payments_handler_ptr = untag_ptr(async_payments_handler); + CHECK_ACCESS(async_payments_handler_ptr); + LDKAsyncPaymentsMessageHandler async_payments_handler_conv = *(LDKAsyncPaymentsMessageHandler*)(async_payments_handler_ptr); + if (async_payments_handler_conv.free == LDKAsyncPaymentsMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKAsyncPaymentsMessageHandler_JCalls_cloned(&async_payments_handler_conv); + } + void* custom_handler_ptr = untag_ptr(custom_handler); + CHECK_ACCESS(custom_handler_ptr); + LDKCustomOnionMessageHandler custom_handler_conv = *(LDKCustomOnionMessageHandler*)(custom_handler_ptr); + if (custom_handler_conv.free == LDKCustomOnionMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKCustomOnionMessageHandler_JCalls_cloned(&custom_handler_conv); + } + LDKOnionMessenger ret_var = OnionMessenger_new_with_offline_peer_interception(entropy_source_conv, node_signer_conv, logger_conv, node_id_lookup_conv, message_router_conv, offers_handler_conv, async_payments_handler_conv, custom_handler_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1send_1onion_1message(JNIEnv *env, jclass clz, int64_t this_arg, int64_t contents, int64_t instructions) { + LDKOnionMessenger this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + void* contents_ptr = untag_ptr(contents); + CHECK_ACCESS(contents_ptr); + LDKOnionMessageContents contents_conv = *(LDKOnionMessageContents*)(contents_ptr); + if (contents_conv.free == LDKOnionMessageContents_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOnionMessageContents_JCalls_cloned(&contents_conv); + } + void* instructions_ptr = untag_ptr(instructions); + CHECK_ACCESS(instructions_ptr); + LDKMessageSendInstructions instructions_conv = *(LDKMessageSendInstructions*)(instructions_ptr); + instructions_conv = MessageSendInstructions_clone((LDKMessageSendInstructions*)untag_ptr(instructions)); + LDKCResult_SendSuccessSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SendSuccessSendErrorZ), "LDKCResult_SendSuccessSendErrorZ"); + *ret_conv = OnionMessenger_send_onion_message(&this_arg_conv, contents_conv, instructions_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1forward_1onion_1message(JNIEnv *env, jclass clz, int64_t this_arg, int64_t message, int8_tArray peer_node_id) { + LDKOnionMessenger this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKOnionMessage message_conv; + message_conv.inner = untag_ptr(message); + message_conv.is_owned = ptr_is_owned(message); + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_conv); + message_conv = OnionMessage_clone(&message_conv); + LDKPublicKey peer_node_id_ref; + CHECK((*env)->GetArrayLength(env, peer_node_id) == 33); + (*env)->GetByteArrayRegion(env, peer_node_id, 0, 33, peer_node_id_ref.compressed_form); + LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ"); + *ret_conv = OnionMessenger_forward_onion_message(&this_arg_conv, message_conv, peer_node_id_ref); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1handle_1onion_1message_1response(JNIEnv *env, jclass clz, int64_t this_arg, int64_t response, int64_t instructions) { + LDKOnionMessenger this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + void* response_ptr = untag_ptr(response); + CHECK_ACCESS(response_ptr); + LDKOnionMessageContents response_conv = *(LDKOnionMessageContents*)(response_ptr); + if (response_conv.free == LDKOnionMessageContents_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOnionMessageContents_JCalls_cloned(&response_conv); + } + LDKResponseInstruction instructions_conv; + instructions_conv.inner = untag_ptr(instructions); + instructions_conv.is_owned = ptr_is_owned(instructions); + CHECK_INNER_FIELD_ACCESS_OR_NULL(instructions_conv); + instructions_conv = ResponseInstruction_clone(&instructions_conv); + LDKCResult_SendSuccessSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SendSuccessSendErrorZ), "LDKCResult_SendSuccessSendErrorZ"); + *ret_conv = OnionMessenger_handle_onion_message_response(&this_arg_conv, response_conv, instructions_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1get_1update_1future(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOnionMessenger this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKFuture ret_var = OnionMessenger_get_update_future(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1as_1EventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOnionMessenger this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); + *ret_ret = OnionMessenger_as_EventsProvider(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1as_1OnionMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOnionMessenger this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKOnionMessageHandler* ret_ret = MALLOC(sizeof(LDKOnionMessageHandler), "LDKOnionMessageHandler"); + *ret_ret = OnionMessenger_as_OnionMessageHandler(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OffersMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKOffersMessageHandler this_ptr_conv = *(LDKOffersMessageHandler*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + OffersMessageHandler_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OffersMessage_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKOffersMessage this_ptr_conv = *(LDKOffersMessage*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + OffersMessage_free(this_ptr_conv); +} + +static inline uint64_t OffersMessage_clone_ptr(LDKOffersMessage *NONNULL_PTR arg) { + LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); + *ret_copy = OffersMessage_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKOffersMessage* arg_conv = (LDKOffersMessage*)untag_ptr(arg); + int64_t ret_conv = OffersMessage_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessage_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKOffersMessage* orig_conv = (LDKOffersMessage*)untag_ptr(orig); + LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); + *ret_copy = OffersMessage_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessage_1invoice_1request(JNIEnv *env, jclass clz, int64_t a) { + LDKInvoiceRequest a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = InvoiceRequest_clone(&a_conv); + LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); + *ret_copy = OffersMessage_invoice_request(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessage_1invoice(JNIEnv *env, jclass clz, int64_t a) { + LDKBolt12Invoice a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = Bolt12Invoice_clone(&a_conv); + LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); + *ret_copy = OffersMessage_invoice(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessage_1invoice_1error(JNIEnv *env, jclass clz, int64_t a) { + LDKInvoiceError a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = InvoiceError_clone(&a_conv); + LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); + *ret_copy = OffersMessage_invoice_error(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OffersMessage_1is_1known_1type(JNIEnv *env, jclass clz, int64_t tlv_type) { + jboolean ret_conv = OffersMessage_is_known_type(tlv_type); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessage_1as_1OnionMessageContents(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOffersMessage* this_arg_conv = (LDKOffersMessage*)untag_ptr(this_arg); + LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *ret_ret = OffersMessage_as_OnionMessageContents(this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OffersMessage_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKOffersMessage* obj_conv = (LDKOffersMessage*)untag_ptr(obj); + LDKCVec_u8Z ret_var = OffersMessage_write(obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessage_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg_a, int64_t arg_b) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); - *ret_conv = RouteHint_read(ser_ref); + void* arg_b_ptr = untag_ptr(arg_b); + if (ptr_is_owned(arg_b)) { CHECK_ACCESS(arg_b_ptr); } + LDKLogger* arg_b_conv = (LDKLogger*)arg_b_ptr; + LDKCResult_OffersMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersMessageDecodeErrorZ), "LDKCResult_OffersMessageDecodeErrorZ"); + *ret_conv = OffersMessage_read(ser_ref, arg_a, arg_b_conv); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKRouteHintHop this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Packet_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPacket this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - RouteHintHop_free(this_obj_conv); + Packet_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1src_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRouteHintHop this_ptr_conv; +JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_Packet_1get_1version(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPacket this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RouteHintHop_get_src_node_id(&this_ptr_conv).compressed_form); - return ret_arr; + int8_t ret_conv = Packet_get_version(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1src_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKRouteHintHop this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Packet_1set_1version(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) { + LDKPacket this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - RouteHintHop_set_src_node_id(&this_ptr_conv, val_ref); + Packet_set_version(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRouteHintHop this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Packet_1get_1public_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPacket this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = RouteHintHop_get_short_channel_id(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Packet_get_public_key(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKRouteHintHop this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Packet_1set_1public_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKPacket this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - RouteHintHop_set_short_channel_id(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + Packet_set_public_key(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1fees(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRouteHintHop this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Packet_1get_1hop_1data(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPacket this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKRoutingFees ret_var = RouteHintHop_get_fees(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + LDKCVec_u8Z ret_var = Packet_get_hop_data(&this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1fees(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKRouteHintHop this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Packet_1set_1hop_1data(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKPacket this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKRoutingFees val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = RoutingFees_clone(&val_conv); - RouteHintHop_set_fees(&this_ptr_conv, val_conv); -} - -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRouteHintHop this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int16_t ret_conv = RouteHintHop_get_cltv_expiry_delta(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKRouteHintHop this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - RouteHintHop_set_cltv_expiry_delta(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRouteHintHop this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = RouteHintHop_get_htlc_minimum_msat(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKRouteHintHop this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - RouteHintHop_set_htlc_minimum_msat(&this_ptr_conv, val_conv); + LDKCVec_u8Z val_ref; + val_ref.datalen = (*env)->GetArrayLength(env, val); + val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data); + Packet_set_hop_data(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRouteHintHop this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Packet_1get_1hmac(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPacket this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = RouteHintHop_get_htlc_maximum_msat(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *Packet_get_hmac(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKRouteHintHop this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Packet_1set_1hmac(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKPacket this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - RouteHintHop_set_htlc_maximum_msat(&this_ptr_conv, val_conv); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + Packet_set_hmac(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1new(JNIEnv *env, jclass clz, int8_tArray src_node_id_arg, int64_t short_channel_id_arg, int64_t fees_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg) { - LDKPublicKey src_node_id_arg_ref; - CHECK((*env)->GetArrayLength(env, src_node_id_arg) == 33); - (*env)->GetByteArrayRegion(env, src_node_id_arg, 0, 33, src_node_id_arg_ref.compressed_form); - LDKRoutingFees fees_arg_conv; - fees_arg_conv.inner = untag_ptr(fees_arg); - fees_arg_conv.is_owned = ptr_is_owned(fees_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv); - fees_arg_conv = RoutingFees_clone(&fees_arg_conv); - void* htlc_minimum_msat_arg_ptr = untag_ptr(htlc_minimum_msat_arg); - CHECK_ACCESS(htlc_minimum_msat_arg_ptr); - LDKCOption_u64Z htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_minimum_msat_arg_ptr); - htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_minimum_msat_arg)); - void* htlc_maximum_msat_arg_ptr = untag_ptr(htlc_maximum_msat_arg); - CHECK_ACCESS(htlc_maximum_msat_arg_ptr); - LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_arg_ptr); - htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_maximum_msat_arg)); - LDKRouteHintHop ret_var = RouteHintHop_new(src_node_id_arg_ref, short_channel_id_arg, fees_arg_conv, cltv_expiry_delta_arg, htlc_minimum_msat_arg_conv, htlc_maximum_msat_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Packet_1new(JNIEnv *env, jclass clz, int8_t version_arg, int8_tArray public_key_arg, int8_tArray hop_data_arg, int8_tArray hmac_arg) { + LDKPublicKey public_key_arg_ref; + CHECK((*env)->GetArrayLength(env, public_key_arg) == 33); + (*env)->GetByteArrayRegion(env, public_key_arg, 0, 33, public_key_arg_ref.compressed_form); + LDKCVec_u8Z hop_data_arg_ref; + hop_data_arg_ref.datalen = (*env)->GetArrayLength(env, hop_data_arg); + hop_data_arg_ref.data = MALLOC(hop_data_arg_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, hop_data_arg, 0, hop_data_arg_ref.datalen, hop_data_arg_ref.data); + LDKThirtyTwoBytes hmac_arg_ref; + CHECK((*env)->GetArrayLength(env, hmac_arg) == 32); + (*env)->GetByteArrayRegion(env, hmac_arg, 0, 32, hmac_arg_ref.data); + LDKPacket ret_var = Packet_new(version_arg, public_key_arg_ref, hop_data_arg_ref, hmac_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t RouteHintHop_clone_ptr(LDKRouteHintHop *NONNULL_PTR arg) { - LDKRouteHintHop ret_var = RouteHintHop_clone(arg); +static inline uint64_t Packet_clone_ptr(LDKPacket *NONNULL_PTR arg) { + LDKPacket ret_var = Packet_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKRouteHintHop arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Packet_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPacket arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = RouteHintHop_clone_ptr(&arg_conv); + int64_t ret_conv = Packet_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKRouteHintHop orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Packet_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPacket orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKRouteHintHop ret_var = RouteHintHop_clone(&orig_conv); + LDKPacket ret_var = Packet_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKRouteHintHop o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Packet_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKPacket o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv.is_owned = false; - int64_t ret_conv = RouteHintHop_hash(&o_conv); + int64_t ret_conv = Packet_hash(&o_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKRouteHintHop a_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Packet_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKPacket a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKRouteHintHop b_conv; + LDKPacket b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = RouteHintHop_eq(&a_conv, &b_conv); + jboolean ret_conv = Packet_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKRouteHintHop obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Packet_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKPacket obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = RouteHintHop_write(&obj_conv); + LDKCVec_u8Z ret_var = Packet_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); - *ret_conv = RouteHintHop_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKParsedOnionMessageContents this_ptr_conv = *(LDKParsedOnionMessageContents*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + ParsedOnionMessageContents_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FirstHopCandidate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKFirstHopCandidate this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - FirstHopCandidate_free(this_obj_conv); +static inline uint64_t ParsedOnionMessageContents_clone_ptr(LDKParsedOnionMessageContents *NONNULL_PTR arg) { + LDKParsedOnionMessageContents *ret_copy = MALLOC(sizeof(LDKParsedOnionMessageContents), "LDKParsedOnionMessageContents"); + *ret_copy = ParsedOnionMessageContents_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKParsedOnionMessageContents* arg_conv = (LDKParsedOnionMessageContents*)untag_ptr(arg); + int64_t ret_conv = ParsedOnionMessageContents_clone_ptr(arg_conv); + return ret_conv; } -static inline uint64_t FirstHopCandidate_clone_ptr(LDKFirstHopCandidate *NONNULL_PTR arg) { - LDKFirstHopCandidate ret_var = FirstHopCandidate_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKParsedOnionMessageContents* orig_conv = (LDKParsedOnionMessageContents*)untag_ptr(orig); + LDKParsedOnionMessageContents *ret_copy = MALLOC(sizeof(LDKParsedOnionMessageContents), "LDKParsedOnionMessageContents"); + *ret_copy = ParsedOnionMessageContents_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FirstHopCandidate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKFirstHopCandidate arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = FirstHopCandidate_clone_ptr(&arg_conv); + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1offers(JNIEnv *env, jclass clz, int64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKOffersMessage a_conv = *(LDKOffersMessage*)(a_ptr); + a_conv = OffersMessage_clone((LDKOffersMessage*)untag_ptr(a)); + LDKParsedOnionMessageContents *ret_copy = MALLOC(sizeof(LDKParsedOnionMessageContents), "LDKParsedOnionMessageContents"); + *ret_copy = ParsedOnionMessageContents_offers(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1custom(JNIEnv *env, jclass clz, int64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKOnionMessageContents a_conv = *(LDKOnionMessageContents*)(a_ptr); + if (a_conv.free == LDKOnionMessageContents_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOnionMessageContents_JCalls_cloned(&a_conv); + } + LDKParsedOnionMessageContents *ret_copy = MALLOC(sizeof(LDKParsedOnionMessageContents), "LDKParsedOnionMessageContents"); + *ret_copy = ParsedOnionMessageContents_custom(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1as_1OnionMessageContents(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKParsedOnionMessageContents* this_arg_conv = (LDKParsedOnionMessageContents*)untag_ptr(this_arg); + LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *ret_ret = ParsedOnionMessageContents_as_OnionMessageContents(this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKParsedOnionMessageContents* obj_conv = (LDKParsedOnionMessageContents*)untag_ptr(obj); + LDKCVec_u8Z ret_var = ParsedOnionMessageContents_write(obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +static inline uint64_t OnionMessageContents_clone_ptr(LDKOnionMessageContents *NONNULL_PTR arg) { + LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *ret_ret = OnionMessageContents_clone(arg); + return tag_ptr(ret_ret, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + void* arg_ptr = untag_ptr(arg); + if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); } + LDKOnionMessageContents* arg_conv = (LDKOnionMessageContents*)arg_ptr; + int64_t ret_conv = OnionMessageContents_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FirstHopCandidate_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKFirstHopCandidate orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKFirstHopCandidate ret_var = FirstHopCandidate_clone(&orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1clone(JNIEnv *env, jclass clz, int64_t orig) { + void* orig_ptr = untag_ptr(orig); + if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); } + LDKOnionMessageContents* orig_conv = (LDKOnionMessageContents*)orig_ptr; + LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *ret_ret = OnionMessageContents_clone(orig_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKOnionMessageContents this_ptr_conv = *(LDKOnionMessageContents*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + OnionMessageContents_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKIntroductionNode this_ptr_conv = *(LDKIntroductionNode*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + IntroductionNode_free(this_ptr_conv); +} + +static inline uint64_t IntroductionNode_clone_ptr(LDKIntroductionNode *NONNULL_PTR arg) { + LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); + *ret_copy = IntroductionNode_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKIntroductionNode* arg_conv = (LDKIntroductionNode*)untag_ptr(arg); + int64_t ret_conv = IntroductionNode_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKIntroductionNode* orig_conv = (LDKIntroductionNode*)untag_ptr(orig); + LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); + *ret_copy = IntroductionNode_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1node_1id(JNIEnv *env, jclass clz, int8_tArray a) { + LDKPublicKey a_ref; + CHECK((*env)->GetArrayLength(env, a) == 33); + (*env)->GetByteArrayRegion(env, a, 0, 33, a_ref.compressed_form); + LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); + *ret_copy = IntroductionNode_node_id(a_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1directed_1short_1channel_1id(JNIEnv *env, jclass clz, jclass a, int64_t b) { + LDKDirection a_conv = LDKDirection_from_java(env, a); + LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); + *ret_copy = IntroductionNode_directed_short_channel_id(a_conv, b); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKIntroductionNode* o_conv = (LDKIntroductionNode*)untag_ptr(o); + int64_t ret_conv = IntroductionNode_hash(o_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKIntroductionNode* a_conv = (LDKIntroductionNode*)untag_ptr(a); + LDKIntroductionNode* b_conv = (LDKIntroductionNode*)untag_ptr(b); + jboolean ret_conv = IntroductionNode_eq(a_conv, b_conv); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Direction_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKDirection* orig_conv = (LDKDirection*)untag_ptr(orig); + jclass ret_conv = LDKDirection_to_java(env, Direction_clone(orig_conv)); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Direction_1node_1one(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKDirection_to_java(env, Direction_node_one()); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Direction_1node_1two(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKDirection_to_java(env, Direction_node_two()); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Direction_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKDirection* o_conv = (LDKDirection*)untag_ptr(o); + int64_t ret_conv = Direction_hash(o_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Direction_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKDirection* a_conv = (LDKDirection*)untag_ptr(a); + LDKDirection* b_conv = (LDKDirection*)untag_ptr(b); + jboolean ret_conv = Direction_eq(a_conv, b_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeIdLookUp_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKNodeIdLookUp this_ptr_conv = *(LDKNodeIdLookUp*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + NodeIdLookUp_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EmptyNodeIdLookUp_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKEmptyNodeIdLookUp this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + EmptyNodeIdLookUp_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EmptyNodeIdLookUp_1new(JNIEnv *env, jclass clz) { + LDKEmptyNodeIdLookUp ret_var = EmptyNodeIdLookUp_new(); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PublicHopCandidate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKPublicHopCandidate this_obj_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EmptyNodeIdLookUp_1as_1NodeIdLookUp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKEmptyNodeIdLookUp this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeIdLookUp* ret_ret = MALLOC(sizeof(LDKNodeIdLookUp), "LDKNodeIdLookUp"); + *ret_ret = EmptyNodeIdLookUp_as_NodeIdLookUp(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedHop_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBlindedHop this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PublicHopCandidate_free(this_obj_conv); + BlindedHop_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PublicHopCandidate_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPublicHopCandidate this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedHop_1get_1blinded_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBlindedHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = PublicHopCandidate_get_short_channel_id(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, BlindedHop_get_blinded_node_id(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PublicHopCandidate_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKPublicHopCandidate this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedHop_1set_1blinded_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKBlindedHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - PublicHopCandidate_set_short_channel_id(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + BlindedHop_set_blinded_node_id(&this_ptr_conv, val_ref); } -static inline uint64_t PublicHopCandidate_clone_ptr(LDKPublicHopCandidate *NONNULL_PTR arg) { - LDKPublicHopCandidate ret_var = PublicHopCandidate_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedHop_1get_1encrypted_1payload(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBlindedHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u8Z ret_var = BlindedHop_get_encrypted_payload(&this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PublicHopCandidate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKPublicHopCandidate arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = PublicHopCandidate_clone_ptr(&arg_conv); - return ret_conv; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedHop_1set_1encrypted_1payload(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKBlindedHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u8Z val_ref; + val_ref.datalen = (*env)->GetArrayLength(env, val); + val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data); + BlindedHop_set_encrypted_payload(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PublicHopCandidate_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPublicHopCandidate orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKPublicHopCandidate ret_var = PublicHopCandidate_clone(&orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHop_1new(JNIEnv *env, jclass clz, int8_tArray blinded_node_id_arg, int8_tArray encrypted_payload_arg) { + LDKPublicKey blinded_node_id_arg_ref; + CHECK((*env)->GetArrayLength(env, blinded_node_id_arg) == 33); + (*env)->GetByteArrayRegion(env, blinded_node_id_arg, 0, 33, blinded_node_id_arg_ref.compressed_form); + LDKCVec_u8Z encrypted_payload_arg_ref; + encrypted_payload_arg_ref.datalen = (*env)->GetArrayLength(env, encrypted_payload_arg); + encrypted_payload_arg_ref.data = MALLOC(encrypted_payload_arg_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, encrypted_payload_arg, 0, encrypted_payload_arg_ref.datalen, encrypted_payload_arg_ref.data); + LDKBlindedHop ret_var = BlindedHop_new(blinded_node_id_arg_ref, encrypted_payload_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PrivateHopCandidate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKPrivateHopCandidate this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PrivateHopCandidate_free(this_obj_conv); -} - -static inline uint64_t PrivateHopCandidate_clone_ptr(LDKPrivateHopCandidate *NONNULL_PTR arg) { - LDKPrivateHopCandidate ret_var = PrivateHopCandidate_clone(arg); +static inline uint64_t BlindedHop_clone_ptr(LDKBlindedHop *NONNULL_PTR arg) { + LDKBlindedHop ret_var = BlindedHop_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateHopCandidate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKPrivateHopCandidate arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBlindedHop arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = PrivateHopCandidate_clone_ptr(&arg_conv); + int64_t ret_conv = BlindedHop_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateHopCandidate_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPrivateHopCandidate orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHop_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBlindedHop orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKPrivateHopCandidate ret_var = PrivateHopCandidate_clone(&orig_conv); + LDKBlindedHop ret_var = BlindedHop_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPathCandidate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKBlindedPathCandidate this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BlindedPathCandidate_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHop_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKBlindedHop o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = BlindedHop_hash(&o_conv); + return ret_conv; } -static inline uint64_t BlindedPathCandidate_clone_ptr(LDKBlindedPathCandidate *NONNULL_PTR arg) { - LDKBlindedPathCandidate ret_var = BlindedPathCandidate_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPathCandidate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKBlindedPathCandidate arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedHop_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKBlindedHop a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKBlindedHop b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = BlindedHop_eq(&a_conv, &b_conv); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedHop_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKBlindedHop obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = BlindedHop_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHop_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); + *ret_conv = BlindedHop_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBlindedPayInfo this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + BlindedPayInfo_free(this_obj_conv); +} + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = BlindedPayInfo_get_fee_base_msat(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + BlindedPayInfo_set_fee_base_msat(&this_ptr_conv, val); +} + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = BlindedPayInfo_get_fee_proportional_millionths(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + BlindedPayInfo_set_fee_proportional_millionths(&this_ptr_conv, val); +} + +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int16_t ret_conv = BlindedPayInfo_get_cltv_expiry_delta(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + BlindedPayInfo_set_cltv_expiry_delta(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = BlindedPayInfo_get_htlc_minimum_msat(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + BlindedPayInfo_set_htlc_minimum_msat(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = BlindedPayInfo_get_htlc_maximum_msat(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + BlindedPayInfo_set_htlc_maximum_msat(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBlindedHopFeatures ret_var = BlindedPayInfo_get_features(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBlindedHopFeatures val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = BlindedHopFeatures_clone(&val_conv); + BlindedPayInfo_set_features(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1new(JNIEnv *env, jclass clz, int32_t fee_base_msat_arg, int32_t fee_proportional_millionths_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg, int64_t features_arg) { + LDKBlindedHopFeatures features_arg_conv; + features_arg_conv.inner = untag_ptr(features_arg); + features_arg_conv.is_owned = ptr_is_owned(features_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); + features_arg_conv = BlindedHopFeatures_clone(&features_arg_conv); + LDKBlindedPayInfo ret_var = BlindedPayInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, features_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t BlindedPayInfo_clone_ptr(LDKBlindedPayInfo *NONNULL_PTR arg) { + LDKBlindedPayInfo ret_var = BlindedPayInfo_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBlindedPayInfo arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = BlindedPathCandidate_clone_ptr(&arg_conv); + int64_t ret_conv = BlindedPayInfo_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPathCandidate_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBlindedPathCandidate orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBlindedPayInfo orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBlindedPathCandidate ret_var = BlindedPathCandidate_clone(&orig_conv); + LDKBlindedPayInfo ret_var = BlindedPayInfo_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OneHopBlindedPathCandidate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKOneHopBlindedPathCandidate this_obj_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKBlindedPayInfo o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = BlindedPayInfo_hash(&o_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKBlindedPayInfo a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKBlindedPayInfo b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = BlindedPayInfo_eq(&a_conv, &b_conv); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKBlindedPayInfo obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = BlindedPayInfo_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); + *ret_conv = BlindedPayInfo_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBlindedPaymentPath this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - OneHopBlindedPathCandidate_free(this_obj_conv); + BlindedPaymentPath_free(this_obj_conv); } -static inline uint64_t OneHopBlindedPathCandidate_clone_ptr(LDKOneHopBlindedPathCandidate *NONNULL_PTR arg) { - LDKOneHopBlindedPathCandidate ret_var = OneHopBlindedPathCandidate_clone(arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1get_1payinfo(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBlindedPaymentPath this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBlindedPayInfo ret_var = BlindedPaymentPath_get_payinfo(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OneHopBlindedPathCandidate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKOneHopBlindedPathCandidate arg_conv; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1set_1payinfo(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKBlindedPaymentPath this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBlindedPayInfo val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = BlindedPayInfo_clone(&val_conv); + BlindedPaymentPath_set_payinfo(&this_ptr_conv, val_conv); +} + +static inline uint64_t BlindedPaymentPath_clone_ptr(LDKBlindedPaymentPath *NONNULL_PTR arg) { + LDKBlindedPaymentPath ret_var = BlindedPaymentPath_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBlindedPaymentPath arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = OneHopBlindedPathCandidate_clone_ptr(&arg_conv); + int64_t ret_conv = BlindedPaymentPath_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OneHopBlindedPathCandidate_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKOneHopBlindedPathCandidate orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBlindedPaymentPath orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKOneHopBlindedPathCandidate ret_var = OneHopBlindedPathCandidate_clone(&orig_conv); + LDKBlindedPaymentPath ret_var = BlindedPaymentPath_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKCandidateRouteHop this_ptr_conv = *(LDKCandidateRouteHop*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - CandidateRouteHop_free(this_ptr_conv); -} - -static inline uint64_t CandidateRouteHop_clone_ptr(LDKCandidateRouteHop *NONNULL_PTR arg) { - LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); - *ret_copy = CandidateRouteHop_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCandidateRouteHop* arg_conv = (LDKCandidateRouteHop*)untag_ptr(arg); - int64_t ret_conv = CandidateRouteHop_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKBlindedPaymentPath o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = BlindedPaymentPath_hash(&o_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCandidateRouteHop* orig_conv = (LDKCandidateRouteHop*)untag_ptr(orig); - LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); - *ret_copy = CandidateRouteHop_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1first_1hop(JNIEnv *env, jclass clz, int64_t a) { - LDKFirstHopCandidate a_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKBlindedPaymentPath a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = FirstHopCandidate_clone(&a_conv); - LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); - *ret_copy = CandidateRouteHop_first_hop(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + a_conv.is_owned = false; + LDKBlindedPaymentPath b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = BlindedPaymentPath_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1public_1hop(JNIEnv *env, jclass clz, int64_t a) { - LDKPublicHopCandidate a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = PublicHopCandidate_clone(&a_conv); - LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); - *ret_copy = CandidateRouteHop_public_hop(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1one_1hop(JNIEnv *env, jclass clz, int8_tArray payee_node_id, int64_t payee_tlvs, int16_t min_final_cltv_expiry_delta, int64_t entropy_source) { + LDKPublicKey payee_node_id_ref; + CHECK((*env)->GetArrayLength(env, payee_node_id) == 33); + (*env)->GetByteArrayRegion(env, payee_node_id, 0, 33, payee_node_id_ref.compressed_form); + LDKReceiveTlvs payee_tlvs_conv; + payee_tlvs_conv.inner = untag_ptr(payee_tlvs); + payee_tlvs_conv.is_owned = ptr_is_owned(payee_tlvs); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payee_tlvs_conv); + payee_tlvs_conv = ReceiveTlvs_clone(&payee_tlvs_conv); + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + LDKCResult_BlindedPaymentPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPaymentPathNoneZ), "LDKCResult_BlindedPaymentPathNoneZ"); + *ret_conv = BlindedPaymentPath_one_hop(payee_node_id_ref, payee_tlvs_conv, min_final_cltv_expiry_delta, entropy_source_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1private_1hop(JNIEnv *env, jclass clz, int64_t a) { - LDKPrivateHopCandidate a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = PrivateHopCandidate_clone(&a_conv); - LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); - *ret_copy = CandidateRouteHop_private_hop(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1new(JNIEnv *env, jclass clz, int64_tArray intermediate_nodes, int8_tArray payee_node_id, int64_t payee_tlvs, int64_t htlc_maximum_msat, int16_t min_final_cltv_expiry_delta, int64_t entropy_source) { + LDKCVec_PaymentForwardNodeZ intermediate_nodes_constr; + intermediate_nodes_constr.datalen = (*env)->GetArrayLength(env, intermediate_nodes); + if (intermediate_nodes_constr.datalen > 0) + intermediate_nodes_constr.data = MALLOC(intermediate_nodes_constr.datalen * sizeof(LDKPaymentForwardNode), "LDKCVec_PaymentForwardNodeZ Elements"); + else + intermediate_nodes_constr.data = NULL; + int64_t* intermediate_nodes_vals = (*env)->GetLongArrayElements (env, intermediate_nodes, NULL); + for (size_t u = 0; u < intermediate_nodes_constr.datalen; u++) { + int64_t intermediate_nodes_conv_20 = intermediate_nodes_vals[u]; + LDKPaymentForwardNode intermediate_nodes_conv_20_conv; + intermediate_nodes_conv_20_conv.inner = untag_ptr(intermediate_nodes_conv_20); + intermediate_nodes_conv_20_conv.is_owned = ptr_is_owned(intermediate_nodes_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(intermediate_nodes_conv_20_conv); + intermediate_nodes_conv_20_conv = PaymentForwardNode_clone(&intermediate_nodes_conv_20_conv); + intermediate_nodes_constr.data[u] = intermediate_nodes_conv_20_conv; + } + (*env)->ReleaseLongArrayElements(env, intermediate_nodes, intermediate_nodes_vals, 0); + LDKPublicKey payee_node_id_ref; + CHECK((*env)->GetArrayLength(env, payee_node_id) == 33); + (*env)->GetByteArrayRegion(env, payee_node_id, 0, 33, payee_node_id_ref.compressed_form); + LDKReceiveTlvs payee_tlvs_conv; + payee_tlvs_conv.inner = untag_ptr(payee_tlvs); + payee_tlvs_conv.is_owned = ptr_is_owned(payee_tlvs); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payee_tlvs_conv); + payee_tlvs_conv = ReceiveTlvs_clone(&payee_tlvs_conv); + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + LDKCResult_BlindedPaymentPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPaymentPathNoneZ), "LDKCResult_BlindedPaymentPathNoneZ"); + *ret_conv = BlindedPaymentPath_new(intermediate_nodes_constr, payee_node_id_ref, payee_tlvs_conv, htlc_maximum_msat, min_final_cltv_expiry_delta, entropy_source_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1blinded(JNIEnv *env, jclass clz, int64_t a) { - LDKBlindedPathCandidate a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = BlindedPathCandidate_clone(&a_conv); - LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); - *ret_copy = CandidateRouteHop_blinded(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1public_1introduction_1node_1id(JNIEnv *env, jclass clz, int64_t this_arg, int64_t network_graph) { + LDKBlindedPaymentPath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKReadOnlyNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; + LDKNodeId ret_var = BlindedPaymentPath_public_introduction_node_id(&this_arg_conv, &network_graph_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1one_1hop_1blinded(JNIEnv *env, jclass clz, int64_t a) { - LDKOneHopBlindedPathCandidate a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = OneHopBlindedPathCandidate_clone(&a_conv); - LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); - *ret_copy = CandidateRouteHop_one_hop_blinded(a_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1introduction_1node(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBlindedPaymentPath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); + *ret_copy = BlindedPaymentPath_introduction_node(&this_arg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1globally_1unique_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = CandidateRouteHop_globally_unique_short_channel_id(this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1blinding_1point(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBlindedPaymentPath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, BlindedPaymentPath_blinding_point(&this_arg_conv).compressed_form); + return ret_arr; } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); - int32_t ret_conv = CandidateRouteHop_cltv_expiry_delta(this_arg_conv); - return ret_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1blinded_1hops(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBlindedPaymentPath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_BlindedHopZ ret_var = BlindedPaymentPath_blinded_hops(&this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t m = 0; m < ret_var.datalen; m++) { + LDKBlindedHop ret_conv_12_var = ret_var.data[m]; + int64_t ret_conv_12_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_var); + ret_conv_12_ref = tag_ptr(ret_conv_12_var.inner, ret_conv_12_var.is_owned); + ret_arr_ptr[m] = ret_conv_12_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); - int64_t ret_conv = CandidateRouteHop_htlc_minimum_msat(this_arg_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1advance_1path_1by_1one(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_signer, int64_t node_id_lookup) { + LDKBlindedPaymentPath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + void* node_signer_ptr = untag_ptr(node_signer); + if (ptr_is_owned(node_signer)) { CHECK_ACCESS(node_signer_ptr); } + LDKNodeSigner* node_signer_conv = (LDKNodeSigner*)node_signer_ptr; + void* node_id_lookup_ptr = untag_ptr(node_id_lookup); + if (ptr_is_owned(node_id_lookup)) { CHECK_ACCESS(node_id_lookup_ptr); } + LDKNodeIdLookUp* node_id_lookup_conv = (LDKNodeIdLookUp*)node_id_lookup_ptr; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = BlindedPaymentPath_advance_path_by_one(&this_arg_conv, node_signer_conv, node_id_lookup_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1fees(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); - LDKRoutingFees ret_var = CandidateRouteHop_fees(this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentForwardNode_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPaymentForwardNode this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + PaymentForwardNode_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1source(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); - LDKNodeId ret_var = CandidateRouteHop_source(this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentForwardNode_1get_1tlvs(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPaymentForwardNode this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKForwardTlvs ret_var = PaymentForwardNode_get_tlvs(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1target(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); - LDKNodeId ret_var = CandidateRouteHop_target(this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentForwardNode_1set_1tlvs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKPaymentForwardNode this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKForwardTlvs val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ForwardTlvs_clone(&val_conv); + PaymentForwardNode_set_tlvs(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_find_1route(JNIEnv *env, jclass clz, int8_tArray our_node_pubkey, int64_t route_params, int64_t network_graph, int64_tArray first_hops, int64_t logger, int64_t scorer, int64_t score_params, int8_tArray random_seed_bytes) { - LDKPublicKey our_node_pubkey_ref; - CHECK((*env)->GetArrayLength(env, our_node_pubkey) == 33); - (*env)->GetByteArrayRegion(env, our_node_pubkey, 0, 33, our_node_pubkey_ref.compressed_form); - LDKRouteParameters route_params_conv; - route_params_conv.inner = untag_ptr(route_params); - route_params_conv.is_owned = ptr_is_owned(route_params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); - route_params_conv.is_owned = false; - LDKNetworkGraph network_graph_conv; - network_graph_conv.inner = untag_ptr(network_graph); - network_graph_conv.is_owned = ptr_is_owned(network_graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - network_graph_conv.is_owned = false; - LDKCVec_ChannelDetailsZ first_hops_constr; - LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL; - if (first_hops != NULL) { - first_hops_constr.datalen = (*env)->GetArrayLength(env, first_hops); - if (first_hops_constr.datalen > 0) - first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); - else - first_hops_constr.data = NULL; - int64_t* first_hops_vals = (*env)->GetLongArrayElements (env, first_hops, NULL); - for (size_t q = 0; q < first_hops_constr.datalen; q++) { - int64_t first_hops_conv_16 = first_hops_vals[q]; - LDKChannelDetails first_hops_conv_16_conv; - first_hops_conv_16_conv.inner = untag_ptr(first_hops_conv_16); - first_hops_conv_16_conv.is_owned = ptr_is_owned(first_hops_conv_16); - CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv); - first_hops_conv_16_conv.is_owned = false; - first_hops_constr.data[q] = first_hops_conv_16_conv; - } - (*env)->ReleaseLongArrayElements(env, first_hops, first_hops_vals, 0); - first_hops_ptr = &first_hops_constr; - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - void* scorer_ptr = untag_ptr(scorer); - if (ptr_is_owned(scorer)) { CHECK_ACCESS(scorer_ptr); } - LDKScoreLookUp* scorer_conv = (LDKScoreLookUp*)scorer_ptr; - LDKProbabilisticScoringFeeParameters score_params_conv; - score_params_conv.inner = untag_ptr(score_params); - score_params_conv.is_owned = ptr_is_owned(score_params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(score_params_conv); - score_params_conv.is_owned = false; - uint8_t random_seed_bytes_arr[32]; - CHECK((*env)->GetArrayLength(env, random_seed_bytes) == 32); - (*env)->GetByteArrayRegion(env, random_seed_bytes, 0, 32, random_seed_bytes_arr); - uint8_t (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr; - LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); - *ret_conv = find_route(our_node_pubkey_ref, &route_params_conv, &network_graph_conv, first_hops_ptr, logger_conv, scorer_conv, &score_params_conv, random_seed_bytes_ref); - if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); } - return tag_ptr(ret_conv, true); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentForwardNode_1get_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPaymentForwardNode this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, PaymentForwardNode_get_node_id(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_build_1route_1from_1hops(JNIEnv *env, jclass clz, int8_tArray our_node_pubkey, jobjectArray hops, int64_t route_params, int64_t network_graph, int64_t logger, int8_tArray random_seed_bytes) { - LDKPublicKey our_node_pubkey_ref; - CHECK((*env)->GetArrayLength(env, our_node_pubkey) == 33); - (*env)->GetByteArrayRegion(env, our_node_pubkey, 0, 33, our_node_pubkey_ref.compressed_form); - LDKCVec_PublicKeyZ hops_constr; - hops_constr.datalen = (*env)->GetArrayLength(env, hops); - if (hops_constr.datalen > 0) - hops_constr.data = MALLOC(hops_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); - else - hops_constr.data = NULL; - for (size_t i = 0; i < hops_constr.datalen; i++) { - int8_tArray hops_conv_8 = (*env)->GetObjectArrayElement(env, hops, i); - LDKPublicKey hops_conv_8_ref; - CHECK((*env)->GetArrayLength(env, hops_conv_8) == 33); - (*env)->GetByteArrayRegion(env, hops_conv_8, 0, 33, hops_conv_8_ref.compressed_form); - hops_constr.data[i] = hops_conv_8_ref; - } - LDKRouteParameters route_params_conv; - route_params_conv.inner = untag_ptr(route_params); - route_params_conv.is_owned = ptr_is_owned(route_params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); - route_params_conv.is_owned = false; - LDKNetworkGraph network_graph_conv; - network_graph_conv.inner = untag_ptr(network_graph); - network_graph_conv.is_owned = ptr_is_owned(network_graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - network_graph_conv.is_owned = false; - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - uint8_t random_seed_bytes_arr[32]; - CHECK((*env)->GetArrayLength(env, random_seed_bytes) == 32); - (*env)->GetByteArrayRegion(env, random_seed_bytes, 0, 32, random_seed_bytes_arr); - uint8_t (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr; - LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); - *ret_conv = build_route_from_hops(our_node_pubkey_ref, hops_constr, &route_params_conv, &network_graph_conv, logger_conv, random_seed_bytes_ref); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentForwardNode_1set_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKPaymentForwardNode this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + PaymentForwardNode_set_node_id(&this_ptr_conv, val_ref); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoreLookUp_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKScoreLookUp this_ptr_conv = *(LDKScoreLookUp*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - ScoreLookUp_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentForwardNode_1get_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPaymentForwardNode this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = PaymentForwardNode_get_htlc_maximum_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoreUpdate_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKScoreUpdate this_ptr_conv = *(LDKScoreUpdate*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - ScoreUpdate_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentForwardNode_1set_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKPaymentForwardNode this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + PaymentForwardNode_set_htlc_maximum_msat(&this_ptr_conv, val); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKScore this_ptr_conv = *(LDKScore*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Score_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentForwardNode_1new(JNIEnv *env, jclass clz, int64_t tlvs_arg, int8_tArray node_id_arg, int64_t htlc_maximum_msat_arg) { + LDKForwardTlvs tlvs_arg_conv; + tlvs_arg_conv.inner = untag_ptr(tlvs_arg); + tlvs_arg_conv.is_owned = ptr_is_owned(tlvs_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(tlvs_arg_conv); + tlvs_arg_conv = ForwardTlvs_clone(&tlvs_arg_conv); + LDKPublicKey node_id_arg_ref; + CHECK((*env)->GetArrayLength(env, node_id_arg) == 33); + (*env)->GetByteArrayRegion(env, node_id_arg, 0, 33, node_id_arg_ref.compressed_form); + LDKPaymentForwardNode ret_var = PaymentForwardNode_new(tlvs_arg_conv, node_id_arg_ref, htlc_maximum_msat_arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockableScore_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKLockableScore this_ptr_conv = *(LDKLockableScore*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - LockableScore_free(this_ptr_conv); +static inline uint64_t PaymentForwardNode_clone_ptr(LDKPaymentForwardNode *NONNULL_PTR arg) { + LDKPaymentForwardNode ret_var = PaymentForwardNode_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentForwardNode_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPaymentForwardNode arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = PaymentForwardNode_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WriteableScore_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKWriteableScore this_ptr_conv = *(LDKWriteableScore*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - WriteableScore_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentForwardNode_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPaymentForwardNode orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKPaymentForwardNode ret_var = PaymentForwardNode_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKMultiThreadedLockableScore this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKForwardTlvs this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - MultiThreadedLockableScore_free(this_obj_conv); + ForwardTlvs_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1as_1LockableScore(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKMultiThreadedLockableScore this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKLockableScore* ret_ret = MALLOC(sizeof(LDKLockableScore), "LDKLockableScore"); - *ret_ret = MultiThreadedLockableScore_as_LockableScore(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ForwardTlvs_get_short_channel_id(&this_ptr_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKMultiThreadedLockableScore obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = MultiThreadedLockableScore_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ForwardTlvs_set_short_channel_id(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1as_1WriteableScore(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKMultiThreadedLockableScore this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKWriteableScore* ret_ret = MALLOC(sizeof(LDKWriteableScore), "LDKWriteableScore"); - *ret_ret = MultiThreadedLockableScore_as_WriteableScore(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1get_1payment_1relay(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPaymentRelay ret_var = ForwardTlvs_get_payment_relay(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1new(JNIEnv *env, jclass clz, int64_t score) { - void* score_ptr = untag_ptr(score); - CHECK_ACCESS(score_ptr); - LDKScore score_conv = *(LDKScore*)(score_ptr); - if (score_conv.free == LDKScore_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKScore_JCalls_cloned(&score_conv); - } - LDKMultiThreadedLockableScore ret_var = MultiThreadedLockableScore_new(score_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1set_1payment_1relay(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPaymentRelay val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = PaymentRelay_clone(&val_conv); + ForwardTlvs_set_payment_relay(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1get_1payment_1constraints(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPaymentConstraints ret_var = ForwardTlvs_get_payment_constraints(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLockRead_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKMultiThreadedScoreLockRead this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - MultiThreadedScoreLockRead_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1set_1payment_1constraints(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPaymentConstraints val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = PaymentConstraints_clone(&val_conv); + ForwardTlvs_set_payment_constraints(&this_ptr_conv, val_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLockWrite_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKMultiThreadedScoreLockWrite this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - MultiThreadedScoreLockWrite_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBlindedHopFeatures ret_var = ForwardTlvs_get_features(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLockRead_1as_1ScoreLookUp(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKMultiThreadedScoreLockRead this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKScoreLookUp* ret_ret = MALLOC(sizeof(LDKScoreLookUp), "LDKScoreLookUp"); - *ret_ret = MultiThreadedScoreLockRead_as_ScoreLookUp(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBlindedHopFeatures val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = BlindedHopFeatures_clone(&val_conv); + ForwardTlvs_set_features(&this_ptr_conv, val_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLockWrite_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKMultiThreadedScoreLockWrite obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = MultiThreadedScoreLockWrite_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1get_1next_1blinding_1override(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ForwardTlvs_get_next_blinding_override(&this_ptr_conv).compressed_form); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLockWrite_1as_1ScoreUpdate(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKMultiThreadedScoreLockWrite this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKScoreUpdate* ret_ret = MALLOC(sizeof(LDKScoreUpdate), "LDKScoreUpdate"); - *ret_ret = MultiThreadedScoreLockWrite_as_ScoreUpdate(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1set_1next_1blinding_1override(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + ForwardTlvs_set_next_blinding_override(&this_ptr_conv, val_ref); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelUsage this_obj_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1new(JNIEnv *env, jclass clz, int64_t short_channel_id_arg, int64_t payment_relay_arg, int64_t payment_constraints_arg, int64_t features_arg, int8_tArray next_blinding_override_arg) { + LDKPaymentRelay payment_relay_arg_conv; + payment_relay_arg_conv.inner = untag_ptr(payment_relay_arg); + payment_relay_arg_conv.is_owned = ptr_is_owned(payment_relay_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_relay_arg_conv); + payment_relay_arg_conv = PaymentRelay_clone(&payment_relay_arg_conv); + LDKPaymentConstraints payment_constraints_arg_conv; + payment_constraints_arg_conv.inner = untag_ptr(payment_constraints_arg); + payment_constraints_arg_conv.is_owned = ptr_is_owned(payment_constraints_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_constraints_arg_conv); + payment_constraints_arg_conv = PaymentConstraints_clone(&payment_constraints_arg_conv); + LDKBlindedHopFeatures features_arg_conv; + features_arg_conv.inner = untag_ptr(features_arg); + features_arg_conv.is_owned = ptr_is_owned(features_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); + features_arg_conv = BlindedHopFeatures_clone(&features_arg_conv); + LDKPublicKey next_blinding_override_arg_ref; + CHECK((*env)->GetArrayLength(env, next_blinding_override_arg) == 33); + (*env)->GetByteArrayRegion(env, next_blinding_override_arg, 0, 33, next_blinding_override_arg_ref.compressed_form); + LDKForwardTlvs ret_var = ForwardTlvs_new(short_channel_id_arg, payment_relay_arg_conv, payment_constraints_arg_conv, features_arg_conv, next_blinding_override_arg_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t ForwardTlvs_clone_ptr(LDKForwardTlvs *NONNULL_PTR arg) { + LDKForwardTlvs ret_var = ForwardTlvs_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKForwardTlvs arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = ForwardTlvs_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKForwardTlvs orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKForwardTlvs ret_var = ForwardTlvs_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKReceiveTlvs this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelUsage_free(this_obj_conv); + ReceiveTlvs_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelUsage this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1get_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKReceiveTlvs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelUsage_get_amount_msat(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ReceiveTlvs_get_payment_secret(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelUsage this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1set_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKReceiveTlvs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelUsage_set_amount_msat(&this_ptr_conv, val); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + ReceiveTlvs_set_payment_secret(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1inflight_1htlc_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelUsage this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1get_1payment_1constraints(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKReceiveTlvs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelUsage_get_inflight_htlc_msat(&this_ptr_conv); - return ret_conv; + LDKPaymentConstraints ret_var = ReceiveTlvs_get_payment_constraints(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1inflight_1htlc_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelUsage this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1set_1payment_1constraints(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKReceiveTlvs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelUsage_set_inflight_htlc_msat(&this_ptr_conv, val); + LDKPaymentConstraints val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = PaymentConstraints_clone(&val_conv); + ReceiveTlvs_set_payment_constraints(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1effective_1capacity(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelUsage this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1get_1payment_1context(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKReceiveTlvs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = ChannelUsage_get_effective_capacity(&this_ptr_conv); + LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); + *ret_copy = ReceiveTlvs_get_payment_context(&this_ptr_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1effective_1capacity(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelUsage this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1set_1payment_1context(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKReceiveTlvs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; void* val_ptr = untag_ptr(val); CHECK_ACCESS(val_ptr); - LDKEffectiveCapacity val_conv = *(LDKEffectiveCapacity*)(val_ptr); - val_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(val)); - ChannelUsage_set_effective_capacity(&this_ptr_conv, val_conv); + LDKPaymentContext val_conv = *(LDKPaymentContext*)(val_ptr); + val_conv = PaymentContext_clone((LDKPaymentContext*)untag_ptr(val)); + ReceiveTlvs_set_payment_context(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1new(JNIEnv *env, jclass clz, int64_t amount_msat_arg, int64_t inflight_htlc_msat_arg, int64_t effective_capacity_arg) { - void* effective_capacity_arg_ptr = untag_ptr(effective_capacity_arg); - CHECK_ACCESS(effective_capacity_arg_ptr); - LDKEffectiveCapacity effective_capacity_arg_conv = *(LDKEffectiveCapacity*)(effective_capacity_arg_ptr); - effective_capacity_arg_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(effective_capacity_arg)); - LDKChannelUsage ret_var = ChannelUsage_new(amount_msat_arg, inflight_htlc_msat_arg, effective_capacity_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1new(JNIEnv *env, jclass clz, int8_tArray payment_secret_arg, int64_t payment_constraints_arg, int64_t payment_context_arg) { + LDKThirtyTwoBytes payment_secret_arg_ref; + CHECK((*env)->GetArrayLength(env, payment_secret_arg) == 32); + (*env)->GetByteArrayRegion(env, payment_secret_arg, 0, 32, payment_secret_arg_ref.data); + LDKPaymentConstraints payment_constraints_arg_conv; + payment_constraints_arg_conv.inner = untag_ptr(payment_constraints_arg); + payment_constraints_arg_conv.is_owned = ptr_is_owned(payment_constraints_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_constraints_arg_conv); + payment_constraints_arg_conv = PaymentConstraints_clone(&payment_constraints_arg_conv); + void* payment_context_arg_ptr = untag_ptr(payment_context_arg); + CHECK_ACCESS(payment_context_arg_ptr); + LDKPaymentContext payment_context_arg_conv = *(LDKPaymentContext*)(payment_context_arg_ptr); + payment_context_arg_conv = PaymentContext_clone((LDKPaymentContext*)untag_ptr(payment_context_arg)); + LDKReceiveTlvs ret_var = ReceiveTlvs_new(payment_secret_arg_ref, payment_constraints_arg_conv, payment_context_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t ChannelUsage_clone_ptr(LDKChannelUsage *NONNULL_PTR arg) { - LDKChannelUsage ret_var = ChannelUsage_clone(arg); +static inline uint64_t ReceiveTlvs_clone_ptr(LDKReceiveTlvs *NONNULL_PTR arg) { + LDKReceiveTlvs ret_var = ReceiveTlvs_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelUsage arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKReceiveTlvs arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = ChannelUsage_clone_ptr(&arg_conv); + int64_t ret_conv = ReceiveTlvs_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelUsage orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKReceiveTlvs orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKChannelUsage ret_var = ChannelUsage_clone(&orig_conv); + LDKReceiveTlvs ret_var = ReceiveTlvs_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKFixedPenaltyScorer this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPaymentRelay this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - FixedPenaltyScorer_free(this_obj_conv); + PaymentRelay_free(this_obj_conv); } -static inline uint64_t FixedPenaltyScorer_clone_ptr(LDKFixedPenaltyScorer *NONNULL_PTR arg) { - LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKFixedPenaltyScorer arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = FixedPenaltyScorer_clone_ptr(&arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKFixedPenaltyScorer orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1with_1penalty(JNIEnv *env, jclass clz, int64_t penalty_msat) { - LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_with_penalty(penalty_msat); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1as_1ScoreLookUp(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKFixedPenaltyScorer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKScoreLookUp* ret_ret = MALLOC(sizeof(LDKScoreLookUp), "LDKScoreLookUp"); - *ret_ret = FixedPenaltyScorer_as_ScoreLookUp(&this_arg_conv); - return tag_ptr(ret_ret, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1as_1ScoreUpdate(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKFixedPenaltyScorer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKScoreUpdate* ret_ret = MALLOC(sizeof(LDKScoreUpdate), "LDKScoreUpdate"); - *ret_ret = FixedPenaltyScorer_as_ScoreUpdate(&this_arg_conv); - return tag_ptr(ret_ret, true); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKFixedPenaltyScorer obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = FixedPenaltyScorer_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); - *ret_conv = FixedPenaltyScorer_read(ser_ref, arg); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKProbabilisticScorer this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ProbabilisticScorer_free(this_obj_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKProbabilisticScoringFeeParameters this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ProbabilisticScoringFeeParameters_free(this_obj_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1base_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPaymentRelay this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = ProbabilisticScoringFeeParameters_get_base_penalty_msat(&this_ptr_conv); + int16_t ret_conv = PaymentRelay_get_cltv_expiry_delta(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1base_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKPaymentRelay this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_base_penalty_msat(&this_ptr_conv, val); + PaymentRelay_set_cltv_expiry_delta(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1base_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1get_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPaymentRelay this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = ProbabilisticScoringFeeParameters_get_base_penalty_amount_multiplier_msat(&this_ptr_conv); + int32_t ret_conv = PaymentRelay_get_fee_proportional_millionths(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1base_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1set_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKPaymentRelay this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_base_penalty_amount_multiplier_msat(&this_ptr_conv, val); + PaymentRelay_set_fee_proportional_millionths(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1liquidity_1penalty_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1get_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPaymentRelay this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = ProbabilisticScoringFeeParameters_get_liquidity_penalty_multiplier_msat(&this_ptr_conv); + int32_t ret_conv = PaymentRelay_get_fee_base_msat(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1liquidity_1penalty_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1set_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKPaymentRelay this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_liquidity_penalty_multiplier_msat(&this_ptr_conv, val); + PaymentRelay_set_fee_base_msat(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1liquidity_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = ProbabilisticScoringFeeParameters_get_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1new(JNIEnv *env, jclass clz, int16_t cltv_expiry_delta_arg, int32_t fee_proportional_millionths_arg, int32_t fee_base_msat_arg) { + LDKPaymentRelay ret_var = PaymentRelay_new(cltv_expiry_delta_arg, fee_proportional_millionths_arg, fee_base_msat_arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1liquidity_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val); +static inline uint64_t PaymentRelay_clone_ptr(LDKPaymentRelay *NONNULL_PTR arg) { + LDKPaymentRelay ret_var = PaymentRelay_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1historical_1liquidity_1penalty_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_multiplier_msat(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPaymentRelay arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = PaymentRelay_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1historical_1liquidity_1penalty_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_multiplier_msat(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1historical_1liquidity_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPaymentRelay orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKPaymentRelay ret_var = PaymentRelay_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1historical_1liquidity_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPaymentConstraints this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + PaymentConstraints_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1anti_1probing_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1get_1max_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPaymentConstraints this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = ProbabilisticScoringFeeParameters_get_anti_probing_penalty_msat(&this_ptr_conv); + int32_t ret_conv = PaymentConstraints_get_max_cltv_expiry(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1anti_1probing_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1set_1max_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKPaymentConstraints this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_anti_probing_penalty_msat(&this_ptr_conv, val); + PaymentConstraints_set_max_cltv_expiry(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1considered_1impossible_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPaymentConstraints this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = ProbabilisticScoringFeeParameters_get_considered_impossible_penalty_msat(&this_ptr_conv); + int64_t ret_conv = PaymentConstraints_get_htlc_minimum_msat(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1considered_1impossible_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_considered_impossible_penalty_msat(&this_ptr_conv, val); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1linear_1success_1probability(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKPaymentConstraints this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - jboolean ret_conv = ProbabilisticScoringFeeParameters_get_linear_success_probability(&this_ptr_conv); - return ret_conv; + PaymentConstraints_set_htlc_minimum_msat(&this_ptr_conv, val); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1linear_1success_1probability(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_linear_success_probability(&this_ptr_conv, val); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1new(JNIEnv *env, jclass clz, int32_t max_cltv_expiry_arg, int64_t htlc_minimum_msat_arg) { + LDKPaymentConstraints ret_var = PaymentConstraints_new(max_cltv_expiry_arg, htlc_minimum_msat_arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -static inline uint64_t ProbabilisticScoringFeeParameters_clone_ptr(LDKProbabilisticScoringFeeParameters *NONNULL_PTR arg) { - LDKProbabilisticScoringFeeParameters ret_var = ProbabilisticScoringFeeParameters_clone(arg); +static inline uint64_t PaymentConstraints_clone_ptr(LDKPaymentConstraints *NONNULL_PTR arg) { + LDKPaymentConstraints ret_var = PaymentConstraints_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKProbabilisticScoringFeeParameters arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPaymentConstraints arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = ProbabilisticScoringFeeParameters_clone_ptr(&arg_conv); + int64_t ret_conv = PaymentConstraints_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKProbabilisticScoringFeeParameters orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPaymentConstraints orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKProbabilisticScoringFeeParameters ret_var = ProbabilisticScoringFeeParameters_clone(&orig_conv); + LDKPaymentConstraints ret_var = PaymentConstraints_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1default(JNIEnv *env, jclass clz) { - LDKProbabilisticScoringFeeParameters ret_var = ProbabilisticScoringFeeParameters_default(); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentContext_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKPaymentContext this_ptr_conv = *(LDKPaymentContext*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + PaymentContext_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1add_1banned(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_id) { - LDKProbabilisticScoringFeeParameters this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId node_id_conv; - node_id_conv.inner = untag_ptr(node_id); - node_id_conv.is_owned = ptr_is_owned(node_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); - node_id_conv.is_owned = false; - ProbabilisticScoringFeeParameters_add_banned(&this_arg_conv, &node_id_conv); +static inline uint64_t PaymentContext_clone_ptr(LDKPaymentContext *NONNULL_PTR arg) { + LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); + *ret_copy = PaymentContext_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentContext_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPaymentContext* arg_conv = (LDKPaymentContext*)untag_ptr(arg); + int64_t ret_conv = PaymentContext_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1add_1banned_1from_1list(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray node_ids) { - LDKProbabilisticScoringFeeParameters this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_NodeIdZ node_ids_constr; - node_ids_constr.datalen = (*env)->GetArrayLength(env, node_ids); - if (node_ids_constr.datalen > 0) - node_ids_constr.data = MALLOC(node_ids_constr.datalen * sizeof(LDKNodeId), "LDKCVec_NodeIdZ Elements"); - else - node_ids_constr.data = NULL; - int64_t* node_ids_vals = (*env)->GetLongArrayElements (env, node_ids, NULL); - for (size_t i = 0; i < node_ids_constr.datalen; i++) { - int64_t node_ids_conv_8 = node_ids_vals[i]; - LDKNodeId node_ids_conv_8_conv; - node_ids_conv_8_conv.inner = untag_ptr(node_ids_conv_8); - node_ids_conv_8_conv.is_owned = ptr_is_owned(node_ids_conv_8); - CHECK_INNER_FIELD_ACCESS_OR_NULL(node_ids_conv_8_conv); - node_ids_conv_8_conv = NodeId_clone(&node_ids_conv_8_conv); - node_ids_constr.data[i] = node_ids_conv_8_conv; - } - (*env)->ReleaseLongArrayElements(env, node_ids, node_ids_vals, 0); - ProbabilisticScoringFeeParameters_add_banned_from_list(&this_arg_conv, node_ids_constr); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentContext_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPaymentContext* orig_conv = (LDKPaymentContext*)untag_ptr(orig); + LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); + *ret_copy = PaymentContext_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1remove_1banned(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_id) { - LDKProbabilisticScoringFeeParameters this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId node_id_conv; - node_id_conv.inner = untag_ptr(node_id); - node_id_conv.is_owned = ptr_is_owned(node_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); - node_id_conv.is_owned = false; - ProbabilisticScoringFeeParameters_remove_banned(&this_arg_conv, &node_id_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentContext_1unknown(JNIEnv *env, jclass clz, int64_t a) { + LDKUnknownPaymentContext a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = UnknownPaymentContext_clone(&a_conv); + LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); + *ret_copy = PaymentContext_unknown(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1manual_1penalty(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_id, int64_t penalty) { - LDKProbabilisticScoringFeeParameters this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId node_id_conv; - node_id_conv.inner = untag_ptr(node_id); - node_id_conv.is_owned = ptr_is_owned(node_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); - node_id_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_manual_penalty(&this_arg_conv, &node_id_conv, penalty); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentContext_1bolt12_1offer(JNIEnv *env, jclass clz, int64_t a) { + LDKBolt12OfferContext a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = Bolt12OfferContext_clone(&a_conv); + LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); + *ret_copy = PaymentContext_bolt12_offer(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1remove_1manual_1penalty(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_id) { - LDKProbabilisticScoringFeeParameters this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId node_id_conv; - node_id_conv.inner = untag_ptr(node_id); - node_id_conv.is_owned = ptr_is_owned(node_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); - node_id_conv.is_owned = false; - ProbabilisticScoringFeeParameters_remove_manual_penalty(&this_arg_conv, &node_id_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentContext_1bolt12_1refund(JNIEnv *env, jclass clz, int64_t a) { + LDKBolt12RefundContext a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = Bolt12RefundContext_clone(&a_conv); + LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); + *ret_copy = PaymentContext_bolt12_refund(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1clear_1manual_1penalties(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKProbabilisticScoringFeeParameters this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - ProbabilisticScoringFeeParameters_clear_manual_penalties(&this_arg_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentContext_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKPaymentContext* a_conv = (LDKPaymentContext*)untag_ptr(a); + LDKPaymentContext* b_conv = (LDKPaymentContext*)untag_ptr(b); + jboolean ret_conv = PaymentContext_eq(a_conv, b_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKProbabilisticScoringDecayParameters this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUnknownPaymentContext this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ProbabilisticScoringDecayParameters_free(this_obj_conv); + UnknownPaymentContext_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1get_1historical_1no_1updates_1half_1life(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKProbabilisticScoringDecayParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = ProbabilisticScoringDecayParameters_get_historical_no_updates_half_life(&this_ptr_conv); +static inline uint64_t UnknownPaymentContext_clone_ptr(LDKUnknownPaymentContext *NONNULL_PTR arg) { + LDKUnknownPaymentContext ret_var = UnknownPaymentContext_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUnknownPaymentContext arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = UnknownPaymentContext_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1set_1historical_1no_1updates_1half_1life(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringDecayParameters this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKUnknownPaymentContext orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKUnknownPaymentContext ret_var = UnknownPaymentContext_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKUnknownPaymentContext a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKUnknownPaymentContext b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = UnknownPaymentContext_eq(&a_conv, &b_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBolt12OfferContext this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Bolt12OfferContext_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1get_1offer_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBolt12OfferContext this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ProbabilisticScoringDecayParameters_set_historical_no_updates_half_life(&this_ptr_conv, val); + LDKOfferId ret_var = Bolt12OfferContext_get_offer_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1get_1liquidity_1offset_1half_1life(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKProbabilisticScoringDecayParameters this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1set_1offer_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKBolt12OfferContext this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = ProbabilisticScoringDecayParameters_get_liquidity_offset_half_life(&this_ptr_conv); - return ret_conv; + LDKOfferId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = OfferId_clone(&val_conv); + Bolt12OfferContext_set_offer_id(&this_ptr_conv, val_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1set_1liquidity_1offset_1half_1life(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringDecayParameters this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1get_1invoice_1request(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBolt12OfferContext this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ProbabilisticScoringDecayParameters_set_liquidity_offset_half_life(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1new(JNIEnv *env, jclass clz, int64_t historical_no_updates_half_life_arg, int64_t liquidity_offset_half_life_arg) { - LDKProbabilisticScoringDecayParameters ret_var = ProbabilisticScoringDecayParameters_new(historical_no_updates_half_life_arg, liquidity_offset_half_life_arg); + LDKInvoiceRequestFields ret_var = Bolt12OfferContext_get_invoice_request(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t ProbabilisticScoringDecayParameters_clone_ptr(LDKProbabilisticScoringDecayParameters *NONNULL_PTR arg) { - LDKProbabilisticScoringDecayParameters ret_var = ProbabilisticScoringDecayParameters_clone(arg); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1set_1invoice_1request(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKBolt12OfferContext this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKInvoiceRequestFields val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = InvoiceRequestFields_clone(&val_conv); + Bolt12OfferContext_set_invoice_request(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1new(JNIEnv *env, jclass clz, int64_t offer_id_arg, int64_t invoice_request_arg) { + LDKOfferId offer_id_arg_conv; + offer_id_arg_conv.inner = untag_ptr(offer_id_arg); + offer_id_arg_conv.is_owned = ptr_is_owned(offer_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(offer_id_arg_conv); + offer_id_arg_conv = OfferId_clone(&offer_id_arg_conv); + LDKInvoiceRequestFields invoice_request_arg_conv; + invoice_request_arg_conv.inner = untag_ptr(invoice_request_arg); + invoice_request_arg_conv.is_owned = ptr_is_owned(invoice_request_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_request_arg_conv); + invoice_request_arg_conv = InvoiceRequestFields_clone(&invoice_request_arg_conv); + LDKBolt12OfferContext ret_var = Bolt12OfferContext_new(offer_id_arg_conv, invoice_request_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKProbabilisticScoringDecayParameters arg_conv; + +static inline uint64_t Bolt12OfferContext_clone_ptr(LDKBolt12OfferContext *NONNULL_PTR arg) { + LDKBolt12OfferContext ret_var = Bolt12OfferContext_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBolt12OfferContext arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = ProbabilisticScoringDecayParameters_clone_ptr(&arg_conv); + int64_t ret_conv = Bolt12OfferContext_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKProbabilisticScoringDecayParameters orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBolt12OfferContext orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKProbabilisticScoringDecayParameters ret_var = ProbabilisticScoringDecayParameters_clone(&orig_conv); + LDKBolt12OfferContext ret_var = Bolt12OfferContext_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1default(JNIEnv *env, jclass clz) { - LDKProbabilisticScoringDecayParameters ret_var = ProbabilisticScoringDecayParameters_default(); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKBolt12OfferContext a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKBolt12OfferContext b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = Bolt12OfferContext_eq(&a_conv, &b_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBolt12RefundContext this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Bolt12RefundContext_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1new(JNIEnv *env, jclass clz) { + LDKBolt12RefundContext ret_var = Bolt12RefundContext_new(); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1new(JNIEnv *env, jclass clz, int64_t decay_params, int64_t network_graph, int64_t logger) { - LDKProbabilisticScoringDecayParameters decay_params_conv; - decay_params_conv.inner = untag_ptr(decay_params); - decay_params_conv.is_owned = ptr_is_owned(decay_params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(decay_params_conv); - decay_params_conv = ProbabilisticScoringDecayParameters_clone(&decay_params_conv); - LDKNetworkGraph network_graph_conv; - network_graph_conv.inner = untag_ptr(network_graph); - network_graph_conv.is_owned = ptr_is_owned(network_graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - network_graph_conv.is_owned = false; - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKProbabilisticScorer ret_var = ProbabilisticScorer_new(decay_params_conv, &network_graph_conv, logger_conv); +static inline uint64_t Bolt12RefundContext_clone_ptr(LDKBolt12RefundContext *NONNULL_PTR arg) { + LDKBolt12RefundContext ret_var = Bolt12RefundContext_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1debug_1log_1liquidity_1stats(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKProbabilisticScorer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - ProbabilisticScorer_debug_log_liquidity_stats(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBolt12RefundContext arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = Bolt12RefundContext_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1estimated_1channel_1liquidity_1range(JNIEnv *env, jclass clz, int64_t this_arg, int64_t scid, int64_t target) { - LDKProbabilisticScorer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId target_conv; - target_conv.inner = untag_ptr(target); - target_conv.is_owned = ptr_is_owned(target); - CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); - target_conv.is_owned = false; - LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ"); - *ret_copy = ProbabilisticScorer_estimated_channel_liquidity_range(&this_arg_conv, scid, &target_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBolt12RefundContext orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKBolt12RefundContext ret_var = Bolt12RefundContext_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1historical_1estimated_1channel_1liquidity_1probabilities(JNIEnv *env, jclass clz, int64_t this_arg, int64_t scid, int64_t target) { - LDKProbabilisticScorer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId target_conv; - target_conv.inner = untag_ptr(target); - target_conv.is_owned = ptr_is_owned(target); - CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); - target_conv.is_owned = false; - LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ), "LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ"); - *ret_copy = ProbabilisticScorer_historical_estimated_channel_liquidity_probabilities(&this_arg_conv, scid, &target_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKBolt12RefundContext a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKBolt12RefundContext b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = Bolt12RefundContext_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1historical_1estimated_1payment_1success_1probability(JNIEnv *env, jclass clz, int64_t this_arg, int64_t scid, int64_t target, int64_t amount_msat, int64_t params) { - LDKProbabilisticScorer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId target_conv; - target_conv.inner = untag_ptr(target); - target_conv.is_owned = ptr_is_owned(target); - CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); - target_conv.is_owned = false; - LDKProbabilisticScoringFeeParameters params_conv; - params_conv.inner = untag_ptr(params); - params_conv.is_owned = ptr_is_owned(params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); - params_conv.is_owned = false; - LDKCOption_f64Z *ret_copy = MALLOC(sizeof(LDKCOption_f64Z), "LDKCOption_f64Z"); - *ret_copy = ProbabilisticScorer_historical_estimated_payment_success_probability(&this_arg_conv, scid, &target_conv, amount_msat, ¶ms_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKForwardTlvs obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ForwardTlvs_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1as_1ScoreLookUp(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKProbabilisticScorer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKScoreLookUp* ret_ret = MALLOC(sizeof(LDKScoreLookUp), "LDKScoreLookUp"); - *ret_ret = ProbabilisticScorer_as_ScoreLookUp(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKReceiveTlvs obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ReceiveTlvs_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1as_1ScoreUpdate(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKProbabilisticScorer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKScoreUpdate* ret_ret = MALLOC(sizeof(LDKScoreUpdate), "LDKScoreUpdate"); - *ret_ret = ProbabilisticScorer_as_ScoreUpdate(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKPaymentRelay obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = PaymentRelay_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1as_1Score(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKProbabilisticScorer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore"); - *ret_ret = ProbabilisticScorer_as_Score(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_PaymentRelayDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentRelayDecodeErrorZ), "LDKCResult_PaymentRelayDecodeErrorZ"); + *ret_conv = PaymentRelay_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKProbabilisticScorer obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKPaymentConstraints obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ProbabilisticScorer_write(&obj_conv); + LDKCVec_u8Z ret_var = PaymentConstraints_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg_a, int64_t arg_b, int64_t arg_c) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1read(JNIEnv *env, jclass clz, int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKProbabilisticScoringDecayParameters arg_a_conv; - arg_a_conv.inner = untag_ptr(arg_a); - arg_a_conv.is_owned = ptr_is_owned(arg_a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_a_conv); - arg_a_conv = ProbabilisticScoringDecayParameters_clone(&arg_a_conv); - LDKNetworkGraph arg_b_conv; - arg_b_conv.inner = untag_ptr(arg_b); - arg_b_conv.is_owned = ptr_is_owned(arg_b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_b_conv); - arg_b_conv.is_owned = false; - void* arg_c_ptr = untag_ptr(arg_c); - CHECK_ACCESS(arg_c_ptr); - LDKLogger arg_c_conv = *(LDKLogger*)(arg_c_ptr); - if (arg_c_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&arg_c_conv); - } - LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ"); - *ret_conv = ProbabilisticScorer_read(ser_ref, arg_a_conv, &arg_b_conv, arg_c_conv); + LDKCResult_PaymentConstraintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentConstraintsDecodeErrorZ), "LDKCResult_PaymentConstraintsDecodeErrorZ"); + *ret_conv = PaymentConstraints_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKDelayedPaymentOutputDescriptor this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - DelayedPaymentOutputDescriptor_free(this_obj_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentContext_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKPaymentContext* obj_conv = (LDKPaymentContext*)untag_ptr(obj); + LDKCVec_u8Z ret_var = PaymentContext_write(obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKOutPoint ret_var = DelayedPaymentOutputDescriptor_get_outpoint(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentContext_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_PaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentContextDecodeErrorZ), "LDKCResult_PaymentContextDecodeErrorZ"); + *ret_conv = PaymentContext_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKOutPoint val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = OutPoint_clone(&val_conv); - DelayedPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKUnknownPaymentContext obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = UnknownPaymentContext_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DelayedPaymentOutputDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); + *ret_conv = UnknownPaymentContext_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - DelayedPaymentOutputDescriptor_set_per_commitment_point(&this_ptr_conv, val_ref); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKBolt12OfferContext obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = Bolt12OfferContext_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int16_t ret_conv = DelayedPaymentOutputDescriptor_get_to_self_delay(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_Bolt12OfferContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12OfferContextDecodeErrorZ), "LDKCResult_Bolt12OfferContextDecodeErrorZ"); + *ret_conv = Bolt12OfferContext_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - DelayedPaymentOutputDescriptor_set_to_self_delay(&this_ptr_conv, val); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKBolt12RefundContext obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = Bolt12RefundContext_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1output(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); - *ret_ref = DelayedPaymentOutputDescriptor_get_output(&this_ptr_conv); - return tag_ptr(ret_ref, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_Bolt12RefundContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12RefundContextDecodeErrorZ), "LDKCResult_Bolt12RefundContextDecodeErrorZ"); + *ret_conv = Bolt12RefundContext_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1output(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); - val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val)); - DelayedPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBlindedMessagePath this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + BlindedMessagePath_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1revocation_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKRevocationKey ret_var = DelayedPaymentOutputDescriptor_get_revocation_pubkey(&this_ptr_conv); +static inline uint64_t BlindedMessagePath_clone_ptr(LDKBlindedMessagePath *NONNULL_PTR arg) { + LDKBlindedMessagePath ret_var = BlindedMessagePath_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1revocation_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKRevocationKey val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = RevocationKey_clone(&val_conv); - DelayedPaymentOutputDescriptor_set_revocation_pubkey(&this_ptr_conv, val_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBlindedMessagePath arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = BlindedMessagePath_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *DelayedPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv)); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBlindedMessagePath orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKBlindedMessagePath ret_var = BlindedMessagePath_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - DelayedPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKBlindedMessagePath o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = BlindedMessagePath_hash(&o_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = DelayedPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKBlindedMessagePath a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKBlindedMessagePath b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = BlindedMessagePath_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - DelayedPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKBlindedMessagePath obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = BlindedMessagePath_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1transaction_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelTransactionParameters ret_var = DelayedPaymentOutputDescriptor_get_channel_transaction_parameters(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_BlindedMessagePathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathDecodeErrorZ), "LDKCResult_BlindedMessagePathDecodeErrorZ"); + *ret_conv = BlindedMessagePath_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1transaction_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelTransactionParameters val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelTransactionParameters_clone(&val_conv); - DelayedPaymentOutputDescriptor_set_channel_transaction_parameters(&this_ptr_conv, val_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1one_1hop(JNIEnv *env, jclass clz, int8_tArray recipient_node_id, int64_t context, int64_t entropy_source) { + LDKPublicKey recipient_node_id_ref; + CHECK((*env)->GetArrayLength(env, recipient_node_id) == 33); + (*env)->GetByteArrayRegion(env, recipient_node_id, 0, 33, recipient_node_id_ref.compressed_form); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKMessageContext context_conv = *(LDKMessageContext*)(context_ptr); + context_conv = MessageContext_clone((LDKMessageContext*)untag_ptr(context)); + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + LDKCResult_BlindedMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathNoneZ), "LDKCResult_BlindedMessagePathNoneZ"); + *ret_conv = BlindedMessagePath_one_hop(recipient_node_id_ref, context_conv, entropy_source_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1new(JNIEnv *env, jclass clz, int64_t outpoint_arg, int8_tArray per_commitment_point_arg, int16_t to_self_delay_arg, int64_t output_arg, int64_t revocation_pubkey_arg, int8_tArray channel_keys_id_arg, int64_t channel_value_satoshis_arg, int64_t channel_transaction_parameters_arg) { - LDKOutPoint outpoint_arg_conv; - outpoint_arg_conv.inner = untag_ptr(outpoint_arg); - outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); - outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); - LDKPublicKey per_commitment_point_arg_ref; - CHECK((*env)->GetArrayLength(env, per_commitment_point_arg) == 33); - (*env)->GetByteArrayRegion(env, per_commitment_point_arg, 0, 33, per_commitment_point_arg_ref.compressed_form); - void* output_arg_ptr = untag_ptr(output_arg); - CHECK_ACCESS(output_arg_ptr); - LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr); - output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg)); - LDKRevocationKey revocation_pubkey_arg_conv; - revocation_pubkey_arg_conv.inner = untag_ptr(revocation_pubkey_arg); - revocation_pubkey_arg_conv.is_owned = ptr_is_owned(revocation_pubkey_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(revocation_pubkey_arg_conv); - revocation_pubkey_arg_conv = RevocationKey_clone(&revocation_pubkey_arg_conv); - LDKThirtyTwoBytes channel_keys_id_arg_ref; - CHECK((*env)->GetArrayLength(env, channel_keys_id_arg) == 32); - (*env)->GetByteArrayRegion(env, channel_keys_id_arg, 0, 32, channel_keys_id_arg_ref.data); - LDKChannelTransactionParameters channel_transaction_parameters_arg_conv; - channel_transaction_parameters_arg_conv.inner = untag_ptr(channel_transaction_parameters_arg); - channel_transaction_parameters_arg_conv.is_owned = ptr_is_owned(channel_transaction_parameters_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_transaction_parameters_arg_conv); - channel_transaction_parameters_arg_conv = ChannelTransactionParameters_clone(&channel_transaction_parameters_arg_conv); - LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_new(outpoint_arg_conv, per_commitment_point_arg_ref, to_self_delay_arg, output_arg_conv, revocation_pubkey_arg_conv, channel_keys_id_arg_ref, channel_value_satoshis_arg, channel_transaction_parameters_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1new(JNIEnv *env, jclass clz, int64_tArray intermediate_nodes, int8_tArray recipient_node_id, int64_t context, int64_t entropy_source) { + LDKCVec_MessageForwardNodeZ intermediate_nodes_constr; + intermediate_nodes_constr.datalen = (*env)->GetArrayLength(env, intermediate_nodes); + if (intermediate_nodes_constr.datalen > 0) + intermediate_nodes_constr.data = MALLOC(intermediate_nodes_constr.datalen * sizeof(LDKMessageForwardNode), "LDKCVec_MessageForwardNodeZ Elements"); + else + intermediate_nodes_constr.data = NULL; + int64_t* intermediate_nodes_vals = (*env)->GetLongArrayElements (env, intermediate_nodes, NULL); + for (size_t u = 0; u < intermediate_nodes_constr.datalen; u++) { + int64_t intermediate_nodes_conv_20 = intermediate_nodes_vals[u]; + LDKMessageForwardNode intermediate_nodes_conv_20_conv; + intermediate_nodes_conv_20_conv.inner = untag_ptr(intermediate_nodes_conv_20); + intermediate_nodes_conv_20_conv.is_owned = ptr_is_owned(intermediate_nodes_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(intermediate_nodes_conv_20_conv); + intermediate_nodes_conv_20_conv = MessageForwardNode_clone(&intermediate_nodes_conv_20_conv); + intermediate_nodes_constr.data[u] = intermediate_nodes_conv_20_conv; + } + (*env)->ReleaseLongArrayElements(env, intermediate_nodes, intermediate_nodes_vals, 0); + LDKPublicKey recipient_node_id_ref; + CHECK((*env)->GetArrayLength(env, recipient_node_id) == 33); + (*env)->GetByteArrayRegion(env, recipient_node_id, 0, 33, recipient_node_id_ref.compressed_form); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKMessageContext context_conv = *(LDKMessageContext*)(context_ptr); + context_conv = MessageContext_clone((LDKMessageContext*)untag_ptr(context)); + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + LDKCResult_BlindedMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathNoneZ), "LDKCResult_BlindedMessagePathNoneZ"); + *ret_conv = BlindedMessagePath_new(intermediate_nodes_constr, recipient_node_id_ref, context_conv, entropy_source_conv); + return tag_ptr(ret_conv, true); } -static inline uint64_t DelayedPaymentOutputDescriptor_clone_ptr(LDKDelayedPaymentOutputDescriptor *NONNULL_PTR arg) { - LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKDelayedPaymentOutputDescriptor arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = DelayedPaymentOutputDescriptor_clone_ptr(&arg_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1use_1compact_1introduction_1node(JNIEnv *env, jclass clz, int64_t this_arg, int64_t network_graph) { + LDKBlindedMessagePath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKReadOnlyNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; + BlindedMessagePath_use_compact_introduction_node(&this_arg_conv, &network_graph_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKDelayedPaymentOutputDescriptor orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(&orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1public_1introduction_1node_1id(JNIEnv *env, jclass clz, int64_t this_arg, int64_t network_graph) { + LDKBlindedMessagePath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKReadOnlyNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; + LDKNodeId ret_var = BlindedMessagePath_public_introduction_node_id(&this_arg_conv, &network_graph_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKDelayedPaymentOutputDescriptor o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = DelayedPaymentOutputDescriptor_hash(&o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1introduction_1node(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBlindedMessagePath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); + *ret_copy = BlindedMessagePath_introduction_node(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKDelayedPaymentOutputDescriptor a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKDelayedPaymentOutputDescriptor b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = DelayedPaymentOutputDescriptor_eq(&a_conv, &b_conv); - return ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1blinding_1point(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBlindedMessagePath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, BlindedMessagePath_blinding_point(&this_arg_conv).compressed_form); + return ret_arr; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKDelayedPaymentOutputDescriptor obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = DelayedPaymentOutputDescriptor_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1blinded_1hops(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBlindedMessagePath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_BlindedHopZ ret_var = BlindedMessagePath_blinded_hops(&this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t m = 0; m < ret_var.datalen; m++) { + LDKBlindedHop ret_conv_12_var = ret_var.data[m]; + int64_t ret_conv_12_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_var); + ret_conv_12_ref = tag_ptr(ret_conv_12_var.inner, ret_conv_12_var.is_owned); + ret_arr_ptr[m] = ret_conv_12_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); - *ret_conv = DelayedPaymentOutputDescriptor_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1advance_1path_1by_1one(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_signer, int64_t node_id_lookup) { + LDKBlindedMessagePath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + void* node_signer_ptr = untag_ptr(node_signer); + if (ptr_is_owned(node_signer)) { CHECK_ACCESS(node_signer_ptr); } + LDKNodeSigner* node_signer_conv = (LDKNodeSigner*)node_signer_ptr; + void* node_id_lookup_ptr = untag_ptr(node_id_lookup); + if (ptr_is_owned(node_id_lookup)) { CHECK_ACCESS(node_id_lookup_ptr); } + LDKNodeIdLookUp* node_id_lookup_conv = (LDKNodeIdLookUp*)node_id_lookup_ptr; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = BlindedMessagePath_advance_path_by_one(&this_arg_conv, node_signer_conv, node_id_lookup_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKStaticPaymentOutputDescriptor this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - StaticPaymentOutputDescriptor_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKNextMessageHop this_ptr_conv = *(LDKNextMessageHop*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + NextMessageHop_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKOutPoint ret_var = StaticPaymentOutputDescriptor_get_outpoint(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +static inline uint64_t NextMessageHop_clone_ptr(LDKNextMessageHop *NONNULL_PTR arg) { + LDKNextMessageHop *ret_copy = MALLOC(sizeof(LDKNextMessageHop), "LDKNextMessageHop"); + *ret_copy = NextMessageHop_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNextMessageHop* arg_conv = (LDKNextMessageHop*)untag_ptr(arg); + int64_t ret_conv = NextMessageHop_clone_ptr(arg_conv); + return ret_conv; +} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKOutPoint val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = OutPoint_clone(&val_conv); - StaticPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKNextMessageHop* orig_conv = (LDKNextMessageHop*)untag_ptr(orig); + LDKNextMessageHop *ret_copy = MALLOC(sizeof(LDKNextMessageHop), "LDKNextMessageHop"); + *ret_copy = NextMessageHop_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1output(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); - *ret_ref = StaticPaymentOutputDescriptor_get_output(&this_ptr_conv); - return tag_ptr(ret_ref, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1node_1id(JNIEnv *env, jclass clz, int8_tArray a) { + LDKPublicKey a_ref; + CHECK((*env)->GetArrayLength(env, a) == 33); + (*env)->GetByteArrayRegion(env, a, 0, 33, a_ref.compressed_form); + LDKNextMessageHop *ret_copy = MALLOC(sizeof(LDKNextMessageHop), "LDKNextMessageHop"); + *ret_copy = NextMessageHop_node_id(a_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1output(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); - val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val)); - StaticPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t a) { + LDKNextMessageHop *ret_copy = MALLOC(sizeof(LDKNextMessageHop), "LDKNextMessageHop"); + *ret_copy = NextMessageHop_short_channel_id(a); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *StaticPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv)); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKNextMessageHop* o_conv = (LDKNextMessageHop*)untag_ptr(o); + int64_t ret_conv = NextMessageHop_hash(o_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - StaticPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKNextMessageHop* a_conv = (LDKNextMessageHop*)untag_ptr(a); + LDKNextMessageHop* b_conv = (LDKNextMessageHop*)untag_ptr(b); + jboolean ret_conv = NextMessageHop_eq(a_conv, b_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageForwardNode_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKMessageForwardNode this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + MessageForwardNode_free(this_obj_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_MessageForwardNode_1get_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKMessageForwardNode this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = StaticPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, MessageForwardNode_get_node_id(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageForwardNode_1set_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKMessageForwardNode this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - StaticPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + MessageForwardNode_set_node_id(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1transaction_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageForwardNode_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKMessageForwardNode this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelTransactionParameters ret_var = StaticPaymentOutputDescriptor_get_channel_transaction_parameters(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = MessageForwardNode_get_short_channel_id(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1transaction_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageForwardNode_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKMessageForwardNode this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelTransactionParameters val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelTransactionParameters_clone(&val_conv); - StaticPaymentOutputDescriptor_set_channel_transaction_parameters(&this_ptr_conv, val_conv); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + MessageForwardNode_set_short_channel_id(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1new(JNIEnv *env, jclass clz, int64_t outpoint_arg, int64_t output_arg, int8_tArray channel_keys_id_arg, int64_t channel_value_satoshis_arg, int64_t channel_transaction_parameters_arg) { - LDKOutPoint outpoint_arg_conv; - outpoint_arg_conv.inner = untag_ptr(outpoint_arg); - outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); - outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); - void* output_arg_ptr = untag_ptr(output_arg); - CHECK_ACCESS(output_arg_ptr); - LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr); - output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg)); - LDKThirtyTwoBytes channel_keys_id_arg_ref; - CHECK((*env)->GetArrayLength(env, channel_keys_id_arg) == 32); - (*env)->GetByteArrayRegion(env, channel_keys_id_arg, 0, 32, channel_keys_id_arg_ref.data); - LDKChannelTransactionParameters channel_transaction_parameters_arg_conv; - channel_transaction_parameters_arg_conv.inner = untag_ptr(channel_transaction_parameters_arg); - channel_transaction_parameters_arg_conv.is_owned = ptr_is_owned(channel_transaction_parameters_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_transaction_parameters_arg_conv); - channel_transaction_parameters_arg_conv = ChannelTransactionParameters_clone(&channel_transaction_parameters_arg_conv); - LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_new(outpoint_arg_conv, output_arg_conv, channel_keys_id_arg_ref, channel_value_satoshis_arg, channel_transaction_parameters_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageForwardNode_1new(JNIEnv *env, jclass clz, int8_tArray node_id_arg, int64_t short_channel_id_arg) { + LDKPublicKey node_id_arg_ref; + CHECK((*env)->GetArrayLength(env, node_id_arg) == 33); + (*env)->GetByteArrayRegion(env, node_id_arg, 0, 33, node_id_arg_ref.compressed_form); + void* short_channel_id_arg_ptr = untag_ptr(short_channel_id_arg); + CHECK_ACCESS(short_channel_id_arg_ptr); + LDKCOption_u64Z short_channel_id_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_arg_ptr); + short_channel_id_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id_arg)); + LDKMessageForwardNode ret_var = MessageForwardNode_new(node_id_arg_ref, short_channel_id_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t StaticPaymentOutputDescriptor_clone_ptr(LDKStaticPaymentOutputDescriptor *NONNULL_PTR arg) { - LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(arg); +static inline uint64_t MessageForwardNode_clone_ptr(LDKMessageForwardNode *NONNULL_PTR arg) { + LDKMessageForwardNode ret_var = MessageForwardNode_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKStaticPaymentOutputDescriptor arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageForwardNode_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKMessageForwardNode arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = StaticPaymentOutputDescriptor_clone_ptr(&arg_conv); + int64_t ret_conv = MessageForwardNode_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKStaticPaymentOutputDescriptor orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageForwardNode_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKMessageForwardNode orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(&orig_conv); + LDKMessageForwardNode ret_var = MessageForwardNode_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKStaticPaymentOutputDescriptor o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageForwardNode_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKMessageForwardNode o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv.is_owned = false; - int64_t ret_conv = StaticPaymentOutputDescriptor_hash(&o_conv); + int64_t ret_conv = MessageForwardNode_hash(&o_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKStaticPaymentOutputDescriptor a_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_MessageForwardNode_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKMessageForwardNode a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKStaticPaymentOutputDescriptor b_conv; + LDKMessageForwardNode b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = StaticPaymentOutputDescriptor_eq(&a_conv, &b_conv); + jboolean ret_conv = MessageForwardNode_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1witness_1script(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKStaticPaymentOutputDescriptor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = StaticPaymentOutputDescriptor_witness_script(&this_arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageContext_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKMessageContext this_ptr_conv = *(LDKMessageContext*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + MessageContext_free(this_ptr_conv); +} + +static inline uint64_t MessageContext_clone_ptr(LDKMessageContext *NONNULL_PTR arg) { + LDKMessageContext *ret_copy = MALLOC(sizeof(LDKMessageContext), "LDKMessageContext"); + *ret_copy = MessageContext_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1max_1witness_1length(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKStaticPaymentOutputDescriptor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = StaticPaymentOutputDescriptor_max_witness_length(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageContext_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKMessageContext* arg_conv = (LDKMessageContext*)untag_ptr(arg); + int64_t ret_conv = MessageContext_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKStaticPaymentOutputDescriptor obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = StaticPaymentOutputDescriptor_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageContext_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKMessageContext* orig_conv = (LDKMessageContext*)untag_ptr(orig); + LDKMessageContext *ret_copy = MALLOC(sizeof(LDKMessageContext), "LDKMessageContext"); + *ret_copy = MessageContext_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); - *ret_conv = StaticPaymentOutputDescriptor_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageContext_1offers(JNIEnv *env, jclass clz, int64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKOffersContext a_conv = *(LDKOffersContext*)(a_ptr); + a_conv = OffersContext_clone((LDKOffersContext*)untag_ptr(a)); + LDKMessageContext *ret_copy = MALLOC(sizeof(LDKMessageContext), "LDKMessageContext"); + *ret_copy = MessageContext_offers(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageContext_1custom(JNIEnv *env, jclass clz, int8_tArray a) { + LDKCVec_u8Z a_ref; + a_ref.datalen = (*env)->GetArrayLength(env, a); + a_ref.data = MALLOC(a_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, a, 0, a_ref.datalen, a_ref.data); + LDKMessageContext *ret_copy = MALLOC(sizeof(LDKMessageContext), "LDKMessageContext"); + *ret_copy = MessageContext_custom(a_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OffersContext_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); CHECK_ACCESS(this_ptr_ptr); - LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)(this_ptr_ptr); + LDKOffersContext this_ptr_conv = *(LDKOffersContext*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - SpendableOutputDescriptor_free(this_ptr_conv); + OffersContext_free(this_ptr_conv); } -static inline uint64_t SpendableOutputDescriptor_clone_ptr(LDKSpendableOutputDescriptor *NONNULL_PTR arg) { - LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_copy = SpendableOutputDescriptor_clone(arg); +static inline uint64_t OffersContext_clone_ptr(LDKOffersContext *NONNULL_PTR arg) { + LDKOffersContext *ret_copy = MALLOC(sizeof(LDKOffersContext), "LDKOffersContext"); + *ret_copy = OffersContext_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKSpendableOutputDescriptor* arg_conv = (LDKSpendableOutputDescriptor*)untag_ptr(arg); - int64_t ret_conv = SpendableOutputDescriptor_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersContext_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKOffersContext* arg_conv = (LDKOffersContext*)untag_ptr(arg); + int64_t ret_conv = OffersContext_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKSpendableOutputDescriptor* orig_conv = (LDKSpendableOutputDescriptor*)untag_ptr(orig); - LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_copy = SpendableOutputDescriptor_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersContext_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKOffersContext* orig_conv = (LDKOffersContext*)untag_ptr(orig); + LDKOffersContext *ret_copy = MALLOC(sizeof(LDKOffersContext), "LDKOffersContext"); + *ret_copy = OffersContext_clone(orig_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1static_1output(JNIEnv *env, jclass clz, int64_t outpoint, int64_t output, int8_tArray channel_keys_id) { - LDKOutPoint outpoint_conv; - outpoint_conv.inner = untag_ptr(outpoint); - outpoint_conv.is_owned = ptr_is_owned(outpoint); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv); - outpoint_conv = OutPoint_clone(&outpoint_conv); - void* output_ptr = untag_ptr(output); - CHECK_ACCESS(output_ptr); - LDKTxOut output_conv = *(LDKTxOut*)(output_ptr); - output_conv = TxOut_clone((LDKTxOut*)untag_ptr(output)); - LDKThirtyTwoBytes channel_keys_id_ref; - CHECK((*env)->GetArrayLength(env, channel_keys_id) == 32); - (*env)->GetByteArrayRegion(env, channel_keys_id, 0, 32, channel_keys_id_ref.data); - LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_copy = SpendableOutputDescriptor_static_output(outpoint_conv, output_conv, channel_keys_id_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersContext_1invoice_1request(JNIEnv *env, jclass clz, int64_t nonce) { + LDKNonce nonce_conv; + nonce_conv.inner = untag_ptr(nonce); + nonce_conv.is_owned = ptr_is_owned(nonce); + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_conv); + nonce_conv = Nonce_clone(&nonce_conv); + LDKOffersContext *ret_copy = MALLOC(sizeof(LDKOffersContext), "LDKOffersContext"); + *ret_copy = OffersContext_invoice_request(nonce_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1delayed_1payment_1output(JNIEnv *env, jclass clz, int64_t a) { - LDKDelayedPaymentOutputDescriptor a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = DelayedPaymentOutputDescriptor_clone(&a_conv); - LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_copy = SpendableOutputDescriptor_delayed_payment_output(a_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersContext_1outbound_1payment(JNIEnv *env, jclass clz, int8_tArray payment_id, int64_t nonce, int8_tArray hmac) { + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + LDKNonce nonce_conv; + nonce_conv.inner = untag_ptr(nonce); + nonce_conv.is_owned = ptr_is_owned(nonce); + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_conv); + nonce_conv = Nonce_clone(&nonce_conv); + LDKThirtyTwoBytes hmac_ref; + CHECK((*env)->GetArrayLength(env, hmac) == 32); + (*env)->GetByteArrayRegion(env, hmac, 0, 32, hmac_ref.data); + LDKOffersContext *ret_copy = MALLOC(sizeof(LDKOffersContext), "LDKOffersContext"); + *ret_copy = OffersContext_outbound_payment(payment_id_ref, nonce_conv, hmac_ref); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1static_1payment_1output(JNIEnv *env, jclass clz, int64_t a) { - LDKStaticPaymentOutputDescriptor a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = StaticPaymentOutputDescriptor_clone(&a_conv); - LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_copy = SpendableOutputDescriptor_static_payment_output(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersContext_1inbound_1payment(JNIEnv *env, jclass clz, int8_tArray payment_hash) { + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + LDKOffersContext *ret_copy = MALLOC(sizeof(LDKOffersContext), "LDKOffersContext"); + *ret_copy = OffersContext_inbound_payment(payment_hash_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKSpendableOutputDescriptor* o_conv = (LDKSpendableOutputDescriptor*)untag_ptr(o); - int64_t ret_conv = SpendableOutputDescriptor_hash(o_conv); - return ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKSpendableOutputDescriptor* a_conv = (LDKSpendableOutputDescriptor*)untag_ptr(a); - LDKSpendableOutputDescriptor* b_conv = (LDKSpendableOutputDescriptor*)untag_ptr(b); - jboolean ret_conv = SpendableOutputDescriptor_eq(a_conv, b_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OffersContext_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKOffersContext* a_conv = (LDKOffersContext*)untag_ptr(a); + LDKOffersContext* b_conv = (LDKOffersContext*)untag_ptr(b); + jboolean ret_conv = OffersContext_eq(a_conv, b_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKSpendableOutputDescriptor* obj_conv = (LDKSpendableOutputDescriptor*)untag_ptr(obj); - LDKCVec_u8Z ret_var = SpendableOutputDescriptor_write(obj_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_MessageContext_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKMessageContext* obj_conv = (LDKMessageContext*)untag_ptr(obj); + LDKCVec_u8Z ret_var = MessageContext_write(obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageContext_1read(JNIEnv *env, jclass clz, int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); - *ret_conv = SpendableOutputDescriptor_read(ser_ref); + LDKCResult_MessageContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_MessageContextDecodeErrorZ), "LDKCResult_MessageContextDecodeErrorZ"); + *ret_conv = MessageContext_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1create_1spendable_1outputs_1psbt(JNIEnv *env, jclass clz, int64_tArray descriptors, int64_tArray outputs, int8_tArray change_destination_script, int32_t feerate_sat_per_1000_weight, int64_t locktime) { - LDKCVec_SpendableOutputDescriptorZ descriptors_constr; - descriptors_constr.datalen = (*env)->GetArrayLength(env, descriptors); - if (descriptors_constr.datalen > 0) - descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); - else - descriptors_constr.data = NULL; - int64_t* descriptors_vals = (*env)->GetLongArrayElements (env, descriptors, NULL); - for (size_t b = 0; b < descriptors_constr.datalen; b++) { - int64_t descriptors_conv_27 = descriptors_vals[b]; - void* descriptors_conv_27_ptr = untag_ptr(descriptors_conv_27); - CHECK_ACCESS(descriptors_conv_27_ptr); - LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr); - descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(descriptors_conv_27)); - descriptors_constr.data[b] = descriptors_conv_27_conv; - } - (*env)->ReleaseLongArrayElements(env, descriptors, descriptors_vals, 0); - LDKCVec_TxOutZ outputs_constr; - outputs_constr.datalen = (*env)->GetArrayLength(env, outputs); - if (outputs_constr.datalen > 0) - outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements"); - else - outputs_constr.data = NULL; - int64_t* outputs_vals = (*env)->GetLongArrayElements (env, outputs, NULL); - for (size_t h = 0; h < outputs_constr.datalen; h++) { - int64_t outputs_conv_7 = outputs_vals[h]; - void* outputs_conv_7_ptr = untag_ptr(outputs_conv_7); - CHECK_ACCESS(outputs_conv_7_ptr); - LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr); - outputs_conv_7_conv = TxOut_clone((LDKTxOut*)untag_ptr(outputs_conv_7)); - outputs_constr.data[h] = outputs_conv_7_conv; - } - (*env)->ReleaseLongArrayElements(env, outputs, outputs_vals, 0); - LDKCVec_u8Z change_destination_script_ref; - change_destination_script_ref.datalen = (*env)->GetArrayLength(env, change_destination_script); - change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, change_destination_script, 0, change_destination_script_ref.datalen, change_destination_script_ref.data); - void* locktime_ptr = untag_ptr(locktime); - CHECK_ACCESS(locktime_ptr); - LDKCOption_u32Z locktime_conv = *(LDKCOption_u32Z*)(locktime_ptr); - locktime_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(locktime)); - LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ), "LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ"); - *ret_conv = SpendableOutputDescriptor_create_spendable_outputs_psbt(descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight, locktime_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OffersContext_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKOffersContext* obj_conv = (LDKOffersContext*)untag_ptr(obj); + LDKCVec_u8Z ret_var = OffersContext_write(obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersContext_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_OffersContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersContextDecodeErrorZ), "LDKCResult_OffersContextDecodeErrorZ"); + *ret_conv = OffersContext_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelDerivationParameters this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelDerivationParameters_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingInfo_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKFundingInfo this_ptr_conv = *(LDKFundingInfo*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + FundingInfo_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1get_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDerivationParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelDerivationParameters_get_value_satoshis(&this_ptr_conv); +static inline uint64_t FundingInfo_clone_ptr(LDKFundingInfo *NONNULL_PTR arg) { + LDKFundingInfo *ret_copy = MALLOC(sizeof(LDKFundingInfo), "LDKFundingInfo"); + *ret_copy = FundingInfo_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKFundingInfo* arg_conv = (LDKFundingInfo*)untag_ptr(arg); + int64_t ret_conv = FundingInfo_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1set_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelDerivationParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelDerivationParameters_set_value_satoshis(&this_ptr_conv, val); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKFundingInfo* orig_conv = (LDKFundingInfo*)untag_ptr(orig); + LDKFundingInfo *ret_copy = MALLOC(sizeof(LDKFundingInfo), "LDKFundingInfo"); + *ret_copy = FundingInfo_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1get_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDerivationParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelDerivationParameters_get_keys_id(&this_ptr_conv)); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingInfo_1tx(JNIEnv *env, jclass clz, int8_tArray transaction) { + LDKTransaction transaction_ref; + transaction_ref.datalen = (*env)->GetArrayLength(env, transaction); + transaction_ref.data = MALLOC(transaction_ref.datalen, "LDKTransaction Bytes"); + (*env)->GetByteArrayRegion(env, transaction, 0, transaction_ref.datalen, transaction_ref.data); + transaction_ref.data_is_owned = true; + LDKFundingInfo *ret_copy = MALLOC(sizeof(LDKFundingInfo), "LDKFundingInfo"); + *ret_copy = FundingInfo_tx(transaction_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingInfo_1out_1point(JNIEnv *env, jclass clz, int64_t outpoint) { + LDKOutPoint outpoint_conv; + outpoint_conv.inner = untag_ptr(outpoint); + outpoint_conv.is_owned = ptr_is_owned(outpoint); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv); + outpoint_conv = OutPoint_clone(&outpoint_conv); + LDKFundingInfo *ret_copy = MALLOC(sizeof(LDKFundingInfo), "LDKFundingInfo"); + *ret_copy = FundingInfo_out_point(outpoint_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_FundingInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKFundingInfo* a_conv = (LDKFundingInfo*)untag_ptr(a); + LDKFundingInfo* b_conv = (LDKFundingInfo*)untag_ptr(b); + jboolean ret_conv = FundingInfo_eq(a_conv, b_conv); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingInfo_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKFundingInfo* obj_conv = (LDKFundingInfo*)untag_ptr(obj); + LDKCVec_u8Z ret_var = FundingInfo_write(obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1set_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKChannelDerivationParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - ChannelDerivationParameters_set_keys_id(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_FundingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingInfoDecodeErrorZ), "LDKCResult_FundingInfoDecodeErrorZ"); + *ret_conv = FundingInfo_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1get_1transaction_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDerivationParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelTransactionParameters ret_var = ChannelDerivationParameters_get_transaction_parameters(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKPaymentPurpose this_ptr_conv = *(LDKPaymentPurpose*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + PaymentPurpose_free(this_ptr_conv); +} + +static inline uint64_t PaymentPurpose_clone_ptr(LDKPaymentPurpose *NONNULL_PTR arg) { + LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); + *ret_copy = PaymentPurpose_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPaymentPurpose* arg_conv = (LDKPaymentPurpose*)untag_ptr(arg); + int64_t ret_conv = PaymentPurpose_clone_ptr(arg_conv); + return ret_conv; +} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1set_1transaction_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelDerivationParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelTransactionParameters val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelTransactionParameters_clone(&val_conv); - ChannelDerivationParameters_set_transaction_parameters(&this_ptr_conv, val_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPaymentPurpose* orig_conv = (LDKPaymentPurpose*)untag_ptr(orig); + LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); + *ret_copy = PaymentPurpose_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1new(JNIEnv *env, jclass clz, int64_t value_satoshis_arg, int8_tArray keys_id_arg, int64_t transaction_parameters_arg) { - LDKThirtyTwoBytes keys_id_arg_ref; - CHECK((*env)->GetArrayLength(env, keys_id_arg) == 32); - (*env)->GetByteArrayRegion(env, keys_id_arg, 0, 32, keys_id_arg_ref.data); - LDKChannelTransactionParameters transaction_parameters_arg_conv; - transaction_parameters_arg_conv.inner = untag_ptr(transaction_parameters_arg); - transaction_parameters_arg_conv.is_owned = ptr_is_owned(transaction_parameters_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(transaction_parameters_arg_conv); - transaction_parameters_arg_conv = ChannelTransactionParameters_clone(&transaction_parameters_arg_conv); - LDKChannelDerivationParameters ret_var = ChannelDerivationParameters_new(value_satoshis_arg, keys_id_arg_ref, transaction_parameters_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1bolt11_1invoice_1payment(JNIEnv *env, jclass clz, int64_t payment_preimage, int8_tArray payment_secret) { + void* payment_preimage_ptr = untag_ptr(payment_preimage); + CHECK_ACCESS(payment_preimage_ptr); + LDKCOption_ThirtyTwoBytesZ payment_preimage_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_preimage_ptr); + payment_preimage_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_preimage)); + LDKThirtyTwoBytes payment_secret_ref; + CHECK((*env)->GetArrayLength(env, payment_secret) == 32); + (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data); + LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); + *ret_copy = PaymentPurpose_bolt11_invoice_payment(payment_preimage_conv, payment_secret_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline uint64_t ChannelDerivationParameters_clone_ptr(LDKChannelDerivationParameters *NONNULL_PTR arg) { - LDKChannelDerivationParameters ret_var = ChannelDerivationParameters_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1bolt12_1offer_1payment(JNIEnv *env, jclass clz, int64_t payment_preimage, int8_tArray payment_secret, int64_t payment_context) { + void* payment_preimage_ptr = untag_ptr(payment_preimage); + CHECK_ACCESS(payment_preimage_ptr); + LDKCOption_ThirtyTwoBytesZ payment_preimage_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_preimage_ptr); + payment_preimage_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_preimage)); + LDKThirtyTwoBytes payment_secret_ref; + CHECK((*env)->GetArrayLength(env, payment_secret) == 32); + (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data); + LDKBolt12OfferContext payment_context_conv; + payment_context_conv.inner = untag_ptr(payment_context); + payment_context_conv.is_owned = ptr_is_owned(payment_context); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_context_conv); + payment_context_conv = Bolt12OfferContext_clone(&payment_context_conv); + LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); + *ret_copy = PaymentPurpose_bolt12_offer_payment(payment_preimage_conv, payment_secret_ref, payment_context_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelDerivationParameters arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = ChannelDerivationParameters_clone_ptr(&arg_conv); - return ret_conv; + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1bolt12_1refund_1payment(JNIEnv *env, jclass clz, int64_t payment_preimage, int8_tArray payment_secret, int64_t payment_context) { + void* payment_preimage_ptr = untag_ptr(payment_preimage); + CHECK_ACCESS(payment_preimage_ptr); + LDKCOption_ThirtyTwoBytesZ payment_preimage_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_preimage_ptr); + payment_preimage_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_preimage)); + LDKThirtyTwoBytes payment_secret_ref; + CHECK((*env)->GetArrayLength(env, payment_secret) == 32); + (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data); + LDKBolt12RefundContext payment_context_conv; + payment_context_conv.inner = untag_ptr(payment_context); + payment_context_conv.is_owned = ptr_is_owned(payment_context); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_context_conv); + payment_context_conv = Bolt12RefundContext_clone(&payment_context_conv); + LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); + *ret_copy = PaymentPurpose_bolt12_refund_payment(payment_preimage_conv, payment_secret_ref, payment_context_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelDerivationParameters orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKChannelDerivationParameters ret_var = ChannelDerivationParameters_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1spontaneous_1payment(JNIEnv *env, jclass clz, int8_tArray a) { + LDKThirtyTwoBytes a_ref; + CHECK((*env)->GetArrayLength(env, a) == 32); + (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data); + LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); + *ret_copy = PaymentPurpose_spontaneous_payment(a_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKChannelDerivationParameters a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKChannelDerivationParameters b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = ChannelDerivationParameters_eq(&a_conv, &b_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKPaymentPurpose* a_conv = (LDKPaymentPurpose*)untag_ptr(a); + LDKPaymentPurpose* b_conv = (LDKPaymentPurpose*)untag_ptr(b); + jboolean ret_conv = PaymentPurpose_eq(a_conv, b_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelDerivationParameters obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ChannelDerivationParameters_write(&obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1preimage(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKPaymentPurpose* this_arg_conv = (LDKPaymentPurpose*)untag_ptr(this_arg); + LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); + *ret_copy = PaymentPurpose_preimage(this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKPaymentPurpose* obj_conv = (LDKPaymentPurpose*)untag_ptr(obj); + LDKCVec_u8Z ret_var = PaymentPurpose_write(obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1read(JNIEnv *env, jclass clz, int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_ChannelDerivationParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDerivationParametersDecodeErrorZ), "LDKCResult_ChannelDerivationParametersDecodeErrorZ"); - *ret_conv = ChannelDerivationParameters_read(ser_ref); + LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); + *ret_conv = PaymentPurpose_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKHTLCDescriptor this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKClaimedHTLC this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - HTLCDescriptor_free(this_obj_conv); + ClaimedHTLC_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1channel_1derivation_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKHTLCDescriptor this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKClaimedHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelDerivationParameters ret_var = HTLCDescriptor_get_channel_derivation_parameters(&this_ptr_conv); + LDKChannelId ret_var = ClaimedHTLC_get_channel_id(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1channel_1derivation_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKHTLCDescriptor this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKClaimedHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelDerivationParameters val_conv; + LDKChannelId val_conv; val_conv.inner = untag_ptr(val); val_conv.is_owned = ptr_is_owned(val); CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelDerivationParameters_clone(&val_conv); - HTLCDescriptor_set_channel_derivation_parameters(&this_ptr_conv, val_conv); + val_conv = ChannelId_clone(&val_conv); + ClaimedHTLC_set_channel_id(&this_ptr_conv, val_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1commitment_1txid(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKHTLCDescriptor this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1get_1user_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKClaimedHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *HTLCDescriptor_get_commitment_txid(&this_ptr_conv)); + int8_tArray ret_arr = (*env)->NewByteArray(env, 16); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 16, ClaimedHTLC_get_user_channel_id(&this_ptr_conv).le_bytes); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1commitment_1txid(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKHTLCDescriptor this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1set_1user_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKClaimedHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - HTLCDescriptor_set_commitment_txid(&this_ptr_conv, val_ref); + LDKU128 val_ref; + CHECK((*env)->GetArrayLength(env, val) == 16); + (*env)->GetByteArrayRegion(env, val, 0, 16, val_ref.le_bytes); + ClaimedHTLC_set_user_channel_id(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1per_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKHTLCDescriptor this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1get_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKClaimedHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = HTLCDescriptor_get_per_commitment_number(&this_ptr_conv); + int32_t ret_conv = ClaimedHTLC_get_cltv_expiry(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1per_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKHTLCDescriptor this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1set_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKClaimedHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - HTLCDescriptor_set_per_commitment_number(&this_ptr_conv, val); + ClaimedHTLC_set_cltv_expiry(&this_ptr_conv, val); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKHTLCDescriptor this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1get_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKClaimedHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, HTLCDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form); - return ret_arr; + int64_t ret_conv = ClaimedHTLC_get_value_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKHTLCDescriptor this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1set_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKClaimedHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - HTLCDescriptor_set_per_commitment_point(&this_ptr_conv, val_ref); + ClaimedHTLC_set_value_msat(&this_ptr_conv, val); } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKHTLCDescriptor this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1get_1counterparty_1skimmed_1fee_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKClaimedHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int32_t ret_conv = HTLCDescriptor_get_feerate_per_kw(&this_ptr_conv); + int64_t ret_conv = ClaimedHTLC_get_counterparty_skimmed_fee_msat(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKHTLCDescriptor this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1set_1counterparty_1skimmed_1fee_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKClaimedHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - HTLCDescriptor_set_feerate_per_kw(&this_ptr_conv, val); + ClaimedHTLC_set_counterparty_skimmed_fee_msat(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1htlc(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKHTLCDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKHTLCOutputInCommitment ret_var = HTLCDescriptor_get_htlc(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1new(JNIEnv *env, jclass clz, int64_t channel_id_arg, int8_tArray user_channel_id_arg, int32_t cltv_expiry_arg, int64_t value_msat_arg, int64_t counterparty_skimmed_fee_msat_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); + LDKU128 user_channel_id_arg_ref; + CHECK((*env)->GetArrayLength(env, user_channel_id_arg) == 16); + (*env)->GetByteArrayRegion(env, user_channel_id_arg, 0, 16, user_channel_id_arg_ref.le_bytes); + LDKClaimedHTLC ret_var = ClaimedHTLC_new(channel_id_arg_conv, user_channel_id_arg_ref, cltv_expiry_arg, value_msat_arg, counterparty_skimmed_fee_msat_arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1htlc(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKHTLCDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKHTLCOutputInCommitment val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = HTLCOutputInCommitment_clone(&val_conv); - HTLCDescriptor_set_htlc(&this_ptr_conv, val_conv); +static inline uint64_t ClaimedHTLC_clone_ptr(LDKClaimedHTLC *NONNULL_PTR arg) { + LDKClaimedHTLC ret_var = ClaimedHTLC_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKClaimedHTLC arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = ClaimedHTLC_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1preimage(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKHTLCDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); - *ret_copy = HTLCDescriptor_get_preimage(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKClaimedHTLC orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKClaimedHTLC ret_var = ClaimedHTLC_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1preimage(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKHTLCDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_ThirtyTwoBytesZ val_conv = *(LDKCOption_ThirtyTwoBytesZ*)(val_ptr); - val_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(val)); - HTLCDescriptor_set_preimage(&this_ptr_conv, val_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKClaimedHTLC a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKClaimedHTLC b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ClaimedHTLC_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1counterparty_1sig(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKHTLCDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, HTLCDescriptor_get_counterparty_sig(&this_ptr_conv).compact_form); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKClaimedHTLC obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ClaimedHTLC_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1counterparty_1sig(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKHTLCDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKECDSASignature val_ref; - CHECK((*env)->GetArrayLength(env, val) == 64); - (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); - HTLCDescriptor_set_counterparty_sig(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_ClaimedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClaimedHTLCDecodeErrorZ), "LDKCResult_ClaimedHTLCDecodeErrorZ"); + *ret_conv = ClaimedHTLC_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1new(JNIEnv *env, jclass clz, int64_t channel_derivation_parameters_arg, int8_tArray commitment_txid_arg, int64_t per_commitment_number_arg, int8_tArray per_commitment_point_arg, int32_t feerate_per_kw_arg, int64_t htlc_arg, int64_t preimage_arg, int8_tArray counterparty_sig_arg) { - LDKChannelDerivationParameters channel_derivation_parameters_arg_conv; - channel_derivation_parameters_arg_conv.inner = untag_ptr(channel_derivation_parameters_arg); - channel_derivation_parameters_arg_conv.is_owned = ptr_is_owned(channel_derivation_parameters_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_derivation_parameters_arg_conv); - channel_derivation_parameters_arg_conv = ChannelDerivationParameters_clone(&channel_derivation_parameters_arg_conv); - LDKThirtyTwoBytes commitment_txid_arg_ref; - CHECK((*env)->GetArrayLength(env, commitment_txid_arg) == 32); - (*env)->GetByteArrayRegion(env, commitment_txid_arg, 0, 32, commitment_txid_arg_ref.data); - LDKPublicKey per_commitment_point_arg_ref; - CHECK((*env)->GetArrayLength(env, per_commitment_point_arg) == 33); - (*env)->GetByteArrayRegion(env, per_commitment_point_arg, 0, 33, per_commitment_point_arg_ref.compressed_form); - LDKHTLCOutputInCommitment htlc_arg_conv; - htlc_arg_conv.inner = untag_ptr(htlc_arg); - htlc_arg_conv.is_owned = ptr_is_owned(htlc_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_arg_conv); - htlc_arg_conv = HTLCOutputInCommitment_clone(&htlc_arg_conv); - void* preimage_arg_ptr = untag_ptr(preimage_arg); - CHECK_ACCESS(preimage_arg_ptr); - LDKCOption_ThirtyTwoBytesZ preimage_arg_conv = *(LDKCOption_ThirtyTwoBytesZ*)(preimage_arg_ptr); - preimage_arg_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(preimage_arg)); - LDKECDSASignature counterparty_sig_arg_ref; - CHECK((*env)->GetArrayLength(env, counterparty_sig_arg) == 64); - (*env)->GetByteArrayRegion(env, counterparty_sig_arg, 0, 64, counterparty_sig_arg_ref.compact_form); - LDKHTLCDescriptor ret_var = HTLCDescriptor_new(channel_derivation_parameters_arg_conv, commitment_txid_arg_ref, per_commitment_number_arg, per_commitment_point_arg_ref, feerate_per_kw_arg, htlc_arg_conv, preimage_arg_conv, counterparty_sig_arg_ref); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PathFailure_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKPathFailure this_ptr_conv = *(LDKPathFailure*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + PathFailure_free(this_ptr_conv); } -static inline uint64_t HTLCDescriptor_clone_ptr(LDKHTLCDescriptor *NONNULL_PTR arg) { - LDKHTLCDescriptor ret_var = HTLCDescriptor_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +static inline uint64_t PathFailure_clone_ptr(LDKPathFailure *NONNULL_PTR arg) { + LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure"); + *ret_copy = PathFailure_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKHTLCDescriptor arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = HTLCDescriptor_clone_ptr(&arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PathFailure_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPathFailure* arg_conv = (LDKPathFailure*)untag_ptr(arg); + int64_t ret_conv = PathFailure_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKHTLCDescriptor orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKHTLCDescriptor ret_var = HTLCDescriptor_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PathFailure_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPathFailure* orig_conv = (LDKPathFailure*)untag_ptr(orig); + LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure"); + *ret_copy = PathFailure_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKHTLCDescriptor a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKHTLCDescriptor b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = HTLCDescriptor_eq(&a_conv, &b_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PathFailure_1initial_1send(JNIEnv *env, jclass clz, int64_t err) { + void* err_ptr = untag_ptr(err); + CHECK_ACCESS(err_ptr); + LDKAPIError err_conv = *(LDKAPIError*)(err_ptr); + err_conv = APIError_clone((LDKAPIError*)untag_ptr(err)); + LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure"); + *ret_copy = PathFailure_initial_send(err_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PathFailure_1on_1path(JNIEnv *env, jclass clz, int64_t network_update) { + void* network_update_ptr = untag_ptr(network_update); + CHECK_ACCESS(network_update_ptr); + LDKCOption_NetworkUpdateZ network_update_conv = *(LDKCOption_NetworkUpdateZ*)(network_update_ptr); + network_update_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)untag_ptr(network_update)); + LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure"); + *ret_copy = PathFailure_on_path(network_update_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PathFailure_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKPathFailure* a_conv = (LDKPathFailure*)untag_ptr(a); + LDKPathFailure* b_conv = (LDKPathFailure*)untag_ptr(b); + jboolean ret_conv = PathFailure_eq(a_conv, b_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKHTLCDescriptor obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = HTLCDescriptor_write(&obj_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PathFailure_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKPathFailure* obj_conv = (LDKPathFailure*)untag_ptr(obj); + LDKCVec_u8Z ret_var = PathFailure_write(obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PathFailure_1read(JNIEnv *env, jclass clz, int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_HTLCDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCDescriptorDecodeErrorZ), "LDKCResult_HTLCDescriptorDecodeErrorZ"); - *ret_conv = HTLCDescriptor_read(ser_ref); + LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ"); + *ret_conv = PathFailure_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1outpoint(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKHTLCDescriptor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOutPoint ret_var = HTLCDescriptor_outpoint(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosureReason_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKClosureReason this_ptr_conv = *(LDKClosureReason*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + ClosureReason_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1previous_1utxo(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKHTLCDescriptor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); - *ret_ref = HTLCDescriptor_previous_utxo(&this_arg_conv); - return tag_ptr(ret_ref, true); +static inline uint64_t ClosureReason_clone_ptr(LDKClosureReason *NONNULL_PTR arg) { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKClosureReason* arg_conv = (LDKClosureReason*)untag_ptr(arg); + int64_t ret_conv = ClosureReason_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1unsigned_1tx_1input(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKHTLCDescriptor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKTxIn* ret_ref = MALLOC(sizeof(LDKTxIn), "LDKTxIn"); - *ret_ref = HTLCDescriptor_unsigned_tx_input(&this_arg_conv); - return tag_ptr(ret_ref, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKClosureReason* orig_conv = (LDKClosureReason*)untag_ptr(orig); + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1tx_1output(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKHTLCDescriptor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); - *ret_ref = HTLCDescriptor_tx_output(&this_arg_conv); - return tag_ptr(ret_ref, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1counterparty_1force_1closed(JNIEnv *env, jclass clz, int64_t peer_msg) { + LDKUntrustedString peer_msg_conv; + peer_msg_conv.inner = untag_ptr(peer_msg); + peer_msg_conv.is_owned = ptr_is_owned(peer_msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(peer_msg_conv); + peer_msg_conv = UntrustedString_clone(&peer_msg_conv); + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_counterparty_force_closed(peer_msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1witness_1script(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKHTLCDescriptor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_u8Z ret_var = HTLCDescriptor_witness_script(&this_arg_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1holder_1force_1closed(JNIEnv *env, jclass clz, int64_t broadcasted_latest_txn) { + void* broadcasted_latest_txn_ptr = untag_ptr(broadcasted_latest_txn); + CHECK_ACCESS(broadcasted_latest_txn_ptr); + LDKCOption_boolZ broadcasted_latest_txn_conv = *(LDKCOption_boolZ*)(broadcasted_latest_txn_ptr); + broadcasted_latest_txn_conv = COption_boolZ_clone((LDKCOption_boolZ*)untag_ptr(broadcasted_latest_txn)); + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_holder_force_closed(broadcasted_latest_txn_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1tx_1input_1witness(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray signature, int8_tArray witness_script) { - LDKHTLCDescriptor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKECDSASignature signature_ref; - CHECK((*env)->GetArrayLength(env, signature) == 64); - (*env)->GetByteArrayRegion(env, signature, 0, 64, signature_ref.compact_form); - LDKu8slice witness_script_ref; - witness_script_ref.datalen = (*env)->GetArrayLength(env, witness_script); - witness_script_ref.data = (*env)->GetByteArrayElements (env, witness_script, NULL); - LDKWitness ret_var = HTLCDescriptor_tx_input_witness(&this_arg_conv, signature_ref, witness_script_ref); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - Witness_free(ret_var); - (*env)->ReleaseByteArrayElements(env, witness_script, (int8_t*)witness_script_ref.data, 0); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1legacy_1cooperative_1closure(JNIEnv *env, jclass clz) { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_legacy_cooperative_closure(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1derive_1channel_1signer(JNIEnv *env, jclass clz, int64_t this_arg, int64_t signer_provider) { - LDKHTLCDescriptor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - void* signer_provider_ptr = untag_ptr(signer_provider); - if (ptr_is_owned(signer_provider)) { CHECK_ACCESS(signer_provider_ptr); } - LDKSignerProvider* signer_provider_conv = (LDKSignerProvider*)signer_provider_ptr; - LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner"); - *ret_ret = HTLCDescriptor_derive_channel_signer(&this_arg_conv, signer_provider_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1counterparty_1initiated_1cooperative_1closure(JNIEnv *env, jclass clz) { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_counterparty_initiated_cooperative_closure(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelSigner_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKChannelSigner this_ptr_conv = *(LDKChannelSigner*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - ChannelSigner_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1locally_1initiated_1cooperative_1closure(JNIEnv *env, jclass clz) { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_locally_initiated_cooperative_closure(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Recipient_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKRecipient* orig_conv = (LDKRecipient*)untag_ptr(orig); - jclass ret_conv = LDKRecipient_to_java(env, Recipient_clone(orig_conv)); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1commitment_1tx_1confirmed(JNIEnv *env, jclass clz) { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_commitment_tx_confirmed(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Recipient_1node(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKRecipient_to_java(env, Recipient_node()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1funding_1timed_1out(JNIEnv *env, jclass clz) { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_funding_timed_out(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Recipient_1phantom_1node(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKRecipient_to_java(env, Recipient_phantom_node()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1processing_1error(JNIEnv *env, jclass clz, jstring err) { + LDKStr err_conv = java_to_owned_str(env, err); + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_processing_error(err_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EntropySource_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKEntropySource this_ptr_conv = *(LDKEntropySource*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - EntropySource_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1disconnected_1peer(JNIEnv *env, jclass clz) { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_disconnected_peer(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeSigner_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKNodeSigner this_ptr_conv = *(LDKNodeSigner*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - NodeSigner_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1outdated_1channel_1manager(JNIEnv *env, jclass clz) { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_outdated_channel_manager(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutputSpender_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKOutputSpender this_ptr_conv = *(LDKOutputSpender*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - OutputSpender_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1counterparty_1coop_1closed_1unfunded_1channel(JNIEnv *env, jclass clz) { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_counterparty_coop_closed_unfunded_channel(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignerProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKSignerProvider this_ptr_conv = *(LDKSignerProvider*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - SignerProvider_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1funding_1batch_1closure(JNIEnv *env, jclass clz) { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_funding_batch_closure(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChangeDestinationSource_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKChangeDestinationSource this_ptr_conv = *(LDKChangeDestinationSource*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - ChangeDestinationSource_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1htlcs_1timed_1out(JNIEnv *env, jclass clz) { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_htlcs_timed_out(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKInMemorySigner this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InMemorySigner_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1peer_1feerate_1too_1low(JNIEnv *env, jclass clz, int32_t peer_feerate_sat_per_kw, int32_t required_feerate_sat_per_kw) { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_peer_feerate_too_low(peer_feerate_sat_per_kw, required_feerate_sat_per_kw); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1funding_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_funding_key(&this_ptr_conv)); - return ret_arr; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ClosureReason_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKClosureReason* a_conv = (LDKClosureReason*)untag_ptr(a); + LDKClosureReason* b_conv = (LDKClosureReason*)untag_ptr(b); + jboolean ret_conv = ClosureReason_eq(a_conv, b_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1funding_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKSecretKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); - InMemorySigner_set_funding_key(&this_ptr_conv, val_ref); +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ClosureReason_1to_1str(JNIEnv *env, jclass clz, int64_t o) { + LDKClosureReason* o_conv = (LDKClosureReason*)untag_ptr(o); + LDKStr ret_str = ClosureReason_to_str(o_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1revocation_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_revocation_base_key(&this_ptr_conv)); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosureReason_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKClosureReason* obj_conv = (LDKClosureReason*)untag_ptr(obj); + LDKCVec_u8Z ret_var = ClosureReason_write(obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1revocation_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKSecretKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); - InMemorySigner_set_revocation_base_key(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = ClosureReason_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_payment_key(&this_ptr_conv)); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKHTLCDestination this_ptr_conv = *(LDKHTLCDestination*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + HTLCDestination_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKSecretKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); - InMemorySigner_set_payment_key(&this_ptr_conv, val_ref); +static inline uint64_t HTLCDestination_clone_ptr(LDKHTLCDestination *NONNULL_PTR arg) { + LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); + *ret_copy = HTLCDestination_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKHTLCDestination* arg_conv = (LDKHTLCDestination*)untag_ptr(arg); + int64_t ret_conv = HTLCDestination_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1delayed_1payment_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_delayed_payment_base_key(&this_ptr_conv)); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKHTLCDestination* orig_conv = (LDKHTLCDestination*)untag_ptr(orig); + LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); + *ret_copy = HTLCDestination_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1delayed_1payment_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKSecretKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); - InMemorySigner_set_delayed_payment_base_key(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1next_1hop_1channel(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t channel_id) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); + LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); + *ret_copy = HTLCDestination_next_hop_channel(node_id_ref, channel_id_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1htlc_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_htlc_base_key(&this_ptr_conv)); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1htlc_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKSecretKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); - InMemorySigner_set_htlc_base_key(&this_ptr_conv, val_ref); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1commitment_1seed(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_commitment_seed(&this_ptr_conv)); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1unknown_1next_1hop(JNIEnv *env, jclass clz, int64_t requested_forward_scid) { + LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); + *ret_copy = HTLCDestination_unknown_next_hop(requested_forward_scid); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1commitment_1seed(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - InMemorySigner_set_commitment_seed(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1invalid_1forward(JNIEnv *env, jclass clz, int64_t requested_forward_scid) { + LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); + *ret_copy = HTLCDestination_invalid_forward(requested_forward_scid); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -static inline uint64_t InMemorySigner_clone_ptr(LDKInMemorySigner *NONNULL_PTR arg) { - LDKInMemorySigner ret_var = InMemorySigner_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1invalid_1onion(JNIEnv *env, jclass clz) { + LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); + *ret_copy = HTLCDestination_invalid_onion(); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKInMemorySigner arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = InMemorySigner_clone_ptr(&arg_conv); - return ret_conv; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKInMemorySigner orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKInMemorySigner ret_var = InMemorySigner_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1failed_1payment(JNIEnv *env, jclass clz, int8_tArray payment_hash) { + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); + *ret_copy = HTLCDestination_failed_payment(payment_hash_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1new(JNIEnv *env, jclass clz, int8_tArray funding_key, int8_tArray revocation_base_key, int8_tArray payment_key, int8_tArray delayed_payment_base_key, int8_tArray htlc_base_key, int8_tArray commitment_seed, int64_t channel_value_satoshis, int8_tArray channel_keys_id, int8_tArray rand_bytes_unique_start) { - LDKSecretKey funding_key_ref; - CHECK((*env)->GetArrayLength(env, funding_key) == 32); - (*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_ref.bytes); - LDKSecretKey revocation_base_key_ref; - CHECK((*env)->GetArrayLength(env, revocation_base_key) == 32); - (*env)->GetByteArrayRegion(env, revocation_base_key, 0, 32, revocation_base_key_ref.bytes); - LDKSecretKey payment_key_ref; - CHECK((*env)->GetArrayLength(env, payment_key) == 32); - (*env)->GetByteArrayRegion(env, payment_key, 0, 32, payment_key_ref.bytes); - LDKSecretKey delayed_payment_base_key_ref; - CHECK((*env)->GetArrayLength(env, delayed_payment_base_key) == 32); - (*env)->GetByteArrayRegion(env, delayed_payment_base_key, 0, 32, delayed_payment_base_key_ref.bytes); - LDKSecretKey htlc_base_key_ref; - CHECK((*env)->GetArrayLength(env, htlc_base_key) == 32); - (*env)->GetByteArrayRegion(env, htlc_base_key, 0, 32, htlc_base_key_ref.bytes); - LDKThirtyTwoBytes commitment_seed_ref; - CHECK((*env)->GetArrayLength(env, commitment_seed) == 32); - (*env)->GetByteArrayRegion(env, commitment_seed, 0, 32, commitment_seed_ref.data); - LDKThirtyTwoBytes channel_keys_id_ref; - CHECK((*env)->GetArrayLength(env, channel_keys_id) == 32); - (*env)->GetByteArrayRegion(env, channel_keys_id, 0, 32, channel_keys_id_ref.data); - LDKThirtyTwoBytes rand_bytes_unique_start_ref; - CHECK((*env)->GetArrayLength(env, rand_bytes_unique_start) == 32); - (*env)->GetByteArrayRegion(env, rand_bytes_unique_start, 0, 32, rand_bytes_unique_start_ref.data); - LDKInMemorySigner ret_var = InMemorySigner_new(funding_key_ref, revocation_base_key_ref, payment_key_ref, delayed_payment_base_key_ref, htlc_base_key_ref, commitment_seed_ref, channel_value_satoshis, channel_keys_id_ref, rand_bytes_unique_start_ref); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKHTLCDestination* a_conv = (LDKHTLCDestination*)untag_ptr(a); + LDKHTLCDestination* b_conv = (LDKHTLCDestination*)untag_ptr(b); + jboolean ret_conv = HTLCDestination_eq(a_conv, b_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterparty_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelPublicKeys ret_var = InMemorySigner_counterparty_pubkeys(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKHTLCDestination* obj_conv = (LDKHTLCDestination*)untag_ptr(obj); + LDKCVec_u8Z ret_var = HTLCDestination_write(obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterparty_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); - *ret_copy = InMemorySigner_counterparty_selected_contest_delay(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ"); + *ret_conv = HTLCDestination_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1holder_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); - *ret_copy = InMemorySigner_holder_selected_contest_delay(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPaymentFailureReason* orig_conv = (LDKPaymentFailureReason*)untag_ptr(orig); + jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_clone(orig_conv)); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_boolZ *ret_copy = MALLOC(sizeof(LDKCOption_boolZ), "LDKCOption_boolZ"); - *ret_copy = InMemorySigner_is_outbound(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1recipient_1rejected(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_recipient_rejected()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOutPoint ret_var = InMemorySigner_funding_outpoint(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1user_1abandoned(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_user_abandoned()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1channel_1parameters(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelTransactionParameters ret_var = InMemorySigner_get_channel_parameters(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1retries_1exhausted(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_retries_exhausted()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1channel_1type_1features(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelTypeFeatures ret_var = InMemorySigner_channel_type_features(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1payment_1expired(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_payment_expired()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1counterparty_1payment_1input(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray spend_tx, int64_t input_idx, int64_t descriptor) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKTransaction spend_tx_ref; - spend_tx_ref.datalen = (*env)->GetArrayLength(env, spend_tx); - spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); - (*env)->GetByteArrayRegion(env, spend_tx, 0, spend_tx_ref.datalen, spend_tx_ref.data); - spend_tx_ref.data_is_owned = true; - LDKStaticPaymentOutputDescriptor descriptor_conv; - descriptor_conv.inner = untag_ptr(descriptor); - descriptor_conv.is_owned = ptr_is_owned(descriptor); - CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); - descriptor_conv.is_owned = false; - LDKCResult_WitnessNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_WitnessNoneZ), "LDKCResult_WitnessNoneZ"); - *ret_conv = InMemorySigner_sign_counterparty_payment_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1route_1not_1found(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_route_not_found()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1dynamic_1p2wsh_1input(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray spend_tx, int64_t input_idx, int64_t descriptor) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKTransaction spend_tx_ref; - spend_tx_ref.datalen = (*env)->GetArrayLength(env, spend_tx); - spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); - (*env)->GetByteArrayRegion(env, spend_tx, 0, spend_tx_ref.datalen, spend_tx_ref.data); - spend_tx_ref.data_is_owned = true; - LDKDelayedPaymentOutputDescriptor descriptor_conv; - descriptor_conv.inner = untag_ptr(descriptor); - descriptor_conv.is_owned = ptr_is_owned(descriptor); - CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); - descriptor_conv.is_owned = false; - LDKCResult_WitnessNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_WitnessNoneZ), "LDKCResult_WitnessNoneZ"); - *ret_conv = InMemorySigner_sign_dynamic_p2wsh_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1unexpected_1error(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_unexpected_error()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1EntropySource(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource"); - *ret_ret = InMemorySigner_as_EntropySource(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1unknown_1required_1features(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_unknown_required_features()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1ChannelSigner(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelSigner* ret_ret = MALLOC(sizeof(LDKChannelSigner), "LDKChannelSigner"); - *ret_ret = InMemorySigner_as_ChannelSigner(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1invoice_1request_1expired(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_invoice_request_expired()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1EcdsaChannelSigner(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner"); - *ret_ret = InMemorySigner_as_EcdsaChannelSigner(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1invoice_1request_1rejected(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_invoice_request_rejected()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1WriteableEcdsaChannelSigner(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner"); - *ret_ret = InMemorySigner_as_WriteableEcdsaChannelSigner(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKPaymentFailureReason* a_conv = (LDKPaymentFailureReason*)untag_ptr(a); + LDKPaymentFailureReason* b_conv = (LDKPaymentFailureReason*)untag_ptr(b); + jboolean ret_conv = PaymentFailureReason_eq(a_conv, b_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKInMemorySigner obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = InMemorySigner_write(&obj_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKPaymentFailureReason* obj_conv = (LDKPaymentFailureReason*)untag_ptr(obj); + LDKCVec_u8Z ret_var = PaymentFailureReason_write(obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1read(JNIEnv *env, jclass clz, int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - void* arg_ptr = untag_ptr(arg); - CHECK_ACCESS(arg_ptr); - LDKEntropySource arg_conv = *(LDKEntropySource*)(arg_ptr); - if (arg_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&arg_conv); - } - LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); - *ret_conv = InMemorySigner_read(ser_ref, arg_conv); + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ), "LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ"); + *ret_conv = PaymentFailureReason_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKKeysManager this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - KeysManager_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Event_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKEvent this_ptr_conv = *(LDKEvent*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Event_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1new(JNIEnv *env, jclass clz, int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos) { - uint8_t seed_arr[32]; - CHECK((*env)->GetArrayLength(env, seed) == 32); - (*env)->GetByteArrayRegion(env, seed, 0, 32, seed_arr); - uint8_t (*seed_ref)[32] = &seed_arr; - LDKKeysManager ret_var = KeysManager_new(seed_ref, starting_time_secs, starting_time_nanos); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +static inline uint64_t Event_clone_ptr(LDKEvent *NONNULL_PTR arg) { + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKEvent* arg_conv = (LDKEvent*)untag_ptr(arg); + int64_t ret_conv = Event_clone_ptr(arg_conv); + return ret_conv; +} -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_KeysManager_1get_1node_1secret_1key(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKKeysManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, KeysManager_get_node_secret_key(&this_arg_conv).bytes); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKEvent* orig_conv = (LDKEvent*)untag_ptr(orig); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1derive_1channel_1keys(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_value_satoshis, int8_tArray params) { - LDKKeysManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - uint8_t params_arr[32]; - CHECK((*env)->GetArrayLength(env, params) == 32); - (*env)->GetByteArrayRegion(env, params, 0, 32, params_arr); - uint8_t (*params_ref)[32] = ¶ms_arr; - LDKInMemorySigner ret_var = KeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1funding_1generation_1ready(JNIEnv *env, jclass clz, int64_t temporary_channel_id, int8_tArray counterparty_node_id, int64_t channel_value_satoshis, int8_tArray output_script, int8_tArray user_channel_id) { + LDKChannelId temporary_channel_id_conv; + temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); + temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); + temporary_channel_id_conv = ChannelId_clone(&temporary_channel_id_conv); + LDKPublicKey counterparty_node_id_ref; + CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); + (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); + LDKCVec_u8Z output_script_ref; + output_script_ref.datalen = (*env)->GetArrayLength(env, output_script); + output_script_ref.data = MALLOC(output_script_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, output_script, 0, output_script_ref.datalen, output_script_ref.data); + LDKU128 user_channel_id_ref; + CHECK((*env)->GetArrayLength(env, user_channel_id) == 16); + (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_funding_generation_ready(temporary_channel_id_conv, counterparty_node_id_ref, channel_value_satoshis, output_script_ref, user_channel_id_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1sign_1spendable_1outputs_1psbt(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray descriptors, int8_tArray psbt) { - LDKKeysManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_SpendableOutputDescriptorZ descriptors_constr; - descriptors_constr.datalen = (*env)->GetArrayLength(env, descriptors); - if (descriptors_constr.datalen > 0) - descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); - else - descriptors_constr.data = NULL; - int64_t* descriptors_vals = (*env)->GetLongArrayElements (env, descriptors, NULL); - for (size_t b = 0; b < descriptors_constr.datalen; b++) { - int64_t descriptors_conv_27 = descriptors_vals[b]; - void* descriptors_conv_27_ptr = untag_ptr(descriptors_conv_27); - CHECK_ACCESS(descriptors_conv_27_ptr); - LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr); - descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(descriptors_conv_27)); - descriptors_constr.data[b] = descriptors_conv_27_conv; - } - (*env)->ReleaseLongArrayElements(env, descriptors, descriptors_vals, 0); - LDKCVec_u8Z psbt_ref; - psbt_ref.datalen = (*env)->GetArrayLength(env, psbt); - psbt_ref.data = MALLOC(psbt_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, psbt, 0, psbt_ref.datalen, psbt_ref.data); - LDKCResult_CVec_u8ZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZNoneZ), "LDKCResult_CVec_u8ZNoneZ"); - *ret_conv = KeysManager_sign_spendable_outputs_psbt(&this_arg_conv, descriptors_constr, psbt_ref); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1funding_1tx_1broadcast_1safe(JNIEnv *env, jclass clz, int64_t channel_id, int8_tArray user_channel_id, int64_t funding_txo, int8_tArray counterparty_node_id, int64_t former_temporary_channel_id) { + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); + LDKU128 user_channel_id_ref; + CHECK((*env)->GetArrayLength(env, user_channel_id) == 16); + (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes); + LDKOutPoint funding_txo_conv; + funding_txo_conv.inner = untag_ptr(funding_txo); + funding_txo_conv.is_owned = ptr_is_owned(funding_txo); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); + funding_txo_conv = OutPoint_clone(&funding_txo_conv); + LDKPublicKey counterparty_node_id_ref; + CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); + (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); + LDKChannelId former_temporary_channel_id_conv; + former_temporary_channel_id_conv.inner = untag_ptr(former_temporary_channel_id); + former_temporary_channel_id_conv.is_owned = ptr_is_owned(former_temporary_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(former_temporary_channel_id_conv); + former_temporary_channel_id_conv = ChannelId_clone(&former_temporary_channel_id_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_funding_tx_broadcast_safe(channel_id_conv, user_channel_id_ref, funding_txo_conv, counterparty_node_id_ref, former_temporary_channel_id_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1EntropySource(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKKeysManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource"); - *ret_ret = KeysManager_as_EntropySource(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1claimable(JNIEnv *env, jclass clz, int8_tArray receiver_node_id, int8_tArray payment_hash, int64_t onion_fields, int64_t amount_msat, int64_t counterparty_skimmed_fee_msat, int64_t purpose, int64_t via_channel_id, int64_t via_user_channel_id, int64_t claim_deadline) { + LDKPublicKey receiver_node_id_ref; + CHECK((*env)->GetArrayLength(env, receiver_node_id) == 33); + (*env)->GetByteArrayRegion(env, receiver_node_id, 0, 33, receiver_node_id_ref.compressed_form); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + LDKRecipientOnionFields onion_fields_conv; + onion_fields_conv.inner = untag_ptr(onion_fields); + onion_fields_conv.is_owned = ptr_is_owned(onion_fields); + CHECK_INNER_FIELD_ACCESS_OR_NULL(onion_fields_conv); + onion_fields_conv = RecipientOnionFields_clone(&onion_fields_conv); + void* purpose_ptr = untag_ptr(purpose); + CHECK_ACCESS(purpose_ptr); + LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr); + purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose)); + LDKChannelId via_channel_id_conv; + via_channel_id_conv.inner = untag_ptr(via_channel_id); + via_channel_id_conv.is_owned = ptr_is_owned(via_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(via_channel_id_conv); + via_channel_id_conv = ChannelId_clone(&via_channel_id_conv); + void* via_user_channel_id_ptr = untag_ptr(via_user_channel_id); + CHECK_ACCESS(via_user_channel_id_ptr); + LDKCOption_U128Z via_user_channel_id_conv = *(LDKCOption_U128Z*)(via_user_channel_id_ptr); + via_user_channel_id_conv = COption_U128Z_clone((LDKCOption_U128Z*)untag_ptr(via_user_channel_id)); + void* claim_deadline_ptr = untag_ptr(claim_deadline); + CHECK_ACCESS(claim_deadline_ptr); + LDKCOption_u32Z claim_deadline_conv = *(LDKCOption_u32Z*)(claim_deadline_ptr); + claim_deadline_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(claim_deadline)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_claimable(receiver_node_id_ref, payment_hash_ref, onion_fields_conv, amount_msat, counterparty_skimmed_fee_msat, purpose_conv, via_channel_id_conv, via_user_channel_id_conv, claim_deadline_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1NodeSigner(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKKeysManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeSigner* ret_ret = MALLOC(sizeof(LDKNodeSigner), "LDKNodeSigner"); - *ret_ret = KeysManager_as_NodeSigner(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1claimed(JNIEnv *env, jclass clz, int8_tArray receiver_node_id, int8_tArray payment_hash, int64_t amount_msat, int64_t purpose, int64_tArray htlcs, int64_t sender_intended_total_msat, int64_t onion_fields) { + LDKPublicKey receiver_node_id_ref; + CHECK((*env)->GetArrayLength(env, receiver_node_id) == 33); + (*env)->GetByteArrayRegion(env, receiver_node_id, 0, 33, receiver_node_id_ref.compressed_form); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + void* purpose_ptr = untag_ptr(purpose); + CHECK_ACCESS(purpose_ptr); + LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr); + purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose)); + LDKCVec_ClaimedHTLCZ htlcs_constr; + htlcs_constr.datalen = (*env)->GetArrayLength(env, htlcs); + if (htlcs_constr.datalen > 0) + htlcs_constr.data = MALLOC(htlcs_constr.datalen * sizeof(LDKClaimedHTLC), "LDKCVec_ClaimedHTLCZ Elements"); + else + htlcs_constr.data = NULL; + int64_t* htlcs_vals = (*env)->GetLongArrayElements (env, htlcs, NULL); + for (size_t n = 0; n < htlcs_constr.datalen; n++) { + int64_t htlcs_conv_13 = htlcs_vals[n]; + LDKClaimedHTLC htlcs_conv_13_conv; + htlcs_conv_13_conv.inner = untag_ptr(htlcs_conv_13); + htlcs_conv_13_conv.is_owned = ptr_is_owned(htlcs_conv_13); + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlcs_conv_13_conv); + htlcs_conv_13_conv = ClaimedHTLC_clone(&htlcs_conv_13_conv); + htlcs_constr.data[n] = htlcs_conv_13_conv; + } + (*env)->ReleaseLongArrayElements(env, htlcs, htlcs_vals, 0); + void* sender_intended_total_msat_ptr = untag_ptr(sender_intended_total_msat); + CHECK_ACCESS(sender_intended_total_msat_ptr); + LDKCOption_u64Z sender_intended_total_msat_conv = *(LDKCOption_u64Z*)(sender_intended_total_msat_ptr); + sender_intended_total_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(sender_intended_total_msat)); + LDKRecipientOnionFields onion_fields_conv; + onion_fields_conv.inner = untag_ptr(onion_fields); + onion_fields_conv.is_owned = ptr_is_owned(onion_fields); + CHECK_INNER_FIELD_ACCESS_OR_NULL(onion_fields_conv); + onion_fields_conv = RecipientOnionFields_clone(&onion_fields_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_claimed(receiver_node_id_ref, payment_hash_ref, amount_msat, purpose_conv, htlcs_constr, sender_intended_total_msat_conv, onion_fields_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1OutputSpender(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKKeysManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOutputSpender* ret_ret = MALLOC(sizeof(LDKOutputSpender), "LDKOutputSpender"); - *ret_ret = KeysManager_as_OutputSpender(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1connection_1needed(JNIEnv *env, jclass clz, int8_tArray node_id, int64_tArray addresses) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKCVec_SocketAddressZ addresses_constr; + addresses_constr.datalen = (*env)->GetArrayLength(env, addresses); + if (addresses_constr.datalen > 0) + addresses_constr.data = MALLOC(addresses_constr.datalen * sizeof(LDKSocketAddress), "LDKCVec_SocketAddressZ Elements"); + else + addresses_constr.data = NULL; + int64_t* addresses_vals = (*env)->GetLongArrayElements (env, addresses, NULL); + for (size_t p = 0; p < addresses_constr.datalen; p++) { + int64_t addresses_conv_15 = addresses_vals[p]; + void* addresses_conv_15_ptr = untag_ptr(addresses_conv_15); + CHECK_ACCESS(addresses_conv_15_ptr); + LDKSocketAddress addresses_conv_15_conv = *(LDKSocketAddress*)(addresses_conv_15_ptr); + addresses_conv_15_conv = SocketAddress_clone((LDKSocketAddress*)untag_ptr(addresses_conv_15)); + addresses_constr.data[p] = addresses_conv_15_conv; + } + (*env)->ReleaseLongArrayElements(env, addresses, addresses_vals, 0); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_connection_needed(node_id_ref, addresses_constr); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1SignerProvider(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKKeysManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKSignerProvider* ret_ret = MALLOC(sizeof(LDKSignerProvider), "LDKSignerProvider"); - *ret_ret = KeysManager_as_SignerProvider(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1invoice_1received(JNIEnv *env, jclass clz, int8_tArray payment_id, int64_t invoice, int64_t context, int64_t responder) { + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + LDKBolt12Invoice invoice_conv; + invoice_conv.inner = untag_ptr(invoice); + invoice_conv.is_owned = ptr_is_owned(invoice); + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); + invoice_conv = Bolt12Invoice_clone(&invoice_conv); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKCOption_OffersContextZ context_conv = *(LDKCOption_OffersContextZ*)(context_ptr); + context_conv = COption_OffersContextZ_clone((LDKCOption_OffersContextZ*)untag_ptr(context)); + LDKResponder responder_conv; + responder_conv.inner = untag_ptr(responder); + responder_conv.is_owned = ptr_is_owned(responder); + CHECK_INNER_FIELD_ACCESS_OR_NULL(responder_conv); + responder_conv = Responder_clone(&responder_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_invoice_received(payment_id_ref, invoice_conv, context_conv, responder_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKPhantomKeysManager this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PhantomKeysManager_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1sent(JNIEnv *env, jclass clz, int64_t payment_id, int8_tArray payment_preimage, int8_tArray payment_hash, int64_t fee_paid_msat) { + void* payment_id_ptr = untag_ptr(payment_id); + CHECK_ACCESS(payment_id_ptr); + LDKCOption_ThirtyTwoBytesZ payment_id_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_id_ptr); + payment_id_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_id)); + LDKThirtyTwoBytes payment_preimage_ref; + CHECK((*env)->GetArrayLength(env, payment_preimage) == 32); + (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + void* fee_paid_msat_ptr = untag_ptr(fee_paid_msat); + CHECK_ACCESS(fee_paid_msat_ptr); + LDKCOption_u64Z fee_paid_msat_conv = *(LDKCOption_u64Z*)(fee_paid_msat_ptr); + fee_paid_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(fee_paid_msat)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_sent(payment_id_conv, payment_preimage_ref, payment_hash_ref, fee_paid_msat_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1as_1EntropySource(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKPhantomKeysManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource"); - *ret_ret = PhantomKeysManager_as_EntropySource(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1failed(JNIEnv *env, jclass clz, int8_tArray payment_id, int64_t payment_hash, int64_t reason) { + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + void* payment_hash_ptr = untag_ptr(payment_hash); + CHECK_ACCESS(payment_hash_ptr); + LDKCOption_ThirtyTwoBytesZ payment_hash_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_ptr); + payment_hash_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash)); + void* reason_ptr = untag_ptr(reason); + CHECK_ACCESS(reason_ptr); + LDKCOption_PaymentFailureReasonZ reason_conv = *(LDKCOption_PaymentFailureReasonZ*)(reason_ptr); + reason_conv = COption_PaymentFailureReasonZ_clone((LDKCOption_PaymentFailureReasonZ*)untag_ptr(reason)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_failed(payment_id_ref, payment_hash_conv, reason_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1as_1NodeSigner(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKPhantomKeysManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeSigner* ret_ret = MALLOC(sizeof(LDKNodeSigner), "LDKNodeSigner"); - *ret_ret = PhantomKeysManager_as_NodeSigner(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1successful(JNIEnv *env, jclass clz, int8_tArray payment_id, int64_t payment_hash, int64_t path) { + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + void* payment_hash_ptr = untag_ptr(payment_hash); + CHECK_ACCESS(payment_hash_ptr); + LDKCOption_ThirtyTwoBytesZ payment_hash_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_ptr); + payment_hash_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash)); + LDKPath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv = Path_clone(&path_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_path_successful(payment_id_ref, payment_hash_conv, path_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1as_1OutputSpender(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKPhantomKeysManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOutputSpender* ret_ret = MALLOC(sizeof(LDKOutputSpender), "LDKOutputSpender"); - *ret_ret = PhantomKeysManager_as_OutputSpender(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1failed(JNIEnv *env, jclass clz, int64_t payment_id, int8_tArray payment_hash, jboolean payment_failed_permanently, int64_t failure, int64_t path, int64_t short_channel_id) { + void* payment_id_ptr = untag_ptr(payment_id); + CHECK_ACCESS(payment_id_ptr); + LDKCOption_ThirtyTwoBytesZ payment_id_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_id_ptr); + payment_id_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_id)); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + void* failure_ptr = untag_ptr(failure); + CHECK_ACCESS(failure_ptr); + LDKPathFailure failure_conv = *(LDKPathFailure*)(failure_ptr); + failure_conv = PathFailure_clone((LDKPathFailure*)untag_ptr(failure)); + LDKPath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv = Path_clone(&path_conv); + void* short_channel_id_ptr = untag_ptr(short_channel_id); + CHECK_ACCESS(short_channel_id_ptr); + LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr); + short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_path_failed(payment_id_conv, payment_hash_ref, payment_failed_permanently, failure_conv, path_conv, short_channel_id_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1as_1SignerProvider(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKPhantomKeysManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKSignerProvider* ret_ret = MALLOC(sizeof(LDKSignerProvider), "LDKSignerProvider"); - *ret_ret = PhantomKeysManager_as_SignerProvider(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1probe_1successful(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_hash, int64_t path) { + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + LDKPath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv = Path_clone(&path_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_probe_successful(payment_id_ref, payment_hash_ref, path_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1new(JNIEnv *env, jclass clz, int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos, int8_tArray cross_node_seed) { - uint8_t seed_arr[32]; - CHECK((*env)->GetArrayLength(env, seed) == 32); - (*env)->GetByteArrayRegion(env, seed, 0, 32, seed_arr); - uint8_t (*seed_ref)[32] = &seed_arr; - uint8_t cross_node_seed_arr[32]; - CHECK((*env)->GetArrayLength(env, cross_node_seed) == 32); - (*env)->GetByteArrayRegion(env, cross_node_seed, 0, 32, cross_node_seed_arr); - uint8_t (*cross_node_seed_ref)[32] = &cross_node_seed_arr; - LDKPhantomKeysManager ret_var = PhantomKeysManager_new(seed_ref, starting_time_secs, starting_time_nanos, cross_node_seed_ref); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1probe_1failed(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_hash, int64_t path, int64_t short_channel_id) { + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + LDKPath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv = Path_clone(&path_conv); + void* short_channel_id_ptr = untag_ptr(short_channel_id); + CHECK_ACCESS(short_channel_id_ptr); + LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr); + short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_probe_failed(payment_id_ref, payment_hash_ref, path_conv, short_channel_id_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1derive_1channel_1keys(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_value_satoshis, int8_tArray params) { - LDKPhantomKeysManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - uint8_t params_arr[32]; - CHECK((*env)->GetArrayLength(env, params) == 32); - (*env)->GetByteArrayRegion(env, params, 0, 32, params_arr); - uint8_t (*params_ref)[32] = ¶ms_arr; - LDKInMemorySigner ret_var = PhantomKeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1pending_1htlcs_1forwardable(JNIEnv *env, jclass clz, int64_t time_forwardable) { + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_pending_htlcs_forwardable(time_forwardable); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1get_1node_1secret_1key(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKPhantomKeysManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, PhantomKeysManager_get_node_secret_key(&this_arg_conv).bytes); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1htlcintercepted(JNIEnv *env, jclass clz, int8_tArray intercept_id, int64_t requested_next_hop_scid, int8_tArray payment_hash, int64_t inbound_amount_msat, int64_t expected_outbound_amount_msat) { + LDKThirtyTwoBytes intercept_id_ref; + CHECK((*env)->GetArrayLength(env, intercept_id) == 32); + (*env)->GetByteArrayRegion(env, intercept_id, 0, 32, intercept_id_ref.data); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_htlcintercepted(intercept_id_ref, requested_next_hop_scid, payment_hash_ref, inbound_amount_msat, expected_outbound_amount_msat); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1get_1phantom_1node_1secret_1key(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKPhantomKeysManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, PhantomKeysManager_get_phantom_node_secret_key(&this_arg_conv).bytes); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1spendable_1outputs(JNIEnv *env, jclass clz, int64_tArray outputs, int64_t channel_id) { + LDKCVec_SpendableOutputDescriptorZ outputs_constr; + outputs_constr.datalen = (*env)->GetArrayLength(env, outputs); + if (outputs_constr.datalen > 0) + outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); + else + outputs_constr.data = NULL; + int64_t* outputs_vals = (*env)->GetLongArrayElements (env, outputs, NULL); + for (size_t b = 0; b < outputs_constr.datalen; b++) { + int64_t outputs_conv_27 = outputs_vals[b]; + void* outputs_conv_27_ptr = untag_ptr(outputs_conv_27); + CHECK_ACCESS(outputs_conv_27_ptr); + LDKSpendableOutputDescriptor outputs_conv_27_conv = *(LDKSpendableOutputDescriptor*)(outputs_conv_27_ptr); + outputs_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(outputs_conv_27)); + outputs_constr.data[b] = outputs_conv_27_conv; + } + (*env)->ReleaseLongArrayElements(env, outputs, outputs_vals, 0); + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_spendable_outputs(outputs_constr, channel_id_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RandomBytes_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKRandomBytes this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - RandomBytes_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1forwarded(JNIEnv *env, jclass clz, int64_t prev_channel_id, int64_t next_channel_id, int64_t prev_user_channel_id, int64_t next_user_channel_id, int64_t total_fee_earned_msat, int64_t skimmed_fee_msat, jboolean claim_from_onchain_tx, int64_t outbound_amount_forwarded_msat) { + LDKChannelId prev_channel_id_conv; + prev_channel_id_conv.inner = untag_ptr(prev_channel_id); + prev_channel_id_conv.is_owned = ptr_is_owned(prev_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(prev_channel_id_conv); + prev_channel_id_conv = ChannelId_clone(&prev_channel_id_conv); + LDKChannelId next_channel_id_conv; + next_channel_id_conv.inner = untag_ptr(next_channel_id); + next_channel_id_conv.is_owned = ptr_is_owned(next_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(next_channel_id_conv); + next_channel_id_conv = ChannelId_clone(&next_channel_id_conv); + void* prev_user_channel_id_ptr = untag_ptr(prev_user_channel_id); + CHECK_ACCESS(prev_user_channel_id_ptr); + LDKCOption_U128Z prev_user_channel_id_conv = *(LDKCOption_U128Z*)(prev_user_channel_id_ptr); + prev_user_channel_id_conv = COption_U128Z_clone((LDKCOption_U128Z*)untag_ptr(prev_user_channel_id)); + void* next_user_channel_id_ptr = untag_ptr(next_user_channel_id); + CHECK_ACCESS(next_user_channel_id_ptr); + LDKCOption_U128Z next_user_channel_id_conv = *(LDKCOption_U128Z*)(next_user_channel_id_ptr); + next_user_channel_id_conv = COption_U128Z_clone((LDKCOption_U128Z*)untag_ptr(next_user_channel_id)); + void* total_fee_earned_msat_ptr = untag_ptr(total_fee_earned_msat); + CHECK_ACCESS(total_fee_earned_msat_ptr); + LDKCOption_u64Z total_fee_earned_msat_conv = *(LDKCOption_u64Z*)(total_fee_earned_msat_ptr); + total_fee_earned_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(total_fee_earned_msat)); + void* skimmed_fee_msat_ptr = untag_ptr(skimmed_fee_msat); + CHECK_ACCESS(skimmed_fee_msat_ptr); + LDKCOption_u64Z skimmed_fee_msat_conv = *(LDKCOption_u64Z*)(skimmed_fee_msat_ptr); + skimmed_fee_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(skimmed_fee_msat)); + void* outbound_amount_forwarded_msat_ptr = untag_ptr(outbound_amount_forwarded_msat); + CHECK_ACCESS(outbound_amount_forwarded_msat_ptr); + LDKCOption_u64Z outbound_amount_forwarded_msat_conv = *(LDKCOption_u64Z*)(outbound_amount_forwarded_msat_ptr); + outbound_amount_forwarded_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_amount_forwarded_msat)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_forwarded(prev_channel_id_conv, next_channel_id_conv, prev_user_channel_id_conv, next_user_channel_id_conv, total_fee_earned_msat_conv, skimmed_fee_msat_conv, claim_from_onchain_tx, outbound_amount_forwarded_msat_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RandomBytes_1new(JNIEnv *env, jclass clz, int8_tArray seed) { - LDKThirtyTwoBytes seed_ref; - CHECK((*env)->GetArrayLength(env, seed) == 32); - (*env)->GetByteArrayRegion(env, seed, 0, 32, seed_ref.data); - LDKRandomBytes ret_var = RandomBytes_new(seed_ref); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1channel_1pending(JNIEnv *env, jclass clz, int64_t channel_id, int8_tArray user_channel_id, int64_t former_temporary_channel_id, int8_tArray counterparty_node_id, int64_t funding_txo, int64_t channel_type) { + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); + LDKU128 user_channel_id_ref; + CHECK((*env)->GetArrayLength(env, user_channel_id) == 16); + (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes); + LDKChannelId former_temporary_channel_id_conv; + former_temporary_channel_id_conv.inner = untag_ptr(former_temporary_channel_id); + former_temporary_channel_id_conv.is_owned = ptr_is_owned(former_temporary_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(former_temporary_channel_id_conv); + former_temporary_channel_id_conv = ChannelId_clone(&former_temporary_channel_id_conv); + LDKPublicKey counterparty_node_id_ref; + CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); + (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); + LDKOutPoint funding_txo_conv; + funding_txo_conv.inner = untag_ptr(funding_txo); + funding_txo_conv.is_owned = ptr_is_owned(funding_txo); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); + funding_txo_conv = OutPoint_clone(&funding_txo_conv); + LDKChannelTypeFeatures channel_type_conv; + channel_type_conv.inner = untag_ptr(channel_type); + channel_type_conv.is_owned = ptr_is_owned(channel_type); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_conv); + channel_type_conv = ChannelTypeFeatures_clone(&channel_type_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_channel_pending(channel_id_conv, user_channel_id_ref, former_temporary_channel_id_conv, counterparty_node_id_ref, funding_txo_conv, channel_type_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RandomBytes_1as_1EntropySource(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKRandomBytes this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource"); - *ret_ret = RandomBytes_as_EntropySource(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1channel_1ready(JNIEnv *env, jclass clz, int64_t channel_id, int8_tArray user_channel_id, int8_tArray counterparty_node_id, int64_t channel_type) { + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); + LDKU128 user_channel_id_ref; + CHECK((*env)->GetArrayLength(env, user_channel_id) == 16); + (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes); + LDKPublicKey counterparty_node_id_ref; + CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); + (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); + LDKChannelTypeFeatures channel_type_conv; + channel_type_conv.inner = untag_ptr(channel_type); + channel_type_conv.is_owned = ptr_is_owned(channel_type); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_conv); + channel_type_conv = ChannelTypeFeatures_clone(&channel_type_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_channel_ready(channel_id_conv, user_channel_id_ref, counterparty_node_id_ref, channel_type_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EcdsaChannelSigner_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKEcdsaChannelSigner this_ptr_conv = *(LDKEcdsaChannelSigner*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - EcdsaChannelSigner_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1channel_1closed(JNIEnv *env, jclass clz, int64_t channel_id, int8_tArray user_channel_id, int64_t reason, int8_tArray counterparty_node_id, int64_t channel_capacity_sats, int64_t channel_funding_txo) { + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); + LDKU128 user_channel_id_ref; + CHECK((*env)->GetArrayLength(env, user_channel_id) == 16); + (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes); + void* reason_ptr = untag_ptr(reason); + CHECK_ACCESS(reason_ptr); + LDKClosureReason reason_conv = *(LDKClosureReason*)(reason_ptr); + reason_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(reason)); + LDKPublicKey counterparty_node_id_ref; + CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); + (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); + void* channel_capacity_sats_ptr = untag_ptr(channel_capacity_sats); + CHECK_ACCESS(channel_capacity_sats_ptr); + LDKCOption_u64Z channel_capacity_sats_conv = *(LDKCOption_u64Z*)(channel_capacity_sats_ptr); + channel_capacity_sats_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(channel_capacity_sats)); + LDKOutPoint channel_funding_txo_conv; + channel_funding_txo_conv.inner = untag_ptr(channel_funding_txo); + channel_funding_txo_conv.is_owned = ptr_is_owned(channel_funding_txo); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_funding_txo_conv); + channel_funding_txo_conv = OutPoint_clone(&channel_funding_txo_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_channel_closed(channel_id_conv, user_channel_id_ref, reason_conv, counterparty_node_id_ref, channel_capacity_sats_conv, channel_funding_txo_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -static inline uint64_t WriteableEcdsaChannelSigner_clone_ptr(LDKWriteableEcdsaChannelSigner *NONNULL_PTR arg) { - LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner"); - *ret_ret = WriteableEcdsaChannelSigner_clone(arg); - return tag_ptr(ret_ret, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WriteableEcdsaChannelSigner_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - void* arg_ptr = untag_ptr(arg); - if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); } - LDKWriteableEcdsaChannelSigner* arg_conv = (LDKWriteableEcdsaChannelSigner*)arg_ptr; - int64_t ret_conv = WriteableEcdsaChannelSigner_clone_ptr(arg_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1discard_1funding(JNIEnv *env, jclass clz, int64_t channel_id, int64_t funding_info) { + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); + void* funding_info_ptr = untag_ptr(funding_info); + CHECK_ACCESS(funding_info_ptr); + LDKFundingInfo funding_info_conv = *(LDKFundingInfo*)(funding_info_ptr); + funding_info_conv = FundingInfo_clone((LDKFundingInfo*)untag_ptr(funding_info)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_discard_funding(channel_id_conv, funding_info_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WriteableEcdsaChannelSigner_1clone(JNIEnv *env, jclass clz, int64_t orig) { - void* orig_ptr = untag_ptr(orig); - if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); } - LDKWriteableEcdsaChannelSigner* orig_conv = (LDKWriteableEcdsaChannelSigner*)orig_ptr; - LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner"); - *ret_ret = WriteableEcdsaChannelSigner_clone(orig_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1open_1channel_1request(JNIEnv *env, jclass clz, int64_t temporary_channel_id, int8_tArray counterparty_node_id, int64_t funding_satoshis, int64_t push_msat, int64_t channel_type, jboolean is_announced, int64_t params) { + LDKChannelId temporary_channel_id_conv; + temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); + temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); + temporary_channel_id_conv = ChannelId_clone(&temporary_channel_id_conv); + LDKPublicKey counterparty_node_id_ref; + CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); + (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); + LDKChannelTypeFeatures channel_type_conv; + channel_type_conv.inner = untag_ptr(channel_type); + channel_type_conv.is_owned = ptr_is_owned(channel_type); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_conv); + channel_type_conv = ChannelTypeFeatures_clone(&channel_type_conv); + LDKChannelParameters params_conv; + params_conv.inner = untag_ptr(params); + params_conv.is_owned = ptr_is_owned(params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); + params_conv = ChannelParameters_clone(¶ms_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_open_channel_request(temporary_channel_id_conv, counterparty_node_id_ref, funding_satoshis, push_msat, channel_type_conv, is_announced, params_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WriteableEcdsaChannelSigner_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKWriteableEcdsaChannelSigner this_ptr_conv = *(LDKWriteableEcdsaChannelSigner*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - WriteableEcdsaChannelSigner_free(this_ptr_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKOnionMessenger this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - OnionMessenger_free(this_obj_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageRouter_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKMessageRouter this_ptr_conv = *(LDKMessageRouter*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - MessageRouter_free(this_ptr_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DefaultMessageRouter_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKDefaultMessageRouter this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - DefaultMessageRouter_free(this_obj_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultMessageRouter_1new(JNIEnv *env, jclass clz, int64_t network_graph, int64_t entropy_source) { - LDKNetworkGraph network_graph_conv; - network_graph_conv.inner = untag_ptr(network_graph); - network_graph_conv.is_owned = ptr_is_owned(network_graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - network_graph_conv.is_owned = false; - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - LDKDefaultMessageRouter ret_var = DefaultMessageRouter_new(&network_graph_conv, entropy_source_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1htlchandling_1failed(JNIEnv *env, jclass clz, int64_t prev_channel_id, int64_t failed_next_destination) { + LDKChannelId prev_channel_id_conv; + prev_channel_id_conv.inner = untag_ptr(prev_channel_id); + prev_channel_id_conv.is_owned = ptr_is_owned(prev_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(prev_channel_id_conv); + prev_channel_id_conv = ChannelId_clone(&prev_channel_id_conv); + void* failed_next_destination_ptr = untag_ptr(failed_next_destination); + CHECK_ACCESS(failed_next_destination_ptr); + LDKHTLCDestination failed_next_destination_conv = *(LDKHTLCDestination*)(failed_next_destination_ptr); + failed_next_destination_conv = HTLCDestination_clone((LDKHTLCDestination*)untag_ptr(failed_next_destination)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_htlchandling_failed(prev_channel_id_conv, failed_next_destination_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultMessageRouter_1as_1MessageRouter(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKDefaultMessageRouter this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKMessageRouter* ret_ret = MALLOC(sizeof(LDKMessageRouter), "LDKMessageRouter"); - *ret_ret = DefaultMessageRouter_as_MessageRouter(&this_arg_conv); - return tag_ptr(ret_ret, true); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKOnionMessagePath this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - OnionMessagePath_free(this_obj_conv); -} - -JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1get_1intermediate_1nodes(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOnionMessagePath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_PublicKeyZ ret_var = OnionMessagePath_get_intermediate_nodes(&this_ptr_conv); - jobjectArray ret_arr = NULL; - ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); - ; - for (size_t i = 0; i < ret_var.datalen; i++) { - int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 33, ret_var.data[i].compressed_form); - (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); - } - - FREE(ret_var.data); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1set_1intermediate_1nodes(JNIEnv *env, jclass clz, int64_t this_ptr, jobjectArray val) { - LDKOnionMessagePath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_PublicKeyZ val_constr; - val_constr.datalen = (*env)->GetArrayLength(env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); - else - val_constr.data = NULL; - for (size_t i = 0; i < val_constr.datalen; i++) { - int8_tArray val_conv_8 = (*env)->GetObjectArrayElement(env, val, i); - LDKPublicKey val_conv_8_ref; - CHECK((*env)->GetArrayLength(env, val_conv_8) == 33); - (*env)->GetByteArrayRegion(env, val_conv_8, 0, 33, val_conv_8_ref.compressed_form); - val_constr.data[i] = val_conv_8_ref; - } - OnionMessagePath_set_intermediate_nodes(&this_ptr_conv, val_constr); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1get_1destination(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOnionMessagePath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); - *ret_copy = OnionMessagePath_get_destination(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1bump_1transaction(JNIEnv *env, jclass clz, int64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKBumpTransactionEvent a_conv = *(LDKBumpTransactionEvent*)(a_ptr); + a_conv = BumpTransactionEvent_clone((LDKBumpTransactionEvent*)untag_ptr(a)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_bump_transaction(a_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1set_1destination(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKOnionMessagePath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKDestination val_conv = *(LDKDestination*)(val_ptr); - val_conv = Destination_clone((LDKDestination*)untag_ptr(val)); - OnionMessagePath_set_destination(&this_ptr_conv, val_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1get_1first_1node_1addresses(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOnionMessagePath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_CVec_SocketAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_SocketAddressZZ), "LDKCOption_CVec_SocketAddressZZ"); - *ret_copy = OnionMessagePath_get_first_node_addresses(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1onion_1message_1intercepted(JNIEnv *env, jclass clz, int8_tArray peer_node_id, int64_t message) { + LDKPublicKey peer_node_id_ref; + CHECK((*env)->GetArrayLength(env, peer_node_id) == 33); + (*env)->GetByteArrayRegion(env, peer_node_id, 0, 33, peer_node_id_ref.compressed_form); + LDKOnionMessage message_conv; + message_conv.inner = untag_ptr(message); + message_conv.is_owned = ptr_is_owned(message); + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_conv); + message_conv = OnionMessage_clone(&message_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_onion_message_intercepted(peer_node_id_ref, message_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1set_1first_1node_1addresses(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKOnionMessagePath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_CVec_SocketAddressZZ val_conv = *(LDKCOption_CVec_SocketAddressZZ*)(val_ptr); - val_conv = COption_CVec_SocketAddressZZ_clone((LDKCOption_CVec_SocketAddressZZ*)untag_ptr(val)); - OnionMessagePath_set_first_node_addresses(&this_ptr_conv, val_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1new(JNIEnv *env, jclass clz, jobjectArray intermediate_nodes_arg, int64_t destination_arg, int64_t first_node_addresses_arg) { - LDKCVec_PublicKeyZ intermediate_nodes_arg_constr; - intermediate_nodes_arg_constr.datalen = (*env)->GetArrayLength(env, intermediate_nodes_arg); - if (intermediate_nodes_arg_constr.datalen > 0) - intermediate_nodes_arg_constr.data = MALLOC(intermediate_nodes_arg_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); - else - intermediate_nodes_arg_constr.data = NULL; - for (size_t i = 0; i < intermediate_nodes_arg_constr.datalen; i++) { - int8_tArray intermediate_nodes_arg_conv_8 = (*env)->GetObjectArrayElement(env, intermediate_nodes_arg, i); - LDKPublicKey intermediate_nodes_arg_conv_8_ref; - CHECK((*env)->GetArrayLength(env, intermediate_nodes_arg_conv_8) == 33); - (*env)->GetByteArrayRegion(env, intermediate_nodes_arg_conv_8, 0, 33, intermediate_nodes_arg_conv_8_ref.compressed_form); - intermediate_nodes_arg_constr.data[i] = intermediate_nodes_arg_conv_8_ref; - } - void* destination_arg_ptr = untag_ptr(destination_arg); - CHECK_ACCESS(destination_arg_ptr); - LDKDestination destination_arg_conv = *(LDKDestination*)(destination_arg_ptr); - destination_arg_conv = Destination_clone((LDKDestination*)untag_ptr(destination_arg)); - void* first_node_addresses_arg_ptr = untag_ptr(first_node_addresses_arg); - CHECK_ACCESS(first_node_addresses_arg_ptr); - LDKCOption_CVec_SocketAddressZZ first_node_addresses_arg_conv = *(LDKCOption_CVec_SocketAddressZZ*)(first_node_addresses_arg_ptr); - LDKOnionMessagePath ret_var = OnionMessagePath_new(intermediate_nodes_arg_constr, destination_arg_conv, first_node_addresses_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1onion_1message_1peer_1connected(JNIEnv *env, jclass clz, int8_tArray peer_node_id) { + LDKPublicKey peer_node_id_ref; + CHECK((*env)->GetArrayLength(env, peer_node_id) == 33); + (*env)->GetByteArrayRegion(env, peer_node_id, 0, 33, peer_node_id_ref.compressed_form); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_onion_message_peer_connected(peer_node_id_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline uint64_t OnionMessagePath_clone_ptr(LDKOnionMessagePath *NONNULL_PTR arg) { - LDKOnionMessagePath ret_var = OnionMessagePath_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKOnionMessagePath arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = OnionMessagePath_clone_ptr(&arg_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Event_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKEvent* a_conv = (LDKEvent*)untag_ptr(a); + LDKEvent* b_conv = (LDKEvent*)untag_ptr(b); + jboolean ret_conv = Event_eq(a_conv, b_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKOnionMessagePath orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKOnionMessagePath ret_var = OnionMessagePath_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Event_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKEvent* obj_conv = (LDKEvent*)untag_ptr(obj); + LDKCVec_u8Z ret_var = Event_write(obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1first_1node(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOnionMessagePath this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OnionMessagePath_first_node(&this_arg_conv).compressed_form); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = Event_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Destination_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); CHECK_ACCESS(this_ptr_ptr); - LDKDestination this_ptr_conv = *(LDKDestination*)(this_ptr_ptr); + LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - Destination_free(this_ptr_conv); + MessageSendEvent_free(this_ptr_conv); } -static inline uint64_t Destination_clone_ptr(LDKDestination *NONNULL_PTR arg) { - LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); - *ret_copy = Destination_clone(arg); +static inline uint64_t MessageSendEvent_clone_ptr(LDKMessageSendEvent *NONNULL_PTR arg) { + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKDestination* arg_conv = (LDKDestination*)untag_ptr(arg); - int64_t ret_conv = Destination_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKMessageSendEvent* arg_conv = (LDKMessageSendEvent*)untag_ptr(arg); + int64_t ret_conv = MessageSendEvent_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKDestination* orig_conv = (LDKDestination*)untag_ptr(orig); - LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); - *ret_copy = Destination_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKMessageSendEvent* orig_conv = (LDKMessageSendEvent*)untag_ptr(orig); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_clone(orig_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1node(JNIEnv *env, jclass clz, int8_tArray a) { - LDKPublicKey a_ref; - CHECK((*env)->GetArrayLength(env, a) == 33); - (*env)->GetByteArrayRegion(env, a, 0, 33, a_ref.compressed_form); - LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); - *ret_copy = Destination_node(a_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1accept_1channel(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKAcceptChannel msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = AcceptChannel_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_accept_channel(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1blinded_1path(JNIEnv *env, jclass clz, int64_t a) { - LDKBlindedPath a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = BlindedPath_clone(&a_conv); - LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); - *ret_copy = Destination_blinded_path(a_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1accept_1channel_1v2(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKAcceptChannelV2 msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = AcceptChannelV2_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_accept_channel_v2(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKDestination* o_conv = (LDKDestination*)untag_ptr(o); - int64_t ret_conv = Destination_hash(o_conv); - return ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Destination_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKDestination* a_conv = (LDKDestination*)untag_ptr(a); - LDKDestination* b_conv = (LDKDestination*)untag_ptr(b); - jboolean ret_conv = Destination_eq(a_conv, b_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Destination_1resolve(JNIEnv *env, jclass clz, int64_t this_arg, int64_t network_graph) { - LDKDestination* this_arg_conv = (LDKDestination*)untag_ptr(this_arg); - LDKReadOnlyNetworkGraph network_graph_conv; - network_graph_conv.inner = untag_ptr(network_graph); - network_graph_conv.is_owned = ptr_is_owned(network_graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - network_graph_conv.is_owned = false; - Destination_resolve(this_arg_conv, &network_graph_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SendSuccess_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKSendSuccess this_ptr_conv = *(LDKSendSuccess*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - SendSuccess_free(this_ptr_conv); -} - -static inline uint64_t SendSuccess_clone_ptr(LDKSendSuccess *NONNULL_PTR arg) { - LDKSendSuccess *ret_copy = MALLOC(sizeof(LDKSendSuccess), "LDKSendSuccess"); - *ret_copy = SendSuccess_clone(arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1open_1channel(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKOpenChannel msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = OpenChannel_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_open_channel(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendSuccess_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKSendSuccess* arg_conv = (LDKSendSuccess*)untag_ptr(arg); - int64_t ret_conv = SendSuccess_clone_ptr(arg_conv); - return ret_conv; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendSuccess_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKSendSuccess* orig_conv = (LDKSendSuccess*)untag_ptr(orig); - LDKSendSuccess *ret_copy = MALLOC(sizeof(LDKSendSuccess), "LDKSendSuccess"); - *ret_copy = SendSuccess_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1open_1channel_1v2(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKOpenChannelV2 msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = OpenChannelV2_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_open_channel_v2(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendSuccess_1buffered(JNIEnv *env, jclass clz) { - LDKSendSuccess *ret_copy = MALLOC(sizeof(LDKSendSuccess), "LDKSendSuccess"); - *ret_copy = SendSuccess_buffered(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1funding_1created(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKFundingCreated msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = FundingCreated_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_funding_created(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendSuccess_1buffered_1awaiting_1connection(JNIEnv *env, jclass clz, int8_tArray a) { - LDKPublicKey a_ref; - CHECK((*env)->GetArrayLength(env, a) == 33); - (*env)->GetByteArrayRegion(env, a, 0, 33, a_ref.compressed_form); - LDKSendSuccess *ret_copy = MALLOC(sizeof(LDKSendSuccess), "LDKSendSuccess"); - *ret_copy = SendSuccess_buffered_awaiting_connection(a_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1funding_1signed(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKFundingSigned msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = FundingSigned_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_funding_signed(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendSuccess_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKSendSuccess* o_conv = (LDKSendSuccess*)untag_ptr(o); - int64_t ret_conv = SendSuccess_hash(o_conv); - return ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SendSuccess_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKSendSuccess* a_conv = (LDKSendSuccess*)untag_ptr(a); - LDKSendSuccess* b_conv = (LDKSendSuccess*)untag_ptr(b); - jboolean ret_conv = SendSuccess_eq(a_conv, b_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SendError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKSendError this_ptr_conv = *(LDKSendError*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - SendError_free(this_ptr_conv); -} - -static inline uint64_t SendError_clone_ptr(LDKSendError *NONNULL_PTR arg) { - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_clone(arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1stfu(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKStfu msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = Stfu_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_stfu(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKSendError* arg_conv = (LDKSendError*)untag_ptr(arg); - int64_t ret_conv = SendError_clone_ptr(arg_conv); - return ret_conv; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKSendError* orig_conv = (LDKSendError*)untag_ptr(orig); - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1splice_1init(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKSpliceInit msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = SpliceInit_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_splice_init(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1secp256k1(JNIEnv *env, jclass clz, jclass a) { - LDKSecp256k1Error a_conv = LDKSecp256k1Error_from_java(env, a); - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_secp256k1(a_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1splice_1ack(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKSpliceAck msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = SpliceAck_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_splice_ack(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1too_1big_1packet(JNIEnv *env, jclass clz) { - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_too_big_packet(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1splice_1locked(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKSpliceLocked msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = SpliceLocked_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_splice_locked(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1too_1few_1blinded_1hops(JNIEnv *env, jclass clz) { - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_too_few_blinded_hops(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1add_1input(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKTxAddInput msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = TxAddInput_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_tx_add_input(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1invalid_1first_1hop(JNIEnv *env, jclass clz, int8_tArray a) { - LDKPublicKey a_ref; - CHECK((*env)->GetArrayLength(env, a) == 33); - (*env)->GetByteArrayRegion(env, a, 0, 33, a_ref.compressed_form); - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_invalid_first_hop(a_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1add_1output(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKTxAddOutput msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = TxAddOutput_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_tx_add_output(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1path_1not_1found(JNIEnv *env, jclass clz) { - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_path_not_found(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1remove_1input(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKTxRemoveInput msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = TxRemoveInput_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_tx_remove_input(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1invalid_1message(JNIEnv *env, jclass clz) { - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_invalid_message(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1remove_1output(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKTxRemoveOutput msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = TxRemoveOutput_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_tx_remove_output(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1buffer_1full(JNIEnv *env, jclass clz) { - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_buffer_full(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1complete(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKTxComplete msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = TxComplete_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_tx_complete(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1get_1node_1id_1failed(JNIEnv *env, jclass clz) { - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_get_node_id_failed(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1signatures(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKTxSignatures msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = TxSignatures_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_tx_signatures(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1unresolved_1introduction_1node(JNIEnv *env, jclass clz) { - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_unresolved_introduction_node(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1init_1rbf(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKTxInitRbf msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = TxInitRbf_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_tx_init_rbf(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1blinded_1path_1advance_1failed(JNIEnv *env, jclass clz) { - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_blinded_path_advance_failed(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1ack_1rbf(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKTxAckRbf msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = TxAckRbf_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_tx_ack_rbf(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKSendError* o_conv = (LDKSendError*)untag_ptr(o); - int64_t ret_conv = SendError_hash(o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1abort(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKTxAbort msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = TxAbort_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_tx_abort(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SendError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKSendError* a_conv = (LDKSendError*)untag_ptr(a); - LDKSendError* b_conv = (LDKSendError*)untag_ptr(b); - jboolean ret_conv = SendError_eq(a_conv, b_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1ready(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKChannelReady msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = ChannelReady_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_channel_ready(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKCustomOnionMessageHandler this_ptr_conv = *(LDKCustomOnionMessageHandler*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - CustomOnionMessageHandler_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1announcement_1signatures(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKAnnouncementSignatures msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = AnnouncementSignatures_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_announcement_signatures(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeeledOnion_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKPeeledOnion this_ptr_conv = *(LDKPeeledOnion*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - PeeledOnion_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1update_1htlcs(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t updates) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKCommitmentUpdate updates_conv; + updates_conv.inner = untag_ptr(updates); + updates_conv.is_owned = ptr_is_owned(updates); + CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv); + updates_conv = CommitmentUpdate_clone(&updates_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_update_htlcs(node_id_ref, updates_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -static inline uint64_t PeeledOnion_clone_ptr(LDKPeeledOnion *NONNULL_PTR arg) { - LDKPeeledOnion *ret_copy = MALLOC(sizeof(LDKPeeledOnion), "LDKPeeledOnion"); - *ret_copy = PeeledOnion_clone(arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1revoke_1and_1ack(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKRevokeAndACK msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = RevokeAndACK_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_revoke_and_ack(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeeledOnion_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKPeeledOnion* arg_conv = (LDKPeeledOnion*)untag_ptr(arg); - int64_t ret_conv = PeeledOnion_clone_ptr(arg_conv); - return ret_conv; + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1closing_1signed(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKClosingSigned msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = ClosingSigned_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_closing_signed(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeeledOnion_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPeeledOnion* orig_conv = (LDKPeeledOnion*)untag_ptr(orig); - LDKPeeledOnion *ret_copy = MALLOC(sizeof(LDKPeeledOnion), "LDKPeeledOnion"); - *ret_copy = PeeledOnion_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1shutdown(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKShutdown msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = Shutdown_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_shutdown(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeeledOnion_1forward(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKNextMessageHop a_conv = *(LDKNextMessageHop*)(a_ptr); - a_conv = NextMessageHop_clone((LDKNextMessageHop*)untag_ptr(a)); - LDKOnionMessage b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv = OnionMessage_clone(&b_conv); - LDKPeeledOnion *ret_copy = MALLOC(sizeof(LDKPeeledOnion), "LDKPeeledOnion"); - *ret_copy = PeeledOnion_forward(a_conv, b_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1reestablish(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKChannelReestablish msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = ChannelReestablish_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_channel_reestablish(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeeledOnion_1receive(JNIEnv *env, jclass clz, int64_t a, int8_tArray b, int64_t c) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKParsedOnionMessageContents a_conv = *(LDKParsedOnionMessageContents*)(a_ptr); - a_conv = ParsedOnionMessageContents_clone((LDKParsedOnionMessageContents*)untag_ptr(a)); - LDKThirtyTwoBytes b_ref; - CHECK((*env)->GetArrayLength(env, b) == 32); - (*env)->GetByteArrayRegion(env, b, 0, 32, b_ref.data); - LDKBlindedPath c_conv; - c_conv.inner = untag_ptr(c); - c_conv.is_owned = ptr_is_owned(c); - CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv); - c_conv = BlindedPath_clone(&c_conv); - LDKPeeledOnion *ret_copy = MALLOC(sizeof(LDKPeeledOnion), "LDKPeeledOnion"); - *ret_copy = PeeledOnion_receive(a_conv, b_ref, c_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1announcement(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg, int64_t update_msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKChannelAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = ChannelAnnouncement_clone(&msg_conv); + LDKChannelUpdate update_msg_conv; + update_msg_conv.inner = untag_ptr(update_msg); + update_msg_conv.is_owned = ptr_is_owned(update_msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv); + update_msg_conv = ChannelUpdate_clone(&update_msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_channel_announcement(node_id_ref, msg_conv, update_msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1onion_1message_1resolving_1destination(JNIEnv *env, jclass clz, int64_t entropy_source, int64_t node_signer, int64_t node_id_lookup, int64_t network_graph, int64_t path, int64_t contents, int64_t reply_path) { - void* entropy_source_ptr = untag_ptr(entropy_source); - if (ptr_is_owned(entropy_source)) { CHECK_ACCESS(entropy_source_ptr); } - LDKEntropySource* entropy_source_conv = (LDKEntropySource*)entropy_source_ptr; - void* node_signer_ptr = untag_ptr(node_signer); - if (ptr_is_owned(node_signer)) { CHECK_ACCESS(node_signer_ptr); } - LDKNodeSigner* node_signer_conv = (LDKNodeSigner*)node_signer_ptr; - void* node_id_lookup_ptr = untag_ptr(node_id_lookup); - if (ptr_is_owned(node_id_lookup)) { CHECK_ACCESS(node_id_lookup_ptr); } - LDKNodeIdLookUp* node_id_lookup_conv = (LDKNodeIdLookUp*)node_id_lookup_ptr; - LDKReadOnlyNetworkGraph network_graph_conv; - network_graph_conv.inner = untag_ptr(network_graph); - network_graph_conv.is_owned = ptr_is_owned(network_graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - network_graph_conv.is_owned = false; - LDKOnionMessagePath path_conv; - path_conv.inner = untag_ptr(path); - path_conv.is_owned = ptr_is_owned(path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); - path_conv = OnionMessagePath_clone(&path_conv); - void* contents_ptr = untag_ptr(contents); - CHECK_ACCESS(contents_ptr); - LDKOnionMessageContents contents_conv = *(LDKOnionMessageContents*)(contents_ptr); - if (contents_conv.free == LDKOnionMessageContents_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKOnionMessageContents_JCalls_cloned(&contents_conv); - } - LDKBlindedPath reply_path_conv; - reply_path_conv.inner = untag_ptr(reply_path); - reply_path_conv.is_owned = ptr_is_owned(reply_path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(reply_path_conv); - reply_path_conv = BlindedPath_clone(&reply_path_conv); - LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ), "LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ"); - *ret_conv = create_onion_message_resolving_destination(entropy_source_conv, node_signer_conv, node_id_lookup_conv, &network_graph_conv, path_conv, contents_conv, reply_path_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1channel_1announcement(JNIEnv *env, jclass clz, int64_t msg, int64_t update_msg) { + LDKChannelAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = ChannelAnnouncement_clone(&msg_conv); + LDKChannelUpdate update_msg_conv; + update_msg_conv.inner = untag_ptr(update_msg); + update_msg_conv.is_owned = ptr_is_owned(update_msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv); + update_msg_conv = ChannelUpdate_clone(&update_msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_broadcast_channel_announcement(msg_conv, update_msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1onion_1message(JNIEnv *env, jclass clz, int64_t entropy_source, int64_t node_signer, int64_t node_id_lookup, int64_t path, int64_t contents, int64_t reply_path) { - void* entropy_source_ptr = untag_ptr(entropy_source); - if (ptr_is_owned(entropy_source)) { CHECK_ACCESS(entropy_source_ptr); } - LDKEntropySource* entropy_source_conv = (LDKEntropySource*)entropy_source_ptr; - void* node_signer_ptr = untag_ptr(node_signer); - if (ptr_is_owned(node_signer)) { CHECK_ACCESS(node_signer_ptr); } - LDKNodeSigner* node_signer_conv = (LDKNodeSigner*)node_signer_ptr; - void* node_id_lookup_ptr = untag_ptr(node_id_lookup); - if (ptr_is_owned(node_id_lookup)) { CHECK_ACCESS(node_id_lookup_ptr); } - LDKNodeIdLookUp* node_id_lookup_conv = (LDKNodeIdLookUp*)node_id_lookup_ptr; - LDKOnionMessagePath path_conv; - path_conv.inner = untag_ptr(path); - path_conv.is_owned = ptr_is_owned(path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); - path_conv = OnionMessagePath_clone(&path_conv); - void* contents_ptr = untag_ptr(contents); - CHECK_ACCESS(contents_ptr); - LDKOnionMessageContents contents_conv = *(LDKOnionMessageContents*)(contents_ptr); - if (contents_conv.free == LDKOnionMessageContents_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKOnionMessageContents_JCalls_cloned(&contents_conv); - } - LDKBlindedPath reply_path_conv; - reply_path_conv.inner = untag_ptr(reply_path); - reply_path_conv.is_owned = ptr_is_owned(reply_path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(reply_path_conv); - reply_path_conv = BlindedPath_clone(&reply_path_conv); - LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ), "LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ"); - *ret_conv = create_onion_message(entropy_source_conv, node_signer_conv, node_id_lookup_conv, path_conv, contents_conv, reply_path_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1channel_1update(JNIEnv *env, jclass clz, int64_t msg) { + LDKChannelUpdate msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = ChannelUpdate_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_broadcast_channel_update(msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_peel_1onion_1message(JNIEnv *env, jclass clz, int64_t msg, int64_t node_signer, int64_t logger, int64_t custom_handler) { - LDKOnionMessage msg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1node_1announcement(JNIEnv *env, jclass clz, int64_t msg) { + LDKNodeAnnouncement msg_conv; msg_conv.inner = untag_ptr(msg); msg_conv.is_owned = ptr_is_owned(msg); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - void* custom_handler_ptr = untag_ptr(custom_handler); - CHECK_ACCESS(custom_handler_ptr); - LDKCustomOnionMessageHandler custom_handler_conv = *(LDKCustomOnionMessageHandler*)(custom_handler_ptr); - if (custom_handler_conv.free == LDKCustomOnionMessageHandler_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKCustomOnionMessageHandler_JCalls_cloned(&custom_handler_conv); - } - LDKCResult_PeeledOnionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PeeledOnionNoneZ), "LDKCResult_PeeledOnionNoneZ"); - *ret_conv = peel_onion_message(&msg_conv, node_signer_conv, logger_conv, custom_handler_conv); - return tag_ptr(ret_conv, true); + msg_conv = NodeAnnouncement_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_broadcast_node_announcement(msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1new(JNIEnv *env, jclass clz, int64_t entropy_source, int64_t node_signer, int64_t logger, int64_t node_id_lookup, int64_t message_router, int64_t offers_handler, int64_t custom_handler) { - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - void* node_id_lookup_ptr = untag_ptr(node_id_lookup); - CHECK_ACCESS(node_id_lookup_ptr); - LDKNodeIdLookUp node_id_lookup_conv = *(LDKNodeIdLookUp*)(node_id_lookup_ptr); - if (node_id_lookup_conv.free == LDKNodeIdLookUp_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeIdLookUp_JCalls_cloned(&node_id_lookup_conv); - } - void* message_router_ptr = untag_ptr(message_router); - CHECK_ACCESS(message_router_ptr); - LDKMessageRouter message_router_conv = *(LDKMessageRouter*)(message_router_ptr); - if (message_router_conv.free == LDKMessageRouter_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKMessageRouter_JCalls_cloned(&message_router_conv); - } - void* offers_handler_ptr = untag_ptr(offers_handler); - CHECK_ACCESS(offers_handler_ptr); - LDKOffersMessageHandler offers_handler_conv = *(LDKOffersMessageHandler*)(offers_handler_ptr); - if (offers_handler_conv.free == LDKOffersMessageHandler_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKOffersMessageHandler_JCalls_cloned(&offers_handler_conv); - } - void* custom_handler_ptr = untag_ptr(custom_handler); - CHECK_ACCESS(custom_handler_ptr); - LDKCustomOnionMessageHandler custom_handler_conv = *(LDKCustomOnionMessageHandler*)(custom_handler_ptr); - if (custom_handler_conv.free == LDKCustomOnionMessageHandler_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKCustomOnionMessageHandler_JCalls_cloned(&custom_handler_conv); - } - LDKOnionMessenger ret_var = OnionMessenger_new(entropy_source_conv, node_signer_conv, logger_conv, node_id_lookup_conv, message_router_conv, offers_handler_conv, custom_handler_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1update(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKChannelUpdate msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = ChannelUpdate_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_channel_update(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1send_1onion_1message(JNIEnv *env, jclass clz, int64_t this_arg, int64_t contents, int64_t destination, int64_t reply_path) { - LDKOnionMessenger this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - void* contents_ptr = untag_ptr(contents); - CHECK_ACCESS(contents_ptr); - LDKOnionMessageContents contents_conv = *(LDKOnionMessageContents*)(contents_ptr); - if (contents_conv.free == LDKOnionMessageContents_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKOnionMessageContents_JCalls_cloned(&contents_conv); - } - void* destination_ptr = untag_ptr(destination); - CHECK_ACCESS(destination_ptr); - LDKDestination destination_conv = *(LDKDestination*)(destination_ptr); - destination_conv = Destination_clone((LDKDestination*)untag_ptr(destination)); - LDKBlindedPath reply_path_conv; - reply_path_conv.inner = untag_ptr(reply_path); - reply_path_conv.is_owned = ptr_is_owned(reply_path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(reply_path_conv); - reply_path_conv = BlindedPath_clone(&reply_path_conv); - LDKCResult_SendSuccessSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SendSuccessSendErrorZ), "LDKCResult_SendSuccessSendErrorZ"); - *ret_conv = OnionMessenger_send_onion_message(&this_arg_conv, contents_conv, destination_conv, reply_path_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1handle_1error(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t action) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + void* action_ptr = untag_ptr(action); + CHECK_ACCESS(action_ptr); + LDKErrorAction action_conv = *(LDKErrorAction*)(action_ptr); + action_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(action)); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_handle_error(node_id_ref, action_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1as_1OnionMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOnionMessenger this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOnionMessageHandler* ret_ret = MALLOC(sizeof(LDKOnionMessageHandler), "LDKOnionMessageHandler"); - *ret_ret = OnionMessenger_as_OnionMessageHandler(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1range_1query(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKQueryChannelRange msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = QueryChannelRange_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_channel_range_query(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OffersMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1short_1ids_1query(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKQueryShortChannelIds msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = QueryShortChannelIds_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_short_ids_query(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1reply_1channel_1range(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKReplyChannelRange msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = ReplyChannelRange_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_reply_channel_range(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1gossip_1timestamp_1filter(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKGossipTimestampFilter msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = GossipTimestampFilter_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_gossip_timestamp_filter(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); CHECK_ACCESS(this_ptr_ptr); - LDKOffersMessageHandler this_ptr_conv = *(LDKOffersMessageHandler*)(this_ptr_ptr); + LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - OffersMessageHandler_free(this_ptr_conv); + MessageSendEventsProvider_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OffersMessage_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); CHECK_ACCESS(this_ptr_ptr); - LDKOffersMessage this_ptr_conv = *(LDKOffersMessage*)(this_ptr_ptr); + LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - OffersMessage_free(this_ptr_conv); -} - -static inline uint64_t OffersMessage_clone_ptr(LDKOffersMessage *NONNULL_PTR arg) { - LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); - *ret_copy = OffersMessage_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKOffersMessage* arg_conv = (LDKOffersMessage*)untag_ptr(arg); - int64_t ret_conv = OffersMessage_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessage_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKOffersMessage* orig_conv = (LDKOffersMessage*)untag_ptr(orig); - LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); - *ret_copy = OffersMessage_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + EventsProvider_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessage_1invoice_1request(JNIEnv *env, jclass clz, int64_t a) { - LDKInvoiceRequest a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = InvoiceRequest_clone(&a_conv); - LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); - *ret_copy = OffersMessage_invoice_request(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplayEvent_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKReplayEvent this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ReplayEvent_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessage_1invoice(JNIEnv *env, jclass clz, int64_t a) { - LDKBolt12Invoice a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = Bolt12Invoice_clone(&a_conv); - LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); - *ret_copy = OffersMessage_invoice(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplayEvent_1new(JNIEnv *env, jclass clz) { + LDKReplayEvent ret_var = ReplayEvent_new(); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessage_1invoice_1error(JNIEnv *env, jclass clz, int64_t a) { - LDKInvoiceError a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = InvoiceError_clone(&a_conv); - LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); - *ret_copy = OffersMessage_invoice_error(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +static inline uint64_t ReplayEvent_clone_ptr(LDKReplayEvent *NONNULL_PTR arg) { + LDKReplayEvent ret_var = ReplayEvent_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OffersMessage_1is_1known_1type(JNIEnv *env, jclass clz, int64_t tlv_type) { - jboolean ret_conv = OffersMessage_is_known_type(tlv_type); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplayEvent_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKReplayEvent arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = ReplayEvent_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessage_1as_1OnionMessageContents(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOffersMessage* this_arg_conv = (LDKOffersMessage*)untag_ptr(this_arg); - LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); - *ret_ret = OffersMessage_as_OnionMessageContents(this_arg_conv); - return tag_ptr(ret_ret, true); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OffersMessage_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKOffersMessage* obj_conv = (LDKOffersMessage*)untag_ptr(obj); - LDKCVec_u8Z ret_var = OffersMessage_write(obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplayEvent_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKReplayEvent orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKReplayEvent ret_var = ReplayEvent_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessage_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg_a, int64_t arg_b) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - void* arg_b_ptr = untag_ptr(arg_b); - if (ptr_is_owned(arg_b)) { CHECK_ACCESS(arg_b_ptr); } - LDKLogger* arg_b_conv = (LDKLogger*)arg_b_ptr; - LDKCResult_OffersMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersMessageDecodeErrorZ), "LDKCResult_OffersMessageDecodeErrorZ"); - *ret_conv = OffersMessage_read(ser_ref, arg_a, arg_b_conv); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKEventHandler this_ptr_conv = *(LDKEventHandler*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + EventHandler_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Packet_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKPacket this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKAnchorDescriptor this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Packet_free(this_obj_conv); -} - -JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_Packet_1get_1version(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPacket this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_t ret_conv = Packet_get_version(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Packet_1set_1version(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) { - LDKPacket this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - Packet_set_version(&this_ptr_conv, val); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Packet_1get_1public_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPacket this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Packet_get_public_key(&this_ptr_conv).compressed_form); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Packet_1set_1public_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKPacket this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - Packet_set_public_key(&this_ptr_conv, val_ref); + AnchorDescriptor_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Packet_1get_1hop_1data(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPacket this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1get_1channel_1derivation_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAnchorDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u8Z ret_var = Packet_get_hop_data(&this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; + LDKChannelDerivationParameters ret_var = AnchorDescriptor_get_channel_derivation_parameters(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Packet_1set_1hop_1data(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKPacket this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1set_1channel_1derivation_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKAnchorDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u8Z val_ref; - val_ref.datalen = (*env)->GetArrayLength(env, val); - val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data); - Packet_set_hop_data(&this_ptr_conv, val_ref); + LDKChannelDerivationParameters val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelDerivationParameters_clone(&val_conv); + AnchorDescriptor_set_channel_derivation_parameters(&this_ptr_conv, val_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Packet_1get_1hmac(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPacket this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAnchorDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *Packet_get_hmac(&this_ptr_conv)); - return ret_arr; + LDKOutPoint ret_var = AnchorDescriptor_get_outpoint(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Packet_1set_1hmac(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKPacket this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKAnchorDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - Packet_set_hmac(&this_ptr_conv, val_ref); + LDKOutPoint val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = OutPoint_clone(&val_conv); + AnchorDescriptor_set_outpoint(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Packet_1new(JNIEnv *env, jclass clz, int8_t version_arg, int8_tArray public_key_arg, int8_tArray hop_data_arg, int8_tArray hmac_arg) { - LDKPublicKey public_key_arg_ref; - CHECK((*env)->GetArrayLength(env, public_key_arg) == 33); - (*env)->GetByteArrayRegion(env, public_key_arg, 0, 33, public_key_arg_ref.compressed_form); - LDKCVec_u8Z hop_data_arg_ref; - hop_data_arg_ref.datalen = (*env)->GetArrayLength(env, hop_data_arg); - hop_data_arg_ref.data = MALLOC(hop_data_arg_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, hop_data_arg, 0, hop_data_arg_ref.datalen, hop_data_arg_ref.data); - LDKThirtyTwoBytes hmac_arg_ref; - CHECK((*env)->GetArrayLength(env, hmac_arg) == 32); - (*env)->GetByteArrayRegion(env, hmac_arg, 0, 32, hmac_arg_ref.data); - LDKPacket ret_var = Packet_new(version_arg, public_key_arg_ref, hop_data_arg_ref, hmac_arg_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1new(JNIEnv *env, jclass clz, int64_t channel_derivation_parameters_arg, int64_t outpoint_arg) { + LDKChannelDerivationParameters channel_derivation_parameters_arg_conv; + channel_derivation_parameters_arg_conv.inner = untag_ptr(channel_derivation_parameters_arg); + channel_derivation_parameters_arg_conv.is_owned = ptr_is_owned(channel_derivation_parameters_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_derivation_parameters_arg_conv); + channel_derivation_parameters_arg_conv = ChannelDerivationParameters_clone(&channel_derivation_parameters_arg_conv); + LDKOutPoint outpoint_arg_conv; + outpoint_arg_conv.inner = untag_ptr(outpoint_arg); + outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); + outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); + LDKAnchorDescriptor ret_var = AnchorDescriptor_new(channel_derivation_parameters_arg_conv, outpoint_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t Packet_clone_ptr(LDKPacket *NONNULL_PTR arg) { - LDKPacket ret_var = Packet_clone(arg); +static inline uint64_t AnchorDescriptor_clone_ptr(LDKAnchorDescriptor *NONNULL_PTR arg) { + LDKAnchorDescriptor ret_var = AnchorDescriptor_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Packet_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKPacket arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKAnchorDescriptor arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Packet_clone_ptr(&arg_conv); + int64_t ret_conv = AnchorDescriptor_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Packet_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPacket orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKAnchorDescriptor orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKPacket ret_var = Packet_clone(&orig_conv); + LDKAnchorDescriptor ret_var = AnchorDescriptor_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Packet_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKPacket o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = Packet_hash(&o_conv); - return ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Packet_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKPacket a_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKAnchorDescriptor a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKPacket b_conv; + LDKAnchorDescriptor b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = Packet_eq(&a_conv, &b_conv); + jboolean ret_conv = AnchorDescriptor_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Packet_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKPacket obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = Packet_write(&obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1previous_1utxo(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKAnchorDescriptor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = AnchorDescriptor_previous_utxo(&this_arg_conv); + return tag_ptr(ret_ref, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1unsigned_1tx_1input(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKAnchorDescriptor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKTxIn* ret_ref = MALLOC(sizeof(LDKTxIn), "LDKTxIn"); + *ret_ref = AnchorDescriptor_unsigned_tx_input(&this_arg_conv); + return tag_ptr(ret_ref, true); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1witness_1script(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKAnchorDescriptor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_u8Z ret_var = AnchorDescriptor_witness_script(&this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1tx_1input_1witness(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray signature) { + LDKAnchorDescriptor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKECDSASignature signature_ref; + CHECK((*env)->GetArrayLength(env, signature) == 64); + (*env)->GetByteArrayRegion(env, signature, 0, 64, signature_ref.compact_form); + LDKWitness ret_var = AnchorDescriptor_tx_input_witness(&this_arg_conv, signature_ref); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + Witness_free(ret_var); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1derive_1channel_1signer(JNIEnv *env, jclass clz, int64_t this_arg, int64_t signer_provider) { + LDKAnchorDescriptor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + void* signer_provider_ptr = untag_ptr(signer_provider); + if (ptr_is_owned(signer_provider)) { CHECK_ACCESS(signer_provider_ptr); } + LDKSignerProvider* signer_provider_conv = (LDKSignerProvider*)signer_provider_ptr; + LDKEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner"); + *ret_ret = AnchorDescriptor_derive_channel_signer(&this_arg_conv, signer_provider_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BumpTransactionEvent_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); CHECK_ACCESS(this_ptr_ptr); - LDKParsedOnionMessageContents this_ptr_conv = *(LDKParsedOnionMessageContents*)(this_ptr_ptr); + LDKBumpTransactionEvent this_ptr_conv = *(LDKBumpTransactionEvent*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - ParsedOnionMessageContents_free(this_ptr_conv); + BumpTransactionEvent_free(this_ptr_conv); } -static inline uint64_t ParsedOnionMessageContents_clone_ptr(LDKParsedOnionMessageContents *NONNULL_PTR arg) { - LDKParsedOnionMessageContents *ret_copy = MALLOC(sizeof(LDKParsedOnionMessageContents), "LDKParsedOnionMessageContents"); - *ret_copy = ParsedOnionMessageContents_clone(arg); +static inline uint64_t BumpTransactionEvent_clone_ptr(LDKBumpTransactionEvent *NONNULL_PTR arg) { + LDKBumpTransactionEvent *ret_copy = MALLOC(sizeof(LDKBumpTransactionEvent), "LDKBumpTransactionEvent"); + *ret_copy = BumpTransactionEvent_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKParsedOnionMessageContents* arg_conv = (LDKParsedOnionMessageContents*)untag_ptr(arg); - int64_t ret_conv = ParsedOnionMessageContents_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BumpTransactionEvent_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBumpTransactionEvent* arg_conv = (LDKBumpTransactionEvent*)untag_ptr(arg); + int64_t ret_conv = BumpTransactionEvent_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKParsedOnionMessageContents* orig_conv = (LDKParsedOnionMessageContents*)untag_ptr(orig); - LDKParsedOnionMessageContents *ret_copy = MALLOC(sizeof(LDKParsedOnionMessageContents), "LDKParsedOnionMessageContents"); - *ret_copy = ParsedOnionMessageContents_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BumpTransactionEvent_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBumpTransactionEvent* orig_conv = (LDKBumpTransactionEvent*)untag_ptr(orig); + LDKBumpTransactionEvent *ret_copy = MALLOC(sizeof(LDKBumpTransactionEvent), "LDKBumpTransactionEvent"); + *ret_copy = BumpTransactionEvent_clone(orig_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1offers(JNIEnv *env, jclass clz, int64_t a) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKOffersMessage a_conv = *(LDKOffersMessage*)(a_ptr); - a_conv = OffersMessage_clone((LDKOffersMessage*)untag_ptr(a)); - LDKParsedOnionMessageContents *ret_copy = MALLOC(sizeof(LDKParsedOnionMessageContents), "LDKParsedOnionMessageContents"); - *ret_copy = ParsedOnionMessageContents_offers(a_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BumpTransactionEvent_1channel_1close(JNIEnv *env, jclass clz, int64_t channel_id, int8_tArray counterparty_node_id, int8_tArray claim_id, int32_t package_target_feerate_sat_per_1000_weight, int8_tArray commitment_tx, int64_t commitment_tx_fee_satoshis, int64_t anchor_descriptor, int64_tArray pending_htlcs) { + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); + LDKPublicKey counterparty_node_id_ref; + CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); + (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); + LDKThirtyTwoBytes claim_id_ref; + CHECK((*env)->GetArrayLength(env, claim_id) == 32); + (*env)->GetByteArrayRegion(env, claim_id, 0, 32, claim_id_ref.data); + LDKTransaction commitment_tx_ref; + commitment_tx_ref.datalen = (*env)->GetArrayLength(env, commitment_tx); + commitment_tx_ref.data = MALLOC(commitment_tx_ref.datalen, "LDKTransaction Bytes"); + (*env)->GetByteArrayRegion(env, commitment_tx, 0, commitment_tx_ref.datalen, commitment_tx_ref.data); + commitment_tx_ref.data_is_owned = true; + LDKAnchorDescriptor anchor_descriptor_conv; + anchor_descriptor_conv.inner = untag_ptr(anchor_descriptor); + anchor_descriptor_conv.is_owned = ptr_is_owned(anchor_descriptor); + CHECK_INNER_FIELD_ACCESS_OR_NULL(anchor_descriptor_conv); + anchor_descriptor_conv = AnchorDescriptor_clone(&anchor_descriptor_conv); + LDKCVec_HTLCOutputInCommitmentZ pending_htlcs_constr; + pending_htlcs_constr.datalen = (*env)->GetArrayLength(env, pending_htlcs); + if (pending_htlcs_constr.datalen > 0) + pending_htlcs_constr.data = MALLOC(pending_htlcs_constr.datalen * sizeof(LDKHTLCOutputInCommitment), "LDKCVec_HTLCOutputInCommitmentZ Elements"); + else + pending_htlcs_constr.data = NULL; + int64_t* pending_htlcs_vals = (*env)->GetLongArrayElements (env, pending_htlcs, NULL); + for (size_t y = 0; y < pending_htlcs_constr.datalen; y++) { + int64_t pending_htlcs_conv_24 = pending_htlcs_vals[y]; + LDKHTLCOutputInCommitment pending_htlcs_conv_24_conv; + pending_htlcs_conv_24_conv.inner = untag_ptr(pending_htlcs_conv_24); + pending_htlcs_conv_24_conv.is_owned = ptr_is_owned(pending_htlcs_conv_24); + CHECK_INNER_FIELD_ACCESS_OR_NULL(pending_htlcs_conv_24_conv); + pending_htlcs_conv_24_conv = HTLCOutputInCommitment_clone(&pending_htlcs_conv_24_conv); + pending_htlcs_constr.data[y] = pending_htlcs_conv_24_conv; + } + (*env)->ReleaseLongArrayElements(env, pending_htlcs, pending_htlcs_vals, 0); + LDKBumpTransactionEvent *ret_copy = MALLOC(sizeof(LDKBumpTransactionEvent), "LDKBumpTransactionEvent"); + *ret_copy = BumpTransactionEvent_channel_close(channel_id_conv, counterparty_node_id_ref, claim_id_ref, package_target_feerate_sat_per_1000_weight, commitment_tx_ref, commitment_tx_fee_satoshis, anchor_descriptor_conv, pending_htlcs_constr); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1custom(JNIEnv *env, jclass clz, int64_t a) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKOnionMessageContents a_conv = *(LDKOnionMessageContents*)(a_ptr); - if (a_conv.free == LDKOnionMessageContents_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKOnionMessageContents_JCalls_cloned(&a_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BumpTransactionEvent_1htlcresolution(JNIEnv *env, jclass clz, int64_t channel_id, int8_tArray counterparty_node_id, int8_tArray claim_id, int32_t target_feerate_sat_per_1000_weight, int64_tArray htlc_descriptors, int32_t tx_lock_time) { + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); + LDKPublicKey counterparty_node_id_ref; + CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); + (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); + LDKThirtyTwoBytes claim_id_ref; + CHECK((*env)->GetArrayLength(env, claim_id) == 32); + (*env)->GetByteArrayRegion(env, claim_id, 0, 32, claim_id_ref.data); + LDKCVec_HTLCDescriptorZ htlc_descriptors_constr; + htlc_descriptors_constr.datalen = (*env)->GetArrayLength(env, htlc_descriptors); + if (htlc_descriptors_constr.datalen > 0) + htlc_descriptors_constr.data = MALLOC(htlc_descriptors_constr.datalen * sizeof(LDKHTLCDescriptor), "LDKCVec_HTLCDescriptorZ Elements"); + else + htlc_descriptors_constr.data = NULL; + int64_t* htlc_descriptors_vals = (*env)->GetLongArrayElements (env, htlc_descriptors, NULL); + for (size_t q = 0; q < htlc_descriptors_constr.datalen; q++) { + int64_t htlc_descriptors_conv_16 = htlc_descriptors_vals[q]; + LDKHTLCDescriptor htlc_descriptors_conv_16_conv; + htlc_descriptors_conv_16_conv.inner = untag_ptr(htlc_descriptors_conv_16); + htlc_descriptors_conv_16_conv.is_owned = ptr_is_owned(htlc_descriptors_conv_16); + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_descriptors_conv_16_conv); + htlc_descriptors_conv_16_conv = HTLCDescriptor_clone(&htlc_descriptors_conv_16_conv); + htlc_descriptors_constr.data[q] = htlc_descriptors_conv_16_conv; } - LDKParsedOnionMessageContents *ret_copy = MALLOC(sizeof(LDKParsedOnionMessageContents), "LDKParsedOnionMessageContents"); - *ret_copy = ParsedOnionMessageContents_custom(a_conv); + (*env)->ReleaseLongArrayElements(env, htlc_descriptors, htlc_descriptors_vals, 0); + LDKBumpTransactionEvent *ret_copy = MALLOC(sizeof(LDKBumpTransactionEvent), "LDKBumpTransactionEvent"); + *ret_copy = BumpTransactionEvent_htlcresolution(channel_id_conv, counterparty_node_id_ref, claim_id_ref, target_feerate_sat_per_1000_weight, htlc_descriptors_constr, tx_lock_time); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1as_1OnionMessageContents(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKParsedOnionMessageContents* this_arg_conv = (LDKParsedOnionMessageContents*)untag_ptr(this_arg); - LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); - *ret_ret = ParsedOnionMessageContents_as_OnionMessageContents(this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BumpTransactionEvent_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKBumpTransactionEvent* a_conv = (LDKBumpTransactionEvent*)untag_ptr(a); + LDKBumpTransactionEvent* b_conv = (LDKBumpTransactionEvent*)untag_ptr(b); + jboolean ret_conv = BumpTransactionEvent_eq(a_conv, b_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKParsedOnionMessageContents* obj_conv = (LDKParsedOnionMessageContents*)untag_ptr(obj); - LDKCVec_u8Z ret_var = ParsedOnionMessageContents_write(obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -static inline uint64_t OnionMessageContents_clone_ptr(LDKOnionMessageContents *NONNULL_PTR arg) { - LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); - *ret_ret = OnionMessageContents_clone(arg); - return tag_ptr(ret_ret, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - void* arg_ptr = untag_ptr(arg); - if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); } - LDKOnionMessageContents* arg_conv = (LDKOnionMessageContents*)arg_ptr; - int64_t ret_conv = OnionMessageContents_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1clone(JNIEnv *env, jclass clz, int64_t orig) { - void* orig_ptr = untag_ptr(orig); - if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); } - LDKOnionMessageContents* orig_conv = (LDKOnionMessageContents*)orig_ptr; - LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); - *ret_ret = OnionMessageContents_clone(orig_conv); - return tag_ptr(ret_ret, true); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKOnionMessageContents this_ptr_conv = *(LDKOnionMessageContents*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - OnionMessageContents_free(this_ptr_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKNextMessageHop this_ptr_conv = *(LDKNextMessageHop*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - NextMessageHop_free(this_ptr_conv); -} - -static inline uint64_t NextMessageHop_clone_ptr(LDKNextMessageHop *NONNULL_PTR arg) { - LDKNextMessageHop *ret_copy = MALLOC(sizeof(LDKNextMessageHop), "LDKNextMessageHop"); - *ret_copy = NextMessageHop_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKNextMessageHop* arg_conv = (LDKNextMessageHop*)untag_ptr(arg); - int64_t ret_conv = NextMessageHop_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKNextMessageHop* orig_conv = (LDKNextMessageHop*)untag_ptr(orig); - LDKNextMessageHop *ret_copy = MALLOC(sizeof(LDKNextMessageHop), "LDKNextMessageHop"); - *ret_copy = NextMessageHop_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1node_1id(JNIEnv *env, jclass clz, int8_tArray a) { - LDKPublicKey a_ref; - CHECK((*env)->GetArrayLength(env, a) == 33); - (*env)->GetByteArrayRegion(env, a, 0, 33, a_ref.compressed_form); - LDKNextMessageHop *ret_copy = MALLOC(sizeof(LDKNextMessageHop), "LDKNextMessageHop"); - *ret_copy = NextMessageHop_node_id(a_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t a) { - LDKNextMessageHop *ret_copy = MALLOC(sizeof(LDKNextMessageHop), "LDKNextMessageHop"); - *ret_copy = NextMessageHop_short_channel_id(a); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKNextMessageHop* o_conv = (LDKNextMessageHop*)untag_ptr(o); - int64_t ret_conv = NextMessageHop_hash(o_conv); - return ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKNextMessageHop* a_conv = (LDKNextMessageHop*)untag_ptr(a); - LDKNextMessageHop* b_conv = (LDKNextMessageHop*)untag_ptr(b); - jboolean ret_conv = NextMessageHop_eq(a_conv, b_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPath_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKBlindedPath this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Input_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInput this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BlindedPath_free(this_obj_conv); + Input_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1get_1introduction_1node(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBlindedPath this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Input_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); - *ret_copy = BlindedPath_get_introduction_node(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); + LDKOutPoint ret_var = Input_get_outpoint(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPath_1set_1introduction_1node(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKBlindedPath this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Input_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKInput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKIntroductionNode val_conv = *(LDKIntroductionNode*)(val_ptr); - val_conv = IntroductionNode_clone((LDKIntroductionNode*)untag_ptr(val)); - BlindedPath_set_introduction_node(&this_ptr_conv, val_conv); + LDKOutPoint val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = OutPoint_clone(&val_conv); + Input_set_outpoint(&this_ptr_conv, val_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedPath_1get_1blinding_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBlindedPath this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Input_1get_1previous_1utxo(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, BlindedPath_get_blinding_point(&this_ptr_conv).compressed_form); - return ret_arr; + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = Input_get_previous_utxo(&this_ptr_conv); + return tag_ptr(ret_ref, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPath_1set_1blinding_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKBlindedPath this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Input_1set_1previous_1utxo(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKInput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - BlindedPath_set_blinding_point(&this_ptr_conv, val_ref); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); + val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val)); + Input_set_previous_utxo(&this_ptr_conv, val_conv); } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_BlindedPath_1get_1blinded_1hops(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBlindedPath this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Input_1get_1satisfaction_1weight(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_BlindedHopZ ret_var = BlindedPath_get_blinded_hops(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t m = 0; m < ret_var.datalen; m++) { - LDKBlindedHop ret_conv_12_var = ret_var.data[m]; - int64_t ret_conv_12_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_var); - ret_conv_12_ref = tag_ptr(ret_conv_12_var.inner, ret_conv_12_var.is_owned); - ret_arr_ptr[m] = ret_conv_12_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; + int64_t ret_conv = Input_get_satisfaction_weight(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPath_1set_1blinded_1hops(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { - LDKBlindedPath this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Input_1set_1satisfaction_1weight(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKInput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_BlindedHopZ val_constr; - val_constr.datalen = (*env)->GetArrayLength(env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKBlindedHop), "LDKCVec_BlindedHopZ Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); - for (size_t m = 0; m < val_constr.datalen; m++) { - int64_t val_conv_12 = val_vals[m]; - LDKBlindedHop val_conv_12_conv; - val_conv_12_conv.inner = untag_ptr(val_conv_12); - val_conv_12_conv.is_owned = ptr_is_owned(val_conv_12); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_12_conv); - val_conv_12_conv = BlindedHop_clone(&val_conv_12_conv); - val_constr.data[m] = val_conv_12_conv; - } - (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); - BlindedPath_set_blinded_hops(&this_ptr_conv, val_constr); + Input_set_satisfaction_weight(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1new(JNIEnv *env, jclass clz, int64_t introduction_node_arg, int8_tArray blinding_point_arg, int64_tArray blinded_hops_arg) { - void* introduction_node_arg_ptr = untag_ptr(introduction_node_arg); - CHECK_ACCESS(introduction_node_arg_ptr); - LDKIntroductionNode introduction_node_arg_conv = *(LDKIntroductionNode*)(introduction_node_arg_ptr); - introduction_node_arg_conv = IntroductionNode_clone((LDKIntroductionNode*)untag_ptr(introduction_node_arg)); - LDKPublicKey blinding_point_arg_ref; - CHECK((*env)->GetArrayLength(env, blinding_point_arg) == 33); - (*env)->GetByteArrayRegion(env, blinding_point_arg, 0, 33, blinding_point_arg_ref.compressed_form); - LDKCVec_BlindedHopZ blinded_hops_arg_constr; - blinded_hops_arg_constr.datalen = (*env)->GetArrayLength(env, blinded_hops_arg); - if (blinded_hops_arg_constr.datalen > 0) - blinded_hops_arg_constr.data = MALLOC(blinded_hops_arg_constr.datalen * sizeof(LDKBlindedHop), "LDKCVec_BlindedHopZ Elements"); - else - blinded_hops_arg_constr.data = NULL; - int64_t* blinded_hops_arg_vals = (*env)->GetLongArrayElements (env, blinded_hops_arg, NULL); - for (size_t m = 0; m < blinded_hops_arg_constr.datalen; m++) { - int64_t blinded_hops_arg_conv_12 = blinded_hops_arg_vals[m]; - LDKBlindedHop blinded_hops_arg_conv_12_conv; - blinded_hops_arg_conv_12_conv.inner = untag_ptr(blinded_hops_arg_conv_12); - blinded_hops_arg_conv_12_conv.is_owned = ptr_is_owned(blinded_hops_arg_conv_12); - CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_hops_arg_conv_12_conv); - blinded_hops_arg_conv_12_conv = BlindedHop_clone(&blinded_hops_arg_conv_12_conv); - blinded_hops_arg_constr.data[m] = blinded_hops_arg_conv_12_conv; - } - (*env)->ReleaseLongArrayElements(env, blinded_hops_arg, blinded_hops_arg_vals, 0); - LDKBlindedPath ret_var = BlindedPath_new(introduction_node_arg_conv, blinding_point_arg_ref, blinded_hops_arg_constr); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Input_1new(JNIEnv *env, jclass clz, int64_t outpoint_arg, int64_t previous_utxo_arg, int64_t satisfaction_weight_arg) { + LDKOutPoint outpoint_arg_conv; + outpoint_arg_conv.inner = untag_ptr(outpoint_arg); + outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); + outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); + void* previous_utxo_arg_ptr = untag_ptr(previous_utxo_arg); + CHECK_ACCESS(previous_utxo_arg_ptr); + LDKTxOut previous_utxo_arg_conv = *(LDKTxOut*)(previous_utxo_arg_ptr); + previous_utxo_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(previous_utxo_arg)); + LDKInput ret_var = Input_new(outpoint_arg_conv, previous_utxo_arg_conv, satisfaction_weight_arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t BlindedPath_clone_ptr(LDKBlindedPath *NONNULL_PTR arg) { - LDKBlindedPath ret_var = BlindedPath_clone(arg); +static inline uint64_t Input_clone_ptr(LDKInput *NONNULL_PTR arg) { + LDKInput ret_var = Input_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKBlindedPath arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Input_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInput arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = BlindedPath_clone_ptr(&arg_conv); + int64_t ret_conv = Input_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBlindedPath orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Input_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKInput orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBlindedPath ret_var = BlindedPath_clone(&orig_conv); + LDKInput ret_var = Input_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKBlindedPath o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Input_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKInput o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv.is_owned = false; - int64_t ret_conv = BlindedPath_hash(&o_conv); + int64_t ret_conv = Input_hash(&o_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedPath_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKBlindedPath a_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Input_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKInput a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKBlindedPath b_conv; + LDKInput b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = BlindedPath_eq(&a_conv, &b_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKIntroductionNode this_ptr_conv = *(LDKIntroductionNode*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - IntroductionNode_free(this_ptr_conv); -} - -static inline uint64_t IntroductionNode_clone_ptr(LDKIntroductionNode *NONNULL_PTR arg) { - LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); - *ret_copy = IntroductionNode_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKIntroductionNode* arg_conv = (LDKIntroductionNode*)untag_ptr(arg); - int64_t ret_conv = IntroductionNode_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKIntroductionNode* orig_conv = (LDKIntroductionNode*)untag_ptr(orig); - LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); - *ret_copy = IntroductionNode_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1node_1id(JNIEnv *env, jclass clz, int8_tArray a) { - LDKPublicKey a_ref; - CHECK((*env)->GetArrayLength(env, a) == 33); - (*env)->GetByteArrayRegion(env, a, 0, 33, a_ref.compressed_form); - LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); - *ret_copy = IntroductionNode_node_id(a_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1directed_1short_1channel_1id(JNIEnv *env, jclass clz, jclass a, int64_t b) { - LDKDirection a_conv = LDKDirection_from_java(env, a); - LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); - *ret_copy = IntroductionNode_directed_short_channel_id(a_conv, b); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKIntroductionNode* o_conv = (LDKIntroductionNode*)untag_ptr(o); - int64_t ret_conv = IntroductionNode_hash(o_conv); - return ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKIntroductionNode* a_conv = (LDKIntroductionNode*)untag_ptr(a); - LDKIntroductionNode* b_conv = (LDKIntroductionNode*)untag_ptr(b); - jboolean ret_conv = IntroductionNode_eq(a_conv, b_conv); - return ret_conv; -} - -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Direction_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKDirection* orig_conv = (LDKDirection*)untag_ptr(orig); - jclass ret_conv = LDKDirection_to_java(env, Direction_clone(orig_conv)); - return ret_conv; -} - -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Direction_1node_1one(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKDirection_to_java(env, Direction_node_one()); - return ret_conv; -} - -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Direction_1node_1two(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKDirection_to_java(env, Direction_node_two()); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Direction_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKDirection* o_conv = (LDKDirection*)untag_ptr(o); - int64_t ret_conv = Direction_hash(o_conv); - return ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Direction_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKDirection* a_conv = (LDKDirection*)untag_ptr(a); - LDKDirection* b_conv = (LDKDirection*)untag_ptr(b); - jboolean ret_conv = Direction_eq(a_conv, b_conv); + jboolean ret_conv = Input_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeIdLookUp_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKNodeIdLookUp this_ptr_conv = *(LDKNodeIdLookUp*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - NodeIdLookUp_free(this_ptr_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EmptyNodeIdLookUp_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKEmptyNodeIdLookUp this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Utxo_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUtxo this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - EmptyNodeIdLookUp_free(this_obj_conv); + Utxo_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EmptyNodeIdLookUp_1new(JNIEnv *env, jclass clz) { - LDKEmptyNodeIdLookUp ret_var = EmptyNodeIdLookUp_new(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Utxo_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUtxo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKOutPoint ret_var = Utxo_get_outpoint(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EmptyNodeIdLookUp_1as_1NodeIdLookUp(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKEmptyNodeIdLookUp this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeIdLookUp* ret_ret = MALLOC(sizeof(LDKNodeIdLookUp), "LDKNodeIdLookUp"); - *ret_ret = EmptyNodeIdLookUp_as_NodeIdLookUp(&this_arg_conv); - return tag_ptr(ret_ret, true); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedHop_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKBlindedHop this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BlindedHop_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Utxo_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUtxo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKOutPoint val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = OutPoint_clone(&val_conv); + Utxo_set_outpoint(&this_ptr_conv, val_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedHop_1get_1blinded_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBlindedHop this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Utxo_1get_1output(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUtxo this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, BlindedHop_get_blinded_node_id(&this_ptr_conv).compressed_form); - return ret_arr; + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = Utxo_get_output(&this_ptr_conv); + return tag_ptr(ret_ref, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedHop_1set_1blinded_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKBlindedHop this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Utxo_1set_1output(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUtxo this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - BlindedHop_set_blinded_node_id(&this_ptr_conv, val_ref); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); + val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val)); + Utxo_set_output(&this_ptr_conv, val_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedHop_1get_1encrypted_1payload(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBlindedHop this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Utxo_1get_1satisfaction_1weight(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUtxo this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u8Z ret_var = BlindedHop_get_encrypted_payload(&this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; + int64_t ret_conv = Utxo_get_satisfaction_weight(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedHop_1set_1encrypted_1payload(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKBlindedHop this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Utxo_1set_1satisfaction_1weight(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUtxo this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u8Z val_ref; - val_ref.datalen = (*env)->GetArrayLength(env, val); - val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data); - BlindedHop_set_encrypted_payload(&this_ptr_conv, val_ref); + Utxo_set_satisfaction_weight(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHop_1new(JNIEnv *env, jclass clz, int8_tArray blinded_node_id_arg, int8_tArray encrypted_payload_arg) { - LDKPublicKey blinded_node_id_arg_ref; - CHECK((*env)->GetArrayLength(env, blinded_node_id_arg) == 33); - (*env)->GetByteArrayRegion(env, blinded_node_id_arg, 0, 33, blinded_node_id_arg_ref.compressed_form); - LDKCVec_u8Z encrypted_payload_arg_ref; - encrypted_payload_arg_ref.datalen = (*env)->GetArrayLength(env, encrypted_payload_arg); - encrypted_payload_arg_ref.data = MALLOC(encrypted_payload_arg_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, encrypted_payload_arg, 0, encrypted_payload_arg_ref.datalen, encrypted_payload_arg_ref.data); - LDKBlindedHop ret_var = BlindedHop_new(blinded_node_id_arg_ref, encrypted_payload_arg_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Utxo_1new(JNIEnv *env, jclass clz, int64_t outpoint_arg, int64_t output_arg, int64_t satisfaction_weight_arg) { + LDKOutPoint outpoint_arg_conv; + outpoint_arg_conv.inner = untag_ptr(outpoint_arg); + outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); + outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); + void* output_arg_ptr = untag_ptr(output_arg); + CHECK_ACCESS(output_arg_ptr); + LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr); + output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg)); + LDKUtxo ret_var = Utxo_new(outpoint_arg_conv, output_arg_conv, satisfaction_weight_arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t BlindedHop_clone_ptr(LDKBlindedHop *NONNULL_PTR arg) { - LDKBlindedHop ret_var = BlindedHop_clone(arg); +static inline uint64_t Utxo_clone_ptr(LDKUtxo *NONNULL_PTR arg) { + LDKUtxo ret_var = Utxo_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKBlindedHop arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Utxo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUtxo arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = BlindedHop_clone_ptr(&arg_conv); + int64_t ret_conv = Utxo_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHop_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBlindedHop orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Utxo_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKUtxo orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBlindedHop ret_var = BlindedHop_clone(&orig_conv); + LDKUtxo ret_var = Utxo_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHop_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKBlindedHop o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Utxo_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKUtxo o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv.is_owned = false; - int64_t ret_conv = BlindedHop_hash(&o_conv); + int64_t ret_conv = Utxo_hash(&o_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedHop_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKBlindedHop a_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Utxo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKUtxo a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKBlindedHop b_conv; + LDKUtxo b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = BlindedHop_eq(&a_conv, &b_conv); + jboolean ret_conv = Utxo_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1one_1hop_1for_1message(JNIEnv *env, jclass clz, int8_tArray recipient_node_id, int64_t entropy_source) { - LDKPublicKey recipient_node_id_ref; - CHECK((*env)->GetArrayLength(env, recipient_node_id) == 33); - (*env)->GetByteArrayRegion(env, recipient_node_id, 0, 33, recipient_node_id_ref.compressed_form); - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); - *ret_conv = BlindedPath_one_hop_for_message(recipient_node_id_ref, entropy_source_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Utxo_1new_1p2pkh(JNIEnv *env, jclass clz, int64_t outpoint, int64_t value, int8_tArray pubkey_hash) { + LDKOutPoint outpoint_conv; + outpoint_conv.inner = untag_ptr(outpoint); + outpoint_conv.is_owned = ptr_is_owned(outpoint); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv); + outpoint_conv = OutPoint_clone(&outpoint_conv); + uint8_t pubkey_hash_arr[20]; + CHECK((*env)->GetArrayLength(env, pubkey_hash) == 20); + (*env)->GetByteArrayRegion(env, pubkey_hash, 0, 20, pubkey_hash_arr); + uint8_t (*pubkey_hash_ref)[20] = &pubkey_hash_arr; + LDKUtxo ret_var = Utxo_new_p2pkh(outpoint_conv, value, pubkey_hash_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1new_1for_1message(JNIEnv *env, jclass clz, jobjectArray node_pks, int64_t entropy_source) { - LDKCVec_PublicKeyZ node_pks_constr; - node_pks_constr.datalen = (*env)->GetArrayLength(env, node_pks); - if (node_pks_constr.datalen > 0) - node_pks_constr.data = MALLOC(node_pks_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); - else - node_pks_constr.data = NULL; - for (size_t i = 0; i < node_pks_constr.datalen; i++) { - int8_tArray node_pks_conv_8 = (*env)->GetObjectArrayElement(env, node_pks, i); - LDKPublicKey node_pks_conv_8_ref; - CHECK((*env)->GetArrayLength(env, node_pks_conv_8) == 33); - (*env)->GetByteArrayRegion(env, node_pks_conv_8, 0, 33, node_pks_conv_8_ref.compressed_form); - node_pks_constr.data[i] = node_pks_conv_8_ref; - } - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); - *ret_conv = BlindedPath_new_for_message(node_pks_constr, entropy_source_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CoinSelection_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKCoinSelection this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + CoinSelection_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1one_1hop_1for_1payment(JNIEnv *env, jclass clz, int8_tArray payee_node_id, int64_t payee_tlvs, int16_t min_final_cltv_expiry_delta, int64_t entropy_source) { - LDKPublicKey payee_node_id_ref; - CHECK((*env)->GetArrayLength(env, payee_node_id) == 33); - (*env)->GetByteArrayRegion(env, payee_node_id, 0, 33, payee_node_id_ref.compressed_form); - LDKReceiveTlvs payee_tlvs_conv; - payee_tlvs_conv.inner = untag_ptr(payee_tlvs); - payee_tlvs_conv.is_owned = ptr_is_owned(payee_tlvs); - CHECK_INNER_FIELD_ACCESS_OR_NULL(payee_tlvs_conv); - payee_tlvs_conv = ReceiveTlvs_clone(&payee_tlvs_conv); - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CoinSelection_1get_1confirmed_1utxos(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKCoinSelection this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_UtxoZ ret_var = CoinSelection_get_confirmed_utxos(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t g = 0; g < ret_var.datalen; g++) { + LDKUtxo ret_conv_6_var = ret_var.data[g]; + int64_t ret_conv_6_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_6_var); + ret_conv_6_ref = tag_ptr(ret_conv_6_var.inner, ret_conv_6_var.is_owned); + ret_arr_ptr[g] = ret_conv_6_ref; } - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ), "LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ"); - *ret_conv = BlindedPath_one_hop_for_payment(payee_node_id_ref, payee_tlvs_conv, min_final_cltv_expiry_delta, entropy_source_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1new_1for_1payment(JNIEnv *env, jclass clz, int64_tArray intermediate_nodes, int8_tArray payee_node_id, int64_t payee_tlvs, int64_t htlc_maximum_msat, int16_t min_final_cltv_expiry_delta, int64_t entropy_source) { - LDKCVec_ForwardNodeZ intermediate_nodes_constr; - intermediate_nodes_constr.datalen = (*env)->GetArrayLength(env, intermediate_nodes); - if (intermediate_nodes_constr.datalen > 0) - intermediate_nodes_constr.data = MALLOC(intermediate_nodes_constr.datalen * sizeof(LDKForwardNode), "LDKCVec_ForwardNodeZ Elements"); - else - intermediate_nodes_constr.data = NULL; - int64_t* intermediate_nodes_vals = (*env)->GetLongArrayElements (env, intermediate_nodes, NULL); - for (size_t n = 0; n < intermediate_nodes_constr.datalen; n++) { - int64_t intermediate_nodes_conv_13 = intermediate_nodes_vals[n]; - LDKForwardNode intermediate_nodes_conv_13_conv; - intermediate_nodes_conv_13_conv.inner = untag_ptr(intermediate_nodes_conv_13); - intermediate_nodes_conv_13_conv.is_owned = ptr_is_owned(intermediate_nodes_conv_13); - CHECK_INNER_FIELD_ACCESS_OR_NULL(intermediate_nodes_conv_13_conv); - intermediate_nodes_conv_13_conv = ForwardNode_clone(&intermediate_nodes_conv_13_conv); - intermediate_nodes_constr.data[n] = intermediate_nodes_conv_13_conv; - } - (*env)->ReleaseLongArrayElements(env, intermediate_nodes, intermediate_nodes_vals, 0); - LDKPublicKey payee_node_id_ref; - CHECK((*env)->GetArrayLength(env, payee_node_id) == 33); - (*env)->GetByteArrayRegion(env, payee_node_id, 0, 33, payee_node_id_ref.compressed_form); - LDKReceiveTlvs payee_tlvs_conv; - payee_tlvs_conv.inner = untag_ptr(payee_tlvs); - payee_tlvs_conv.is_owned = ptr_is_owned(payee_tlvs); - CHECK_INNER_FIELD_ACCESS_OR_NULL(payee_tlvs_conv); - payee_tlvs_conv = ReceiveTlvs_clone(&payee_tlvs_conv); - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ), "LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ"); - *ret_conv = BlindedPath_new_for_payment(intermediate_nodes_constr, payee_node_id_ref, payee_tlvs_conv, htlc_maximum_msat, min_final_cltv_expiry_delta, entropy_source_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1public_1introduction_1node_1id(JNIEnv *env, jclass clz, int64_t this_arg, int64_t network_graph) { - LDKBlindedPath this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKReadOnlyNetworkGraph network_graph_conv; - network_graph_conv.inner = untag_ptr(network_graph); - network_graph_conv.is_owned = ptr_is_owned(network_graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - network_graph_conv.is_owned = false; - LDKNodeId ret_var = BlindedPath_public_introduction_node_id(&this_arg_conv, &network_graph_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedPath_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKBlindedPath obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = BlindedPath_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ"); - *ret_conv = BlindedPath_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedHop_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKBlindedHop obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = BlindedHop_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHop_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); - *ret_conv = BlindedHop_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardNode_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKForwardNode this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ForwardNode_free(this_obj_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardNode_1get_1tlvs(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKForwardNode this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKForwardTlvs ret_var = ForwardNode_get_tlvs(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardNode_1set_1tlvs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKForwardNode this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKForwardTlvs val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ForwardTlvs_clone(&val_conv); - ForwardNode_set_tlvs(&this_ptr_conv, val_conv); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ForwardNode_1get_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKForwardNode this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ForwardNode_get_node_id(&this_ptr_conv).compressed_form); + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardNode_1set_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKForwardNode this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CoinSelection_1set_1confirmed_1utxos(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { + LDKCoinSelection this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - ForwardNode_set_node_id(&this_ptr_conv, val_ref); + LDKCVec_UtxoZ val_constr; + val_constr.datalen = (*env)->GetArrayLength(env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUtxo), "LDKCVec_UtxoZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); + for (size_t g = 0; g < val_constr.datalen; g++) { + int64_t val_conv_6 = val_vals[g]; + LDKUtxo val_conv_6_conv; + val_conv_6_conv.inner = untag_ptr(val_conv_6); + val_conv_6_conv.is_owned = ptr_is_owned(val_conv_6); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_6_conv); + val_conv_6_conv = Utxo_clone(&val_conv_6_conv); + val_constr.data[g] = val_conv_6_conv; + } + (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); + CoinSelection_set_confirmed_utxos(&this_ptr_conv, val_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardNode_1get_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKForwardNode this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CoinSelection_1get_1change_1output(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKCoinSelection this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = ForwardNode_get_htlc_maximum_msat(&this_ptr_conv); - return ret_conv; + LDKCOption_TxOutZ *ret_copy = MALLOC(sizeof(LDKCOption_TxOutZ), "LDKCOption_TxOutZ"); + *ret_copy = CoinSelection_get_change_output(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardNode_1set_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKForwardNode this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CoinSelection_1set_1change_1output(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKCoinSelection this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ForwardNode_set_htlc_maximum_msat(&this_ptr_conv, val); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_TxOutZ val_conv = *(LDKCOption_TxOutZ*)(val_ptr); + val_conv = COption_TxOutZ_clone((LDKCOption_TxOutZ*)untag_ptr(val)); + CoinSelection_set_change_output(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardNode_1new(JNIEnv *env, jclass clz, int64_t tlvs_arg, int8_tArray node_id_arg, int64_t htlc_maximum_msat_arg) { - LDKForwardTlvs tlvs_arg_conv; - tlvs_arg_conv.inner = untag_ptr(tlvs_arg); - tlvs_arg_conv.is_owned = ptr_is_owned(tlvs_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(tlvs_arg_conv); - tlvs_arg_conv = ForwardTlvs_clone(&tlvs_arg_conv); - LDKPublicKey node_id_arg_ref; - CHECK((*env)->GetArrayLength(env, node_id_arg) == 33); - (*env)->GetByteArrayRegion(env, node_id_arg, 0, 33, node_id_arg_ref.compressed_form); - LDKForwardNode ret_var = ForwardNode_new(tlvs_arg_conv, node_id_arg_ref, htlc_maximum_msat_arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CoinSelection_1new(JNIEnv *env, jclass clz, int64_tArray confirmed_utxos_arg, int64_t change_output_arg) { + LDKCVec_UtxoZ confirmed_utxos_arg_constr; + confirmed_utxos_arg_constr.datalen = (*env)->GetArrayLength(env, confirmed_utxos_arg); + if (confirmed_utxos_arg_constr.datalen > 0) + confirmed_utxos_arg_constr.data = MALLOC(confirmed_utxos_arg_constr.datalen * sizeof(LDKUtxo), "LDKCVec_UtxoZ Elements"); + else + confirmed_utxos_arg_constr.data = NULL; + int64_t* confirmed_utxos_arg_vals = (*env)->GetLongArrayElements (env, confirmed_utxos_arg, NULL); + for (size_t g = 0; g < confirmed_utxos_arg_constr.datalen; g++) { + int64_t confirmed_utxos_arg_conv_6 = confirmed_utxos_arg_vals[g]; + LDKUtxo confirmed_utxos_arg_conv_6_conv; + confirmed_utxos_arg_conv_6_conv.inner = untag_ptr(confirmed_utxos_arg_conv_6); + confirmed_utxos_arg_conv_6_conv.is_owned = ptr_is_owned(confirmed_utxos_arg_conv_6); + CHECK_INNER_FIELD_ACCESS_OR_NULL(confirmed_utxos_arg_conv_6_conv); + confirmed_utxos_arg_conv_6_conv = Utxo_clone(&confirmed_utxos_arg_conv_6_conv); + confirmed_utxos_arg_constr.data[g] = confirmed_utxos_arg_conv_6_conv; + } + (*env)->ReleaseLongArrayElements(env, confirmed_utxos_arg, confirmed_utxos_arg_vals, 0); + void* change_output_arg_ptr = untag_ptr(change_output_arg); + CHECK_ACCESS(change_output_arg_ptr); + LDKCOption_TxOutZ change_output_arg_conv = *(LDKCOption_TxOutZ*)(change_output_arg_ptr); + change_output_arg_conv = COption_TxOutZ_clone((LDKCOption_TxOutZ*)untag_ptr(change_output_arg)); + LDKCoinSelection ret_var = CoinSelection_new(confirmed_utxos_arg_constr, change_output_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t ForwardNode_clone_ptr(LDKForwardNode *NONNULL_PTR arg) { - LDKForwardNode ret_var = ForwardNode_clone(arg); +static inline uint64_t CoinSelection_clone_ptr(LDKCoinSelection *NONNULL_PTR arg) { + LDKCoinSelection ret_var = CoinSelection_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardNode_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKForwardNode arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CoinSelection_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCoinSelection arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = ForwardNode_clone_ptr(&arg_conv); + int64_t ret_conv = CoinSelection_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardNode_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKForwardNode orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CoinSelection_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCoinSelection orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKForwardNode ret_var = ForwardNode_clone(&orig_conv); + LDKCoinSelection ret_var = CoinSelection_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKForwardTlvs this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ForwardTlvs_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CoinSelectionSource_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKCoinSelectionSource this_ptr_conv = *(LDKCoinSelectionSource*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + CoinSelectionSource_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKForwardTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = ForwardTlvs_get_short_channel_id(&this_ptr_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WalletSource_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKWalletSource this_ptr_conv = *(LDKWalletSource*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + WalletSource_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKForwardTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ForwardTlvs_set_short_channel_id(&this_ptr_conv, val); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Wallet_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKWallet this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Wallet_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1get_1payment_1relay(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKForwardTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPaymentRelay ret_var = ForwardTlvs_get_payment_relay(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Wallet_1new(JNIEnv *env, jclass clz, int64_t source, int64_t logger) { + void* source_ptr = untag_ptr(source); + CHECK_ACCESS(source_ptr); + LDKWalletSource source_conv = *(LDKWalletSource*)(source_ptr); + if (source_conv.free == LDKWalletSource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKWalletSource_JCalls_cloned(&source_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKWallet ret_var = Wallet_new(source_conv, logger_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1set_1payment_1relay(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKForwardTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPaymentRelay val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = PaymentRelay_clone(&val_conv); - ForwardTlvs_set_payment_relay(&this_ptr_conv, val_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1get_1payment_1constraints(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKForwardTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPaymentConstraints ret_var = ForwardTlvs_get_payment_constraints(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Wallet_1as_1CoinSelectionSource(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKWallet this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCoinSelectionSource* ret_ret = MALLOC(sizeof(LDKCoinSelectionSource), "LDKCoinSelectionSource"); + *ret_ret = Wallet_as_CoinSelectionSource(&this_arg_conv); + return tag_ptr(ret_ret, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1set_1payment_1constraints(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKForwardTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPaymentConstraints val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = PaymentConstraints_clone(&val_conv); - ForwardTlvs_set_payment_constraints(&this_ptr_conv, val_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BumpTransactionEventHandler_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBumpTransactionEventHandler this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + BumpTransactionEventHandler_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKForwardTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKBlindedHopFeatures ret_var = ForwardTlvs_get_features(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BumpTransactionEventHandler_1new(JNIEnv *env, jclass clz, int64_t broadcaster, int64_t utxo_source, int64_t signer_provider, int64_t logger) { + void* broadcaster_ptr = untag_ptr(broadcaster); + CHECK_ACCESS(broadcaster_ptr); + LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); + if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); + } + void* utxo_source_ptr = untag_ptr(utxo_source); + CHECK_ACCESS(utxo_source_ptr); + LDKCoinSelectionSource utxo_source_conv = *(LDKCoinSelectionSource*)(utxo_source_ptr); + if (utxo_source_conv.free == LDKCoinSelectionSource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKCoinSelectionSource_JCalls_cloned(&utxo_source_conv); + } + void* signer_provider_ptr = untag_ptr(signer_provider); + CHECK_ACCESS(signer_provider_ptr); + LDKSignerProvider signer_provider_conv = *(LDKSignerProvider*)(signer_provider_ptr); + if (signer_provider_conv.free == LDKSignerProvider_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKSignerProvider_JCalls_cloned(&signer_provider_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKBumpTransactionEventHandler ret_var = BumpTransactionEventHandler_new(broadcaster_conv, utxo_source_conv, signer_provider_conv, logger_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKForwardTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKBlindedHopFeatures val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = BlindedHopFeatures_clone(&val_conv); - ForwardTlvs_set_features(&this_ptr_conv, val_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BumpTransactionEventHandler_1handle_1event(JNIEnv *env, jclass clz, int64_t this_arg, int64_t event) { + LDKBumpTransactionEventHandler this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKBumpTransactionEvent* event_conv = (LDKBumpTransactionEvent*)untag_ptr(event); + BumpTransactionEventHandler_handle_event(&this_arg_conv, event_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1new(JNIEnv *env, jclass clz, int64_t short_channel_id_arg, int64_t payment_relay_arg, int64_t payment_constraints_arg, int64_t features_arg) { - LDKPaymentRelay payment_relay_arg_conv; - payment_relay_arg_conv.inner = untag_ptr(payment_relay_arg); - payment_relay_arg_conv.is_owned = ptr_is_owned(payment_relay_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_relay_arg_conv); - payment_relay_arg_conv = PaymentRelay_clone(&payment_relay_arg_conv); - LDKPaymentConstraints payment_constraints_arg_conv; - payment_constraints_arg_conv.inner = untag_ptr(payment_constraints_arg); - payment_constraints_arg_conv.is_owned = ptr_is_owned(payment_constraints_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_constraints_arg_conv); - payment_constraints_arg_conv = PaymentConstraints_clone(&payment_constraints_arg_conv); - LDKBlindedHopFeatures features_arg_conv; - features_arg_conv.inner = untag_ptr(features_arg); - features_arg_conv.is_owned = ptr_is_owned(features_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); - features_arg_conv = BlindedHopFeatures_clone(&features_arg_conv); - LDKForwardTlvs ret_var = ForwardTlvs_new(short_channel_id_arg, payment_relay_arg_conv, payment_constraints_arg_conv, features_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKInitFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKInitFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = InitFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -static inline uint64_t ForwardTlvs_clone_ptr(LDKForwardTlvs *NONNULL_PTR arg) { - LDKForwardTlvs ret_var = ForwardTlvs_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKForwardTlvs arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = ForwardTlvs_clone_ptr(&arg_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKNodeFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKNodeFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKForwardTlvs orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKForwardTlvs ret_var = ForwardTlvs_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKChannelFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKChannelFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ChannelFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKReceiveTlvs this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ReceiveTlvs_free(this_obj_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKBolt11InvoiceFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKBolt11InvoiceFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = Bolt11InvoiceFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1get_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKReceiveTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ReceiveTlvs_get_payment_secret(&this_ptr_conv)); - return ret_arr; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKOfferFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKOfferFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = OfferFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1set_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKReceiveTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - ReceiveTlvs_set_payment_secret(&this_ptr_conv, val_ref); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKInvoiceRequestFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKInvoiceRequestFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = InvoiceRequestFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1get_1payment_1constraints(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKReceiveTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPaymentConstraints ret_var = ReceiveTlvs_get_payment_constraints(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1set_1payment_1constraints(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKReceiveTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPaymentConstraints val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = PaymentConstraints_clone(&val_conv); - ReceiveTlvs_set_payment_constraints(&this_ptr_conv, val_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1get_1payment_1context(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKReceiveTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); - *ret_copy = ReceiveTlvs_get_payment_context(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKBolt12InvoiceFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKBolt12InvoiceFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = Bolt12InvoiceFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1set_1payment_1context(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKReceiveTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKPaymentContext val_conv = *(LDKPaymentContext*)(val_ptr); - val_conv = PaymentContext_clone((LDKPaymentContext*)untag_ptr(val)); - ReceiveTlvs_set_payment_context(&this_ptr_conv, val_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKBlindedHopFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKBlindedHopFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = BlindedHopFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1new(JNIEnv *env, jclass clz, int8_tArray payment_secret_arg, int64_t payment_constraints_arg, int64_t payment_context_arg) { - LDKThirtyTwoBytes payment_secret_arg_ref; - CHECK((*env)->GetArrayLength(env, payment_secret_arg) == 32); - (*env)->GetByteArrayRegion(env, payment_secret_arg, 0, 32, payment_secret_arg_ref.data); - LDKPaymentConstraints payment_constraints_arg_conv; - payment_constraints_arg_conv.inner = untag_ptr(payment_constraints_arg); - payment_constraints_arg_conv.is_owned = ptr_is_owned(payment_constraints_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_constraints_arg_conv); - payment_constraints_arg_conv = PaymentConstraints_clone(&payment_constraints_arg_conv); - void* payment_context_arg_ptr = untag_ptr(payment_context_arg); - CHECK_ACCESS(payment_context_arg_ptr); - LDKPaymentContext payment_context_arg_conv = *(LDKPaymentContext*)(payment_context_arg_ptr); - payment_context_arg_conv = PaymentContext_clone((LDKPaymentContext*)untag_ptr(payment_context_arg)); - LDKReceiveTlvs ret_var = ReceiveTlvs_new(payment_secret_arg_ref, payment_constraints_arg_conv, payment_context_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKChannelTypeFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKChannelTypeFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -static inline uint64_t ReceiveTlvs_clone_ptr(LDKReceiveTlvs *NONNULL_PTR arg) { - LDKReceiveTlvs ret_var = ReceiveTlvs_clone(arg); +static inline uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg) { + LDKInitFeatures ret_var = InitFeatures_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKReceiveTlvs arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInitFeatures arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = ReceiveTlvs_clone_ptr(&arg_conv); + int64_t ret_conv = InitFeatures_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKReceiveTlvs orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKInitFeatures orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKReceiveTlvs ret_var = ReceiveTlvs_clone(&orig_conv); + LDKInitFeatures ret_var = InitFeatures_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKPaymentRelay this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PaymentRelay_free(this_obj_conv); -} - -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPaymentRelay this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int16_t ret_conv = PaymentRelay_get_cltv_expiry_delta(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKPaymentRelay this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - PaymentRelay_set_cltv_expiry_delta(&this_ptr_conv, val); -} - -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1get_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPaymentRelay this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int32_t ret_conv = PaymentRelay_get_fee_proportional_millionths(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1set_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKPaymentRelay this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - PaymentRelay_set_fee_proportional_millionths(&this_ptr_conv, val); +static inline uint64_t NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg) { + LDKNodeFeatures ret_var = NodeFeatures_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } - -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1get_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPaymentRelay this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int32_t ret_conv = PaymentRelay_get_fee_base_msat(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNodeFeatures arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = NodeFeatures_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1set_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKPaymentRelay this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - PaymentRelay_set_fee_base_msat(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1new(JNIEnv *env, jclass clz, int16_t cltv_expiry_delta_arg, int32_t fee_proportional_millionths_arg, int32_t fee_base_msat_arg) { - LDKPaymentRelay ret_var = PaymentRelay_new(cltv_expiry_delta_arg, fee_proportional_millionths_arg, fee_base_msat_arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKNodeFeatures orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKNodeFeatures ret_var = NodeFeatures_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t PaymentRelay_clone_ptr(LDKPaymentRelay *NONNULL_PTR arg) { - LDKPaymentRelay ret_var = PaymentRelay_clone(arg); +static inline uint64_t ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg) { + LDKChannelFeatures ret_var = ChannelFeatures_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKPaymentRelay arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelFeatures arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = PaymentRelay_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelFeatures_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPaymentRelay orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelFeatures orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKPaymentRelay ret_var = PaymentRelay_clone(&orig_conv); + LDKChannelFeatures ret_var = ChannelFeatures_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKPaymentConstraints this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PaymentConstraints_free(this_obj_conv); -} - -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1get_1max_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPaymentConstraints this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int32_t ret_conv = PaymentConstraints_get_max_cltv_expiry(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1set_1max_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKPaymentConstraints this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - PaymentConstraints_set_max_cltv_expiry(&this_ptr_conv, val); +static inline uint64_t Bolt11InvoiceFeatures_clone_ptr(LDKBolt11InvoiceFeatures *NONNULL_PTR arg) { + LDKBolt11InvoiceFeatures ret_var = Bolt11InvoiceFeatures_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPaymentConstraints this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = PaymentConstraints_get_htlc_minimum_msat(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBolt11InvoiceFeatures arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = Bolt11InvoiceFeatures_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKPaymentConstraints this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - PaymentConstraints_set_htlc_minimum_msat(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1new(JNIEnv *env, jclass clz, int32_t max_cltv_expiry_arg, int64_t htlc_minimum_msat_arg) { - LDKPaymentConstraints ret_var = PaymentConstraints_new(max_cltv_expiry_arg, htlc_minimum_msat_arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBolt11InvoiceFeatures orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKBolt11InvoiceFeatures ret_var = Bolt11InvoiceFeatures_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t PaymentConstraints_clone_ptr(LDKPaymentConstraints *NONNULL_PTR arg) { - LDKPaymentConstraints ret_var = PaymentConstraints_clone(arg); +static inline uint64_t OfferFeatures_clone_ptr(LDKOfferFeatures *NONNULL_PTR arg) { + LDKOfferFeatures ret_var = OfferFeatures_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKPaymentConstraints arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKOfferFeatures arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = PaymentConstraints_clone_ptr(&arg_conv); + int64_t ret_conv = OfferFeatures_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPaymentConstraints orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKOfferFeatures orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKPaymentConstraints ret_var = PaymentConstraints_clone(&orig_conv); + LDKOfferFeatures ret_var = OfferFeatures_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentContext_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKPaymentContext this_ptr_conv = *(LDKPaymentContext*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - PaymentContext_free(this_ptr_conv); -} - -static inline uint64_t PaymentContext_clone_ptr(LDKPaymentContext *NONNULL_PTR arg) { - LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); - *ret_copy = PaymentContext_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentContext_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKPaymentContext* arg_conv = (LDKPaymentContext*)untag_ptr(arg); - int64_t ret_conv = PaymentContext_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentContext_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPaymentContext* orig_conv = (LDKPaymentContext*)untag_ptr(orig); - LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); - *ret_copy = PaymentContext_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentContext_1unknown(JNIEnv *env, jclass clz, int64_t a) { - LDKUnknownPaymentContext a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = UnknownPaymentContext_clone(&a_conv); - LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); - *ret_copy = PaymentContext_unknown(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentContext_1bolt12_1offer(JNIEnv *env, jclass clz, int64_t a) { - LDKBolt12OfferContext a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = Bolt12OfferContext_clone(&a_conv); - LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); - *ret_copy = PaymentContext_bolt12_offer(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentContext_1bolt12_1refund(JNIEnv *env, jclass clz, int64_t a) { - LDKBolt12RefundContext a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = Bolt12RefundContext_clone(&a_conv); - LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); - *ret_copy = PaymentContext_bolt12_refund(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentContext_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKPaymentContext* a_conv = (LDKPaymentContext*)untag_ptr(a); - LDKPaymentContext* b_conv = (LDKPaymentContext*)untag_ptr(b); - jboolean ret_conv = PaymentContext_eq(a_conv, b_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKUnknownPaymentContext this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - UnknownPaymentContext_free(this_obj_conv); -} - -static inline uint64_t UnknownPaymentContext_clone_ptr(LDKUnknownPaymentContext *NONNULL_PTR arg) { - LDKUnknownPaymentContext ret_var = UnknownPaymentContext_clone(arg); +static inline uint64_t InvoiceRequestFeatures_clone_ptr(LDKInvoiceRequestFeatures *NONNULL_PTR arg) { + LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKUnknownPaymentContext arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInvoiceRequestFeatures arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = UnknownPaymentContext_clone_ptr(&arg_conv); + int64_t ret_conv = InvoiceRequestFeatures_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKUnknownPaymentContext orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKInvoiceRequestFeatures orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKUnknownPaymentContext ret_var = UnknownPaymentContext_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKUnknownPaymentContext a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKUnknownPaymentContext b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = UnknownPaymentContext_eq(&a_conv, &b_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKBolt12OfferContext this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Bolt12OfferContext_free(this_obj_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1get_1offer_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBolt12OfferContext this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKOfferId ret_var = Bolt12OfferContext_get_offer_id(&this_ptr_conv); + LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1set_1offer_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKBolt12OfferContext this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKOfferId val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = OfferId_clone(&val_conv); - Bolt12OfferContext_set_offer_id(&this_ptr_conv, val_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1get_1invoice_1request(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBolt12OfferContext this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKInvoiceRequestFields ret_var = Bolt12OfferContext_get_invoice_request(&this_ptr_conv); +static inline uint64_t Bolt12InvoiceFeatures_clone_ptr(LDKBolt12InvoiceFeatures *NONNULL_PTR arg) { + LDKBolt12InvoiceFeatures ret_var = Bolt12InvoiceFeatures_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1set_1invoice_1request(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKBolt12OfferContext this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKInvoiceRequestFields val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = InvoiceRequestFields_clone(&val_conv); - Bolt12OfferContext_set_invoice_request(&this_ptr_conv, val_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBolt12InvoiceFeatures arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = Bolt12InvoiceFeatures_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1new(JNIEnv *env, jclass clz, int64_t offer_id_arg, int64_t invoice_request_arg) { - LDKOfferId offer_id_arg_conv; - offer_id_arg_conv.inner = untag_ptr(offer_id_arg); - offer_id_arg_conv.is_owned = ptr_is_owned(offer_id_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(offer_id_arg_conv); - offer_id_arg_conv = OfferId_clone(&offer_id_arg_conv); - LDKInvoiceRequestFields invoice_request_arg_conv; - invoice_request_arg_conv.inner = untag_ptr(invoice_request_arg); - invoice_request_arg_conv.is_owned = ptr_is_owned(invoice_request_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_request_arg_conv); - invoice_request_arg_conv = InvoiceRequestFields_clone(&invoice_request_arg_conv); - LDKBolt12OfferContext ret_var = Bolt12OfferContext_new(offer_id_arg_conv, invoice_request_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBolt12InvoiceFeatures orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKBolt12InvoiceFeatures ret_var = Bolt12InvoiceFeatures_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t Bolt12OfferContext_clone_ptr(LDKBolt12OfferContext *NONNULL_PTR arg) { - LDKBolt12OfferContext ret_var = Bolt12OfferContext_clone(arg); +static inline uint64_t BlindedHopFeatures_clone_ptr(LDKBlindedHopFeatures *NONNULL_PTR arg) { + LDKBlindedHopFeatures ret_var = BlindedHopFeatures_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKBolt12OfferContext arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBlindedHopFeatures arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Bolt12OfferContext_clone_ptr(&arg_conv); + int64_t ret_conv = BlindedHopFeatures_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBolt12OfferContext orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBlindedHopFeatures orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBolt12OfferContext ret_var = Bolt12OfferContext_clone(&orig_conv); + LDKBlindedHopFeatures ret_var = BlindedHopFeatures_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKBolt12OfferContext a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKBolt12OfferContext b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = Bolt12OfferContext_eq(&a_conv, &b_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKBolt12RefundContext this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Bolt12RefundContext_free(this_obj_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1new(JNIEnv *env, jclass clz) { - LDKBolt12RefundContext ret_var = Bolt12RefundContext_new(); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline uint64_t Bolt12RefundContext_clone_ptr(LDKBolt12RefundContext *NONNULL_PTR arg) { - LDKBolt12RefundContext ret_var = Bolt12RefundContext_clone(arg); +static inline uint64_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg) { + LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKBolt12RefundContext arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelTypeFeatures arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Bolt12RefundContext_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelTypeFeatures_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBolt12RefundContext orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelTypeFeatures orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBolt12RefundContext ret_var = Bolt12RefundContext_clone(&orig_conv); + LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKBolt12RefundContext a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKBolt12RefundContext b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = Bolt12RefundContext_eq(&a_conv, &b_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKInitFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = InitFeatures_hash(&o_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKForwardTlvs obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ForwardTlvs_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKNodeFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = NodeFeatures_hash(&o_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKReceiveTlvs obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ReceiveTlvs_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKChannelFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = ChannelFeatures_hash(&o_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKPaymentRelay obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = PaymentRelay_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKBolt11InvoiceFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = Bolt11InvoiceFeatures_hash(&o_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_PaymentRelayDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentRelayDecodeErrorZ), "LDKCResult_PaymentRelayDecodeErrorZ"); - *ret_conv = PaymentRelay_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKOfferFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = OfferFeatures_hash(&o_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKPaymentConstraints obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = PaymentConstraints_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKInvoiceRequestFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = InvoiceRequestFeatures_hash(&o_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_PaymentConstraintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentConstraintsDecodeErrorZ), "LDKCResult_PaymentConstraintsDecodeErrorZ"); - *ret_conv = PaymentConstraints_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKBolt12InvoiceFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = Bolt12InvoiceFeatures_hash(&o_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentContext_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKPaymentContext* obj_conv = (LDKPaymentContext*)untag_ptr(obj); - LDKCVec_u8Z ret_var = PaymentContext_write(obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKBlindedHopFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = BlindedHopFeatures_hash(&o_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentContext_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_PaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentContextDecodeErrorZ), "LDKCResult_PaymentContextDecodeErrorZ"); - *ret_conv = PaymentContext_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKChannelTypeFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = ChannelTypeFeatures_hash(&o_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKUnknownPaymentContext obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = UnknownPaymentContext_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInitFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InitFeatures_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); - *ret_conv = UnknownPaymentContext_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKNodeFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + NodeFeatures_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKBolt12OfferContext obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = Bolt12OfferContext_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelFeatures_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_Bolt12OfferContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12OfferContextDecodeErrorZ), "LDKCResult_Bolt12OfferContextDecodeErrorZ"); - *ret_conv = Bolt12OfferContext_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBolt11InvoiceFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Bolt11InvoiceFeatures_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKBolt12RefundContext obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = Bolt12RefundContext_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKOfferFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OfferFeatures_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_Bolt12RefundContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12RefundContextDecodeErrorZ), "LDKCResult_Bolt12RefundContextDecodeErrorZ"); - *ret_conv = Bolt12RefundContext_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInvoiceRequestFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InvoiceRequestFeatures_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKPaymentPurpose this_ptr_conv = *(LDKPaymentPurpose*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - PaymentPurpose_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBolt12InvoiceFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Bolt12InvoiceFeatures_free(this_obj_conv); } -static inline uint64_t PaymentPurpose_clone_ptr(LDKPaymentPurpose *NONNULL_PTR arg) { - LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); - *ret_copy = PaymentPurpose_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBlindedHopFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + BlindedHopFeatures_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKPaymentPurpose* arg_conv = (LDKPaymentPurpose*)untag_ptr(arg); - int64_t ret_conv = PaymentPurpose_clone_ptr(arg_conv); - return ret_conv; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelTypeFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelTypeFeatures_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPaymentPurpose* orig_conv = (LDKPaymentPurpose*)untag_ptr(orig); - LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); - *ret_copy = PaymentPurpose_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1for_1keysend(JNIEnv *env, jclass clz, jboolean allow_mpp) { + LDKBolt11InvoiceFeatures ret_var = Bolt11InvoiceFeatures_for_keysend(allow_mpp); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1bolt11_1invoice_1payment(JNIEnv *env, jclass clz, int64_t payment_preimage, int8_tArray payment_secret) { - void* payment_preimage_ptr = untag_ptr(payment_preimage); - CHECK_ACCESS(payment_preimage_ptr); - LDKCOption_ThirtyTwoBytesZ payment_preimage_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_preimage_ptr); - payment_preimage_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_preimage)); - LDKThirtyTwoBytes payment_secret_ref; - CHECK((*env)->GetArrayLength(env, payment_secret) == 32); - (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data); - LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); - *ret_copy = PaymentPurpose_bolt11_invoice_payment(payment_preimage_conv, payment_secret_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1only_1static_1remote_1key(JNIEnv *env, jclass clz) { + LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_only_static_remote_key(); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1bolt12_1offer_1payment(JNIEnv *env, jclass clz, int64_t payment_preimage, int8_tArray payment_secret, int64_t payment_context) { - void* payment_preimage_ptr = untag_ptr(payment_preimage); - CHECK_ACCESS(payment_preimage_ptr); - LDKCOption_ThirtyTwoBytesZ payment_preimage_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_preimage_ptr); - payment_preimage_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_preimage)); - LDKThirtyTwoBytes payment_secret_ref; - CHECK((*env)->GetArrayLength(env, payment_secret) == 32); - (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data); - LDKBolt12OfferContext payment_context_conv; - payment_context_conv.inner = untag_ptr(payment_context); - payment_context_conv.is_owned = ptr_is_owned(payment_context); - CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_context_conv); - payment_context_conv = Bolt12OfferContext_clone(&payment_context_conv); - LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); - *ret_copy = PaymentPurpose_bolt12_offer_payment(payment_preimage_conv, payment_secret_ref, payment_context_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1anchors_1zero_1htlc_1fee_1and_1dependencies(JNIEnv *env, jclass clz) { + LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_anchors_zero_htlc_fee_and_dependencies(); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1bolt12_1refund_1payment(JNIEnv *env, jclass clz, int64_t payment_preimage, int8_tArray payment_secret, int64_t payment_context) { - void* payment_preimage_ptr = untag_ptr(payment_preimage); - CHECK_ACCESS(payment_preimage_ptr); - LDKCOption_ThirtyTwoBytesZ payment_preimage_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_preimage_ptr); - payment_preimage_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_preimage)); - LDKThirtyTwoBytes payment_secret_ref; - CHECK((*env)->GetArrayLength(env, payment_secret) == 32); - (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data); - LDKBolt12RefundContext payment_context_conv; - payment_context_conv.inner = untag_ptr(payment_context); - payment_context_conv.is_owned = ptr_is_owned(payment_context); - CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_context_conv); - payment_context_conv = Bolt12RefundContext_clone(&payment_context_conv); - LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); - *ret_copy = PaymentPurpose_bolt12_refund_payment(payment_preimage_conv, payment_secret_ref, payment_context_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1empty(JNIEnv *env, jclass clz) { + LDKInitFeatures ret_var = InitFeatures_empty(); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1spontaneous_1payment(JNIEnv *env, jclass clz, int8_tArray a) { - LDKThirtyTwoBytes a_ref; - CHECK((*env)->GetArrayLength(env, a) == 32); - (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data); - LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); - *ret_copy = PaymentPurpose_spontaneous_payment(a_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InitFeatures_1le_1flags(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKu8slice ret_var = InitFeatures_le_flags(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKPaymentPurpose* a_conv = (LDKPaymentPurpose*)untag_ptr(a); - LDKPaymentPurpose* b_conv = (LDKPaymentPurpose*)untag_ptr(b); - jboolean ret_conv = PaymentPurpose_eq(a_conv, b_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1any_1optional_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_any_optional_bits(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1preimage(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKPaymentPurpose* this_arg_conv = (LDKPaymentPurpose*)untag_ptr(this_arg); - LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); - *ret_copy = PaymentPurpose_preimage(this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKInitFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKPaymentPurpose* obj_conv = (LDKPaymentPurpose*)untag_ptr(obj); - LDKCVec_u8Z ret_var = PaymentPurpose_write(obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_InitFeatures_1required_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKInitFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + LDKCVec_u64Z ret_var = InitFeatures_required_unknown_bits_from(&this_arg_conv, &other_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); - *ret_conv = PaymentPurpose_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_unknown_bits(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKClaimedHTLC this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ClaimedHTLC_free(this_obj_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_unknown_bits(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKClaimedHTLC this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelId ret_var = ClaimedHTLC_get_channel_id(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1required_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = InitFeatures_set_required_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKClaimedHTLC this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelId val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelId_clone(&val_conv); - ClaimedHTLC_set_channel_id(&this_ptr_conv, val_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1optional_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = InitFeatures_set_optional_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1get_1user_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKClaimedHTLC this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 16); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 16, ClaimedHTLC_get_user_channel_id(&this_ptr_conv).le_bytes); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1required_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = InitFeatures_set_required_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1set_1user_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKClaimedHTLC this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKU128 val_ref; - CHECK((*env)->GetArrayLength(env, val) == 16); - (*env)->GetByteArrayRegion(env, val, 0, 16, val_ref.le_bytes); - ClaimedHTLC_set_user_channel_id(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1optional_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = InitFeatures_set_optional_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1get_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKClaimedHTLC this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int32_t ret_conv = ClaimedHTLC_get_cltv_expiry(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1empty(JNIEnv *env, jclass clz) { + LDKNodeFeatures ret_var = NodeFeatures_empty(); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1set_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKClaimedHTLC this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ClaimedHTLC_set_cltv_expiry(&this_ptr_conv, val); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1le_1flags(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKu8slice ret_var = NodeFeatures_le_flags(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1get_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKClaimedHTLC this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = ClaimedHTLC_get_value_msat(&this_ptr_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1any_1optional_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_any_optional_bits(&this_arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1set_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKClaimedHTLC this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ClaimedHTLC_set_value_msat(&this_ptr_conv, val); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1get_1counterparty_1skimmed_1fee_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKClaimedHTLC this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = ClaimedHTLC_get_counterparty_skimmed_fee_msat(&this_ptr_conv); +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1required_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + LDKCVec_u64Z ret_var = NodeFeatures_required_unknown_bits_from(&this_arg_conv, &other_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_unknown_bits(&this_arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1set_1counterparty_1skimmed_1fee_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKClaimedHTLC this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ClaimedHTLC_set_counterparty_skimmed_fee_msat(&this_ptr_conv, val); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_unknown_bits(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1new(JNIEnv *env, jclass clz, int64_t channel_id_arg, int8_tArray user_channel_id_arg, int32_t cltv_expiry_arg, int64_t value_msat_arg, int64_t counterparty_skimmed_fee_msat_arg) { - LDKChannelId channel_id_arg_conv; - channel_id_arg_conv.inner = untag_ptr(channel_id_arg); - channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); - channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); - LDKU128 user_channel_id_arg_ref; - CHECK((*env)->GetArrayLength(env, user_channel_id_arg) == 16); - (*env)->GetByteArrayRegion(env, user_channel_id_arg, 0, 16, user_channel_id_arg_ref.le_bytes); - LDKClaimedHTLC ret_var = ClaimedHTLC_new(channel_id_arg_conv, user_channel_id_arg_ref, cltv_expiry_arg, value_msat_arg, counterparty_skimmed_fee_msat_arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1required_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = NodeFeatures_set_required_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -static inline uint64_t ClaimedHTLC_clone_ptr(LDKClaimedHTLC *NONNULL_PTR arg) { - LDKClaimedHTLC ret_var = ClaimedHTLC_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1optional_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = NodeFeatures_set_optional_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKClaimedHTLC arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = ClaimedHTLC_clone_ptr(&arg_conv); - return ret_conv; + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1required_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = NodeFeatures_set_required_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKClaimedHTLC orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKClaimedHTLC ret_var = ClaimedHTLC_clone(&orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1optional_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = NodeFeatures_set_optional_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1empty(JNIEnv *env, jclass clz) { + LDKChannelFeatures ret_var = ChannelFeatures_empty(); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKClaimedHTLC a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKClaimedHTLC b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = ClaimedHTLC_eq(&a_conv, &b_conv); - return ret_conv; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKClaimedHTLC obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ClaimedHTLC_write(&obj_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1le_1flags(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKu8slice ret_var = ChannelFeatures_le_flags(&this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_ClaimedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClaimedHTLCDecodeErrorZ), "LDKCResult_ClaimedHTLCDecodeErrorZ"); - *ret_conv = ClaimedHTLC_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1supports_1any_1optional_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelFeatures_supports_any_optional_bits(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PathFailure_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKPathFailure this_ptr_conv = *(LDKPathFailure*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - PathFailure_free(this_ptr_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1requires_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + jboolean ret_conv = ChannelFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); + return ret_conv; } -static inline uint64_t PathFailure_clone_ptr(LDKPathFailure *NONNULL_PTR arg) { - LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure"); - *ret_copy = PathFailure_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1required_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + LDKCVec_u64Z ret_var = ChannelFeatures_required_unknown_bits_from(&this_arg_conv, &other_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PathFailure_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKPathFailure* arg_conv = (LDKPathFailure*)untag_ptr(arg); - int64_t ret_conv = PathFailure_clone_ptr(arg_conv); + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelFeatures_requires_unknown_bits(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PathFailure_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPathFailure* orig_conv = (LDKPathFailure*)untag_ptr(orig); - LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure"); - *ret_copy = PathFailure_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1supports_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelFeatures_supports_unknown_bits(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PathFailure_1initial_1send(JNIEnv *env, jclass clz, int64_t err) { - void* err_ptr = untag_ptr(err); - CHECK_ACCESS(err_ptr); - LDKAPIError err_conv = *(LDKAPIError*)(err_ptr); - err_conv = APIError_clone((LDKAPIError*)untag_ptr(err)); - LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure"); - *ret_copy = PathFailure_initial_send(err_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1set_1required_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelFeatures_set_required_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PathFailure_1on_1path(JNIEnv *env, jclass clz, int64_t network_update) { - void* network_update_ptr = untag_ptr(network_update); - CHECK_ACCESS(network_update_ptr); - LDKCOption_NetworkUpdateZ network_update_conv = *(LDKCOption_NetworkUpdateZ*)(network_update_ptr); - network_update_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)untag_ptr(network_update)); - LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure"); - *ret_copy = PathFailure_on_path(network_update_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1set_1optional_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelFeatures_set_optional_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PathFailure_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKPathFailure* a_conv = (LDKPathFailure*)untag_ptr(a); - LDKPathFailure* b_conv = (LDKPathFailure*)untag_ptr(b); - jboolean ret_conv = PathFailure_eq(a_conv, b_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1set_1required_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelFeatures_set_required_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PathFailure_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKPathFailure* obj_conv = (LDKPathFailure*)untag_ptr(obj); - LDKCVec_u8Z ret_var = PathFailure_write(obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1set_1optional_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelFeatures_set_optional_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1empty(JNIEnv *env, jclass clz) { + LDKBolt11InvoiceFeatures ret_var = Bolt11InvoiceFeatures_empty(); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1le_1flags(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKu8slice ret_var = Bolt11InvoiceFeatures_le_flags(&this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PathFailure_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ"); - *ret_conv = PathFailure_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1supports_1any_1optional_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt11InvoiceFeatures_supports_any_optional_bits(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosureReason_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKClosureReason this_ptr_conv = *(LDKClosureReason*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - ClosureReason_free(this_ptr_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKBolt11InvoiceFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + jboolean ret_conv = Bolt11InvoiceFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); + return ret_conv; } -static inline uint64_t ClosureReason_clone_ptr(LDKClosureReason *NONNULL_PTR arg) { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1required_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKBolt11InvoiceFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + LDKCVec_u64Z ret_var = Bolt11InvoiceFeatures_required_unknown_bits_from(&this_arg_conv, &other_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKClosureReason* arg_conv = (LDKClosureReason*)untag_ptr(arg); - int64_t ret_conv = ClosureReason_clone_ptr(arg_conv); + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt11InvoiceFeatures_requires_unknown_bits(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKClosureReason* orig_conv = (LDKClosureReason*)untag_ptr(orig); - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1supports_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt11InvoiceFeatures_supports_unknown_bits(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1counterparty_1force_1closed(JNIEnv *env, jclass clz, int64_t peer_msg) { - LDKUntrustedString peer_msg_conv; - peer_msg_conv.inner = untag_ptr(peer_msg); - peer_msg_conv.is_owned = ptr_is_owned(peer_msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(peer_msg_conv); - peer_msg_conv = UntrustedString_clone(&peer_msg_conv); - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_counterparty_force_closed(peer_msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1required_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = Bolt11InvoiceFeatures_set_required_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1holder_1force_1closed(JNIEnv *env, jclass clz) { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_holder_force_closed(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1optional_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = Bolt11InvoiceFeatures_set_optional_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1legacy_1cooperative_1closure(JNIEnv *env, jclass clz) { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_legacy_cooperative_closure(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1required_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = Bolt11InvoiceFeatures_set_required_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1counterparty_1initiated_1cooperative_1closure(JNIEnv *env, jclass clz) { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_counterparty_initiated_cooperative_closure(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1optional_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = Bolt11InvoiceFeatures_set_optional_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1locally_1initiated_1cooperative_1closure(JNIEnv *env, jclass clz) { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_locally_initiated_cooperative_closure(); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1empty(JNIEnv *env, jclass clz) { + LDKOfferFeatures ret_var = OfferFeatures_empty(); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1commitment_1tx_1confirmed(JNIEnv *env, jclass clz) { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_commitment_tx_confirmed(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1le_1flags(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKu8slice ret_var = OfferFeatures_le_flags(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1funding_1timed_1out(JNIEnv *env, jclass clz) { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_funding_timed_out(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1supports_1any_1optional_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = OfferFeatures_supports_any_optional_bits(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1processing_1error(JNIEnv *env, jclass clz, jstring err) { - LDKStr err_conv = java_to_owned_str(env, err); - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_processing_error(err_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1requires_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKOfferFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + jboolean ret_conv = OfferFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1disconnected_1peer(JNIEnv *env, jclass clz) { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_disconnected_peer(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1required_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKOfferFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + LDKCVec_u64Z ret_var = OfferFeatures_required_unknown_bits_from(&this_arg_conv, &other_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1outdated_1channel_1manager(JNIEnv *env, jclass clz) { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_outdated_channel_manager(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = OfferFeatures_requires_unknown_bits(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1counterparty_1coop_1closed_1unfunded_1channel(JNIEnv *env, jclass clz) { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_counterparty_coop_closed_unfunded_channel(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1supports_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = OfferFeatures_supports_unknown_bits(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1funding_1batch_1closure(JNIEnv *env, jclass clz) { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_funding_batch_closure(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1set_1required_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = OfferFeatures_set_required_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1htlcs_1timed_1out(JNIEnv *env, jclass clz) { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_htlcs_timed_out(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1set_1optional_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = OfferFeatures_set_optional_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ClosureReason_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKClosureReason* a_conv = (LDKClosureReason*)untag_ptr(a); - LDKClosureReason* b_conv = (LDKClosureReason*)untag_ptr(b); - jboolean ret_conv = ClosureReason_eq(a_conv, b_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1set_1required_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = OfferFeatures_set_required_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ClosureReason_1to_1str(JNIEnv *env, jclass clz, int64_t o) { - LDKClosureReason* o_conv = (LDKClosureReason*)untag_ptr(o); - LDKStr ret_str = ClosureReason_to_str(o_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1set_1optional_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = OfferFeatures_set_optional_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosureReason_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKClosureReason* obj_conv = (LDKClosureReason*)untag_ptr(obj); - LDKCVec_u8Z ret_var = ClosureReason_write(obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1empty(JNIEnv *env, jclass clz) { + LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_empty(); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1le_1flags(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKu8slice ret_var = InvoiceRequestFeatures_le_flags(&this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); - *ret_conv = ClosureReason_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1supports_1any_1optional_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InvoiceRequestFeatures_supports_any_optional_bits(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKHTLCDestination this_ptr_conv = *(LDKHTLCDestination*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - HTLCDestination_free(this_ptr_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1requires_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKInvoiceRequestFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + jboolean ret_conv = InvoiceRequestFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); + return ret_conv; } -static inline uint64_t HTLCDestination_clone_ptr(LDKHTLCDestination *NONNULL_PTR arg) { - LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); - *ret_copy = HTLCDestination_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1required_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKInvoiceRequestFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + LDKCVec_u64Z ret_var = InvoiceRequestFeatures_required_unknown_bits_from(&this_arg_conv, &other_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKHTLCDestination* arg_conv = (LDKHTLCDestination*)untag_ptr(arg); - int64_t ret_conv = HTLCDestination_clone_ptr(arg_conv); + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InvoiceRequestFeatures_requires_unknown_bits(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKHTLCDestination* orig_conv = (LDKHTLCDestination*)untag_ptr(orig); - LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); - *ret_copy = HTLCDestination_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1supports_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InvoiceRequestFeatures_supports_unknown_bits(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1next_1hop_1channel(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t channel_id) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKChannelId channel_id_conv; - channel_id_conv.inner = untag_ptr(channel_id); - channel_id_conv.is_owned = ptr_is_owned(channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); - channel_id_conv = ChannelId_clone(&channel_id_conv); - LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); - *ret_copy = HTLCDestination_next_hop_channel(node_id_ref, channel_id_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1set_1required_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = InvoiceRequestFeatures_set_required_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1unknown_1next_1hop(JNIEnv *env, jclass clz, int64_t requested_forward_scid) { - LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); - *ret_copy = HTLCDestination_unknown_next_hop(requested_forward_scid); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1set_1optional_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = InvoiceRequestFeatures_set_optional_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1invalid_1forward(JNIEnv *env, jclass clz, int64_t requested_forward_scid) { - LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); - *ret_copy = HTLCDestination_invalid_forward(requested_forward_scid); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1set_1required_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = InvoiceRequestFeatures_set_required_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1invalid_1onion(JNIEnv *env, jclass clz) { - LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); - *ret_copy = HTLCDestination_invalid_onion(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1set_1optional_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = InvoiceRequestFeatures_set_optional_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1failed_1payment(JNIEnv *env, jclass clz, int8_tArray payment_hash) { - LDKThirtyTwoBytes payment_hash_ref; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); - *ret_copy = HTLCDestination_failed_payment(payment_hash_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1empty(JNIEnv *env, jclass clz) { + LDKBolt12InvoiceFeatures ret_var = Bolt12InvoiceFeatures_empty(); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKHTLCDestination* a_conv = (LDKHTLCDestination*)untag_ptr(a); - LDKHTLCDestination* b_conv = (LDKHTLCDestination*)untag_ptr(b); - jboolean ret_conv = HTLCDestination_eq(a_conv, b_conv); - return ret_conv; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKHTLCDestination* obj_conv = (LDKHTLCDestination*)untag_ptr(obj); - LDKCVec_u8Z ret_var = HTLCDestination_write(obj_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1le_1flags(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKu8slice ret_var = Bolt12InvoiceFeatures_le_flags(&this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ"); - *ret_conv = HTLCDestination_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1supports_1any_1optional_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt12InvoiceFeatures_supports_any_optional_bits(&this_arg_conv); + return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPaymentFailureReason* orig_conv = (LDKPaymentFailureReason*)untag_ptr(orig); - jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_clone(orig_conv)); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1requires_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKBolt12InvoiceFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + jboolean ret_conv = Bolt12InvoiceFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1recipient_1rejected(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_recipient_rejected()); - return ret_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1required_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKBolt12InvoiceFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + LDKCVec_u64Z ret_var = Bolt12InvoiceFeatures_required_unknown_bits_from(&this_arg_conv, &other_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1user_1abandoned(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_user_abandoned()); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt12InvoiceFeatures_requires_unknown_bits(&this_arg_conv); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1retries_1exhausted(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_retries_exhausted()); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1supports_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt12InvoiceFeatures_supports_unknown_bits(&this_arg_conv); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1payment_1expired(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_payment_expired()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1required_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = Bolt12InvoiceFeatures_set_required_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1route_1not_1found(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_route_not_found()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1optional_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = Bolt12InvoiceFeatures_set_optional_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1unexpected_1error(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_unexpected_error()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1required_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = Bolt12InvoiceFeatures_set_required_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKPaymentFailureReason* a_conv = (LDKPaymentFailureReason*)untag_ptr(a); - LDKPaymentFailureReason* b_conv = (LDKPaymentFailureReason*)untag_ptr(b); - jboolean ret_conv = PaymentFailureReason_eq(a_conv, b_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1optional_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = Bolt12InvoiceFeatures_set_optional_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKPaymentFailureReason* obj_conv = (LDKPaymentFailureReason*)untag_ptr(obj); - LDKCVec_u8Z ret_var = PaymentFailureReason_write(obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1empty(JNIEnv *env, jclass clz) { + LDKBlindedHopFeatures ret_var = BlindedHopFeatures_empty(); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1le_1flags(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKu8slice ret_var = BlindedHopFeatures_le_flags(&this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_PaymentFailureReasonDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentFailureReasonDecodeErrorZ), "LDKCResult_PaymentFailureReasonDecodeErrorZ"); - *ret_conv = PaymentFailureReason_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1supports_1any_1optional_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = BlindedHopFeatures_supports_any_optional_bits(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Event_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKEvent this_ptr_conv = *(LDKEvent*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Event_free(this_ptr_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1requires_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKBlindedHopFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + jboolean ret_conv = BlindedHopFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); + return ret_conv; } -static inline uint64_t Event_clone_ptr(LDKEvent *NONNULL_PTR arg) { - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1required_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKBlindedHopFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + LDKCVec_u64Z ret_var = BlindedHopFeatures_required_unknown_bits_from(&this_arg_conv, &other_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKEvent* arg_conv = (LDKEvent*)untag_ptr(arg); - int64_t ret_conv = Event_clone_ptr(arg_conv); + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = BlindedHopFeatures_requires_unknown_bits(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKEvent* orig_conv = (LDKEvent*)untag_ptr(orig); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1supports_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = BlindedHopFeatures_supports_unknown_bits(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1funding_1generation_1ready(JNIEnv *env, jclass clz, int64_t temporary_channel_id, int8_tArray counterparty_node_id, int64_t channel_value_satoshis, int8_tArray output_script, int8_tArray user_channel_id) { - LDKChannelId temporary_channel_id_conv; - temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); - temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); - temporary_channel_id_conv = ChannelId_clone(&temporary_channel_id_conv); - LDKPublicKey counterparty_node_id_ref; - CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); - (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); - LDKCVec_u8Z output_script_ref; - output_script_ref.datalen = (*env)->GetArrayLength(env, output_script); - output_script_ref.data = MALLOC(output_script_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, output_script, 0, output_script_ref.datalen, output_script_ref.data); - LDKU128 user_channel_id_ref; - CHECK((*env)->GetArrayLength(env, user_channel_id) == 16); - (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_funding_generation_ready(temporary_channel_id_conv, counterparty_node_id_ref, channel_value_satoshis, output_script_ref, user_channel_id_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1set_1required_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = BlindedHopFeatures_set_required_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1claimable(JNIEnv *env, jclass clz, int8_tArray receiver_node_id, int8_tArray payment_hash, int64_t onion_fields, int64_t amount_msat, int64_t counterparty_skimmed_fee_msat, int64_t purpose, int64_t via_channel_id, int64_t via_user_channel_id, int64_t claim_deadline) { - LDKPublicKey receiver_node_id_ref; - CHECK((*env)->GetArrayLength(env, receiver_node_id) == 33); - (*env)->GetByteArrayRegion(env, receiver_node_id, 0, 33, receiver_node_id_ref.compressed_form); - LDKThirtyTwoBytes payment_hash_ref; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - LDKRecipientOnionFields onion_fields_conv; - onion_fields_conv.inner = untag_ptr(onion_fields); - onion_fields_conv.is_owned = ptr_is_owned(onion_fields); - CHECK_INNER_FIELD_ACCESS_OR_NULL(onion_fields_conv); - onion_fields_conv = RecipientOnionFields_clone(&onion_fields_conv); - void* purpose_ptr = untag_ptr(purpose); - CHECK_ACCESS(purpose_ptr); - LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr); - purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose)); - LDKChannelId via_channel_id_conv; - via_channel_id_conv.inner = untag_ptr(via_channel_id); - via_channel_id_conv.is_owned = ptr_is_owned(via_channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(via_channel_id_conv); - via_channel_id_conv = ChannelId_clone(&via_channel_id_conv); - void* via_user_channel_id_ptr = untag_ptr(via_user_channel_id); - CHECK_ACCESS(via_user_channel_id_ptr); - LDKCOption_U128Z via_user_channel_id_conv = *(LDKCOption_U128Z*)(via_user_channel_id_ptr); - via_user_channel_id_conv = COption_U128Z_clone((LDKCOption_U128Z*)untag_ptr(via_user_channel_id)); - void* claim_deadline_ptr = untag_ptr(claim_deadline); - CHECK_ACCESS(claim_deadline_ptr); - LDKCOption_u32Z claim_deadline_conv = *(LDKCOption_u32Z*)(claim_deadline_ptr); - claim_deadline_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(claim_deadline)); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_claimable(receiver_node_id_ref, payment_hash_ref, onion_fields_conv, amount_msat, counterparty_skimmed_fee_msat, purpose_conv, via_channel_id_conv, via_user_channel_id_conv, claim_deadline_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1set_1optional_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = BlindedHopFeatures_set_optional_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1claimed(JNIEnv *env, jclass clz, int8_tArray receiver_node_id, int8_tArray payment_hash, int64_t amount_msat, int64_t purpose, int64_tArray htlcs, int64_t sender_intended_total_msat) { - LDKPublicKey receiver_node_id_ref; - CHECK((*env)->GetArrayLength(env, receiver_node_id) == 33); - (*env)->GetByteArrayRegion(env, receiver_node_id, 0, 33, receiver_node_id_ref.compressed_form); - LDKThirtyTwoBytes payment_hash_ref; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - void* purpose_ptr = untag_ptr(purpose); - CHECK_ACCESS(purpose_ptr); - LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr); - purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose)); - LDKCVec_ClaimedHTLCZ htlcs_constr; - htlcs_constr.datalen = (*env)->GetArrayLength(env, htlcs); - if (htlcs_constr.datalen > 0) - htlcs_constr.data = MALLOC(htlcs_constr.datalen * sizeof(LDKClaimedHTLC), "LDKCVec_ClaimedHTLCZ Elements"); - else - htlcs_constr.data = NULL; - int64_t* htlcs_vals = (*env)->GetLongArrayElements (env, htlcs, NULL); - for (size_t n = 0; n < htlcs_constr.datalen; n++) { - int64_t htlcs_conv_13 = htlcs_vals[n]; - LDKClaimedHTLC htlcs_conv_13_conv; - htlcs_conv_13_conv.inner = untag_ptr(htlcs_conv_13); - htlcs_conv_13_conv.is_owned = ptr_is_owned(htlcs_conv_13); - CHECK_INNER_FIELD_ACCESS_OR_NULL(htlcs_conv_13_conv); - htlcs_conv_13_conv = ClaimedHTLC_clone(&htlcs_conv_13_conv); - htlcs_constr.data[n] = htlcs_conv_13_conv; - } - (*env)->ReleaseLongArrayElements(env, htlcs, htlcs_vals, 0); - void* sender_intended_total_msat_ptr = untag_ptr(sender_intended_total_msat); - CHECK_ACCESS(sender_intended_total_msat_ptr); - LDKCOption_u64Z sender_intended_total_msat_conv = *(LDKCOption_u64Z*)(sender_intended_total_msat_ptr); - sender_intended_total_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(sender_intended_total_msat)); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_claimed(receiver_node_id_ref, payment_hash_ref, amount_msat, purpose_conv, htlcs_constr, sender_intended_total_msat_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1set_1required_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = BlindedHopFeatures_set_required_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1connection_1needed(JNIEnv *env, jclass clz, int8_tArray node_id, int64_tArray addresses) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKCVec_SocketAddressZ addresses_constr; - addresses_constr.datalen = (*env)->GetArrayLength(env, addresses); - if (addresses_constr.datalen > 0) - addresses_constr.data = MALLOC(addresses_constr.datalen * sizeof(LDKSocketAddress), "LDKCVec_SocketAddressZ Elements"); - else - addresses_constr.data = NULL; - int64_t* addresses_vals = (*env)->GetLongArrayElements (env, addresses, NULL); - for (size_t p = 0; p < addresses_constr.datalen; p++) { - int64_t addresses_conv_15 = addresses_vals[p]; - void* addresses_conv_15_ptr = untag_ptr(addresses_conv_15); - CHECK_ACCESS(addresses_conv_15_ptr); - LDKSocketAddress addresses_conv_15_conv = *(LDKSocketAddress*)(addresses_conv_15_ptr); - addresses_constr.data[p] = addresses_conv_15_conv; - } - (*env)->ReleaseLongArrayElements(env, addresses, addresses_vals, 0); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_connection_needed(node_id_ref, addresses_constr); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1set_1optional_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = BlindedHopFeatures_set_optional_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1invoice_1request_1failed(JNIEnv *env, jclass clz, int8_tArray payment_id) { - LDKThirtyTwoBytes payment_id_ref; - CHECK((*env)->GetArrayLength(env, payment_id) == 32); - (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_invoice_request_failed(payment_id_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1empty(JNIEnv *env, jclass clz) { + LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_empty(); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1sent(JNIEnv *env, jclass clz, int64_t payment_id, int8_tArray payment_preimage, int8_tArray payment_hash, int64_t fee_paid_msat) { - void* payment_id_ptr = untag_ptr(payment_id); - CHECK_ACCESS(payment_id_ptr); - LDKCOption_ThirtyTwoBytesZ payment_id_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_id_ptr); - payment_id_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_id)); - LDKThirtyTwoBytes payment_preimage_ref; - CHECK((*env)->GetArrayLength(env, payment_preimage) == 32); - (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data); - LDKThirtyTwoBytes payment_hash_ref; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - void* fee_paid_msat_ptr = untag_ptr(fee_paid_msat); - CHECK_ACCESS(fee_paid_msat_ptr); - LDKCOption_u64Z fee_paid_msat_conv = *(LDKCOption_u64Z*)(fee_paid_msat_ptr); - fee_paid_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(fee_paid_msat)); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_sent(payment_id_conv, payment_preimage_ref, payment_hash_ref, fee_paid_msat_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1le_1flags(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKu8slice ret_var = ChannelTypeFeatures_le_flags(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1failed(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_hash, int64_t reason) { - LDKThirtyTwoBytes payment_id_ref; - CHECK((*env)->GetArrayLength(env, payment_id) == 32); - (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); - LDKThirtyTwoBytes payment_hash_ref; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - void* reason_ptr = untag_ptr(reason); - CHECK_ACCESS(reason_ptr); - LDKCOption_PaymentFailureReasonZ reason_conv = *(LDKCOption_PaymentFailureReasonZ*)(reason_ptr); - reason_conv = COption_PaymentFailureReasonZ_clone((LDKCOption_PaymentFailureReasonZ*)untag_ptr(reason)); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_failed(payment_id_ref, payment_hash_ref, reason_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1any_1optional_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_supports_any_optional_bits(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1successful(JNIEnv *env, jclass clz, int8_tArray payment_id, int64_t payment_hash, int64_t path) { - LDKThirtyTwoBytes payment_id_ref; - CHECK((*env)->GetArrayLength(env, payment_id) == 32); - (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); - void* payment_hash_ptr = untag_ptr(payment_hash); - CHECK_ACCESS(payment_hash_ptr); - LDKCOption_ThirtyTwoBytesZ payment_hash_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_ptr); - payment_hash_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash)); - LDKPath path_conv; - path_conv.inner = untag_ptr(path); - path_conv.is_owned = ptr_is_owned(path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); - path_conv = Path_clone(&path_conv); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_path_successful(payment_id_ref, payment_hash_conv, path_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelTypeFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1failed(JNIEnv *env, jclass clz, int64_t payment_id, int8_tArray payment_hash, jboolean payment_failed_permanently, int64_t failure, int64_t path, int64_t short_channel_id) { - void* payment_id_ptr = untag_ptr(payment_id); - CHECK_ACCESS(payment_id_ptr); - LDKCOption_ThirtyTwoBytesZ payment_id_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_id_ptr); - payment_id_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_id)); - LDKThirtyTwoBytes payment_hash_ref; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - void* failure_ptr = untag_ptr(failure); - CHECK_ACCESS(failure_ptr); - LDKPathFailure failure_conv = *(LDKPathFailure*)(failure_ptr); - failure_conv = PathFailure_clone((LDKPathFailure*)untag_ptr(failure)); - LDKPath path_conv; - path_conv.inner = untag_ptr(path); - path_conv.is_owned = ptr_is_owned(path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); - path_conv = Path_clone(&path_conv); - void* short_channel_id_ptr = untag_ptr(short_channel_id); - CHECK_ACCESS(short_channel_id_ptr); - LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr); - short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id)); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_path_failed(payment_id_conv, payment_hash_ref, payment_failed_permanently, failure_conv, path_conv, short_channel_id_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1required_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelTypeFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + LDKCVec_u64Z ret_var = ChannelTypeFeatures_required_unknown_bits_from(&this_arg_conv, &other_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1probe_1successful(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_hash, int64_t path) { - LDKThirtyTwoBytes payment_id_ref; - CHECK((*env)->GetArrayLength(env, payment_id) == 32); - (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); - LDKThirtyTwoBytes payment_hash_ref; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - LDKPath path_conv; - path_conv.inner = untag_ptr(path); - path_conv.is_owned = ptr_is_owned(path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); - path_conv = Path_clone(&path_conv); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_probe_successful(payment_id_ref, payment_hash_ref, path_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_requires_unknown_bits(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1probe_1failed(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_hash, int64_t path, int64_t short_channel_id) { - LDKThirtyTwoBytes payment_id_ref; - CHECK((*env)->GetArrayLength(env, payment_id) == 32); - (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); - LDKThirtyTwoBytes payment_hash_ref; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - LDKPath path_conv; - path_conv.inner = untag_ptr(path); - path_conv.is_owned = ptr_is_owned(path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); - path_conv = Path_clone(&path_conv); - void* short_channel_id_ptr = untag_ptr(short_channel_id); - CHECK_ACCESS(short_channel_id_ptr); - LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr); - short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id)); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_probe_failed(payment_id_ref, payment_hash_ref, path_conv, short_channel_id_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_supports_unknown_bits(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1pending_1htlcs_1forwardable(JNIEnv *env, jclass clz, int64_t time_forwardable) { - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_pending_htlcs_forwardable(time_forwardable); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1required_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelTypeFeatures_set_required_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1htlcintercepted(JNIEnv *env, jclass clz, int8_tArray intercept_id, int64_t requested_next_hop_scid, int8_tArray payment_hash, int64_t inbound_amount_msat, int64_t expected_outbound_amount_msat) { - LDKThirtyTwoBytes intercept_id_ref; - CHECK((*env)->GetArrayLength(env, intercept_id) == 32); - (*env)->GetByteArrayRegion(env, intercept_id, 0, 32, intercept_id_ref.data); - LDKThirtyTwoBytes payment_hash_ref; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_htlcintercepted(intercept_id_ref, requested_next_hop_scid, payment_hash_ref, inbound_amount_msat, expected_outbound_amount_msat); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1optional_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelTypeFeatures_set_optional_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1spendable_1outputs(JNIEnv *env, jclass clz, int64_tArray outputs, int64_t channel_id) { - LDKCVec_SpendableOutputDescriptorZ outputs_constr; - outputs_constr.datalen = (*env)->GetArrayLength(env, outputs); - if (outputs_constr.datalen > 0) - outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); - else - outputs_constr.data = NULL; - int64_t* outputs_vals = (*env)->GetLongArrayElements (env, outputs, NULL); - for (size_t b = 0; b < outputs_constr.datalen; b++) { - int64_t outputs_conv_27 = outputs_vals[b]; - void* outputs_conv_27_ptr = untag_ptr(outputs_conv_27); - CHECK_ACCESS(outputs_conv_27_ptr); - LDKSpendableOutputDescriptor outputs_conv_27_conv = *(LDKSpendableOutputDescriptor*)(outputs_conv_27_ptr); - outputs_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(outputs_conv_27)); - outputs_constr.data[b] = outputs_conv_27_conv; - } - (*env)->ReleaseLongArrayElements(env, outputs, outputs_vals, 0); - LDKChannelId channel_id_conv; - channel_id_conv.inner = untag_ptr(channel_id); - channel_id_conv.is_owned = ptr_is_owned(channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); - channel_id_conv = ChannelId_clone(&channel_id_conv); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_spendable_outputs(outputs_constr, channel_id_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1required_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelTypeFeatures_set_required_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1forwarded(JNIEnv *env, jclass clz, int64_t prev_channel_id, int64_t next_channel_id, int64_t prev_user_channel_id, int64_t next_user_channel_id, int64_t total_fee_earned_msat, int64_t skimmed_fee_msat, jboolean claim_from_onchain_tx, int64_t outbound_amount_forwarded_msat) { - LDKChannelId prev_channel_id_conv; - prev_channel_id_conv.inner = untag_ptr(prev_channel_id); - prev_channel_id_conv.is_owned = ptr_is_owned(prev_channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(prev_channel_id_conv); - prev_channel_id_conv = ChannelId_clone(&prev_channel_id_conv); - LDKChannelId next_channel_id_conv; - next_channel_id_conv.inner = untag_ptr(next_channel_id); - next_channel_id_conv.is_owned = ptr_is_owned(next_channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(next_channel_id_conv); - next_channel_id_conv = ChannelId_clone(&next_channel_id_conv); - void* prev_user_channel_id_ptr = untag_ptr(prev_user_channel_id); - CHECK_ACCESS(prev_user_channel_id_ptr); - LDKCOption_U128Z prev_user_channel_id_conv = *(LDKCOption_U128Z*)(prev_user_channel_id_ptr); - prev_user_channel_id_conv = COption_U128Z_clone((LDKCOption_U128Z*)untag_ptr(prev_user_channel_id)); - void* next_user_channel_id_ptr = untag_ptr(next_user_channel_id); - CHECK_ACCESS(next_user_channel_id_ptr); - LDKCOption_U128Z next_user_channel_id_conv = *(LDKCOption_U128Z*)(next_user_channel_id_ptr); - next_user_channel_id_conv = COption_U128Z_clone((LDKCOption_U128Z*)untag_ptr(next_user_channel_id)); - void* total_fee_earned_msat_ptr = untag_ptr(total_fee_earned_msat); - CHECK_ACCESS(total_fee_earned_msat_ptr); - LDKCOption_u64Z total_fee_earned_msat_conv = *(LDKCOption_u64Z*)(total_fee_earned_msat_ptr); - total_fee_earned_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(total_fee_earned_msat)); - void* skimmed_fee_msat_ptr = untag_ptr(skimmed_fee_msat); - CHECK_ACCESS(skimmed_fee_msat_ptr); - LDKCOption_u64Z skimmed_fee_msat_conv = *(LDKCOption_u64Z*)(skimmed_fee_msat_ptr); - skimmed_fee_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(skimmed_fee_msat)); - void* outbound_amount_forwarded_msat_ptr = untag_ptr(outbound_amount_forwarded_msat); - CHECK_ACCESS(outbound_amount_forwarded_msat_ptr); - LDKCOption_u64Z outbound_amount_forwarded_msat_conv = *(LDKCOption_u64Z*)(outbound_amount_forwarded_msat_ptr); - outbound_amount_forwarded_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_amount_forwarded_msat)); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_forwarded(prev_channel_id_conv, next_channel_id_conv, prev_user_channel_id_conv, next_user_channel_id_conv, total_fee_earned_msat_conv, skimmed_fee_msat_conv, claim_from_onchain_tx, outbound_amount_forwarded_msat_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1optional_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelTypeFeatures_set_optional_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clear_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = InitFeatures_clone(&this_arg_conv); + LDKInitFeatures ret_var = InitFeatures_clear_upfront_shutdown_script(this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1channel_1pending(JNIEnv *env, jclass clz, int64_t channel_id, int8_tArray user_channel_id, int64_t former_temporary_channel_id, int8_tArray counterparty_node_id, int64_t funding_txo, int64_t channel_type) { - LDKChannelId channel_id_conv; - channel_id_conv.inner = untag_ptr(channel_id); - channel_id_conv.is_owned = ptr_is_owned(channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); - channel_id_conv = ChannelId_clone(&channel_id_conv); - LDKU128 user_channel_id_ref; - CHECK((*env)->GetArrayLength(env, user_channel_id) == 16); - (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes); - LDKChannelId former_temporary_channel_id_conv; - former_temporary_channel_id_conv.inner = untag_ptr(former_temporary_channel_id); - former_temporary_channel_id_conv.is_owned = ptr_is_owned(former_temporary_channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(former_temporary_channel_id_conv); - former_temporary_channel_id_conv = ChannelId_clone(&former_temporary_channel_id_conv); - LDKPublicKey counterparty_node_id_ref; - CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); - (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); - LDKOutPoint funding_txo_conv; - funding_txo_conv.inner = untag_ptr(funding_txo); - funding_txo_conv.is_owned = ptr_is_owned(funding_txo); - CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); - funding_txo_conv = OutPoint_clone(&funding_txo_conv); - LDKChannelTypeFeatures channel_type_conv; - channel_type_conv.inner = untag_ptr(channel_type); - channel_type_conv.is_owned = ptr_is_owned(channel_type); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_conv); - channel_type_conv = ChannelTypeFeatures_clone(&channel_type_conv); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_channel_pending(channel_id_conv, user_channel_id_ref, former_temporary_channel_id_conv, counterparty_node_id_ref, funding_txo_conv, channel_type_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clear_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = NodeFeatures_clone(&this_arg_conv); + LDKNodeFeatures ret_var = NodeFeatures_clear_upfront_shutdown_script(this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1channel_1ready(JNIEnv *env, jclass clz, int64_t channel_id, int8_tArray user_channel_id, int8_tArray counterparty_node_id, int64_t channel_type) { - LDKChannelId channel_id_conv; - channel_id_conv.inner = untag_ptr(channel_id); - channel_id_conv.is_owned = ptr_is_owned(channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); - channel_id_conv = ChannelId_clone(&channel_id_conv); - LDKU128 user_channel_id_ref; - CHECK((*env)->GetArrayLength(env, user_channel_id) == 16); - (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes); - LDKPublicKey counterparty_node_id_ref; - CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); - (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); - LDKChannelTypeFeatures channel_type_conv; - channel_type_conv.inner = untag_ptr(channel_type); - channel_type_conv.is_owned = ptr_is_owned(channel_type); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_conv); - channel_type_conv = ChannelTypeFeatures_clone(&channel_type_conv); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_channel_ready(channel_id_conv, user_channel_id_ref, counterparty_node_id_ref, channel_type_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clear_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = InitFeatures_clone(&this_arg_conv); + LDKInitFeatures ret_var = InitFeatures_clear_shutdown_anysegwit(this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1channel_1closed(JNIEnv *env, jclass clz, int64_t channel_id, int8_tArray user_channel_id, int64_t reason, int8_tArray counterparty_node_id, int64_t channel_capacity_sats, int64_t channel_funding_txo) { - LDKChannelId channel_id_conv; - channel_id_conv.inner = untag_ptr(channel_id); - channel_id_conv.is_owned = ptr_is_owned(channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); - channel_id_conv = ChannelId_clone(&channel_id_conv); - LDKU128 user_channel_id_ref; - CHECK((*env)->GetArrayLength(env, user_channel_id) == 16); - (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes); - void* reason_ptr = untag_ptr(reason); - CHECK_ACCESS(reason_ptr); - LDKClosureReason reason_conv = *(LDKClosureReason*)(reason_ptr); - reason_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(reason)); - LDKPublicKey counterparty_node_id_ref; - CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); - (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); - void* channel_capacity_sats_ptr = untag_ptr(channel_capacity_sats); - CHECK_ACCESS(channel_capacity_sats_ptr); - LDKCOption_u64Z channel_capacity_sats_conv = *(LDKCOption_u64Z*)(channel_capacity_sats_ptr); - channel_capacity_sats_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(channel_capacity_sats)); - LDKOutPoint channel_funding_txo_conv; - channel_funding_txo_conv.inner = untag_ptr(channel_funding_txo); - channel_funding_txo_conv.is_owned = ptr_is_owned(channel_funding_txo); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_funding_txo_conv); - channel_funding_txo_conv = OutPoint_clone(&channel_funding_txo_conv); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_channel_closed(channel_id_conv, user_channel_id_ref, reason_conv, counterparty_node_id_ref, channel_capacity_sats_conv, channel_funding_txo_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clear_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = NodeFeatures_clone(&this_arg_conv); + LDKNodeFeatures ret_var = NodeFeatures_clear_shutdown_anysegwit(this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1discard_1funding(JNIEnv *env, jclass clz, int64_t channel_id, int8_tArray transaction) { - LDKChannelId channel_id_conv; - channel_id_conv.inner = untag_ptr(channel_id); - channel_id_conv.is_owned = ptr_is_owned(channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); - channel_id_conv = ChannelId_clone(&channel_id_conv); - LDKTransaction transaction_ref; - transaction_ref.datalen = (*env)->GetArrayLength(env, transaction); - transaction_ref.data = MALLOC(transaction_ref.datalen, "LDKTransaction Bytes"); - (*env)->GetByteArrayRegion(env, transaction, 0, transaction_ref.datalen, transaction_ref.data); - transaction_ref.data_is_owned = true; - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_discard_funding(channel_id_conv, transaction_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clear_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = InitFeatures_clone(&this_arg_conv); + LDKInitFeatures ret_var = InitFeatures_clear_wumbo(this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1open_1channel_1request(JNIEnv *env, jclass clz, int64_t temporary_channel_id, int8_tArray counterparty_node_id, int64_t funding_satoshis, int64_t push_msat, int64_t channel_type) { - LDKChannelId temporary_channel_id_conv; - temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); - temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); - temporary_channel_id_conv = ChannelId_clone(&temporary_channel_id_conv); - LDKPublicKey counterparty_node_id_ref; - CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); - (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); - LDKChannelTypeFeatures channel_type_conv; - channel_type_conv.inner = untag_ptr(channel_type); - channel_type_conv.is_owned = ptr_is_owned(channel_type); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_conv); - channel_type_conv = ChannelTypeFeatures_clone(&channel_type_conv); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_open_channel_request(temporary_channel_id_conv, counterparty_node_id_ref, funding_satoshis, push_msat, channel_type_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clear_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = NodeFeatures_clone(&this_arg_conv); + LDKNodeFeatures ret_var = NodeFeatures_clear_wumbo(this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1htlchandling_1failed(JNIEnv *env, jclass clz, int64_t prev_channel_id, int64_t failed_next_destination) { - LDKChannelId prev_channel_id_conv; - prev_channel_id_conv.inner = untag_ptr(prev_channel_id); - prev_channel_id_conv.is_owned = ptr_is_owned(prev_channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(prev_channel_id_conv); - prev_channel_id_conv = ChannelId_clone(&prev_channel_id_conv); - void* failed_next_destination_ptr = untag_ptr(failed_next_destination); - CHECK_ACCESS(failed_next_destination_ptr); - LDKHTLCDestination failed_next_destination_conv = *(LDKHTLCDestination*)(failed_next_destination_ptr); - failed_next_destination_conv = HTLCDestination_clone((LDKHTLCDestination*)untag_ptr(failed_next_destination)); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_htlchandling_failed(prev_channel_id_conv, failed_next_destination_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clear_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_clear_scid_privacy(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clear_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_clear_scid_privacy(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clear_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_clear_scid_privacy(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clear_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_clear_anchors_zero_fee_htlc_tx(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clear_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_clear_anchors_zero_fee_htlc_tx(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clear_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_clear_anchors_zero_fee_htlc_tx(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clear_1route_1blinding(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_clear_route_blinding(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clear_1route_1blinding(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_clear_route_blinding(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1data_1loss_1protect_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_data_loss_protect_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1data_1loss_1protect_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_data_loss_protect_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_data_loss_protect(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1data_1loss_1protect_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_data_loss_protect_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1data_1loss_1protect_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_data_loss_protect_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_data_loss_protect(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_data_loss_protect(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_data_loss_protect(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1initial_1routing_1sync_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_initial_routing_sync_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1initial_1routing_1sync_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_initial_routing_sync_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1initial_1routing_1sync(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_initial_routing_sync(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1upfront_1shutdown_1script_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_upfront_shutdown_script_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1upfront_1shutdown_1script_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_upfront_shutdown_script_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_upfront_shutdown_script(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1upfront_1shutdown_1script_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_upfront_shutdown_script_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1upfront_1shutdown_1script_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_upfront_shutdown_script_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_upfront_shutdown_script(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_upfront_shutdown_script(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_upfront_shutdown_script(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1gossip_1queries_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_gossip_queries_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1gossip_1queries_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_gossip_queries_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_gossip_queries(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1gossip_1queries_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_gossip_queries_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1gossip_1queries_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_gossip_queries_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_gossip_queries(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_gossip_queries(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_gossip_queries(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1variable_1length_1onion_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_variable_length_onion_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1variable_1length_1onion_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_variable_length_onion_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_variable_length_onion(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1variable_1length_1onion_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_variable_length_onion_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1variable_1length_1onion_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_variable_length_onion_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_variable_length_onion(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1variable_1length_1onion_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + Bolt11InvoiceFeatures_set_variable_length_onion_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1variable_1length_1onion_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + Bolt11InvoiceFeatures_set_variable_length_onion_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1supports_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt11InvoiceFeatures_supports_variable_length_onion(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_variable_length_onion(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_variable_length_onion(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt11InvoiceFeatures_requires_variable_length_onion(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1static_1remote_1key_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_static_remote_key_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1static_1remote_1key_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_static_remote_key_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_static_remote_key(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1static_1remote_1key_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_static_remote_key_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1static_1remote_1key_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_static_remote_key_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_static_remote_key(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1static_1remote_1key_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_static_remote_key_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1static_1remote_1key_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_static_remote_key_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_supports_static_remote_key(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_static_remote_key(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_static_remote_key(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_requires_static_remote_key(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1payment_1secret_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_payment_secret_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1payment_1secret_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_payment_secret_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_payment_secret(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1payment_1secret_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_payment_secret_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1payment_1secret_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_payment_secret_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_payment_secret(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1payment_1secret_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + Bolt11InvoiceFeatures_set_payment_secret_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1payment_1secret_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + Bolt11InvoiceFeatures_set_payment_secret_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1supports_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt11InvoiceFeatures_supports_payment_secret(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_payment_secret(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_payment_secret(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt11InvoiceFeatures_requires_payment_secret(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1basic_1mpp_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_basic_mpp_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1basic_1mpp_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_basic_mpp_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_basic_mpp(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1basic_1mpp_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_basic_mpp_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1basic_1mpp_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_basic_mpp_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_basic_mpp(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1basic_1mpp_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + Bolt11InvoiceFeatures_set_basic_mpp_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1basic_1mpp_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + Bolt11InvoiceFeatures_set_basic_mpp_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1supports_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt11InvoiceFeatures_supports_basic_mpp(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1basic_1mpp_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + Bolt12InvoiceFeatures_set_basic_mpp_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1basic_1mpp_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + Bolt12InvoiceFeatures_set_basic_mpp_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1supports_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt12InvoiceFeatures_supports_basic_mpp(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_basic_mpp(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_basic_mpp(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt11InvoiceFeatures_requires_basic_mpp(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1requires_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt12InvoiceFeatures_requires_basic_mpp(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1wumbo_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_wumbo_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1wumbo_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_wumbo_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_wumbo(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1wumbo_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_wumbo_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1wumbo_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_wumbo_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_wumbo(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_wumbo(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_wumbo(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1anchors_1nonzero_1fee_1htlc_1tx_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1anchors_1nonzero_1fee_1htlc_1tx_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1anchors_1nonzero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_anchors_nonzero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1anchors_1nonzero_1fee_1htlc_1tx_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1anchors_1nonzero_1fee_1htlc_1tx_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1anchors_1nonzero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1anchors_1nonzero_1fee_1htlc_1tx_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1anchors_1nonzero_1fee_1htlc_1tx_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1anchors_1nonzero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1anchors_1nonzero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_anchors_nonzero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1anchors_1nonzero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1anchors_1nonzero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_anchors_zero_fee_htlc_tx_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_anchors_zero_fee_htlc_tx_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_anchors_zero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_anchors_zero_fee_htlc_tx_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_anchors_zero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_anchors_zero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_anchors_zero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1route_1blinding_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_route_blinding_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1route_1blinding_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_route_blinding_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1route_1blinding(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_route_blinding(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1route_1blinding_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_route_blinding_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1route_1blinding_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_route_blinding_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1route_1blinding(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_route_blinding(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1route_1blinding(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_route_blinding(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1route_1blinding(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_route_blinding(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1shutdown_1any_1segwit_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_shutdown_any_segwit_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1shutdown_1any_1segwit_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_shutdown_any_segwit_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_shutdown_anysegwit(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1shutdown_1any_1segwit_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_shutdown_any_segwit_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1shutdown_1any_1segwit_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_shutdown_any_segwit_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_shutdown_anysegwit(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_shutdown_anysegwit(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_shutdown_anysegwit(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1bump_1transaction(JNIEnv *env, jclass clz, int64_t a) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKBumpTransactionEvent a_conv = *(LDKBumpTransactionEvent*)(a_ptr); - a_conv = BumpTransactionEvent_clone((LDKBumpTransactionEvent*)untag_ptr(a)); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_bump_transaction(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1taproot_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_taproot_optional(&this_arg_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Event_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKEvent* a_conv = (LDKEvent*)untag_ptr(a); - LDKEvent* b_conv = (LDKEvent*)untag_ptr(b); - jboolean ret_conv = Event_eq(a_conv, b_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1taproot_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_taproot_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1taproot(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_taproot(&this_arg_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Event_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKEvent* obj_conv = (LDKEvent*)untag_ptr(obj); - LDKCVec_u8Z ret_var = Event_write(obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1taproot_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_taproot_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); - *ret_conv = Event_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1taproot_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_taproot_required(&this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - MessageSendEvent_free(this_ptr_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1taproot(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_taproot(&this_arg_conv); + return ret_conv; } -static inline uint64_t MessageSendEvent_clone_ptr(LDKMessageSendEvent *NONNULL_PTR arg) { - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1taproot_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_taproot_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKMessageSendEvent* arg_conv = (LDKMessageSendEvent*)untag_ptr(arg); - int64_t ret_conv = MessageSendEvent_clone_ptr(arg_conv); - return ret_conv; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1taproot_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_taproot_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKMessageSendEvent* orig_conv = (LDKMessageSendEvent*)untag_ptr(orig); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1taproot(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_supports_taproot(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1accept_1channel(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKAcceptChannel msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = AcceptChannel_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_accept_channel(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1taproot(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_taproot(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1accept_1channel_1v2(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKAcceptChannelV2 msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = AcceptChannelV2_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_accept_channel_v2(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1taproot(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_taproot(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1open_1channel(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKOpenChannel msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = OpenChannel_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_open_channel(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1taproot(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_requires_taproot(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1open_1channel_1v2(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKOpenChannelV2 msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = OpenChannelV2_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_open_channel_v2(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1onion_1messages_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_onion_messages_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1funding_1created(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKFundingCreated msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = FundingCreated_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_funding_created(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1onion_1messages_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_onion_messages_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1funding_1signed(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKFundingSigned msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = FundingSigned_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_funding_signed(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1onion_1messages(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_onion_messages(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1stfu(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKStfu msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = Stfu_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_stfu(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1onion_1messages_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_onion_messages_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1splice(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKSplice msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = Splice_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_splice(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1onion_1messages_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_onion_messages_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1splice_1ack(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKSpliceAck msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = SpliceAck_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_splice_ack(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1onion_1messages(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_onion_messages(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1splice_1locked(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKSpliceLocked msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = SpliceLocked_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_splice_locked(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1onion_1messages(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_onion_messages(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1add_1input(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKTxAddInput msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = TxAddInput_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_tx_add_input(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1onion_1messages(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_onion_messages(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1add_1output(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKTxAddOutput msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = TxAddOutput_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_tx_add_output(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1channel_1type_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_channel_type_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1remove_1input(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKTxRemoveInput msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = TxRemoveInput_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_tx_remove_input(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1channel_1type_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_channel_type_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1remove_1output(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKTxRemoveOutput msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = TxRemoveOutput_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_tx_remove_output(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_channel_type(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1complete(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKTxComplete msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = TxComplete_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_tx_complete(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1channel_1type_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_channel_type_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1signatures(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKTxSignatures msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = TxSignatures_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_tx_signatures(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1channel_1type_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_channel_type_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1init_1rbf(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKTxInitRbf msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = TxInitRbf_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_tx_init_rbf(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_channel_type(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1ack_1rbf(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKTxAckRbf msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = TxAckRbf_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_tx_ack_rbf(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_channel_type(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_channel_type(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1abort(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKTxAbort msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = TxAbort_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_tx_abort(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1scid_1privacy_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_scid_privacy_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1ready(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKChannelReady msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ChannelReady_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_channel_ready(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1scid_1privacy_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_scid_privacy_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1announcement_1signatures(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKAnnouncementSignatures msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = AnnouncementSignatures_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_announcement_signatures(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_scid_privacy(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1update_1htlcs(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t updates) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKCommitmentUpdate updates_conv; - updates_conv.inner = untag_ptr(updates); - updates_conv.is_owned = ptr_is_owned(updates); - CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv); - updates_conv = CommitmentUpdate_clone(&updates_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_update_htlcs(node_id_ref, updates_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1scid_1privacy_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_scid_privacy_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1revoke_1and_1ack(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKRevokeAndACK msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = RevokeAndACK_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_revoke_and_ack(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1scid_1privacy_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_scid_privacy_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1closing_1signed(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKClosingSigned msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ClosingSigned_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_closing_signed(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_scid_privacy(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1shutdown(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKShutdown msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = Shutdown_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_shutdown(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1scid_1privacy_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_scid_privacy_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1reestablish(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKChannelReestablish msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ChannelReestablish_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_channel_reestablish(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1scid_1privacy_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_scid_privacy_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1announcement(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg, int64_t update_msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKChannelAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ChannelAnnouncement_clone(&msg_conv); - LDKChannelUpdate update_msg_conv; - update_msg_conv.inner = untag_ptr(update_msg); - update_msg_conv.is_owned = ptr_is_owned(update_msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv); - update_msg_conv = ChannelUpdate_clone(&update_msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_channel_announcement(node_id_ref, msg_conv, update_msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_supports_scid_privacy(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1channel_1announcement(JNIEnv *env, jclass clz, int64_t msg, int64_t update_msg) { - LDKChannelAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ChannelAnnouncement_clone(&msg_conv); - LDKChannelUpdate update_msg_conv; - update_msg_conv.inner = untag_ptr(update_msg); - update_msg_conv.is_owned = ptr_is_owned(update_msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv); - update_msg_conv = ChannelUpdate_clone(&update_msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_broadcast_channel_announcement(msg_conv, update_msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_scid_privacy(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1channel_1update(JNIEnv *env, jclass clz, int64_t msg) { - LDKChannelUpdate msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ChannelUpdate_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_broadcast_channel_update(msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_scid_privacy(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1node_1announcement(JNIEnv *env, jclass clz, int64_t msg) { - LDKNodeAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = NodeAnnouncement_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_broadcast_node_announcement(msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_requires_scid_privacy(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1update(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKChannelUpdate msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ChannelUpdate_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_channel_update(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1payment_1metadata_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + Bolt11InvoiceFeatures_set_payment_metadata_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1handle_1error(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t action) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - void* action_ptr = untag_ptr(action); - CHECK_ACCESS(action_ptr); - LDKErrorAction action_conv = *(LDKErrorAction*)(action_ptr); - action_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(action)); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_handle_error(node_id_ref, action_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1payment_1metadata_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + Bolt11InvoiceFeatures_set_payment_metadata_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1range_1query(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKQueryChannelRange msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = QueryChannelRange_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_channel_range_query(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1supports_1payment_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt11InvoiceFeatures_supports_payment_metadata(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1short_1ids_1query(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKQueryShortChannelIds msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = QueryShortChannelIds_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_short_ids_query(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1payment_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt11InvoiceFeatures_requires_payment_metadata(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1reply_1channel_1range(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKReplyChannelRange msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ReplyChannelRange_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_reply_channel_range(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1zero_1conf_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_zero_conf_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1gossip_1timestamp_1filter(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKGossipTimestampFilter msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = GossipTimestampFilter_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_gossip_timestamp_filter(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1zero_1conf_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_zero_conf_required(&this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - MessageSendEventsProvider_free(this_ptr_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_zero_conf(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - EventsProvider_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1zero_1conf_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_zero_conf_optional(&this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKEventHandler this_ptr_conv = *(LDKEventHandler*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - EventHandler_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1zero_1conf_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_zero_conf_required(&this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKAnchorDescriptor this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - AnchorDescriptor_free(this_obj_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_zero_conf(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1get_1channel_1derivation_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAnchorDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelDerivationParameters ret_var = AnchorDescriptor_get_channel_derivation_parameters(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1zero_1conf_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_zero_conf_optional(&this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1set_1channel_1derivation_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKAnchorDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelDerivationParameters val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelDerivationParameters_clone(&val_conv); - AnchorDescriptor_set_channel_derivation_parameters(&this_ptr_conv, val_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1zero_1conf_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_zero_conf_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAnchorDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKOutPoint ret_var = AnchorDescriptor_get_outpoint(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_supports_zero_conf(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKAnchorDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKOutPoint val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = OutPoint_clone(&val_conv); - AnchorDescriptor_set_outpoint(&this_ptr_conv, val_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_zero_conf(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_zero_conf(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1new(JNIEnv *env, jclass clz, int64_t channel_derivation_parameters_arg, int64_t outpoint_arg) { - LDKChannelDerivationParameters channel_derivation_parameters_arg_conv; - channel_derivation_parameters_arg_conv.inner = untag_ptr(channel_derivation_parameters_arg); - channel_derivation_parameters_arg_conv.is_owned = ptr_is_owned(channel_derivation_parameters_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_derivation_parameters_arg_conv); - channel_derivation_parameters_arg_conv = ChannelDerivationParameters_clone(&channel_derivation_parameters_arg_conv); - LDKOutPoint outpoint_arg_conv; - outpoint_arg_conv.inner = untag_ptr(outpoint_arg); - outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); - outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); - LDKAnchorDescriptor ret_var = AnchorDescriptor_new(channel_derivation_parameters_arg_conv, outpoint_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_requires_zero_conf(&this_arg_conv); + return ret_conv; } -static inline uint64_t AnchorDescriptor_clone_ptr(LDKAnchorDescriptor *NONNULL_PTR arg) { - LDKAnchorDescriptor ret_var = AnchorDescriptor_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1keysend_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_keysend_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKAnchorDescriptor arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = AnchorDescriptor_clone_ptr(&arg_conv); - return ret_conv; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1keysend_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_keysend_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKAnchorDescriptor orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKAnchorDescriptor ret_var = AnchorDescriptor_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1keysend(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_keysend(&this_arg_conv); + return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKAnchorDescriptor a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKAnchorDescriptor b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = AnchorDescriptor_eq(&a_conv, &b_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1keysend(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_keysend(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1previous_1utxo(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKAnchorDescriptor this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1trampoline_1routing_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); - *ret_ref = AnchorDescriptor_previous_utxo(&this_arg_conv); - return tag_ptr(ret_ref, true); + InitFeatures_set_trampoline_routing_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1unsigned_1tx_1input(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKAnchorDescriptor this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1trampoline_1routing_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKTxIn* ret_ref = MALLOC(sizeof(LDKTxIn), "LDKTxIn"); - *ret_ref = AnchorDescriptor_unsigned_tx_input(&this_arg_conv); - return tag_ptr(ret_ref, true); + InitFeatures_set_trampoline_routing_required(&this_arg_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1witness_1script(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKAnchorDescriptor this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1trampoline_1routing(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_u8Z ret_var = AnchorDescriptor_witness_script(&this_arg_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; + jboolean ret_conv = InitFeatures_supports_trampoline_routing(&this_arg_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1tx_1input_1witness(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray signature) { - LDKAnchorDescriptor this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1trampoline_1routing_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKECDSASignature signature_ref; - CHECK((*env)->GetArrayLength(env, signature) == 64); - (*env)->GetByteArrayRegion(env, signature, 0, 64, signature_ref.compact_form); - LDKWitness ret_var = AnchorDescriptor_tx_input_witness(&this_arg_conv, signature_ref); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - Witness_free(ret_var); - return ret_arr; + NodeFeatures_set_trampoline_routing_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1derive_1channel_1signer(JNIEnv *env, jclass clz, int64_t this_arg, int64_t signer_provider) { - LDKAnchorDescriptor this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1trampoline_1routing_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - void* signer_provider_ptr = untag_ptr(signer_provider); - if (ptr_is_owned(signer_provider)) { CHECK_ACCESS(signer_provider_ptr); } - LDKSignerProvider* signer_provider_conv = (LDKSignerProvider*)signer_provider_ptr; - LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner"); - *ret_ret = AnchorDescriptor_derive_channel_signer(&this_arg_conv, signer_provider_conv); - return tag_ptr(ret_ret, true); + NodeFeatures_set_trampoline_routing_required(&this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BumpTransactionEvent_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKBumpTransactionEvent this_ptr_conv = *(LDKBumpTransactionEvent*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - BumpTransactionEvent_free(this_ptr_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1trampoline_1routing(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_trampoline_routing(&this_arg_conv); + return ret_conv; } -static inline uint64_t BumpTransactionEvent_clone_ptr(LDKBumpTransactionEvent *NONNULL_PTR arg) { - LDKBumpTransactionEvent *ret_copy = MALLOC(sizeof(LDKBumpTransactionEvent), "LDKBumpTransactionEvent"); - *ret_copy = BumpTransactionEvent_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1trampoline_1routing_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + Bolt11InvoiceFeatures_set_trampoline_routing_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BumpTransactionEvent_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKBumpTransactionEvent* arg_conv = (LDKBumpTransactionEvent*)untag_ptr(arg); - int64_t ret_conv = BumpTransactionEvent_clone_ptr(arg_conv); - return ret_conv; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1trampoline_1routing_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + Bolt11InvoiceFeatures_set_trampoline_routing_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BumpTransactionEvent_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBumpTransactionEvent* orig_conv = (LDKBumpTransactionEvent*)untag_ptr(orig); - LDKBumpTransactionEvent *ret_copy = MALLOC(sizeof(LDKBumpTransactionEvent), "LDKBumpTransactionEvent"); - *ret_copy = BumpTransactionEvent_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1supports_1trampoline_1routing(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt11InvoiceFeatures_supports_trampoline_routing(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BumpTransactionEvent_1channel_1close(JNIEnv *env, jclass clz, int64_t channel_id, int8_tArray counterparty_node_id, int8_tArray claim_id, int32_t package_target_feerate_sat_per_1000_weight, int8_tArray commitment_tx, int64_t commitment_tx_fee_satoshis, int64_t anchor_descriptor, int64_tArray pending_htlcs) { - LDKChannelId channel_id_conv; - channel_id_conv.inner = untag_ptr(channel_id); - channel_id_conv.is_owned = ptr_is_owned(channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); - channel_id_conv = ChannelId_clone(&channel_id_conv); - LDKPublicKey counterparty_node_id_ref; - CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); - (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); - LDKThirtyTwoBytes claim_id_ref; - CHECK((*env)->GetArrayLength(env, claim_id) == 32); - (*env)->GetByteArrayRegion(env, claim_id, 0, 32, claim_id_ref.data); - LDKTransaction commitment_tx_ref; - commitment_tx_ref.datalen = (*env)->GetArrayLength(env, commitment_tx); - commitment_tx_ref.data = MALLOC(commitment_tx_ref.datalen, "LDKTransaction Bytes"); - (*env)->GetByteArrayRegion(env, commitment_tx, 0, commitment_tx_ref.datalen, commitment_tx_ref.data); - commitment_tx_ref.data_is_owned = true; - LDKAnchorDescriptor anchor_descriptor_conv; - anchor_descriptor_conv.inner = untag_ptr(anchor_descriptor); - anchor_descriptor_conv.is_owned = ptr_is_owned(anchor_descriptor); - CHECK_INNER_FIELD_ACCESS_OR_NULL(anchor_descriptor_conv); - anchor_descriptor_conv = AnchorDescriptor_clone(&anchor_descriptor_conv); - LDKCVec_HTLCOutputInCommitmentZ pending_htlcs_constr; - pending_htlcs_constr.datalen = (*env)->GetArrayLength(env, pending_htlcs); - if (pending_htlcs_constr.datalen > 0) - pending_htlcs_constr.data = MALLOC(pending_htlcs_constr.datalen * sizeof(LDKHTLCOutputInCommitment), "LDKCVec_HTLCOutputInCommitmentZ Elements"); - else - pending_htlcs_constr.data = NULL; - int64_t* pending_htlcs_vals = (*env)->GetLongArrayElements (env, pending_htlcs, NULL); - for (size_t y = 0; y < pending_htlcs_constr.datalen; y++) { - int64_t pending_htlcs_conv_24 = pending_htlcs_vals[y]; - LDKHTLCOutputInCommitment pending_htlcs_conv_24_conv; - pending_htlcs_conv_24_conv.inner = untag_ptr(pending_htlcs_conv_24); - pending_htlcs_conv_24_conv.is_owned = ptr_is_owned(pending_htlcs_conv_24); - CHECK_INNER_FIELD_ACCESS_OR_NULL(pending_htlcs_conv_24_conv); - pending_htlcs_conv_24_conv = HTLCOutputInCommitment_clone(&pending_htlcs_conv_24_conv); - pending_htlcs_constr.data[y] = pending_htlcs_conv_24_conv; - } - (*env)->ReleaseLongArrayElements(env, pending_htlcs, pending_htlcs_vals, 0); - LDKBumpTransactionEvent *ret_copy = MALLOC(sizeof(LDKBumpTransactionEvent), "LDKBumpTransactionEvent"); - *ret_copy = BumpTransactionEvent_channel_close(channel_id_conv, counterparty_node_id_ref, claim_id_ref, package_target_feerate_sat_per_1000_weight, commitment_tx_ref, commitment_tx_fee_satoshis, anchor_descriptor_conv, pending_htlcs_constr); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1trampoline_1routing(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_trampoline_routing(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BumpTransactionEvent_1htlcresolution(JNIEnv *env, jclass clz, int64_t channel_id, int8_tArray counterparty_node_id, int8_tArray claim_id, int32_t target_feerate_sat_per_1000_weight, int64_tArray htlc_descriptors, int32_t tx_lock_time) { - LDKChannelId channel_id_conv; - channel_id_conv.inner = untag_ptr(channel_id); - channel_id_conv.is_owned = ptr_is_owned(channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); - channel_id_conv = ChannelId_clone(&channel_id_conv); - LDKPublicKey counterparty_node_id_ref; - CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); - (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); - LDKThirtyTwoBytes claim_id_ref; - CHECK((*env)->GetArrayLength(env, claim_id) == 32); - (*env)->GetByteArrayRegion(env, claim_id, 0, 32, claim_id_ref.data); - LDKCVec_HTLCDescriptorZ htlc_descriptors_constr; - htlc_descriptors_constr.datalen = (*env)->GetArrayLength(env, htlc_descriptors); - if (htlc_descriptors_constr.datalen > 0) - htlc_descriptors_constr.data = MALLOC(htlc_descriptors_constr.datalen * sizeof(LDKHTLCDescriptor), "LDKCVec_HTLCDescriptorZ Elements"); - else - htlc_descriptors_constr.data = NULL; - int64_t* htlc_descriptors_vals = (*env)->GetLongArrayElements (env, htlc_descriptors, NULL); - for (size_t q = 0; q < htlc_descriptors_constr.datalen; q++) { - int64_t htlc_descriptors_conv_16 = htlc_descriptors_vals[q]; - LDKHTLCDescriptor htlc_descriptors_conv_16_conv; - htlc_descriptors_conv_16_conv.inner = untag_ptr(htlc_descriptors_conv_16); - htlc_descriptors_conv_16_conv.is_owned = ptr_is_owned(htlc_descriptors_conv_16); - CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_descriptors_conv_16_conv); - htlc_descriptors_conv_16_conv = HTLCDescriptor_clone(&htlc_descriptors_conv_16_conv); - htlc_descriptors_constr.data[q] = htlc_descriptors_conv_16_conv; - } - (*env)->ReleaseLongArrayElements(env, htlc_descriptors, htlc_descriptors_vals, 0); - LDKBumpTransactionEvent *ret_copy = MALLOC(sizeof(LDKBumpTransactionEvent), "LDKBumpTransactionEvent"); - *ret_copy = BumpTransactionEvent_htlcresolution(channel_id_conv, counterparty_node_id_ref, claim_id_ref, target_feerate_sat_per_1000_weight, htlc_descriptors_constr, tx_lock_time); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1trampoline_1routing(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_trampoline_routing(&this_arg_conv); + return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BumpTransactionEvent_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKBumpTransactionEvent* a_conv = (LDKBumpTransactionEvent*)untag_ptr(a); - LDKBumpTransactionEvent* b_conv = (LDKBumpTransactionEvent*)untag_ptr(b); - jboolean ret_conv = BumpTransactionEvent_eq(a_conv, b_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1trampoline_1routing(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt11InvoiceFeatures_requires_trampoline_routing(&this_arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Input_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKInput this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKRoutingFees this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Input_free(this_obj_conv); + RoutingFees_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Input_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInput this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRoutingFees this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKOutPoint ret_var = Input_get_outpoint(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + int32_t ret_conv = RoutingFees_get_base_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Input_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKInput this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKRoutingFees this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKOutPoint val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = OutPoint_clone(&val_conv); - Input_set_outpoint(&this_ptr_conv, val_conv); + RoutingFees_set_base_msat(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Input_1get_1previous_1utxo(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInput this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRoutingFees this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); - *ret_ref = Input_get_previous_utxo(&this_ptr_conv); - return tag_ptr(ret_ref, true); + int32_t ret_conv = RoutingFees_get_proportional_millionths(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Input_1set_1previous_1utxo(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKInput this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKRoutingFees this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); - val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val)); - Input_set_previous_utxo(&this_ptr_conv, val_conv); + RoutingFees_set_proportional_millionths(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Input_1get_1satisfaction_1weight(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInput this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1new(JNIEnv *env, jclass clz, int32_t base_msat_arg, int32_t proportional_millionths_arg) { + LDKRoutingFees ret_var = RoutingFees_new(base_msat_arg, proportional_millionths_arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RoutingFees_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKRoutingFees a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKRoutingFees b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = RoutingFees_eq(&a_conv, &b_conv); + return ret_conv; +} + +static inline uint64_t RoutingFees_clone_ptr(LDKRoutingFees *NONNULL_PTR arg) { + LDKRoutingFees ret_var = RoutingFees_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRoutingFees arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = RoutingFees_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKRoutingFees orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKRoutingFees ret_var = RoutingFees_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKRoutingFees o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = RoutingFees_hash(&o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKRouteHint this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + RouteHint_free(this_obj_conv); +} + +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRouteHint this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = Input_get_satisfaction_weight(&this_ptr_conv); - return ret_conv; + LDKCVec_RouteHintHopZ ret_var = RouteHint_get_a(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t o = 0; o < ret_var.datalen; o++) { + LDKRouteHintHop ret_conv_14_var = ret_var.data[o]; + int64_t ret_conv_14_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var); + ret_conv_14_ref = tag_ptr(ret_conv_14_var.inner, ret_conv_14_var.is_owned); + ret_arr_ptr[o] = ret_conv_14_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Input_1set_1satisfaction_1weight(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKInput this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { + LDKRouteHint this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - Input_set_satisfaction_weight(&this_ptr_conv, val); + LDKCVec_RouteHintHopZ val_constr; + val_constr.datalen = (*env)->GetArrayLength(env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); + for (size_t o = 0; o < val_constr.datalen; o++) { + int64_t val_conv_14 = val_vals[o]; + LDKRouteHintHop val_conv_14_conv; + val_conv_14_conv.inner = untag_ptr(val_conv_14); + val_conv_14_conv.is_owned = ptr_is_owned(val_conv_14); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_14_conv); + val_conv_14_conv = RouteHintHop_clone(&val_conv_14_conv); + val_constr.data[o] = val_conv_14_conv; + } + (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); + RouteHint_set_a(&this_ptr_conv, val_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Input_1new(JNIEnv *env, jclass clz, int64_t outpoint_arg, int64_t previous_utxo_arg, int64_t satisfaction_weight_arg) { - LDKOutPoint outpoint_arg_conv; - outpoint_arg_conv.inner = untag_ptr(outpoint_arg); - outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); - outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); - void* previous_utxo_arg_ptr = untag_ptr(previous_utxo_arg); - CHECK_ACCESS(previous_utxo_arg_ptr); - LDKTxOut previous_utxo_arg_conv = *(LDKTxOut*)(previous_utxo_arg_ptr); - previous_utxo_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(previous_utxo_arg)); - LDKInput ret_var = Input_new(outpoint_arg_conv, previous_utxo_arg_conv, satisfaction_weight_arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1new(JNIEnv *env, jclass clz, int64_tArray a_arg) { + LDKCVec_RouteHintHopZ a_arg_constr; + a_arg_constr.datalen = (*env)->GetArrayLength(env, a_arg); + if (a_arg_constr.datalen > 0) + a_arg_constr.data = MALLOC(a_arg_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements"); + else + a_arg_constr.data = NULL; + int64_t* a_arg_vals = (*env)->GetLongArrayElements (env, a_arg, NULL); + for (size_t o = 0; o < a_arg_constr.datalen; o++) { + int64_t a_arg_conv_14 = a_arg_vals[o]; + LDKRouteHintHop a_arg_conv_14_conv; + a_arg_conv_14_conv.inner = untag_ptr(a_arg_conv_14); + a_arg_conv_14_conv.is_owned = ptr_is_owned(a_arg_conv_14); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_arg_conv_14_conv); + a_arg_conv_14_conv = RouteHintHop_clone(&a_arg_conv_14_conv); + a_arg_constr.data[o] = a_arg_conv_14_conv; + } + (*env)->ReleaseLongArrayElements(env, a_arg, a_arg_vals, 0); + LDKRouteHint ret_var = RouteHint_new(a_arg_constr); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t Input_clone_ptr(LDKInput *NONNULL_PTR arg) { - LDKInput ret_var = Input_clone(arg); +static inline uint64_t RouteHint_clone_ptr(LDKRouteHint *NONNULL_PTR arg) { + LDKRouteHint ret_var = RouteHint_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Input_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKInput arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRouteHint arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Input_clone_ptr(&arg_conv); + int64_t ret_conv = RouteHint_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Input_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKInput orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKRouteHint orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKInput ret_var = Input_clone(&orig_conv); + LDKRouteHint ret_var = RouteHint_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Input_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKInput o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKRouteHint o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv.is_owned = false; - int64_t ret_conv = Input_hash(&o_conv); + int64_t ret_conv = RouteHint_hash(&o_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Input_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKInput a_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHint_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKRouteHint a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKInput b_conv; + LDKRouteHint b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = Input_eq(&a_conv, &b_conv); + jboolean ret_conv = RouteHint_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Utxo_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKUtxo this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKRouteHintHop this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Utxo_free(this_obj_conv); + RouteHintHop_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Utxo_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUtxo this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1src_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKOutPoint ret_var = Utxo_get_outpoint(&this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RouteHintHop_get_src_node_id(&this_ptr_conv).compressed_form); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1src_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKRouteHintHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + RouteHintHop_set_src_node_id(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRouteHintHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = RouteHintHop_get_short_channel_id(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKRouteHintHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + RouteHintHop_set_short_channel_id(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1fees(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRouteHintHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKRoutingFees ret_var = RouteHintHop_get_fees(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Utxo_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKUtxo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1fees(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKOutPoint val_conv; + LDKRoutingFees val_conv; val_conv.inner = untag_ptr(val); val_conv.is_owned = ptr_is_owned(val); CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = OutPoint_clone(&val_conv); - Utxo_set_outpoint(&this_ptr_conv, val_conv); + val_conv = RoutingFees_clone(&val_conv); + RouteHintHop_set_fees(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Utxo_1get_1output(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUtxo this_ptr_conv; +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); - *ret_ref = Utxo_get_output(&this_ptr_conv); - return tag_ptr(ret_ref, true); + int16_t ret_conv = RouteHintHop_get_cltv_expiry_delta(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Utxo_1set_1output(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKUtxo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKRouteHintHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + RouteHintHop_set_cltv_expiry_delta(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRouteHintHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = RouteHintHop_get_htlc_minimum_msat(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; void* val_ptr = untag_ptr(val); CHECK_ACCESS(val_ptr); - LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); - val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val)); - Utxo_set_output(&this_ptr_conv, val_conv); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + RouteHintHop_set_htlc_minimum_msat(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Utxo_1get_1satisfaction_1weight(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUtxo this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = Utxo_get_satisfaction_weight(&this_ptr_conv); - return ret_conv; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = RouteHintHop_get_htlc_maximum_msat(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Utxo_1set_1satisfaction_1weight(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKUtxo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - Utxo_set_satisfaction_weight(&this_ptr_conv, val); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + RouteHintHop_set_htlc_maximum_msat(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Utxo_1new(JNIEnv *env, jclass clz, int64_t outpoint_arg, int64_t output_arg, int64_t satisfaction_weight_arg) { - LDKOutPoint outpoint_arg_conv; - outpoint_arg_conv.inner = untag_ptr(outpoint_arg); - outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); - outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); - void* output_arg_ptr = untag_ptr(output_arg); - CHECK_ACCESS(output_arg_ptr); - LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr); - output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg)); - LDKUtxo ret_var = Utxo_new(outpoint_arg_conv, output_arg_conv, satisfaction_weight_arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1new(JNIEnv *env, jclass clz, int8_tArray src_node_id_arg, int64_t short_channel_id_arg, int64_t fees_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg) { + LDKPublicKey src_node_id_arg_ref; + CHECK((*env)->GetArrayLength(env, src_node_id_arg) == 33); + (*env)->GetByteArrayRegion(env, src_node_id_arg, 0, 33, src_node_id_arg_ref.compressed_form); + LDKRoutingFees fees_arg_conv; + fees_arg_conv.inner = untag_ptr(fees_arg); + fees_arg_conv.is_owned = ptr_is_owned(fees_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv); + fees_arg_conv = RoutingFees_clone(&fees_arg_conv); + void* htlc_minimum_msat_arg_ptr = untag_ptr(htlc_minimum_msat_arg); + CHECK_ACCESS(htlc_minimum_msat_arg_ptr); + LDKCOption_u64Z htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_minimum_msat_arg_ptr); + htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_minimum_msat_arg)); + void* htlc_maximum_msat_arg_ptr = untag_ptr(htlc_maximum_msat_arg); + CHECK_ACCESS(htlc_maximum_msat_arg_ptr); + LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_arg_ptr); + htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_maximum_msat_arg)); + LDKRouteHintHop ret_var = RouteHintHop_new(src_node_id_arg_ref, short_channel_id_arg, fees_arg_conv, cltv_expiry_delta_arg, htlc_minimum_msat_arg_conv, htlc_maximum_msat_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t Utxo_clone_ptr(LDKUtxo *NONNULL_PTR arg) { - LDKUtxo ret_var = Utxo_clone(arg); +static inline uint64_t RouteHintHop_clone_ptr(LDKRouteHintHop *NONNULL_PTR arg) { + LDKRouteHintHop ret_var = RouteHintHop_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Utxo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKUtxo arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRouteHintHop arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Utxo_clone_ptr(&arg_conv); + int64_t ret_conv = RouteHintHop_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Utxo_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKUtxo orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKRouteHintHop orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKUtxo ret_var = Utxo_clone(&orig_conv); + LDKRouteHintHop ret_var = RouteHintHop_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Utxo_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKUtxo o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKRouteHintHop o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv.is_owned = false; - int64_t ret_conv = Utxo_hash(&o_conv); + int64_t ret_conv = RouteHintHop_hash(&o_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Utxo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKUtxo a_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKRouteHintHop a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKUtxo b_conv; + LDKRouteHintHop b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = Utxo_eq(&a_conv, &b_conv); + jboolean ret_conv = RouteHintHop_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Utxo_1new_1p2pkh(JNIEnv *env, jclass clz, int64_t outpoint, int64_t value, int8_tArray pubkey_hash) { - LDKOutPoint outpoint_conv; - outpoint_conv.inner = untag_ptr(outpoint); - outpoint_conv.is_owned = ptr_is_owned(outpoint); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv); - outpoint_conv = OutPoint_clone(&outpoint_conv); - uint8_t pubkey_hash_arr[20]; - CHECK((*env)->GetArrayLength(env, pubkey_hash) == 20); - (*env)->GetByteArrayRegion(env, pubkey_hash, 0, 20, pubkey_hash_arr); - uint8_t (*pubkey_hash_ref)[20] = &pubkey_hash_arr; - LDKUtxo ret_var = Utxo_new_p2pkh(outpoint_conv, value, pubkey_hash_ref); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CoinSelection_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKCoinSelection this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UntrustedString_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUntrustedString this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - CoinSelection_free(this_obj_conv); -} - -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CoinSelection_1get_1confirmed_1utxos(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKCoinSelection this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_UtxoZ ret_var = CoinSelection_get_confirmed_utxos(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t g = 0; g < ret_var.datalen; g++) { - LDKUtxo ret_conv_6_var = ret_var.data[g]; - int64_t ret_conv_6_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_6_var); - ret_conv_6_ref = tag_ptr(ret_conv_6_var.inner, ret_conv_6_var.is_owned); - ret_arr_ptr[g] = ret_conv_6_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CoinSelection_1set_1confirmed_1utxos(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { - LDKCoinSelection this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_UtxoZ val_constr; - val_constr.datalen = (*env)->GetArrayLength(env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUtxo), "LDKCVec_UtxoZ Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); - for (size_t g = 0; g < val_constr.datalen; g++) { - int64_t val_conv_6 = val_vals[g]; - LDKUtxo val_conv_6_conv; - val_conv_6_conv.inner = untag_ptr(val_conv_6); - val_conv_6_conv.is_owned = ptr_is_owned(val_conv_6); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_6_conv); - val_conv_6_conv = Utxo_clone(&val_conv_6_conv); - val_constr.data[g] = val_conv_6_conv; - } - (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); - CoinSelection_set_confirmed_utxos(&this_ptr_conv, val_constr); + UntrustedString_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CoinSelection_1get_1change_1output(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKCoinSelection this_ptr_conv; +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_UntrustedString_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUntrustedString this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_TxOutZ *ret_copy = MALLOC(sizeof(LDKCOption_TxOutZ), "LDKCOption_TxOutZ"); - *ret_copy = CoinSelection_get_change_output(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKStr ret_str = UntrustedString_get_a(&this_ptr_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CoinSelection_1set_1change_1output(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKCoinSelection this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UntrustedString_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { + LDKUntrustedString this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_TxOutZ val_conv = *(LDKCOption_TxOutZ*)(val_ptr); - val_conv = COption_TxOutZ_clone((LDKCOption_TxOutZ*)untag_ptr(val)); - CoinSelection_set_change_output(&this_ptr_conv, val_conv); + LDKStr val_conv = java_to_owned_str(env, val); + UntrustedString_set_a(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CoinSelection_1new(JNIEnv *env, jclass clz, int64_tArray confirmed_utxos_arg, int64_t change_output_arg) { - LDKCVec_UtxoZ confirmed_utxos_arg_constr; - confirmed_utxos_arg_constr.datalen = (*env)->GetArrayLength(env, confirmed_utxos_arg); - if (confirmed_utxos_arg_constr.datalen > 0) - confirmed_utxos_arg_constr.data = MALLOC(confirmed_utxos_arg_constr.datalen * sizeof(LDKUtxo), "LDKCVec_UtxoZ Elements"); - else - confirmed_utxos_arg_constr.data = NULL; - int64_t* confirmed_utxos_arg_vals = (*env)->GetLongArrayElements (env, confirmed_utxos_arg, NULL); - for (size_t g = 0; g < confirmed_utxos_arg_constr.datalen; g++) { - int64_t confirmed_utxos_arg_conv_6 = confirmed_utxos_arg_vals[g]; - LDKUtxo confirmed_utxos_arg_conv_6_conv; - confirmed_utxos_arg_conv_6_conv.inner = untag_ptr(confirmed_utxos_arg_conv_6); - confirmed_utxos_arg_conv_6_conv.is_owned = ptr_is_owned(confirmed_utxos_arg_conv_6); - CHECK_INNER_FIELD_ACCESS_OR_NULL(confirmed_utxos_arg_conv_6_conv); - confirmed_utxos_arg_conv_6_conv = Utxo_clone(&confirmed_utxos_arg_conv_6_conv); - confirmed_utxos_arg_constr.data[g] = confirmed_utxos_arg_conv_6_conv; - } - (*env)->ReleaseLongArrayElements(env, confirmed_utxos_arg, confirmed_utxos_arg_vals, 0); - void* change_output_arg_ptr = untag_ptr(change_output_arg); - CHECK_ACCESS(change_output_arg_ptr); - LDKCOption_TxOutZ change_output_arg_conv = *(LDKCOption_TxOutZ*)(change_output_arg_ptr); - change_output_arg_conv = COption_TxOutZ_clone((LDKCOption_TxOutZ*)untag_ptr(change_output_arg)); - LDKCoinSelection ret_var = CoinSelection_new(confirmed_utxos_arg_constr, change_output_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UntrustedString_1new(JNIEnv *env, jclass clz, jstring a_arg) { + LDKStr a_arg_conv = java_to_owned_str(env, a_arg); + LDKUntrustedString ret_var = UntrustedString_new(a_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t CoinSelection_clone_ptr(LDKCoinSelection *NONNULL_PTR arg) { - LDKCoinSelection ret_var = CoinSelection_clone(arg); +static inline uint64_t UntrustedString_clone_ptr(LDKUntrustedString *NONNULL_PTR arg) { + LDKUntrustedString ret_var = UntrustedString_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CoinSelection_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCoinSelection arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UntrustedString_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUntrustedString arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = CoinSelection_clone_ptr(&arg_conv); + int64_t ret_conv = UntrustedString_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CoinSelection_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCoinSelection orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UntrustedString_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKUntrustedString orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKCoinSelection ret_var = CoinSelection_clone(&orig_conv); + LDKUntrustedString ret_var = UntrustedString_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CoinSelectionSource_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKCoinSelectionSource this_ptr_conv = *(LDKCoinSelectionSource*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - CoinSelectionSource_free(this_ptr_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UntrustedString_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKUntrustedString a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKUntrustedString b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = UntrustedString_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WalletSource_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKWalletSource this_ptr_conv = *(LDKWalletSource*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - WalletSource_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UntrustedString_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKUntrustedString o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = UntrustedString_hash(&o_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Wallet_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKWallet this_obj_conv; +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_UntrustedString_1to_1str(JNIEnv *env, jclass clz, int64_t o) { + LDKUntrustedString o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = UntrustedString_to_str(&o_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PrintableString_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPrintableString this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Wallet_free(this_obj_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Wallet_1new(JNIEnv *env, jclass clz, int64_t source, int64_t logger) { - void* source_ptr = untag_ptr(source); - CHECK_ACCESS(source_ptr); - LDKWalletSource source_conv = *(LDKWalletSource*)(source_ptr); - if (source_conv.free == LDKWalletSource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKWalletSource_JCalls_cloned(&source_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKWallet ret_var = Wallet_new(source_conv, logger_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + PrintableString_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Wallet_1as_1CoinSelectionSource(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKWallet this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCoinSelectionSource* ret_ret = MALLOC(sizeof(LDKCoinSelectionSource), "LDKCoinSelectionSource"); - *ret_ret = Wallet_as_CoinSelectionSource(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_PrintableString_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPrintableString this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKStr ret_str = PrintableString_get_a(&this_ptr_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BumpTransactionEventHandler_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKBumpTransactionEventHandler this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BumpTransactionEventHandler_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PrintableString_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { + LDKPrintableString this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKStr val_conv = java_to_owned_str(env, val); + PrintableString_set_a(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BumpTransactionEventHandler_1new(JNIEnv *env, jclass clz, int64_t broadcaster, int64_t utxo_source, int64_t signer_provider, int64_t logger) { - void* broadcaster_ptr = untag_ptr(broadcaster); - CHECK_ACCESS(broadcaster_ptr); - LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); - } - void* utxo_source_ptr = untag_ptr(utxo_source); - CHECK_ACCESS(utxo_source_ptr); - LDKCoinSelectionSource utxo_source_conv = *(LDKCoinSelectionSource*)(utxo_source_ptr); - if (utxo_source_conv.free == LDKCoinSelectionSource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKCoinSelectionSource_JCalls_cloned(&utxo_source_conv); - } - void* signer_provider_ptr = untag_ptr(signer_provider); - CHECK_ACCESS(signer_provider_ptr); - LDKSignerProvider signer_provider_conv = *(LDKSignerProvider*)(signer_provider_ptr); - if (signer_provider_conv.free == LDKSignerProvider_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKSignerProvider_JCalls_cloned(&signer_provider_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKBumpTransactionEventHandler ret_var = BumpTransactionEventHandler_new(broadcaster_conv, utxo_source_conv, signer_provider_conv, logger_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrintableString_1new(JNIEnv *env, jclass clz, jstring a_arg) { + LDKStr a_arg_conv = java_to_owned_str(env, a_arg); + LDKPrintableString ret_var = PrintableString_new(a_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BumpTransactionEventHandler_1handle_1event(JNIEnv *env, jclass clz, int64_t this_arg, int64_t event) { - LDKBumpTransactionEventHandler this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKBumpTransactionEvent* event_conv = (LDKBumpTransactionEvent*)untag_ptr(event); - BumpTransactionEventHandler_handle_event(&this_arg_conv, event_conv); +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_PrintableString_1to_1str(JNIEnv *env, jclass clz, int64_t o) { + LDKPrintableString o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = PrintableString_to_str(&o_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FilesystemStore_1free(JNIEnv *env, jclass clz, int64_t this_obj) { @@ -88653,7 +94112,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipSync_1none(JNIEnv *en return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1start(JNIEnv *env, jclass clz, int64_t persister, int64_t event_handler, int64_t chain_monitor, int64_t channel_manager, int64_t gossip_sync, int64_t peer_manager, int64_t logger, int64_t scorer) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1start(JNIEnv *env, jclass clz, int64_t persister, int64_t event_handler, int64_t chain_monitor, int64_t channel_manager, int64_t onion_messenger, int64_t gossip_sync, int64_t peer_manager, int64_t logger, int64_t scorer) { void* persister_ptr = untag_ptr(persister); CHECK_ACCESS(persister_ptr); LDKPersister persister_conv = *(LDKPersister*)(persister_ptr); @@ -88678,6 +94137,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1start( channel_manager_conv.is_owned = ptr_is_owned(channel_manager); CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_conv); channel_manager_conv.is_owned = false; + LDKOnionMessenger onion_messenger_conv; + onion_messenger_conv.inner = untag_ptr(onion_messenger); + onion_messenger_conv.is_owned = ptr_is_owned(onion_messenger); + CHECK_INNER_FIELD_ACCESS_OR_NULL(onion_messenger_conv); + onion_messenger_conv.is_owned = false; void* gossip_sync_ptr = untag_ptr(gossip_sync); CHECK_ACCESS(gossip_sync_ptr); LDKGossipSync gossip_sync_conv = *(LDKGossipSync*)(gossip_sync_ptr); @@ -88705,7 +94169,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1start( LDKWriteableScore_JCalls_cloned(&scorer_conv.some); } } - LDKBackgroundProcessor ret_var = BackgroundProcessor_start(persister_conv, event_handler_conv, &chain_monitor_conv, &channel_manager_conv, gossip_sync_conv, &peer_manager_conv, logger_conv, scorer_conv); + LDKBackgroundProcessor ret_var = BackgroundProcessor_start(persister_conv, event_handler_conv, &chain_monitor_conv, &channel_manager_conv, &onion_messenger_conv, gossip_sync_conv, &peer_manager_conv, logger_conv, scorer_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -89889,6 +95353,40 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceSignature_1free(J Bolt11InvoiceSignature_free(this_obj_conv); } +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceSignature_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBolt11InvoiceSignature this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 68); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 68, Bolt11InvoiceSignature_get_a(&this_ptr_conv).serialized_form); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceSignature_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKBolt11InvoiceSignature this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKRecoverableSignature val_ref; + CHECK((*env)->GetArrayLength(env, val) == 68); + (*env)->GetByteArrayRegion(env, val, 0, 68, val_ref.serialized_form); + Bolt11InvoiceSignature_set_a(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceSignature_1new(JNIEnv *env, jclass clz, int8_tArray a_arg) { + LDKRecoverableSignature a_arg_ref; + CHECK((*env)->GetArrayLength(env, a_arg) == 68); + (*env)->GetByteArrayRegion(env, a_arg, 0, 68, a_arg_ref.serialized_form); + LDKBolt11InvoiceSignature ret_var = Bolt11InvoiceSignature_new(a_arg_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + static inline uint64_t Bolt11InvoiceSignature_clone_ptr(LDKBolt11InvoiceSignature *NONNULL_PTR arg) { LDKBolt11InvoiceSignature ret_var = Bolt11InvoiceSignature_clone(arg); int64_t ret_ref = 0; @@ -90620,6 +96118,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Description_1into_1inner(JN return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Description_1as_1inner(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKDescription this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKUntrustedString ret_var = Description_as_inner(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Description_1to_1str(JNIEnv *env, jclass clz, int64_t o) { LDKDescription o_conv; o_conv.inner = untag_ptr(o); @@ -90873,334 +96384,6 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1to_1st return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_payment_1parameters_1from_1zero_1amount_1invoice(JNIEnv *env, jclass clz, int64_t invoice, int64_t amount_msat) { - LDKBolt11Invoice invoice_conv; - invoice_conv.inner = untag_ptr(invoice); - invoice_conv.is_owned = ptr_is_owned(invoice); - CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); - invoice_conv.is_owned = false; - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); - *ret_conv = payment_parameters_from_zero_amount_invoice(&invoice_conv, amount_msat); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_payment_1parameters_1from_1invoice(JNIEnv *env, jclass clz, int64_t invoice) { - LDKBolt11Invoice invoice_conv; - invoice_conv.inner = untag_ptr(invoice); - invoice_conv.is_owned = ptr_is_owned(invoice); - CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); - invoice_conv.is_owned = false; - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); - *ret_conv = payment_parameters_from_invoice(&invoice_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice(JNIEnv *env, jclass clz, int64_t amt_msat, int64_t payment_hash, jstring description, int32_t invoice_expiry_delta_secs, int64_tArray phantom_route_hints, int64_t entropy_source, int64_t node_signer, int64_t logger, jclass network, int64_t min_final_cltv_expiry_delta, int64_t duration_since_epoch) { - void* amt_msat_ptr = untag_ptr(amt_msat); - CHECK_ACCESS(amt_msat_ptr); - LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); - amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); - void* payment_hash_ptr = untag_ptr(payment_hash); - CHECK_ACCESS(payment_hash_ptr); - LDKCOption_ThirtyTwoBytesZ payment_hash_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_ptr); - payment_hash_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash)); - LDKStr description_conv = java_to_owned_str(env, description); - LDKCVec_PhantomRouteHintsZ phantom_route_hints_constr; - phantom_route_hints_constr.datalen = (*env)->GetArrayLength(env, phantom_route_hints); - if (phantom_route_hints_constr.datalen > 0) - phantom_route_hints_constr.data = MALLOC(phantom_route_hints_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements"); - else - phantom_route_hints_constr.data = NULL; - int64_t* phantom_route_hints_vals = (*env)->GetLongArrayElements (env, phantom_route_hints, NULL); - for (size_t t = 0; t < phantom_route_hints_constr.datalen; t++) { - int64_t phantom_route_hints_conv_19 = phantom_route_hints_vals[t]; - LDKPhantomRouteHints phantom_route_hints_conv_19_conv; - phantom_route_hints_conv_19_conv.inner = untag_ptr(phantom_route_hints_conv_19); - phantom_route_hints_conv_19_conv.is_owned = ptr_is_owned(phantom_route_hints_conv_19); - CHECK_INNER_FIELD_ACCESS_OR_NULL(phantom_route_hints_conv_19_conv); - phantom_route_hints_conv_19_conv = PhantomRouteHints_clone(&phantom_route_hints_conv_19_conv); - phantom_route_hints_constr.data[t] = phantom_route_hints_conv_19_conv; - } - (*env)->ReleaseLongArrayElements(env, phantom_route_hints, phantom_route_hints_vals, 0); - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKCurrency network_conv = LDKCurrency_from_java(env, network); - void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); - CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); - LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); - min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = create_phantom_invoice(amt_msat_conv, payment_hash_conv, description_conv, invoice_expiry_delta_secs, phantom_route_hints_constr, entropy_source_conv, node_signer_conv, logger_conv, network_conv, min_final_cltv_expiry_delta_conv, duration_since_epoch); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice_1with_1description_1hash(JNIEnv *env, jclass clz, int64_t amt_msat, int64_t payment_hash, int32_t invoice_expiry_delta_secs, int64_t description_hash, int64_tArray phantom_route_hints, int64_t entropy_source, int64_t node_signer, int64_t logger, jclass network, int64_t min_final_cltv_expiry_delta, int64_t duration_since_epoch) { - void* amt_msat_ptr = untag_ptr(amt_msat); - CHECK_ACCESS(amt_msat_ptr); - LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); - amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); - void* payment_hash_ptr = untag_ptr(payment_hash); - CHECK_ACCESS(payment_hash_ptr); - LDKCOption_ThirtyTwoBytesZ payment_hash_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_ptr); - payment_hash_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash)); - LDKSha256 description_hash_conv; - description_hash_conv.inner = untag_ptr(description_hash); - description_hash_conv.is_owned = ptr_is_owned(description_hash); - CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv); - description_hash_conv = Sha256_clone(&description_hash_conv); - LDKCVec_PhantomRouteHintsZ phantom_route_hints_constr; - phantom_route_hints_constr.datalen = (*env)->GetArrayLength(env, phantom_route_hints); - if (phantom_route_hints_constr.datalen > 0) - phantom_route_hints_constr.data = MALLOC(phantom_route_hints_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements"); - else - phantom_route_hints_constr.data = NULL; - int64_t* phantom_route_hints_vals = (*env)->GetLongArrayElements (env, phantom_route_hints, NULL); - for (size_t t = 0; t < phantom_route_hints_constr.datalen; t++) { - int64_t phantom_route_hints_conv_19 = phantom_route_hints_vals[t]; - LDKPhantomRouteHints phantom_route_hints_conv_19_conv; - phantom_route_hints_conv_19_conv.inner = untag_ptr(phantom_route_hints_conv_19); - phantom_route_hints_conv_19_conv.is_owned = ptr_is_owned(phantom_route_hints_conv_19); - CHECK_INNER_FIELD_ACCESS_OR_NULL(phantom_route_hints_conv_19_conv); - phantom_route_hints_conv_19_conv = PhantomRouteHints_clone(&phantom_route_hints_conv_19_conv); - phantom_route_hints_constr.data[t] = phantom_route_hints_conv_19_conv; - } - (*env)->ReleaseLongArrayElements(env, phantom_route_hints, phantom_route_hints_vals, 0); - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKCurrency network_conv = LDKCurrency_from_java(env, network); - void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); - CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); - LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); - min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = create_phantom_invoice_with_description_hash(amt_msat_conv, payment_hash_conv, invoice_expiry_delta_secs, description_hash_conv, phantom_route_hints_constr, entropy_source_conv, node_signer_conv, logger_conv, network_conv, min_final_cltv_expiry_delta_conv, duration_since_epoch); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t node_signer, int64_t logger, jclass network, int64_t amt_msat, jstring description, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { - LDKChannelManager channelmanager_conv; - channelmanager_conv.inner = untag_ptr(channelmanager); - channelmanager_conv.is_owned = ptr_is_owned(channelmanager); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); - channelmanager_conv.is_owned = false; - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKCurrency network_conv = LDKCurrency_from_java(env, network); - void* amt_msat_ptr = untag_ptr(amt_msat); - CHECK_ACCESS(amt_msat_ptr); - LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); - amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); - LDKStr description_conv = java_to_owned_str(env, description); - void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); - CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); - LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); - min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = create_invoice_from_channelmanager(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_conv, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1with_1description_1hash(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t node_signer, int64_t logger, jclass network, int64_t amt_msat, int64_t description_hash, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { - LDKChannelManager channelmanager_conv; - channelmanager_conv.inner = untag_ptr(channelmanager); - channelmanager_conv.is_owned = ptr_is_owned(channelmanager); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); - channelmanager_conv.is_owned = false; - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKCurrency network_conv = LDKCurrency_from_java(env, network); - void* amt_msat_ptr = untag_ptr(amt_msat); - CHECK_ACCESS(amt_msat_ptr); - LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); - amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); - LDKSha256 description_hash_conv; - description_hash_conv.inner = untag_ptr(description_hash); - description_hash_conv.is_owned = ptr_is_owned(description_hash); - CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv); - description_hash_conv = Sha256_clone(&description_hash_conv); - void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); - CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); - LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); - min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = create_invoice_from_channelmanager_with_description_hash(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_hash_conv, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1with_1description_1hash_1and_1duration_1since_1epoch(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t node_signer, int64_t logger, jclass network, int64_t amt_msat, int64_t description_hash, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { - LDKChannelManager channelmanager_conv; - channelmanager_conv.inner = untag_ptr(channelmanager); - channelmanager_conv.is_owned = ptr_is_owned(channelmanager); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); - channelmanager_conv.is_owned = false; - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKCurrency network_conv = LDKCurrency_from_java(env, network); - void* amt_msat_ptr = untag_ptr(amt_msat); - CHECK_ACCESS(amt_msat_ptr); - LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); - amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); - LDKSha256 description_hash_conv; - description_hash_conv.inner = untag_ptr(description_hash); - description_hash_conv.is_owned = ptr_is_owned(description_hash); - CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv); - description_hash_conv = Sha256_clone(&description_hash_conv); - void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); - CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); - LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); - min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_hash_conv, duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1and_1duration_1since_1epoch(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t node_signer, int64_t logger, jclass network, int64_t amt_msat, jstring description, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { - LDKChannelManager channelmanager_conv; - channelmanager_conv.inner = untag_ptr(channelmanager); - channelmanager_conv.is_owned = ptr_is_owned(channelmanager); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); - channelmanager_conv.is_owned = false; - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKCurrency network_conv = LDKCurrency_from_java(env, network); - void* amt_msat_ptr = untag_ptr(amt_msat); - CHECK_ACCESS(amt_msat_ptr); - LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); - amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); - LDKStr description_conv = java_to_owned_str(env, description); - void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); - CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); - LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); - min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = create_invoice_from_channelmanager_and_duration_since_epoch(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_conv, duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1and_1duration_1since_1epoch_1with_1payment_1hash(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t node_signer, int64_t logger, jclass network, int64_t amt_msat, jstring description, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs, int8_tArray payment_hash, int64_t min_final_cltv_expiry_delta) { - LDKChannelManager channelmanager_conv; - channelmanager_conv.inner = untag_ptr(channelmanager); - channelmanager_conv.is_owned = ptr_is_owned(channelmanager); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); - channelmanager_conv.is_owned = false; - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKCurrency network_conv = LDKCurrency_from_java(env, network); - void* amt_msat_ptr = untag_ptr(amt_msat); - CHECK_ACCESS(amt_msat_ptr); - LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); - amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); - LDKStr description_conv = java_to_owned_str(env, description); - LDKThirtyTwoBytes payment_hash_ref; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); - CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); - LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); - min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_conv, duration_since_epoch, invoice_expiry_delta_secs, payment_hash_ref, min_final_cltv_expiry_delta_conv); - return tag_ptr(ret_conv, true); -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SiPrefix_1from_1str(JNIEnv *env, jclass clz, jstring s) { LDKStr s_conv = java_to_owned_str(env, s); LDKCResult_SiPrefixBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixBolt11ParseErrorZ), "LDKCResult_SiPrefixBolt11ParseErrorZ"); diff --git a/src/main/jni/bindings.c.body b/src/main/jni/bindings.c.body index ec875086..5539f5de 100644 --- a/src/main/jni/bindings.c.body +++ b/src/main/jni/bindings.c.body @@ -243,6 +243,52 @@ static inline uint64_t tag_ptr(const void* ptr, bool is_owned) { } } +static inline LDKBalanceSource LDKBalanceSource_from_java(JNIEnv *env, jclass clz) { + jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to BalanceSource.ordinal() from rust threw an exception."); + } + switch (ord) { + case 0: return LDKBalanceSource_HolderForceClosed; + case 1: return LDKBalanceSource_CounterpartyForceClosed; + case 2: return LDKBalanceSource_CoopClose; + case 3: return LDKBalanceSource_Htlc; + } + (*env)->FatalError(env, "A call to BalanceSource.ordinal() from rust returned an invalid value."); + abort(); // Unreachable, but will let the compiler know we don't return here +} +static jclass BalanceSource_class = NULL; +static jfieldID BalanceSource_LDKBalanceSource_HolderForceClosed = NULL; +static jfieldID BalanceSource_LDKBalanceSource_CounterpartyForceClosed = NULL; +static jfieldID BalanceSource_LDKBalanceSource_CoopClose = NULL; +static jfieldID BalanceSource_LDKBalanceSource_Htlc = NULL; +JNIEXPORT void JNICALL Java_org_ldk_enums_BalanceSource_init (JNIEnv *env, jclass clz) { + BalanceSource_class = (*env)->NewGlobalRef(env, clz); + CHECK(BalanceSource_class != NULL); + BalanceSource_LDKBalanceSource_HolderForceClosed = (*env)->GetStaticFieldID(env, BalanceSource_class, "LDKBalanceSource_HolderForceClosed", "Lorg/ldk/enums/BalanceSource;"); + CHECK(BalanceSource_LDKBalanceSource_HolderForceClosed != NULL); + BalanceSource_LDKBalanceSource_CounterpartyForceClosed = (*env)->GetStaticFieldID(env, BalanceSource_class, "LDKBalanceSource_CounterpartyForceClosed", "Lorg/ldk/enums/BalanceSource;"); + CHECK(BalanceSource_LDKBalanceSource_CounterpartyForceClosed != NULL); + BalanceSource_LDKBalanceSource_CoopClose = (*env)->GetStaticFieldID(env, BalanceSource_class, "LDKBalanceSource_CoopClose", "Lorg/ldk/enums/BalanceSource;"); + CHECK(BalanceSource_LDKBalanceSource_CoopClose != NULL); + BalanceSource_LDKBalanceSource_Htlc = (*env)->GetStaticFieldID(env, BalanceSource_class, "LDKBalanceSource_Htlc", "Lorg/ldk/enums/BalanceSource;"); + CHECK(BalanceSource_LDKBalanceSource_Htlc != NULL); +} +static inline jclass LDKBalanceSource_to_java(JNIEnv *env, LDKBalanceSource val) { + switch (val) { + case LDKBalanceSource_HolderForceClosed: + return (*env)->GetStaticObjectField(env, BalanceSource_class, BalanceSource_LDKBalanceSource_HolderForceClosed); + case LDKBalanceSource_CounterpartyForceClosed: + return (*env)->GetStaticObjectField(env, BalanceSource_class, BalanceSource_LDKBalanceSource_CounterpartyForceClosed); + case LDKBalanceSource_CoopClose: + return (*env)->GetStaticObjectField(env, BalanceSource_class, BalanceSource_LDKBalanceSource_CoopClose); + case LDKBalanceSource_Htlc: + return (*env)->GetStaticObjectField(env, BalanceSource_class, BalanceSource_LDKBalanceSource_Htlc); + default: abort(); + } +} + static inline LDKBlindedFailure LDKBlindedFailure_from_java(JNIEnv *env, jclass clz) { jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth); if (UNLIKELY((*env)->ExceptionCheck(env))) { @@ -393,7 +439,8 @@ static inline LDKBolt12SemanticError LDKBolt12SemanticError_from_java(JNIEnv *en case 24: return LDKBolt12SemanticError_InvalidPayInfo; case 25: return LDKBolt12SemanticError_MissingCreationTime; case 26: return LDKBolt12SemanticError_MissingPaymentHash; - case 27: return LDKBolt12SemanticError_MissingSignature; + case 27: return LDKBolt12SemanticError_UnexpectedPaymentHash; + case 28: return LDKBolt12SemanticError_MissingSignature; } (*env)->FatalError(env, "A call to Bolt12SemanticError.ordinal() from rust returned an invalid value."); abort(); // Unreachable, but will let the compiler know we don't return here @@ -426,6 +473,7 @@ static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedPaths = NUL static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_InvalidPayInfo = NULL; static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_MissingCreationTime = NULL; static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_MissingPaymentHash = NULL; +static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedPaymentHash = NULL; static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_MissingSignature = NULL; JNIEXPORT void JNICALL Java_org_ldk_enums_Bolt12SemanticError_init (JNIEnv *env, jclass clz) { Bolt12SemanticError_class = (*env)->NewGlobalRef(env, clz); @@ -484,6 +532,8 @@ JNIEXPORT void JNICALL Java_org_ldk_enums_Bolt12SemanticError_init (JNIEnv *env, CHECK(Bolt12SemanticError_LDKBolt12SemanticError_MissingCreationTime != NULL); Bolt12SemanticError_LDKBolt12SemanticError_MissingPaymentHash = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_MissingPaymentHash", "Lorg/ldk/enums/Bolt12SemanticError;"); CHECK(Bolt12SemanticError_LDKBolt12SemanticError_MissingPaymentHash != NULL); + Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedPaymentHash = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_UnexpectedPaymentHash", "Lorg/ldk/enums/Bolt12SemanticError;"); + CHECK(Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedPaymentHash != NULL); Bolt12SemanticError_LDKBolt12SemanticError_MissingSignature = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_MissingSignature", "Lorg/ldk/enums/Bolt12SemanticError;"); CHECK(Bolt12SemanticError_LDKBolt12SemanticError_MissingSignature != NULL); } @@ -543,6 +593,8 @@ static inline jclass LDKBolt12SemanticError_to_java(JNIEnv *env, LDKBolt12Semant return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_MissingCreationTime); case LDKBolt12SemanticError_MissingPaymentHash: return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_MissingPaymentHash); + case LDKBolt12SemanticError_UnexpectedPaymentHash: + return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedPaymentHash); case LDKBolt12SemanticError_MissingSignature: return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_MissingSignature); default: abort(); @@ -682,19 +734,21 @@ static inline LDKConfirmationTarget LDKConfirmationTarget_from_java(JNIEnv *env, (*env)->FatalError(env, "A call to ConfirmationTarget.ordinal() from rust threw an exception."); } switch (ord) { - case 0: return LDKConfirmationTarget_OnChainSweep; - case 1: return LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee; - case 2: return LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee; - case 3: return LDKConfirmationTarget_AnchorChannelFee; - case 4: return LDKConfirmationTarget_NonAnchorChannelFee; - case 5: return LDKConfirmationTarget_ChannelCloseMinimum; - case 6: return LDKConfirmationTarget_OutputSpendingFee; + case 0: return LDKConfirmationTarget_MaximumFeeEstimate; + case 1: return LDKConfirmationTarget_UrgentOnChainSweep; + case 2: return LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee; + case 3: return LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee; + case 4: return LDKConfirmationTarget_AnchorChannelFee; + case 5: return LDKConfirmationTarget_NonAnchorChannelFee; + case 6: return LDKConfirmationTarget_ChannelCloseMinimum; + case 7: return LDKConfirmationTarget_OutputSpendingFee; } (*env)->FatalError(env, "A call to ConfirmationTarget.ordinal() from rust returned an invalid value."); abort(); // Unreachable, but will let the compiler know we don't return here } static jclass ConfirmationTarget_class = NULL; -static jfieldID ConfirmationTarget_LDKConfirmationTarget_OnChainSweep = NULL; +static jfieldID ConfirmationTarget_LDKConfirmationTarget_MaximumFeeEstimate = NULL; +static jfieldID ConfirmationTarget_LDKConfirmationTarget_UrgentOnChainSweep = NULL; static jfieldID ConfirmationTarget_LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee = NULL; static jfieldID ConfirmationTarget_LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee = NULL; static jfieldID ConfirmationTarget_LDKConfirmationTarget_AnchorChannelFee = NULL; @@ -704,8 +758,10 @@ static jfieldID ConfirmationTarget_LDKConfirmationTarget_OutputSpendingFee = NUL JNIEXPORT void JNICALL Java_org_ldk_enums_ConfirmationTarget_init (JNIEnv *env, jclass clz) { ConfirmationTarget_class = (*env)->NewGlobalRef(env, clz); CHECK(ConfirmationTarget_class != NULL); - ConfirmationTarget_LDKConfirmationTarget_OnChainSweep = (*env)->GetStaticFieldID(env, ConfirmationTarget_class, "LDKConfirmationTarget_OnChainSweep", "Lorg/ldk/enums/ConfirmationTarget;"); - CHECK(ConfirmationTarget_LDKConfirmationTarget_OnChainSweep != NULL); + ConfirmationTarget_LDKConfirmationTarget_MaximumFeeEstimate = (*env)->GetStaticFieldID(env, ConfirmationTarget_class, "LDKConfirmationTarget_MaximumFeeEstimate", "Lorg/ldk/enums/ConfirmationTarget;"); + CHECK(ConfirmationTarget_LDKConfirmationTarget_MaximumFeeEstimate != NULL); + ConfirmationTarget_LDKConfirmationTarget_UrgentOnChainSweep = (*env)->GetStaticFieldID(env, ConfirmationTarget_class, "LDKConfirmationTarget_UrgentOnChainSweep", "Lorg/ldk/enums/ConfirmationTarget;"); + CHECK(ConfirmationTarget_LDKConfirmationTarget_UrgentOnChainSweep != NULL); ConfirmationTarget_LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee = (*env)->GetStaticFieldID(env, ConfirmationTarget_class, "LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee", "Lorg/ldk/enums/ConfirmationTarget;"); CHECK(ConfirmationTarget_LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee != NULL); ConfirmationTarget_LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee = (*env)->GetStaticFieldID(env, ConfirmationTarget_class, "LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee", "Lorg/ldk/enums/ConfirmationTarget;"); @@ -721,8 +777,10 @@ JNIEXPORT void JNICALL Java_org_ldk_enums_ConfirmationTarget_init (JNIEnv *env, } static inline jclass LDKConfirmationTarget_to_java(JNIEnv *env, LDKConfirmationTarget val) { switch (val) { - case LDKConfirmationTarget_OnChainSweep: - return (*env)->GetStaticObjectField(env, ConfirmationTarget_class, ConfirmationTarget_LDKConfirmationTarget_OnChainSweep); + case LDKConfirmationTarget_MaximumFeeEstimate: + return (*env)->GetStaticObjectField(env, ConfirmationTarget_class, ConfirmationTarget_LDKConfirmationTarget_MaximumFeeEstimate); + case LDKConfirmationTarget_UrgentOnChainSweep: + return (*env)->GetStaticObjectField(env, ConfirmationTarget_class, ConfirmationTarget_LDKConfirmationTarget_UrgentOnChainSweep); case LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee: return (*env)->GetStaticObjectField(env, ConfirmationTarget_class, ConfirmationTarget_LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee); case LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee: @@ -1274,6 +1332,9 @@ static inline LDKPaymentFailureReason LDKPaymentFailureReason_from_java(JNIEnv * case 3: return LDKPaymentFailureReason_PaymentExpired; case 4: return LDKPaymentFailureReason_RouteNotFound; case 5: return LDKPaymentFailureReason_UnexpectedError; + case 6: return LDKPaymentFailureReason_UnknownRequiredFeatures; + case 7: return LDKPaymentFailureReason_InvoiceRequestExpired; + case 8: return LDKPaymentFailureReason_InvoiceRequestRejected; } (*env)->FatalError(env, "A call to PaymentFailureReason.ordinal() from rust returned an invalid value."); abort(); // Unreachable, but will let the compiler know we don't return here @@ -1285,6 +1346,9 @@ static jfieldID PaymentFailureReason_LDKPaymentFailureReason_RetriesExhausted = static jfieldID PaymentFailureReason_LDKPaymentFailureReason_PaymentExpired = NULL; static jfieldID PaymentFailureReason_LDKPaymentFailureReason_RouteNotFound = NULL; static jfieldID PaymentFailureReason_LDKPaymentFailureReason_UnexpectedError = NULL; +static jfieldID PaymentFailureReason_LDKPaymentFailureReason_UnknownRequiredFeatures = NULL; +static jfieldID PaymentFailureReason_LDKPaymentFailureReason_InvoiceRequestExpired = NULL; +static jfieldID PaymentFailureReason_LDKPaymentFailureReason_InvoiceRequestRejected = NULL; JNIEXPORT void JNICALL Java_org_ldk_enums_PaymentFailureReason_init (JNIEnv *env, jclass clz) { PaymentFailureReason_class = (*env)->NewGlobalRef(env, clz); CHECK(PaymentFailureReason_class != NULL); @@ -1300,6 +1364,12 @@ JNIEXPORT void JNICALL Java_org_ldk_enums_PaymentFailureReason_init (JNIEnv *env CHECK(PaymentFailureReason_LDKPaymentFailureReason_RouteNotFound != NULL); PaymentFailureReason_LDKPaymentFailureReason_UnexpectedError = (*env)->GetStaticFieldID(env, PaymentFailureReason_class, "LDKPaymentFailureReason_UnexpectedError", "Lorg/ldk/enums/PaymentFailureReason;"); CHECK(PaymentFailureReason_LDKPaymentFailureReason_UnexpectedError != NULL); + PaymentFailureReason_LDKPaymentFailureReason_UnknownRequiredFeatures = (*env)->GetStaticFieldID(env, PaymentFailureReason_class, "LDKPaymentFailureReason_UnknownRequiredFeatures", "Lorg/ldk/enums/PaymentFailureReason;"); + CHECK(PaymentFailureReason_LDKPaymentFailureReason_UnknownRequiredFeatures != NULL); + PaymentFailureReason_LDKPaymentFailureReason_InvoiceRequestExpired = (*env)->GetStaticFieldID(env, PaymentFailureReason_class, "LDKPaymentFailureReason_InvoiceRequestExpired", "Lorg/ldk/enums/PaymentFailureReason;"); + CHECK(PaymentFailureReason_LDKPaymentFailureReason_InvoiceRequestExpired != NULL); + PaymentFailureReason_LDKPaymentFailureReason_InvoiceRequestRejected = (*env)->GetStaticFieldID(env, PaymentFailureReason_class, "LDKPaymentFailureReason_InvoiceRequestRejected", "Lorg/ldk/enums/PaymentFailureReason;"); + CHECK(PaymentFailureReason_LDKPaymentFailureReason_InvoiceRequestRejected != NULL); } static inline jclass LDKPaymentFailureReason_to_java(JNIEnv *env, LDKPaymentFailureReason val) { switch (val) { @@ -1315,6 +1385,12 @@ static inline jclass LDKPaymentFailureReason_to_java(JNIEnv *env, LDKPaymentFail return (*env)->GetStaticObjectField(env, PaymentFailureReason_class, PaymentFailureReason_LDKPaymentFailureReason_RouteNotFound); case LDKPaymentFailureReason_UnexpectedError: return (*env)->GetStaticObjectField(env, PaymentFailureReason_class, PaymentFailureReason_LDKPaymentFailureReason_UnexpectedError); + case LDKPaymentFailureReason_UnknownRequiredFeatures: + return (*env)->GetStaticObjectField(env, PaymentFailureReason_class, PaymentFailureReason_LDKPaymentFailureReason_UnknownRequiredFeatures); + case LDKPaymentFailureReason_InvoiceRequestExpired: + return (*env)->GetStaticObjectField(env, PaymentFailureReason_class, PaymentFailureReason_LDKPaymentFailureReason_InvoiceRequestExpired); + case LDKPaymentFailureReason_InvoiceRequestRejected: + return (*env)->GetStaticObjectField(env, PaymentFailureReason_class, PaymentFailureReason_LDKPaymentFailureReason_InvoiceRequestRejected); default: abort(); } } @@ -1363,6 +1439,7 @@ static inline LDKRetryableSendFailure LDKRetryableSendFailure_from_java(JNIEnv * case 0: return LDKRetryableSendFailure_PaymentExpired; case 1: return LDKRetryableSendFailure_RouteNotFound; case 2: return LDKRetryableSendFailure_DuplicatePayment; + case 3: return LDKRetryableSendFailure_OnionPacketSizeExceeded; } (*env)->FatalError(env, "A call to RetryableSendFailure.ordinal() from rust returned an invalid value."); abort(); // Unreachable, but will let the compiler know we don't return here @@ -1371,6 +1448,7 @@ static jclass RetryableSendFailure_class = NULL; static jfieldID RetryableSendFailure_LDKRetryableSendFailure_PaymentExpired = NULL; static jfieldID RetryableSendFailure_LDKRetryableSendFailure_RouteNotFound = NULL; static jfieldID RetryableSendFailure_LDKRetryableSendFailure_DuplicatePayment = NULL; +static jfieldID RetryableSendFailure_LDKRetryableSendFailure_OnionPacketSizeExceeded = NULL; JNIEXPORT void JNICALL Java_org_ldk_enums_RetryableSendFailure_init (JNIEnv *env, jclass clz) { RetryableSendFailure_class = (*env)->NewGlobalRef(env, clz); CHECK(RetryableSendFailure_class != NULL); @@ -1380,6 +1458,8 @@ JNIEXPORT void JNICALL Java_org_ldk_enums_RetryableSendFailure_init (JNIEnv *env CHECK(RetryableSendFailure_LDKRetryableSendFailure_RouteNotFound != NULL); RetryableSendFailure_LDKRetryableSendFailure_DuplicatePayment = (*env)->GetStaticFieldID(env, RetryableSendFailure_class, "LDKRetryableSendFailure_DuplicatePayment", "Lorg/ldk/enums/RetryableSendFailure;"); CHECK(RetryableSendFailure_LDKRetryableSendFailure_DuplicatePayment != NULL); + RetryableSendFailure_LDKRetryableSendFailure_OnionPacketSizeExceeded = (*env)->GetStaticFieldID(env, RetryableSendFailure_class, "LDKRetryableSendFailure_OnionPacketSizeExceeded", "Lorg/ldk/enums/RetryableSendFailure;"); + CHECK(RetryableSendFailure_LDKRetryableSendFailure_OnionPacketSizeExceeded != NULL); } static inline jclass LDKRetryableSendFailure_to_java(JNIEnv *env, LDKRetryableSendFailure val) { switch (val) { @@ -1389,6 +1469,8 @@ static inline jclass LDKRetryableSendFailure_to_java(JNIEnv *env, LDKRetryableSe return (*env)->GetStaticObjectField(env, RetryableSendFailure_class, RetryableSendFailure_LDKRetryableSendFailure_RouteNotFound); case LDKRetryableSendFailure_DuplicatePayment: return (*env)->GetStaticObjectField(env, RetryableSendFailure_class, RetryableSendFailure_LDKRetryableSendFailure_DuplicatePayment); + case LDKRetryableSendFailure_OnionPacketSizeExceeded: + return (*env)->GetStaticObjectField(env, RetryableSendFailure_class, RetryableSendFailure_LDKRetryableSendFailure_OnionPacketSizeExceeded); default: abort(); } } @@ -1411,6 +1493,7 @@ static inline LDKSecp256k1Error LDKSecp256k1Error_from_java(JNIEnv *env, jclass case 8: return LDKSecp256k1Error_NotEnoughMemory; case 9: return LDKSecp256k1Error_InvalidPublicKeySum; case 10: return LDKSecp256k1Error_InvalidParityValue; + case 11: return LDKSecp256k1Error_InvalidEllSwift; } (*env)->FatalError(env, "A call to Secp256k1Error.ordinal() from rust returned an invalid value."); abort(); // Unreachable, but will let the compiler know we don't return here @@ -1427,6 +1510,7 @@ static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidTweak = NULL; static jfieldID Secp256k1Error_LDKSecp256k1Error_NotEnoughMemory = NULL; static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidPublicKeySum = NULL; static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidParityValue = NULL; +static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidEllSwift = NULL; JNIEXPORT void JNICALL Java_org_ldk_enums_Secp256k1Error_init (JNIEnv *env, jclass clz) { Secp256k1Error_class = (*env)->NewGlobalRef(env, clz); CHECK(Secp256k1Error_class != NULL); @@ -1452,6 +1536,8 @@ JNIEXPORT void JNICALL Java_org_ldk_enums_Secp256k1Error_init (JNIEnv *env, jcla CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidPublicKeySum != NULL); Secp256k1Error_LDKSecp256k1Error_InvalidParityValue = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidParityValue", "Lorg/ldk/enums/Secp256k1Error;"); CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidParityValue != NULL); + Secp256k1Error_LDKSecp256k1Error_InvalidEllSwift = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidEllSwift", "Lorg/ldk/enums/Secp256k1Error;"); + CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidEllSwift != NULL); } static inline jclass LDKSecp256k1Error_to_java(JNIEnv *env, LDKSecp256k1Error val) { switch (val) { @@ -1477,6 +1563,8 @@ static inline jclass LDKSecp256k1Error_to_java(JNIEnv *env, LDKSecp256k1Error va return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidPublicKeySum); case LDKSecp256k1Error_InvalidParityValue: return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidParityValue); + case LDKSecp256k1Error_InvalidEllSwift: + return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidEllSwift); default: abort(); } } @@ -1830,71 +1918,13 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u64Z_1ref_1from default: abort(); } } -static inline LDKCVec_BlindedPathZ CVec_BlindedPathZ_clone(const LDKCVec_BlindedPathZ *orig) { - LDKCVec_BlindedPathZ ret = { .data = MALLOC(sizeof(LDKBlindedPath) * orig->datalen, "LDKCVec_BlindedPathZ clone bytes"), .datalen = orig->datalen }; +static inline LDKCVec_BlindedMessagePathZ CVec_BlindedMessagePathZ_clone(const LDKCVec_BlindedMessagePathZ *orig) { + LDKCVec_BlindedMessagePathZ ret = { .data = MALLOC(sizeof(LDKBlindedMessagePath) * orig->datalen, "LDKCVec_BlindedMessagePathZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = BlindedPath_clone(&orig->data[i]); + ret.data[i] = BlindedMessagePath_clone(&orig->data[i]); } return ret; } -static inline struct LDKRefund CResult_RefundBolt12ParseErrorZ_get_ok(LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR owner){ - LDKRefund ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RefundBolt12ParseErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_RefundBolt12ParseErrorZ* owner_conv = (LDKCResult_RefundBolt12ParseErrorZ*)untag_ptr(owner); - LDKRefund ret_var = CResult_RefundBolt12ParseErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline struct LDKBolt12ParseError CResult_RefundBolt12ParseErrorZ_get_err(LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR owner){ - LDKBolt12ParseError ret = *owner->contents.err; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RefundBolt12ParseErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_RefundBolt12ParseErrorZ* owner_conv = (LDKCResult_RefundBolt12ParseErrorZ*)untag_ptr(owner); - LDKBolt12ParseError ret_var = CResult_RefundBolt12ParseErrorZ_get_err(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static jclass LDKRetry_Attempts_class = NULL; -static jmethodID LDKRetry_Attempts_meth = NULL; -static jclass LDKRetry_Timeout_class = NULL; -static jmethodID LDKRetry_Timeout_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKRetry_init (JNIEnv *env, jclass clz) { - LDKRetry_Attempts_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKRetry$Attempts")); - CHECK(LDKRetry_Attempts_class != NULL); - LDKRetry_Attempts_meth = (*env)->GetMethodID(env, LDKRetry_Attempts_class, "", "(I)V"); - CHECK(LDKRetry_Attempts_meth != NULL); - LDKRetry_Timeout_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKRetry$Timeout")); - CHECK(LDKRetry_Timeout_class != NULL); - LDKRetry_Timeout_meth = (*env)->GetMethodID(env, LDKRetry_Timeout_class, "", "(J)V"); - CHECK(LDKRetry_Timeout_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKRetry_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKRetry *obj = (LDKRetry*)untag_ptr(ptr); - switch(obj->tag) { - case LDKRetry_Attempts: { - int32_t attempts_conv = obj->attempts; - return (*env)->NewObject(env, LDKRetry_Attempts_class, LDKRetry_Attempts_meth, attempts_conv); - } - case LDKRetry_Timeout: { - int64_t timeout_conv = obj->timeout; - return (*env)->NewObject(env, LDKRetry_Timeout_class, LDKRetry_Timeout_meth, timeout_conv); - } - default: abort(); - } -} static jclass LDKDecodeError_UnknownVersion_class = NULL; static jmethodID LDKDecodeError_UnknownVersion_meth = NULL; static jclass LDKDecodeError_UnknownRequiredFeature_class = NULL; @@ -1984,6 +2014,90 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKDecodeError_1ref_1from_1 default: abort(); } } +static inline struct LDKRefund CResult_RefundDecodeErrorZ_get_ok(LDKCResult_RefundDecodeErrorZ *NONNULL_PTR owner){ + LDKRefund ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RefundDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_RefundDecodeErrorZ* owner_conv = (LDKCResult_RefundDecodeErrorZ*)untag_ptr(owner); + LDKRefund ret_var = CResult_RefundDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_RefundDecodeErrorZ_get_err(LDKCResult_RefundDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RefundDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_RefundDecodeErrorZ* owner_conv = (LDKCResult_RefundDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_RefundDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKRefund CResult_RefundBolt12ParseErrorZ_get_ok(LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR owner){ + LDKRefund ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RefundBolt12ParseErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_RefundBolt12ParseErrorZ* owner_conv = (LDKCResult_RefundBolt12ParseErrorZ*)untag_ptr(owner); + LDKRefund ret_var = CResult_RefundBolt12ParseErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKBolt12ParseError CResult_RefundBolt12ParseErrorZ_get_err(LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR owner){ + LDKBolt12ParseError ret = *owner->contents.err; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RefundBolt12ParseErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_RefundBolt12ParseErrorZ* owner_conv = (LDKCResult_RefundBolt12ParseErrorZ*)untag_ptr(owner); + LDKBolt12ParseError ret_var = CResult_RefundBolt12ParseErrorZ_get_err(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static jclass LDKRetry_Attempts_class = NULL; +static jmethodID LDKRetry_Attempts_meth = NULL; +static jclass LDKRetry_Timeout_class = NULL; +static jmethodID LDKRetry_Timeout_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKRetry_init (JNIEnv *env, jclass clz) { + LDKRetry_Attempts_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKRetry$Attempts")); + CHECK(LDKRetry_Attempts_class != NULL); + LDKRetry_Attempts_meth = (*env)->GetMethodID(env, LDKRetry_Attempts_class, "", "(I)V"); + CHECK(LDKRetry_Attempts_meth != NULL); + LDKRetry_Timeout_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKRetry$Timeout")); + CHECK(LDKRetry_Timeout_class != NULL); + LDKRetry_Timeout_meth = (*env)->GetMethodID(env, LDKRetry_Timeout_class, "", "(J)V"); + CHECK(LDKRetry_Timeout_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKRetry_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKRetry *obj = (LDKRetry*)untag_ptr(ptr); + switch(obj->tag) { + case LDKRetry_Attempts: { + int32_t attempts_conv = obj->attempts; + return (*env)->NewObject(env, LDKRetry_Attempts_class, LDKRetry_Attempts_meth, attempts_conv); + } + case LDKRetry_Timeout: { + int64_t timeout_conv = obj->timeout; + return (*env)->NewObject(env, LDKRetry_Timeout_class, LDKRetry_Timeout_meth, timeout_conv); + } + default: abort(); + } +} static inline struct LDKRetry CResult_RetryDecodeErrorZ_get_ok(LDKCResult_RetryDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return Retry_clone(&*owner->contents.result); @@ -2524,28 +2638,28 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesNoneZ_1 CResult_ThirtyTwoBytesNoneZ_get_err(owner_conv); } -static inline struct LDKBlindedPayInfo CResult_BlindedPayInfoDecodeErrorZ_get_ok(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR owner){ - LDKBlindedPayInfo ret = *owner->contents.result; +static inline struct LDKBolt12Invoice CResult_Bolt12InvoiceDecodeErrorZ_get_ok(LDKCResult_Bolt12InvoiceDecodeErrorZ *NONNULL_PTR owner){ + LDKBolt12Invoice ret = *owner->contents.result; ret.is_owned = false; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_BlindedPayInfoDecodeErrorZ* owner_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(owner); - LDKBlindedPayInfo ret_var = CResult_BlindedPayInfoDecodeErrorZ_get_ok(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_Bolt12InvoiceDecodeErrorZ* owner_conv = (LDKCResult_Bolt12InvoiceDecodeErrorZ*)untag_ptr(owner); + LDKBolt12Invoice ret_var = CResult_Bolt12InvoiceDecodeErrorZ_get_ok(owner_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline struct LDKDecodeError CResult_BlindedPayInfoDecodeErrorZ_get_err(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_Bolt12InvoiceDecodeErrorZ_get_err(LDKCResult_Bolt12InvoiceDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return DecodeError_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_BlindedPayInfoDecodeErrorZ* owner_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(owner); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_Bolt12InvoiceDecodeErrorZ* owner_conv = (LDKCResult_Bolt12InvoiceDecodeErrorZ*)untag_ptr(owner); LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_BlindedPayInfoDecodeErrorZ_get_err(owner_conv); + *ret_copy = CResult_Bolt12InvoiceDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -2815,24 +2929,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCDescriptorDeco return ret_ref; } -static inline void CResult_NoneNoneZ_get_ok(LDKCResult_NoneNoneZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner); - CResult_NoneNoneZ_get_ok(owner_conv); -} - -static inline void CResult_NoneNoneZ_get_err(LDKCResult_NoneNoneZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; -} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner); - CResult_NoneNoneZ_get_err(owner_conv); -} - static inline struct LDKPublicKey CResult_PublicKeyNoneZ_get_ok(LDKCResult_PublicKeyNoneZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return *owner->contents.result; @@ -2853,6 +2949,44 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1get_1 CResult_PublicKeyNoneZ_get_err(owner_conv); } +static inline struct LDKThirtyTwoBytes CResult__u832NoneZ_get_ok(LDKCResult__u832NoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return ThirtyTwoBytes_clone(&*owner->contents.result); +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832NoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult__u832NoneZ* owner_conv = (LDKCResult__u832NoneZ*)untag_ptr(owner); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult__u832NoneZ_get_ok(owner_conv).data); + return ret_arr; +} + +static inline void CResult__u832NoneZ_get_err(LDKCResult__u832NoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832NoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult__u832NoneZ* owner_conv = (LDKCResult__u832NoneZ*)untag_ptr(owner); + CResult__u832NoneZ_get_err(owner_conv); +} + +static inline void CResult_NoneNoneZ_get_ok(LDKCResult_NoneNoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner); + CResult_NoneNoneZ_get_ok(owner_conv); +} + +static inline void CResult_NoneNoneZ_get_err(LDKCResult_NoneNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner); + CResult_NoneNoneZ_get_err(owner_conv); +} + static jclass LDKCOption_BigEndianScalarZ_Some_class = NULL; static jmethodID LDKCOption_BigEndianScalarZ_Some_meth = NULL; static jclass LDKCOption_BigEndianScalarZ_None_class = NULL; @@ -3019,7 +3153,7 @@ static void LDKChannelSigner_JCalls_free(void* this_arg) { FREE(j_calls); } } -LDKPublicKey get_per_commitment_point_LDKChannelSigner_jcall(const void* this_arg, uint64_t idx) { +LDKCResult_PublicKeyNoneZ get_per_commitment_point_LDKChannelSigner_jcall(const void* this_arg, uint64_t idx) { LDKChannelSigner_JCalls *j_calls = (LDKChannelSigner_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -3031,20 +3165,21 @@ LDKPublicKey get_per_commitment_point_LDKChannelSigner_jcall(const void* this_ar int64_t idx_conv = idx; jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_per_commitment_point_meth, idx_conv); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_per_commitment_point_meth, idx_conv); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); (*env)->FatalError(env, "A call to get_per_commitment_point in LDKChannelSigner from rust threw an exception."); } - LDKPublicKey ret_ref; - CHECK((*env)->GetArrayLength(env, ret) == 33); - (*env)->GetByteArrayRegion(env, ret, 0, 33, ret_ref.compressed_form); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_PublicKeyNoneZ ret_conv = *(LDKCResult_PublicKeyNoneZ*)(ret_ptr); + FREE(untag_ptr(ret)); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } - return ret_ref; + return ret_conv; } -LDKThirtyTwoBytes release_commitment_secret_LDKChannelSigner_jcall(const void* this_arg, uint64_t idx) { +LDKCResult__u832NoneZ release_commitment_secret_LDKChannelSigner_jcall(const void* this_arg, uint64_t idx) { LDKChannelSigner_JCalls *j_calls = (LDKChannelSigner_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -3056,18 +3191,19 @@ LDKThirtyTwoBytes release_commitment_secret_LDKChannelSigner_jcall(const void* t int64_t idx_conv = idx; jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->release_commitment_secret_meth, idx_conv); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->release_commitment_secret_meth, idx_conv); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); (*env)->FatalError(env, "A call to release_commitment_secret in LDKChannelSigner from rust threw an exception."); } - LDKThirtyTwoBytes ret_ref; - CHECK((*env)->GetArrayLength(env, ret) == 32); - (*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.data); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult__u832NoneZ ret_conv = *(LDKCResult__u832NoneZ*)(ret_ptr); + FREE(untag_ptr(ret)); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } - return ret_ref; + return ret_conv; } LDKCResult_NoneNoneZ validate_holder_commitment_LDKChannelSigner_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * holder_tx, LDKCVec_ThirtyTwoBytesZ outbound_htlc_preimages) { LDKChannelSigner_JCalls *j_calls = (LDKChannelSigner_JCalls*) this_arg; @@ -3194,9 +3330,9 @@ static inline LDKChannelSigner LDKChannelSigner_init (JNIEnv *env, jclass clz, j atomic_init(&calls->refcnt, 1); DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->get_per_commitment_point_meth = (*env)->GetMethodID(env, c, "get_per_commitment_point", "(J)[B"); + calls->get_per_commitment_point_meth = (*env)->GetMethodID(env, c, "get_per_commitment_point", "(J)J"); CHECK(calls->get_per_commitment_point_meth != NULL); - calls->release_commitment_secret_meth = (*env)->GetMethodID(env, c, "release_commitment_secret", "(J)[B"); + calls->release_commitment_secret_meth = (*env)->GetMethodID(env, c, "release_commitment_secret", "(J)J"); CHECK(calls->release_commitment_secret_meth != NULL); calls->validate_holder_commitment_meth = (*env)->GetMethodID(env, c, "validate_holder_commitment", "(J[[B)J"); CHECK(calls->validate_holder_commitment_meth != NULL); @@ -3231,22 +3367,22 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKChannelSigner_1new(JNIEn *res_ptr = LDKChannelSigner_init(env, clz, o, pubkeys); return tag_ptr(res_ptr, true); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelSigner_1get_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelSigner_1get_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelSigner* this_arg_conv = (LDKChannelSigner*)this_arg_ptr; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, (this_arg_conv->get_per_commitment_point)(this_arg_conv->this_arg, idx).compressed_form); - return ret_arr; + LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ"); + *ret_conv = (this_arg_conv->get_per_commitment_point)(this_arg_conv->this_arg, idx); + return tag_ptr(ret_conv, true); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelSigner_1release_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelSigner_1release_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelSigner* this_arg_conv = (LDKChannelSigner*)this_arg_ptr; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->release_commitment_secret)(this_arg_conv->this_arg, idx).data); - return ret_arr; + LDKCResult__u832NoneZ* ret_conv = MALLOC(sizeof(LDKCResult__u832NoneZ), "LDKCResult__u832NoneZ"); + *ret_conv = (this_arg_conv->release_commitment_secret)(this_arg_conv->this_arg, idx); + return tag_ptr(ret_conv, true); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelSigner_1validate_1holder_1commitment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t holder_tx, jobjectArray outbound_htlc_preimages) { @@ -3721,6 +3857,7 @@ static inline LDKEcdsaChannelSigner LDKEcdsaChannelSigner_init (JNIEnv *env, jcl .sign_closing_transaction = sign_closing_transaction_LDKEcdsaChannelSigner_jcall, .sign_holder_anchor_input = sign_holder_anchor_input_LDKEcdsaChannelSigner_jcall, .sign_channel_announcement_with_funding_key = sign_channel_announcement_with_funding_key_LDKEcdsaChannelSigner_jcall, + .cloned = LDKEcdsaChannelSigner_JCalls_cloned, .free = LDKEcdsaChannelSigner_JCalls_free, .ChannelSigner = LDKChannelSigner_init(env, clz, ChannelSigner, pubkeys), }; @@ -3914,131 +4051,25 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EcdsaChannelSigner_1sign_1c return tag_ptr(ret_conv, true); } -typedef struct LDKWriteableEcdsaChannelSigner_JCalls { - atomic_size_t refcnt; - JavaVM *vm; - jweak o; - LDKEcdsaChannelSigner_JCalls* EcdsaChannelSigner; - LDKChannelSigner_JCalls* ChannelSigner; - jmethodID write_meth; -} LDKWriteableEcdsaChannelSigner_JCalls; -static void LDKWriteableEcdsaChannelSigner_JCalls_free(void* this_arg) { - LDKWriteableEcdsaChannelSigner_JCalls *j_calls = (LDKWriteableEcdsaChannelSigner_JCalls*) this_arg; - if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { - JNIEnv *env; - jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK); - } else { - DO_ASSERT(get_jenv_res == JNI_OK); - } - (*env)->DeleteWeakGlobalRef(env, j_calls->o); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); - } - FREE(j_calls); - } -} -LDKCVec_u8Z write_LDKWriteableEcdsaChannelSigner_jcall(const void* this_arg) { - LDKWriteableEcdsaChannelSigner_JCalls *j_calls = (LDKWriteableEcdsaChannelSigner_JCalls*) this_arg; - JNIEnv *env; - jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK); - } else { - DO_ASSERT(get_jenv_res == JNI_OK); - } - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->write_meth); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to write in LDKWriteableEcdsaChannelSigner from rust threw an exception."); - } - LDKCVec_u8Z ret_ref; - ret_ref.datalen = (*env)->GetArrayLength(env, ret); - ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, ret, 0, ret_ref.datalen, ret_ref.data); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); - } - return ret_ref; -} -static void LDKWriteableEcdsaChannelSigner_JCalls_cloned(LDKWriteableEcdsaChannelSigner* new_obj) { - LDKWriteableEcdsaChannelSigner_JCalls *j_calls = (LDKWriteableEcdsaChannelSigner_JCalls*) new_obj->this_arg; - atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); - atomic_fetch_add_explicit(&j_calls->EcdsaChannelSigner->refcnt, 1, memory_order_release); - atomic_fetch_add_explicit(&j_calls->EcdsaChannelSigner->ChannelSigner->refcnt, 1, memory_order_release); -} -static inline LDKWriteableEcdsaChannelSigner LDKWriteableEcdsaChannelSigner_init (JNIEnv *env, jclass clz, jobject o, jobject EcdsaChannelSigner, jobject ChannelSigner, int64_t pubkeys) { - jclass c = (*env)->GetObjectClass(env, o); - CHECK(c != NULL); - LDKWriteableEcdsaChannelSigner_JCalls *calls = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner_JCalls), "LDKWriteableEcdsaChannelSigner_JCalls"); - atomic_init(&calls->refcnt, 1); - DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); - calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->write_meth = (*env)->GetMethodID(env, c, "write", "()[B"); - CHECK(calls->write_meth != NULL); - - LDKChannelPublicKeys pubkeys_conv; - pubkeys_conv.inner = untag_ptr(pubkeys); - pubkeys_conv.is_owned = ptr_is_owned(pubkeys); - CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv); - - LDKWriteableEcdsaChannelSigner ret = { - .this_arg = (void*) calls, - .write = write_LDKWriteableEcdsaChannelSigner_jcall, - .cloned = LDKWriteableEcdsaChannelSigner_JCalls_cloned, - .free = LDKWriteableEcdsaChannelSigner_JCalls_free, - .EcdsaChannelSigner = LDKEcdsaChannelSigner_init(env, clz, EcdsaChannelSigner, ChannelSigner, pubkeys), - }; - calls->EcdsaChannelSigner = ret.EcdsaChannelSigner.this_arg; - calls->ChannelSigner = ret.EcdsaChannelSigner.ChannelSigner.this_arg; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKWriteableEcdsaChannelSigner_1new(JNIEnv *env, jclass clz, jobject o, jobject EcdsaChannelSigner, jobject ChannelSigner, int64_t pubkeys) { - LDKWriteableEcdsaChannelSigner *res_ptr = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner"); - *res_ptr = LDKWriteableEcdsaChannelSigner_init(env, clz, o, EcdsaChannelSigner, ChannelSigner, pubkeys); - return tag_ptr(res_ptr, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKWriteableEcdsaChannelSigner_1get_1EcdsaChannelSigner(JNIEnv *env, jclass clz, int64_t arg) { - LDKWriteableEcdsaChannelSigner *inp = (LDKWriteableEcdsaChannelSigner *)untag_ptr(arg); - return tag_ptr(&inp->EcdsaChannelSigner, false); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKWriteableEcdsaChannelSigner_1get_1ChannelSigner(JNIEnv *env, jclass clz, int64_t arg) { - LDKWriteableEcdsaChannelSigner *inp = (LDKWriteableEcdsaChannelSigner *)untag_ptr(arg); - return tag_ptr(&inp->EcdsaChannelSigner.ChannelSigner, false); -} -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WriteableEcdsaChannelSigner_1write(JNIEnv *env, jclass clz, int64_t this_arg) { - void* this_arg_ptr = untag_ptr(this_arg); - if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKWriteableEcdsaChannelSigner* this_arg_conv = (LDKWriteableEcdsaChannelSigner*)this_arg_ptr; - LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -static inline struct LDKWriteableEcdsaChannelSigner CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_ok(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKEcdsaChannelSigner CResult_EcdsaChannelSignerDecodeErrorZ_get_ok(LDKCResult_EcdsaChannelSignerDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return WriteableEcdsaChannelSigner_clone(&*owner->contents.result); + return EcdsaChannelSigner_clone(&*owner->contents.result); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* owner_conv = (LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)untag_ptr(owner); - LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner"); - *ret_ret = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_ok(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1EcdsaChannelSignerDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_EcdsaChannelSignerDecodeErrorZ* owner_conv = (LDKCResult_EcdsaChannelSignerDecodeErrorZ*)untag_ptr(owner); + LDKEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner"); + *ret_ret = CResult_EcdsaChannelSignerDecodeErrorZ_get_ok(owner_conv); return tag_ptr(ret_ret, true); } -static inline struct LDKDecodeError CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_err(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_EcdsaChannelSignerDecodeErrorZ_get_err(LDKCResult_EcdsaChannelSignerDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return DecodeError_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* owner_conv = (LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)untag_ptr(owner); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1EcdsaChannelSignerDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_EcdsaChannelSignerDecodeErrorZ* owner_conv = (LDKCResult_EcdsaChannelSignerDecodeErrorZ*)untag_ptr(owner); LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_err(owner_conv); + *ret_copy = CResult_EcdsaChannelSignerDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -4896,103 +4927,135 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1NoneIOErrorZ_1get_1 return ret_conv; } -static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) { - LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = ChannelDetails_clone(&orig->data[i]); - } - return ret; +static inline struct LDKThirtyTwoBytes C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_a(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR owner){ + return ThirtyTwoBytes_clone(&owner->a); } -static inline struct LDKRoute CResult_RouteLightningErrorZ_get_ok(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){ - LDKRoute ret = *owner->contents.result; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* owner_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(owner); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_a(owner_conv).data); + return ret_arr; +} + +static inline struct LDKRecipientOnionFields C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_b(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR owner){ + LDKRecipientOnionFields ret = owner->b; ret.is_owned = false; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner); - LDKRoute ret_var = CResult_RouteLightningErrorZ_get_ok(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* owner_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(owner); + LDKRecipientOnionFields ret_var = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_b(owner_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline struct LDKLightningError CResult_RouteLightningErrorZ_get_err(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){ - LDKLightningError ret = *owner->contents.err; +static inline struct LDKRouteParameters C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_c(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR owner){ + LDKRouteParameters ret = owner->c; ret.is_owned = false; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner); - LDKLightningError ret_var = CResult_RouteLightningErrorZ_get_err(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1get_1c(JNIEnv *env, jclass clz, int64_t owner) { + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* owner_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(owner); + LDKRouteParameters ret_var = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_c(owner_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline struct LDKBlindedPayInfo C2Tuple_BlindedPayInfoBlindedPathZ_get_a(LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR owner){ - LDKBlindedPayInfo ret = owner->a; +static inline struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_ok(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(&*owner->contents.result); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* owner_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(owner); + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ), "LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ"); + *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_ok(owner_conv); + return tag_ptr(ret_conv, true); +} + +static inline void CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_err(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* owner_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(owner); + CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_err(owner_conv); +} + +static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) { + LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = ChannelDetails_clone(&orig->data[i]); + } + return ret; +} +static inline struct LDKRoute CResult_RouteLightningErrorZ_get_ok(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){ + LDKRoute ret = *owner->contents.result; ret.is_owned = false; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlindedPayInfoBlindedPathZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { - LDKC2Tuple_BlindedPayInfoBlindedPathZ* owner_conv = (LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(owner); - LDKBlindedPayInfo ret_var = C2Tuple_BlindedPayInfoBlindedPathZ_get_a(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner); + LDKRoute ret_var = CResult_RouteLightningErrorZ_get_ok(owner_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline struct LDKBlindedPath C2Tuple_BlindedPayInfoBlindedPathZ_get_b(LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR owner){ - LDKBlindedPath ret = owner->b; +static inline struct LDKLightningError CResult_RouteLightningErrorZ_get_err(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){ + LDKLightningError ret = *owner->contents.err; ret.is_owned = false; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlindedPayInfoBlindedPathZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { - LDKC2Tuple_BlindedPayInfoBlindedPathZ* owner_conv = (LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(owner); - LDKBlindedPath ret_var = C2Tuple_BlindedPayInfoBlindedPathZ_get_b(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner); + LDKLightningError ret_var = CResult_RouteLightningErrorZ_get_err(owner_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_clone(const LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ *orig) { - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ) * orig->datalen, "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ clone bytes"), .datalen = orig->datalen }; +static inline LDKCVec_BlindedPaymentPathZ CVec_BlindedPaymentPathZ_clone(const LDKCVec_BlindedPaymentPathZ *orig) { + LDKCVec_BlindedPaymentPathZ ret = { .data = MALLOC(sizeof(LDKBlindedPaymentPath) * orig->datalen, "LDKCVec_BlindedPaymentPathZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C2Tuple_BlindedPayInfoBlindedPathZ_clone(&orig->data[i]); + ret.data[i] = BlindedPaymentPath_clone(&orig->data[i]); } return ret; } -static inline struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_ok(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR owner){ +static inline struct LDKCVec_BlindedPaymentPathZ CResult_CVec_BlindedPaymentPathZNoneZ_get_ok(LDKCResult_CVec_BlindedPaymentPathZNoneZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_clone(&*owner->contents.result); + return CVec_BlindedPaymentPathZ_clone(&*owner->contents.result); } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlindedPayInfoBlindedPathZZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* owner_conv = (LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ*)untag_ptr(owner); - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ ret_var = CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_ok(owner_conv); +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPaymentPathZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_CVec_BlindedPaymentPathZNoneZ* owner_conv = (LDKCResult_CVec_BlindedPaymentPathZNoneZ*)untag_ptr(owner); + LDKCVec_BlindedPaymentPathZ ret_var = CResult_CVec_BlindedPaymentPathZNoneZ_get_ok(owner_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t l = 0; l < ret_var.datalen; l++) { - LDKC2Tuple_BlindedPayInfoBlindedPathZ* ret_conv_37_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ"); - *ret_conv_37_conv = ret_var.data[l]; - ret_arr_ptr[l] = tag_ptr(ret_conv_37_conv, true); + for (size_t u = 0; u < ret_var.datalen; u++) { + LDKBlindedPaymentPath ret_conv_20_var = ret_var.data[u]; + int64_t ret_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_20_var); + ret_conv_20_ref = tag_ptr(ret_conv_20_var.inner, ret_conv_20_var.is_owned); + ret_arr_ptr[u] = ret_conv_20_ref; } (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); FREE(ret_var.data); return ret_arr; } -static inline void CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_err(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR owner){ +static inline void CResult_CVec_BlindedPaymentPathZNoneZ_get_err(LDKCResult_CVec_BlindedPaymentPathZNoneZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return *owner->contents.err; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlindedPayInfoBlindedPathZZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* owner_conv = (LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ*)untag_ptr(owner); - CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_err(owner_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPaymentPathZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_CVec_BlindedPaymentPathZNoneZ* owner_conv = (LDKCResult_CVec_BlindedPaymentPathZNoneZ*)untag_ptr(owner); + CResult_CVec_BlindedPaymentPathZNoneZ_get_err(owner_conv); } static inline struct LDKOnionMessagePath CResult_OnionMessagePathNoneZ_get_ok(LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR owner){ @@ -5018,37 +5081,44 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_get_err(owner_conv); } -static inline struct LDKCVec_BlindedPathZ CResult_CVec_BlindedPathZNoneZ_get_ok(LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR owner){ +static inline struct LDKCVec_BlindedMessagePathZ CResult_CVec_BlindedMessagePathZNoneZ_get_ok(LDKCResult_CVec_BlindedMessagePathZNoneZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return CVec_BlindedPathZ_clone(&*owner->contents.result); + return CVec_BlindedMessagePathZ_clone(&*owner->contents.result); } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPathZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_CVec_BlindedPathZNoneZ* owner_conv = (LDKCResult_CVec_BlindedPathZNoneZ*)untag_ptr(owner); - LDKCVec_BlindedPathZ ret_var = CResult_CVec_BlindedPathZNoneZ_get_ok(owner_conv); +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_CVec_BlindedMessagePathZNoneZ* owner_conv = (LDKCResult_CVec_BlindedMessagePathZNoneZ*)untag_ptr(owner); + LDKCVec_BlindedMessagePathZ ret_var = CResult_CVec_BlindedMessagePathZNoneZ_get_ok(owner_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t n = 0; n < ret_var.datalen; n++) { - LDKBlindedPath ret_conv_13_var = ret_var.data[n]; - int64_t ret_conv_13_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_13_var); - ret_conv_13_ref = tag_ptr(ret_conv_13_var.inner, ret_conv_13_var.is_owned); - ret_arr_ptr[n] = ret_conv_13_ref; + for (size_t u = 0; u < ret_var.datalen; u++) { + LDKBlindedMessagePath ret_conv_20_var = ret_var.data[u]; + int64_t ret_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_20_var); + ret_conv_20_ref = tag_ptr(ret_conv_20_var.inner, ret_conv_20_var.is_owned); + ret_arr_ptr[u] = ret_conv_20_ref; } (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); FREE(ret_var.data); return ret_arr; } -static inline void CResult_CVec_BlindedPathZNoneZ_get_err(LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR owner){ +static inline void CResult_CVec_BlindedMessagePathZNoneZ_get_err(LDKCResult_CVec_BlindedMessagePathZNoneZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return *owner->contents.err; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPathZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_CVec_BlindedPathZNoneZ* owner_conv = (LDKCResult_CVec_BlindedPathZNoneZ*)untag_ptr(owner); - CResult_CVec_BlindedPathZNoneZ_get_err(owner_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_CVec_BlindedMessagePathZNoneZ* owner_conv = (LDKCResult_CVec_BlindedMessagePathZNoneZ*)untag_ptr(owner); + CResult_CVec_BlindedMessagePathZNoneZ_get_err(owner_conv); } +static inline LDKCVec_MessageForwardNodeZ CVec_MessageForwardNodeZ_clone(const LDKCVec_MessageForwardNodeZ *orig) { + LDKCVec_MessageForwardNodeZ ret = { .data = MALLOC(sizeof(LDKMessageForwardNode) * orig->datalen, "LDKCVec_MessageForwardNodeZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = MessageForwardNode_clone(&orig->data[i]); + } + return ret; +} static inline struct LDKInFlightHtlcs CResult_InFlightHtlcsDecodeErrorZ_get_ok(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner){ LDKInFlightHtlcs ret = *owner->contents.result; ret.is_owned = false; @@ -5238,13 +5308,6 @@ static inline LDKCVec_RouteHintZ CVec_RouteHintZ_clone(const LDKCVec_RouteHintZ } return ret; } -static inline LDKCVec_RouteHintHopZ CVec_RouteHintHopZ_clone(const LDKCVec_RouteHintHopZ *orig) { - LDKCVec_RouteHintHopZ ret = { .data = MALLOC(sizeof(LDKRouteHintHop) * orig->datalen, "LDKCVec_RouteHintHopZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = RouteHintHop_clone(&orig->data[i]); - } - return ret; -} static inline struct LDKRouteHint CResult_RouteHintDecodeErrorZ_get_ok(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR owner){ LDKRouteHint ret = *owner->contents.result; ret.is_owned = false; @@ -5712,6 +5775,8 @@ static jclass LDKClosureReason_FundingBatchClosure_class = NULL; static jmethodID LDKClosureReason_FundingBatchClosure_meth = NULL; static jclass LDKClosureReason_HTLCsTimedOut_class = NULL; static jmethodID LDKClosureReason_HTLCsTimedOut_meth = NULL; +static jclass LDKClosureReason_PeerFeerateTooLow_class = NULL; +static jmethodID LDKClosureReason_PeerFeerateTooLow_meth = NULL; JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKClosureReason_init (JNIEnv *env, jclass clz) { LDKClosureReason_CounterpartyForceClosed_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$CounterpartyForceClosed")); @@ -5721,7 +5786,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKClosureReason_init (JN LDKClosureReason_HolderForceClosed_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$HolderForceClosed")); CHECK(LDKClosureReason_HolderForceClosed_class != NULL); - LDKClosureReason_HolderForceClosed_meth = (*env)->GetMethodID(env, LDKClosureReason_HolderForceClosed_class, "", "()V"); + LDKClosureReason_HolderForceClosed_meth = (*env)->GetMethodID(env, LDKClosureReason_HolderForceClosed_class, "", "(J)V"); CHECK(LDKClosureReason_HolderForceClosed_meth != NULL); LDKClosureReason_LegacyCooperativeClosure_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$LegacyCooperativeClosure")); @@ -5778,6 +5843,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKClosureReason_init (JN CHECK(LDKClosureReason_HTLCsTimedOut_class != NULL); LDKClosureReason_HTLCsTimedOut_meth = (*env)->GetMethodID(env, LDKClosureReason_HTLCsTimedOut_class, "", "()V"); CHECK(LDKClosureReason_HTLCsTimedOut_meth != NULL); + LDKClosureReason_PeerFeerateTooLow_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$PeerFeerateTooLow")); + CHECK(LDKClosureReason_PeerFeerateTooLow_class != NULL); + LDKClosureReason_PeerFeerateTooLow_meth = (*env)->GetMethodID(env, LDKClosureReason_PeerFeerateTooLow_class, "", "(II)V"); + CHECK(LDKClosureReason_PeerFeerateTooLow_meth != NULL); } JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKClosureReason_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr); @@ -5790,7 +5860,8 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKClosureReason_1ref_1from return (*env)->NewObject(env, LDKClosureReason_CounterpartyForceClosed_class, LDKClosureReason_CounterpartyForceClosed_meth, peer_msg_ref); } case LDKClosureReason_HolderForceClosed: { - return (*env)->NewObject(env, LDKClosureReason_HolderForceClosed_class, LDKClosureReason_HolderForceClosed_meth); + int64_t broadcasted_latest_txn_ref = tag_ptr(&obj->holder_force_closed.broadcasted_latest_txn, false); + return (*env)->NewObject(env, LDKClosureReason_HolderForceClosed_class, LDKClosureReason_HolderForceClosed_meth, broadcasted_latest_txn_ref); } case LDKClosureReason_LegacyCooperativeClosure: { return (*env)->NewObject(env, LDKClosureReason_LegacyCooperativeClosure_class, LDKClosureReason_LegacyCooperativeClosure_meth); @@ -5827,6 +5898,11 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKClosureReason_1ref_1from case LDKClosureReason_HTLCsTimedOut: { return (*env)->NewObject(env, LDKClosureReason_HTLCsTimedOut_class, LDKClosureReason_HTLCsTimedOut_meth); } + case LDKClosureReason_PeerFeerateTooLow: { + int32_t peer_feerate_sat_per_kw_conv = obj->peer_feerate_too_low.peer_feerate_sat_per_kw; + int32_t required_feerate_sat_per_kw_conv = obj->peer_feerate_too_low.required_feerate_sat_per_kw; + return (*env)->NewObject(env, LDKClosureReason_PeerFeerateTooLow_class, LDKClosureReason_PeerFeerateTooLow_meth, peer_feerate_sat_per_kw_conv, required_feerate_sat_per_kw_conv); + } default: abort(); } } @@ -6275,6 +6351,32 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithE return ret_conv; } +static inline struct LDKOffer CResult_OfferDecodeErrorZ_get_ok(LDKCResult_OfferDecodeErrorZ *NONNULL_PTR owner){ + LDKOffer ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OfferDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_OfferDecodeErrorZ* owner_conv = (LDKCResult_OfferDecodeErrorZ*)untag_ptr(owner); + LDKOffer ret_var = CResult_OfferDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_OfferDecodeErrorZ_get_err(LDKCResult_OfferDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OfferDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_OfferDecodeErrorZ* owner_conv = (LDKCResult_OfferDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_OfferDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline struct LDKOffer CResult_OfferBolt12ParseErrorZ_get_ok(LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR owner){ LDKOffer ret = *owner->contents.result; ret.is_owned = false; @@ -6350,18 +6452,11 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecp256k1E return ret_conv; } -static jclass LDKNetworkUpdate_ChannelUpdateMessage_class = NULL; -static jmethodID LDKNetworkUpdate_ChannelUpdateMessage_meth = NULL; static jclass LDKNetworkUpdate_ChannelFailure_class = NULL; static jmethodID LDKNetworkUpdate_ChannelFailure_meth = NULL; static jclass LDKNetworkUpdate_NodeFailure_class = NULL; static jmethodID LDKNetworkUpdate_NodeFailure_meth = NULL; JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNetworkUpdate_init (JNIEnv *env, jclass clz) { - LDKNetworkUpdate_ChannelUpdateMessage_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetworkUpdate$ChannelUpdateMessage")); - CHECK(LDKNetworkUpdate_ChannelUpdateMessage_class != NULL); - LDKNetworkUpdate_ChannelUpdateMessage_meth = (*env)->GetMethodID(env, LDKNetworkUpdate_ChannelUpdateMessage_class, "", "(J)V"); - CHECK(LDKNetworkUpdate_ChannelUpdateMessage_meth != NULL); LDKNetworkUpdate_ChannelFailure_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetworkUpdate$ChannelFailure")); CHECK(LDKNetworkUpdate_ChannelFailure_class != NULL); @@ -6376,13 +6471,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNetworkUpdate_init (JN JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetworkUpdate_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr); switch(obj->tag) { - case LDKNetworkUpdate_ChannelUpdateMessage: { - LDKChannelUpdate msg_var = obj->channel_update_message.msg; - int64_t msg_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = tag_ptr(msg_var.inner, false); - return (*env)->NewObject(env, LDKNetworkUpdate_ChannelUpdateMessage_class, LDKNetworkUpdate_ChannelUpdateMessage_meth, msg_ref); - } case LDKNetworkUpdate_ChannelFailure: { int64_t short_channel_id_conv = obj->channel_failure.short_channel_id; jboolean is_permanent_conv = obj->channel_failure.is_permanent; @@ -6862,8 +6950,8 @@ static jclass LDKMessageSendEvent_SendFundingSigned_class = NULL; static jmethodID LDKMessageSendEvent_SendFundingSigned_meth = NULL; static jclass LDKMessageSendEvent_SendStfu_class = NULL; static jmethodID LDKMessageSendEvent_SendStfu_meth = NULL; -static jclass LDKMessageSendEvent_SendSplice_class = NULL; -static jmethodID LDKMessageSendEvent_SendSplice_meth = NULL; +static jclass LDKMessageSendEvent_SendSpliceInit_class = NULL; +static jmethodID LDKMessageSendEvent_SendSpliceInit_meth = NULL; static jclass LDKMessageSendEvent_SendSpliceAck_class = NULL; static jmethodID LDKMessageSendEvent_SendSpliceAck_meth = NULL; static jclass LDKMessageSendEvent_SendSpliceLocked_class = NULL; @@ -6956,11 +7044,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendEvent_init CHECK(LDKMessageSendEvent_SendStfu_class != NULL); LDKMessageSendEvent_SendStfu_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendStfu_class, "", "([BJ)V"); CHECK(LDKMessageSendEvent_SendStfu_meth != NULL); - LDKMessageSendEvent_SendSplice_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendSplice")); - CHECK(LDKMessageSendEvent_SendSplice_class != NULL); - LDKMessageSendEvent_SendSplice_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendSplice_class, "", "([BJ)V"); - CHECK(LDKMessageSendEvent_SendSplice_meth != NULL); + LDKMessageSendEvent_SendSpliceInit_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendSpliceInit")); + CHECK(LDKMessageSendEvent_SendSpliceInit_class != NULL); + LDKMessageSendEvent_SendSpliceInit_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendSpliceInit_class, "", "([BJ)V"); + CHECK(LDKMessageSendEvent_SendSpliceInit_meth != NULL); LDKMessageSendEvent_SendSpliceAck_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendSpliceAck")); CHECK(LDKMessageSendEvent_SendSpliceAck_class != NULL); @@ -7168,14 +7256,14 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f msg_ref = tag_ptr(msg_var.inner, false); return (*env)->NewObject(env, LDKMessageSendEvent_SendStfu_class, LDKMessageSendEvent_SendStfu_meth, node_id_arr, msg_ref); } - case LDKMessageSendEvent_SendSplice: { + case LDKMessageSendEvent_SendSpliceInit: { int8_tArray node_id_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_splice.node_id.compressed_form); - LDKSplice msg_var = obj->send_splice.msg; + (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_splice_init.node_id.compressed_form); + LDKSpliceInit msg_var = obj->send_splice_init.msg; int64_t msg_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, false); - return (*env)->NewObject(env, LDKMessageSendEvent_SendSplice_class, LDKMessageSendEvent_SendSplice_meth, node_id_arr, msg_ref); + return (*env)->NewObject(env, LDKMessageSendEvent_SendSpliceInit_class, LDKMessageSendEvent_SendSpliceInit_meth, node_id_arr, msg_ref); } case LDKMessageSendEvent_SendSpliceAck: { int8_tArray node_id_arr = (*env)->NewByteArray(env, 33); @@ -7599,17 +7687,51 @@ static inline LDKCVec_SocketAddressZ CVec_SocketAddressZ_clone(const LDKCVec_Soc } return ret; } +static jclass LDKNodeAnnouncementInfo_Relayed_class = NULL; +static jmethodID LDKNodeAnnouncementInfo_Relayed_meth = NULL; +static jclass LDKNodeAnnouncementInfo_Local_class = NULL; +static jmethodID LDKNodeAnnouncementInfo_Local_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNodeAnnouncementInfo_init (JNIEnv *env, jclass clz) { + LDKNodeAnnouncementInfo_Relayed_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNodeAnnouncementInfo$Relayed")); + CHECK(LDKNodeAnnouncementInfo_Relayed_class != NULL); + LDKNodeAnnouncementInfo_Relayed_meth = (*env)->GetMethodID(env, LDKNodeAnnouncementInfo_Relayed_class, "", "(J)V"); + CHECK(LDKNodeAnnouncementInfo_Relayed_meth != NULL); + LDKNodeAnnouncementInfo_Local_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNodeAnnouncementInfo$Local")); + CHECK(LDKNodeAnnouncementInfo_Local_class != NULL); + LDKNodeAnnouncementInfo_Local_meth = (*env)->GetMethodID(env, LDKNodeAnnouncementInfo_Local_class, "", "(J)V"); + CHECK(LDKNodeAnnouncementInfo_Local_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNodeAnnouncementInfo_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKNodeAnnouncementInfo *obj = (LDKNodeAnnouncementInfo*)untag_ptr(ptr); + switch(obj->tag) { + case LDKNodeAnnouncementInfo_Relayed: { + LDKNodeAnnouncement relayed_var = obj->relayed; + int64_t relayed_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(relayed_var); + relayed_ref = tag_ptr(relayed_var.inner, false); + return (*env)->NewObject(env, LDKNodeAnnouncementInfo_Relayed_class, LDKNodeAnnouncementInfo_Relayed_meth, relayed_ref); + } + case LDKNodeAnnouncementInfo_Local: { + LDKNodeAnnouncementDetails local_var = obj->local; + int64_t local_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(local_var); + local_ref = tag_ptr(local_var.inner, false); + return (*env)->NewObject(env, LDKNodeAnnouncementInfo_Local_class, LDKNodeAnnouncementInfo_Local_meth, local_ref); + } + default: abort(); + } +} static inline struct LDKNodeAnnouncementInfo CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner){ - LDKNodeAnnouncementInfo ret = *owner->contents.result; - ret.is_owned = false; - return ret; +CHECK(owner->result_ok); + return NodeAnnouncementInfo_clone(&*owner->contents.result); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(owner); - LDKNodeAnnouncementInfo ret_var = CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKNodeAnnouncementInfo *ret_copy = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo"); + *ret_copy = CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -7651,6 +7773,35 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErr return ret_ref; } +static jclass LDKCOption_NodeAnnouncementInfoZ_Some_class = NULL; +static jmethodID LDKCOption_NodeAnnouncementInfoZ_Some_meth = NULL; +static jclass LDKCOption_NodeAnnouncementInfoZ_None_class = NULL; +static jmethodID LDKCOption_NodeAnnouncementInfoZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1NodeAnnouncementInfoZ_init (JNIEnv *env, jclass clz) { + LDKCOption_NodeAnnouncementInfoZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_NodeAnnouncementInfoZ$Some")); + CHECK(LDKCOption_NodeAnnouncementInfoZ_Some_class != NULL); + LDKCOption_NodeAnnouncementInfoZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_NodeAnnouncementInfoZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_NodeAnnouncementInfoZ_Some_meth != NULL); + LDKCOption_NodeAnnouncementInfoZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_NodeAnnouncementInfoZ$None")); + CHECK(LDKCOption_NodeAnnouncementInfoZ_None_class != NULL); + LDKCOption_NodeAnnouncementInfoZ_None_meth = (*env)->GetMethodID(env, LDKCOption_NodeAnnouncementInfoZ_None_class, "", "()V"); + CHECK(LDKCOption_NodeAnnouncementInfoZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1NodeAnnouncementInfoZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_NodeAnnouncementInfoZ *obj = (LDKCOption_NodeAnnouncementInfoZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_NodeAnnouncementInfoZ_Some: { + int64_t some_ref = tag_ptr(&obj->some, false); + return (*env)->NewObject(env, LDKCOption_NodeAnnouncementInfoZ_Some_class, LDKCOption_NodeAnnouncementInfoZ_Some_meth, some_ref); + } + case LDKCOption_NodeAnnouncementInfoZ_None: { + return (*env)->NewObject(env, LDKCOption_NodeAnnouncementInfoZ_None_class, LDKCOption_NodeAnnouncementInfoZ_None_meth); + } + default: abort(); + } +} static inline struct LDKNodeInfo CResult_NodeInfoDecodeErrorZ_get_ok(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner){ LDKNodeInfo ret = *owner->contents.result; ret.is_owned = false; @@ -8548,6 +8699,87 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesAPIE return ret_ref; } +static jclass LDKOffersContext_InvoiceRequest_class = NULL; +static jmethodID LDKOffersContext_InvoiceRequest_meth = NULL; +static jclass LDKOffersContext_OutboundPayment_class = NULL; +static jmethodID LDKOffersContext_OutboundPayment_meth = NULL; +static jclass LDKOffersContext_InboundPayment_class = NULL; +static jmethodID LDKOffersContext_InboundPayment_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKOffersContext_init (JNIEnv *env, jclass clz) { + LDKOffersContext_InvoiceRequest_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKOffersContext$InvoiceRequest")); + CHECK(LDKOffersContext_InvoiceRequest_class != NULL); + LDKOffersContext_InvoiceRequest_meth = (*env)->GetMethodID(env, LDKOffersContext_InvoiceRequest_class, "", "(J)V"); + CHECK(LDKOffersContext_InvoiceRequest_meth != NULL); + LDKOffersContext_OutboundPayment_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKOffersContext$OutboundPayment")); + CHECK(LDKOffersContext_OutboundPayment_class != NULL); + LDKOffersContext_OutboundPayment_meth = (*env)->GetMethodID(env, LDKOffersContext_OutboundPayment_class, "", "([BJ[B)V"); + CHECK(LDKOffersContext_OutboundPayment_meth != NULL); + LDKOffersContext_InboundPayment_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKOffersContext$InboundPayment")); + CHECK(LDKOffersContext_InboundPayment_class != NULL); + LDKOffersContext_InboundPayment_meth = (*env)->GetMethodID(env, LDKOffersContext_InboundPayment_class, "", "([B)V"); + CHECK(LDKOffersContext_InboundPayment_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKOffersContext_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKOffersContext *obj = (LDKOffersContext*)untag_ptr(ptr); + switch(obj->tag) { + case LDKOffersContext_InvoiceRequest: { + LDKNonce nonce_var = obj->invoice_request.nonce; + int64_t nonce_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_var); + nonce_ref = tag_ptr(nonce_var.inner, false); + return (*env)->NewObject(env, LDKOffersContext_InvoiceRequest_class, LDKOffersContext_InvoiceRequest_meth, nonce_ref); + } + case LDKOffersContext_OutboundPayment: { + int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->outbound_payment.payment_id.data); + LDKNonce nonce_var = obj->outbound_payment.nonce; + int64_t nonce_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_var); + nonce_ref = tag_ptr(nonce_var.inner, false); + int8_tArray hmac_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, hmac_arr, 0, 32, obj->outbound_payment.hmac.data); + return (*env)->NewObject(env, LDKOffersContext_OutboundPayment_class, LDKOffersContext_OutboundPayment_meth, payment_id_arr, nonce_ref, hmac_arr); + } + case LDKOffersContext_InboundPayment: { + int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->inbound_payment.payment_hash.data); + return (*env)->NewObject(env, LDKOffersContext_InboundPayment_class, LDKOffersContext_InboundPayment_meth, payment_hash_arr); + } + default: abort(); + } +} +static jclass LDKCOption_OffersContextZ_Some_class = NULL; +static jmethodID LDKCOption_OffersContextZ_Some_meth = NULL; +static jclass LDKCOption_OffersContextZ_None_class = NULL; +static jmethodID LDKCOption_OffersContextZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1OffersContextZ_init (JNIEnv *env, jclass clz) { + LDKCOption_OffersContextZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_OffersContextZ$Some")); + CHECK(LDKCOption_OffersContextZ_Some_class != NULL); + LDKCOption_OffersContextZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_OffersContextZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_OffersContextZ_Some_meth != NULL); + LDKCOption_OffersContextZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_OffersContextZ$None")); + CHECK(LDKCOption_OffersContextZ_None_class != NULL); + LDKCOption_OffersContextZ_None_meth = (*env)->GetMethodID(env, LDKCOption_OffersContextZ_None_class, "", "()V"); + CHECK(LDKCOption_OffersContextZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1OffersContextZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_OffersContextZ *obj = (LDKCOption_OffersContextZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_OffersContextZ_Some: { + int64_t some_ref = tag_ptr(&obj->some, false); + return (*env)->NewObject(env, LDKCOption_OffersContextZ_Some_class, LDKCOption_OffersContextZ_Some_meth, some_ref); + } + case LDKCOption_OffersContextZ_None: { + return (*env)->NewObject(env, LDKCOption_OffersContextZ_None_class, LDKCOption_OffersContextZ_None_meth); + } + default: abort(); + } +} static jclass LDKOffersMessage_InvoiceRequest_class = NULL; static jmethodID LDKOffersMessage_InvoiceRequest_meth = NULL; static jclass LDKOffersMessage_Invoice_class = NULL; @@ -8598,31 +8830,58 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKOffersMessage_1ref_1from default: abort(); } } -static jclass LDKCOption_OffersMessageZ_Some_class = NULL; -static jmethodID LDKCOption_OffersMessageZ_Some_meth = NULL; -static jclass LDKCOption_OffersMessageZ_None_class = NULL; -static jmethodID LDKCOption_OffersMessageZ_None_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1OffersMessageZ_init (JNIEnv *env, jclass clz) { - LDKCOption_OffersMessageZ_Some_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_OffersMessageZ$Some")); - CHECK(LDKCOption_OffersMessageZ_Some_class != NULL); - LDKCOption_OffersMessageZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_OffersMessageZ_Some_class, "", "(J)V"); - CHECK(LDKCOption_OffersMessageZ_Some_meth != NULL); - LDKCOption_OffersMessageZ_None_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_OffersMessageZ$None")); - CHECK(LDKCOption_OffersMessageZ_None_class != NULL); - LDKCOption_OffersMessageZ_None_meth = (*env)->GetMethodID(env, LDKCOption_OffersMessageZ_None_class, "", "()V"); - CHECK(LDKCOption_OffersMessageZ_None_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1OffersMessageZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKCOption_OffersMessageZ *obj = (LDKCOption_OffersMessageZ*)untag_ptr(ptr); +static inline struct LDKOffersMessage C2Tuple_OffersMessageResponseInstructionZ_get_a(LDKC2Tuple_OffersMessageResponseInstructionZ *NONNULL_PTR owner){ + return OffersMessage_clone(&owner->a); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OffersMessageResponseInstructionZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_OffersMessageResponseInstructionZ* owner_conv = (LDKC2Tuple_OffersMessageResponseInstructionZ*)untag_ptr(owner); + LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); + *ret_copy = C2Tuple_OffersMessageResponseInstructionZ_get_a(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKResponseInstruction C2Tuple_OffersMessageResponseInstructionZ_get_b(LDKC2Tuple_OffersMessageResponseInstructionZ *NONNULL_PTR owner){ + LDKResponseInstruction ret = owner->b; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OffersMessageResponseInstructionZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_OffersMessageResponseInstructionZ* owner_conv = (LDKC2Tuple_OffersMessageResponseInstructionZ*)untag_ptr(owner); + LDKResponseInstruction ret_var = C2Tuple_OffersMessageResponseInstructionZ_get_b(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static jclass LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_Some_class = NULL; +static jmethodID LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_Some_meth = NULL; +static jclass LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_None_class = NULL; +static jmethodID LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C2Tuple_1OffersMessageResponseInstructionZZ_init (JNIEnv *env, jclass clz) { + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ$Some")); + CHECK(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_Some_class != NULL); + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_Some_meth != NULL); + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ$None")); + CHECK(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_None_class != NULL); + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_None_class, "", "()V"); + CHECK(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1OffersMessageResponseInstructionZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ *obj = (LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ*)untag_ptr(ptr); switch(obj->tag) { - case LDKCOption_OffersMessageZ_Some: { - int64_t some_ref = tag_ptr(&obj->some, false); - return (*env)->NewObject(env, LDKCOption_OffersMessageZ_Some_class, LDKCOption_OffersMessageZ_Some_meth, some_ref); + case LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_Some: { + LDKC2Tuple_OffersMessageResponseInstructionZ* some_conv = MALLOC(sizeof(LDKC2Tuple_OffersMessageResponseInstructionZ), "LDKC2Tuple_OffersMessageResponseInstructionZ"); + *some_conv = obj->some; + *some_conv = C2Tuple_OffersMessageResponseInstructionZ_clone(some_conv); + return (*env)->NewObject(env, LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_Some_class, LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_Some_meth, tag_ptr(some_conv, true)); } - case LDKCOption_OffersMessageZ_None: { - return (*env)->NewObject(env, LDKCOption_OffersMessageZ_None_class, LDKCOption_OffersMessageZ_None_meth); + case LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_None: { + return (*env)->NewObject(env, LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_None_class, LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_None_meth); } default: abort(); } @@ -8652,7 +8911,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKDestination_1ref_1from_1 return (*env)->NewObject(env, LDKDestination_Node_class, LDKDestination_Node_meth, node_arr); } case LDKDestination_BlindedPath: { - LDKBlindedPath blinded_path_var = obj->blinded_path; + LDKBlindedMessagePath blinded_path_var = obj->blinded_path; int64_t blinded_path_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_path_var); blinded_path_ref = tag_ptr(blinded_path_var.inner, false); @@ -8661,46 +8920,248 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKDestination_1ref_1from_1 default: abort(); } } -static inline struct LDKOffersMessage C3Tuple_OffersMessageDestinationBlindedPathZ_get_a(LDKC3Tuple_OffersMessageDestinationBlindedPathZ *NONNULL_PTR owner){ +static jclass LDKMessageContext_Offers_class = NULL; +static jmethodID LDKMessageContext_Offers_meth = NULL; +static jclass LDKMessageContext_Custom_class = NULL; +static jmethodID LDKMessageContext_Custom_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageContext_init (JNIEnv *env, jclass clz) { + LDKMessageContext_Offers_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageContext$Offers")); + CHECK(LDKMessageContext_Offers_class != NULL); + LDKMessageContext_Offers_meth = (*env)->GetMethodID(env, LDKMessageContext_Offers_class, "", "(J)V"); + CHECK(LDKMessageContext_Offers_meth != NULL); + LDKMessageContext_Custom_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageContext$Custom")); + CHECK(LDKMessageContext_Custom_class != NULL); + LDKMessageContext_Custom_meth = (*env)->GetMethodID(env, LDKMessageContext_Custom_class, "", "([B)V"); + CHECK(LDKMessageContext_Custom_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageContext_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKMessageContext *obj = (LDKMessageContext*)untag_ptr(ptr); + switch(obj->tag) { + case LDKMessageContext_Offers: { + int64_t offers_ref = tag_ptr(&obj->offers, false); + return (*env)->NewObject(env, LDKMessageContext_Offers_class, LDKMessageContext_Offers_meth, offers_ref); + } + case LDKMessageContext_Custom: { + LDKCVec_u8Z custom_var = obj->custom; + int8_tArray custom_arr = (*env)->NewByteArray(env, custom_var.datalen); + (*env)->SetByteArrayRegion(env, custom_arr, 0, custom_var.datalen, custom_var.data); + return (*env)->NewObject(env, LDKMessageContext_Custom_class, LDKMessageContext_Custom_meth, custom_arr); + } + default: abort(); + } +} +static jclass LDKMessageSendInstructions_WithSpecifiedReplyPath_class = NULL; +static jmethodID LDKMessageSendInstructions_WithSpecifiedReplyPath_meth = NULL; +static jclass LDKMessageSendInstructions_WithReplyPath_class = NULL; +static jmethodID LDKMessageSendInstructions_WithReplyPath_meth = NULL; +static jclass LDKMessageSendInstructions_WithoutReplyPath_class = NULL; +static jmethodID LDKMessageSendInstructions_WithoutReplyPath_meth = NULL; +static jclass LDKMessageSendInstructions_ForReply_class = NULL; +static jmethodID LDKMessageSendInstructions_ForReply_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendInstructions_init (JNIEnv *env, jclass clz) { + LDKMessageSendInstructions_WithSpecifiedReplyPath_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendInstructions$WithSpecifiedReplyPath")); + CHECK(LDKMessageSendInstructions_WithSpecifiedReplyPath_class != NULL); + LDKMessageSendInstructions_WithSpecifiedReplyPath_meth = (*env)->GetMethodID(env, LDKMessageSendInstructions_WithSpecifiedReplyPath_class, "", "(JJ)V"); + CHECK(LDKMessageSendInstructions_WithSpecifiedReplyPath_meth != NULL); + LDKMessageSendInstructions_WithReplyPath_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendInstructions$WithReplyPath")); + CHECK(LDKMessageSendInstructions_WithReplyPath_class != NULL); + LDKMessageSendInstructions_WithReplyPath_meth = (*env)->GetMethodID(env, LDKMessageSendInstructions_WithReplyPath_class, "", "(JJ)V"); + CHECK(LDKMessageSendInstructions_WithReplyPath_meth != NULL); + LDKMessageSendInstructions_WithoutReplyPath_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendInstructions$WithoutReplyPath")); + CHECK(LDKMessageSendInstructions_WithoutReplyPath_class != NULL); + LDKMessageSendInstructions_WithoutReplyPath_meth = (*env)->GetMethodID(env, LDKMessageSendInstructions_WithoutReplyPath_class, "", "(J)V"); + CHECK(LDKMessageSendInstructions_WithoutReplyPath_meth != NULL); + LDKMessageSendInstructions_ForReply_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendInstructions$ForReply")); + CHECK(LDKMessageSendInstructions_ForReply_class != NULL); + LDKMessageSendInstructions_ForReply_meth = (*env)->GetMethodID(env, LDKMessageSendInstructions_ForReply_class, "", "(J)V"); + CHECK(LDKMessageSendInstructions_ForReply_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendInstructions_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKMessageSendInstructions *obj = (LDKMessageSendInstructions*)untag_ptr(ptr); + switch(obj->tag) { + case LDKMessageSendInstructions_WithSpecifiedReplyPath: { + int64_t destination_ref = tag_ptr(&obj->with_specified_reply_path.destination, false); + LDKBlindedMessagePath reply_path_var = obj->with_specified_reply_path.reply_path; + int64_t reply_path_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(reply_path_var); + reply_path_ref = tag_ptr(reply_path_var.inner, false); + return (*env)->NewObject(env, LDKMessageSendInstructions_WithSpecifiedReplyPath_class, LDKMessageSendInstructions_WithSpecifiedReplyPath_meth, destination_ref, reply_path_ref); + } + case LDKMessageSendInstructions_WithReplyPath: { + int64_t destination_ref = tag_ptr(&obj->with_reply_path.destination, false); + int64_t context_ref = tag_ptr(&obj->with_reply_path.context, false); + return (*env)->NewObject(env, LDKMessageSendInstructions_WithReplyPath_class, LDKMessageSendInstructions_WithReplyPath_meth, destination_ref, context_ref); + } + case LDKMessageSendInstructions_WithoutReplyPath: { + int64_t destination_ref = tag_ptr(&obj->without_reply_path.destination, false); + return (*env)->NewObject(env, LDKMessageSendInstructions_WithoutReplyPath_class, LDKMessageSendInstructions_WithoutReplyPath_meth, destination_ref); + } + case LDKMessageSendInstructions_ForReply: { + LDKResponseInstruction instructions_var = obj->for_reply.instructions; + int64_t instructions_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(instructions_var); + instructions_ref = tag_ptr(instructions_var.inner, false); + return (*env)->NewObject(env, LDKMessageSendInstructions_ForReply_class, LDKMessageSendInstructions_ForReply_meth, instructions_ref); + } + default: abort(); + } +} +static inline struct LDKOffersMessage C2Tuple_OffersMessageMessageSendInstructionsZ_get_a(LDKC2Tuple_OffersMessageMessageSendInstructionsZ *NONNULL_PTR owner){ return OffersMessage_clone(&owner->a); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OffersMessageDestinationBlindedPathZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { - LDKC3Tuple_OffersMessageDestinationBlindedPathZ* owner_conv = (LDKC3Tuple_OffersMessageDestinationBlindedPathZ*)untag_ptr(owner); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OffersMessageMessageSendInstructionsZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_OffersMessageMessageSendInstructionsZ* owner_conv = (LDKC2Tuple_OffersMessageMessageSendInstructionsZ*)untag_ptr(owner); LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); - *ret_copy = C3Tuple_OffersMessageDestinationBlindedPathZ_get_a(owner_conv); + *ret_copy = C2Tuple_OffersMessageMessageSendInstructionsZ_get_a(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline struct LDKDestination C3Tuple_OffersMessageDestinationBlindedPathZ_get_b(LDKC3Tuple_OffersMessageDestinationBlindedPathZ *NONNULL_PTR owner){ - return Destination_clone(&owner->b); +static inline struct LDKMessageSendInstructions C2Tuple_OffersMessageMessageSendInstructionsZ_get_b(LDKC2Tuple_OffersMessageMessageSendInstructionsZ *NONNULL_PTR owner){ + return MessageSendInstructions_clone(&owner->b); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OffersMessageDestinationBlindedPathZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { - LDKC3Tuple_OffersMessageDestinationBlindedPathZ* owner_conv = (LDKC3Tuple_OffersMessageDestinationBlindedPathZ*)untag_ptr(owner); - LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); - *ret_copy = C3Tuple_OffersMessageDestinationBlindedPathZ_get_b(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OffersMessageMessageSendInstructionsZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_OffersMessageMessageSendInstructionsZ* owner_conv = (LDKC2Tuple_OffersMessageMessageSendInstructionsZ*)untag_ptr(owner); + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = C2Tuple_OffersMessageMessageSendInstructionsZ_get_b(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline struct LDKBlindedPath C3Tuple_OffersMessageDestinationBlindedPathZ_get_c(LDKC3Tuple_OffersMessageDestinationBlindedPathZ *NONNULL_PTR owner){ - LDKBlindedPath ret = owner->c; +static inline LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ CVec_C2Tuple_OffersMessageMessageSendInstructionsZZ_clone(const LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ *orig) { + LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_OffersMessageMessageSendInstructionsZ) * orig->datalen, "LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = C2Tuple_OffersMessageMessageSendInstructionsZ_clone(&orig->data[i]); + } + return ret; +} +static inline struct LDKReleaseHeldHtlc C2Tuple_ReleaseHeldHtlcResponseInstructionZ_get_a(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ *NONNULL_PTR owner){ + LDKReleaseHeldHtlc ret = owner->a; ret.is_owned = false; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OffersMessageDestinationBlindedPathZ_1get_1c(JNIEnv *env, jclass clz, int64_t owner) { - LDKC3Tuple_OffersMessageDestinationBlindedPathZ* owner_conv = (LDKC3Tuple_OffersMessageDestinationBlindedPathZ*)untag_ptr(owner); - LDKBlindedPath ret_var = C3Tuple_OffersMessageDestinationBlindedPathZ_get_c(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1ReleaseHeldHtlcResponseInstructionZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ* owner_conv = (LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ*)untag_ptr(owner); + LDKReleaseHeldHtlc ret_var = C2Tuple_ReleaseHeldHtlcResponseInstructionZ_get_a(owner_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ CVec_C3Tuple_OffersMessageDestinationBlindedPathZZ_clone(const LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ *orig) { - LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_OffersMessageDestinationBlindedPathZ) * orig->datalen, "LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ clone bytes"), .datalen = orig->datalen }; +static inline struct LDKResponseInstruction C2Tuple_ReleaseHeldHtlcResponseInstructionZ_get_b(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ *NONNULL_PTR owner){ + LDKResponseInstruction ret = owner->b; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1ReleaseHeldHtlcResponseInstructionZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ* owner_conv = (LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ*)untag_ptr(owner); + LDKResponseInstruction ret_var = C2Tuple_ReleaseHeldHtlcResponseInstructionZ_get_b(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static jclass LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_Some_class = NULL; +static jmethodID LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_Some_meth = NULL; +static jclass LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_None_class = NULL; +static jmethodID LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C2Tuple_1ReleaseHeldHtlcResponseInstructionZZ_init (JNIEnv *env, jclass clz) { + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ$Some")); + CHECK(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_Some_class != NULL); + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_Some_meth != NULL); + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ$None")); + CHECK(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_None_class != NULL); + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_None_class, "", "()V"); + CHECK(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1ReleaseHeldHtlcResponseInstructionZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ *obj = (LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_Some: { + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ* some_conv = MALLOC(sizeof(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ), "LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ"); + *some_conv = obj->some; + *some_conv = C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone(some_conv); + return (*env)->NewObject(env, LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_Some_class, LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_Some_meth, tag_ptr(some_conv, true)); + } + case LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_None: { + return (*env)->NewObject(env, LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_None_class, LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_None_meth); + } + default: abort(); + } +} +static jclass LDKAsyncPaymentsMessage_HeldHtlcAvailable_class = NULL; +static jmethodID LDKAsyncPaymentsMessage_HeldHtlcAvailable_meth = NULL; +static jclass LDKAsyncPaymentsMessage_ReleaseHeldHtlc_class = NULL; +static jmethodID LDKAsyncPaymentsMessage_ReleaseHeldHtlc_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKAsyncPaymentsMessage_init (JNIEnv *env, jclass clz) { + LDKAsyncPaymentsMessage_HeldHtlcAvailable_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAsyncPaymentsMessage$HeldHtlcAvailable")); + CHECK(LDKAsyncPaymentsMessage_HeldHtlcAvailable_class != NULL); + LDKAsyncPaymentsMessage_HeldHtlcAvailable_meth = (*env)->GetMethodID(env, LDKAsyncPaymentsMessage_HeldHtlcAvailable_class, "", "(J)V"); + CHECK(LDKAsyncPaymentsMessage_HeldHtlcAvailable_meth != NULL); + LDKAsyncPaymentsMessage_ReleaseHeldHtlc_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAsyncPaymentsMessage$ReleaseHeldHtlc")); + CHECK(LDKAsyncPaymentsMessage_ReleaseHeldHtlc_class != NULL); + LDKAsyncPaymentsMessage_ReleaseHeldHtlc_meth = (*env)->GetMethodID(env, LDKAsyncPaymentsMessage_ReleaseHeldHtlc_class, "", "(J)V"); + CHECK(LDKAsyncPaymentsMessage_ReleaseHeldHtlc_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAsyncPaymentsMessage_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKAsyncPaymentsMessage *obj = (LDKAsyncPaymentsMessage*)untag_ptr(ptr); + switch(obj->tag) { + case LDKAsyncPaymentsMessage_HeldHtlcAvailable: { + LDKHeldHtlcAvailable held_htlc_available_var = obj->held_htlc_available; + int64_t held_htlc_available_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(held_htlc_available_var); + held_htlc_available_ref = tag_ptr(held_htlc_available_var.inner, false); + return (*env)->NewObject(env, LDKAsyncPaymentsMessage_HeldHtlcAvailable_class, LDKAsyncPaymentsMessage_HeldHtlcAvailable_meth, held_htlc_available_ref); + } + case LDKAsyncPaymentsMessage_ReleaseHeldHtlc: { + LDKReleaseHeldHtlc release_held_htlc_var = obj->release_held_htlc; + int64_t release_held_htlc_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(release_held_htlc_var); + release_held_htlc_ref = tag_ptr(release_held_htlc_var.inner, false); + return (*env)->NewObject(env, LDKAsyncPaymentsMessage_ReleaseHeldHtlc_class, LDKAsyncPaymentsMessage_ReleaseHeldHtlc_meth, release_held_htlc_ref); + } + default: abort(); + } +} +static inline struct LDKAsyncPaymentsMessage C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_get_a(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ *NONNULL_PTR owner){ + return AsyncPaymentsMessage_clone(&owner->a); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1AsyncPaymentsMessageMessageSendInstructionsZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ* owner_conv = (LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ*)untag_ptr(owner); + LDKAsyncPaymentsMessage *ret_copy = MALLOC(sizeof(LDKAsyncPaymentsMessage), "LDKAsyncPaymentsMessage"); + *ret_copy = C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_get_a(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKMessageSendInstructions C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_get_b(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ *NONNULL_PTR owner){ + return MessageSendInstructions_clone(&owner->b); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1AsyncPaymentsMessageMessageSendInstructionsZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ* owner_conv = (LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ*)untag_ptr(owner); + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_get_b(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ CVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ_clone(const LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ *orig) { + LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ) * orig->datalen, "LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C3Tuple_OffersMessageDestinationBlindedPathZ_clone(&orig->data[i]); + ret.data[i] = C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone(&orig->data[i]); } return ret; } @@ -9482,7 +9943,7 @@ LDKCResult_ThirtyTwoBytesNoneZ ecdh_LDKNodeSigner_jcall(const void* this_arg, LD } return ret_conv; } -LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKNodeSigner_jcall(const void* this_arg, LDKu8slice hrp_bytes, LDKCVec_U5Z invoice_data, LDKRecipient recipient) { +LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKNodeSigner_jcall(const void* this_arg, const LDKRawBolt11Invoice * invoice, LDKRecipient recipient) { LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -9491,23 +9952,15 @@ LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKNodeSigner_jcall(const void } else { DO_ASSERT(get_jenv_res == JNI_OK); } - LDKu8slice hrp_bytes_var = hrp_bytes; - int8_tArray hrp_bytes_arr = (*env)->NewByteArray(env, hrp_bytes_var.datalen); - (*env)->SetByteArrayRegion(env, hrp_bytes_arr, 0, hrp_bytes_var.datalen, hrp_bytes_var.data); - LDKCVec_U5Z invoice_data_var = invoice_data; - jobjectArray invoice_data_arr = NULL; - invoice_data_arr = (*env)->NewByteArray(env, invoice_data_var.datalen); - int8_t *invoice_data_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, invoice_data_arr, NULL); - for (size_t h = 0; h < invoice_data_var.datalen; h++) { - uint8_t invoice_data_conv_7_val = invoice_data_var.data[h]._0; - invoice_data_arr_ptr[h] = invoice_data_conv_7_val; - } - (*env)->ReleasePrimitiveArrayCritical(env, invoice_data_arr, invoice_data_arr_ptr, 0); - FREE(invoice_data_var.data); + LDKRawBolt11Invoice invoice_var = *invoice; + int64_t invoice_ref = 0; + invoice_var = RawBolt11Invoice_clone(&invoice_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_var); + invoice_ref = tag_ptr(invoice_var.inner, invoice_var.is_owned); jclass recipient_conv = LDKRecipient_to_java(env, recipient); jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_invoice_meth, hrp_bytes_arr, invoice_data_arr, recipient_conv); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_invoice_meth, invoice_ref, recipient_conv); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); (*env)->FatalError(env, "A call to sign_invoice in LDKNodeSigner from rust threw an exception."); @@ -9626,7 +10079,7 @@ static inline LDKNodeSigner LDKNodeSigner_init (JNIEnv *env, jclass clz, jobject CHECK(calls->get_node_id_meth != NULL); calls->ecdh_meth = (*env)->GetMethodID(env, c, "ecdh", "(Lorg/ldk/enums/Recipient;[BJ)J"); CHECK(calls->ecdh_meth != NULL); - calls->sign_invoice_meth = (*env)->GetMethodID(env, c, "sign_invoice", "([B[BLorg/ldk/enums/Recipient;)J"); + calls->sign_invoice_meth = (*env)->GetMethodID(env, c, "sign_invoice", "(JLorg/ldk/enums/Recipient;)J"); CHECK(calls->sign_invoice_meth != NULL); calls->sign_bolt12_invoice_request_meth = (*env)->GetMethodID(env, c, "sign_bolt12_invoice_request", "(J)J"); CHECK(calls->sign_bolt12_invoice_request_meth != NULL); @@ -9689,30 +10142,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeSigner_1ecdh(JNIEnv *en return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeSigner_1sign_1invoice(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray hrp_bytes, jobjectArray invoice_data, jclass recipient) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeSigner_1sign_1invoice(JNIEnv *env, jclass clz, int64_t this_arg, int64_t invoice, jclass recipient) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKNodeSigner* this_arg_conv = (LDKNodeSigner*)this_arg_ptr; - LDKu8slice hrp_bytes_ref; - hrp_bytes_ref.datalen = (*env)->GetArrayLength(env, hrp_bytes); - hrp_bytes_ref.data = (*env)->GetByteArrayElements (env, hrp_bytes, NULL); - LDKCVec_U5Z invoice_data_constr; - invoice_data_constr.datalen = (*env)->GetArrayLength(env, invoice_data); - if (invoice_data_constr.datalen > 0) - invoice_data_constr.data = MALLOC(invoice_data_constr.datalen * sizeof(LDKU5), "LDKCVec_U5Z Elements"); - else - invoice_data_constr.data = NULL; - int8_t* invoice_data_vals = (*env)->GetByteArrayElements (env, invoice_data, NULL); - for (size_t h = 0; h < invoice_data_constr.datalen; h++) { - int8_t invoice_data_conv_7 = invoice_data_vals[h]; - - invoice_data_constr.data[h] = (LDKU5){ ._0 = invoice_data_conv_7 }; - } - (*env)->ReleaseByteArrayElements(env, invoice_data, invoice_data_vals, 0); + LDKRawBolt11Invoice invoice_conv; + invoice_conv.inner = untag_ptr(invoice); + invoice_conv.is_owned = ptr_is_owned(invoice); + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); + invoice_conv.is_owned = false; LDKRecipient recipient_conv = LDKRecipient_from_java(env, recipient); LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); - *ret_conv = (this_arg_conv->sign_invoice)(this_arg_conv->this_arg, hrp_bytes_ref, invoice_data_constr, recipient_conv); - (*env)->ReleaseByteArrayElements(env, hrp_bytes, (int8_t*)hrp_bytes_ref.data, 0); + *ret_conv = (this_arg_conv->sign_invoice)(this_arg_conv->this_arg, &invoice_conv, recipient_conv); return tag_ptr(ret_conv, true); } @@ -9812,7 +10253,7 @@ LDKThirtyTwoBytes generate_channel_keys_id_LDKSignerProvider_jcall(const void* t } return ret_ref; } -LDKWriteableEcdsaChannelSigner derive_channel_signer_LDKSignerProvider_jcall(const void* this_arg, uint64_t channel_value_satoshis, LDKThirtyTwoBytes channel_keys_id) { +LDKEcdsaChannelSigner derive_channel_signer_LDKSignerProvider_jcall(const void* this_arg, uint64_t channel_value_satoshis, LDKThirtyTwoBytes channel_keys_id) { LDKSignerProvider_JCalls *j_calls = (LDKSignerProvider_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -9833,14 +10274,14 @@ LDKWriteableEcdsaChannelSigner derive_channel_signer_LDKSignerProvider_jcall(con } void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); - LDKWriteableEcdsaChannelSigner ret_conv = *(LDKWriteableEcdsaChannelSigner*)(ret_ptr); + LDKEcdsaChannelSigner ret_conv = *(LDKEcdsaChannelSigner*)(ret_ptr); FREE(untag_ptr(ret)); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } return ret_conv; } -LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ read_chan_signer_LDKSignerProvider_jcall(const void* this_arg, LDKu8slice reader) { +LDKCResult_EcdsaChannelSignerDecodeErrorZ read_chan_signer_LDKSignerProvider_jcall(const void* this_arg, LDKu8slice reader) { LDKSignerProvider_JCalls *j_calls = (LDKSignerProvider_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -9861,7 +10302,7 @@ LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ read_chan_signer_LDKSignerPro } void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ ret_conv = *(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)(ret_ptr); + LDKCResult_EcdsaChannelSignerDecodeErrorZ ret_conv = *(LDKCResult_EcdsaChannelSignerDecodeErrorZ*)(ret_ptr); FREE(untag_ptr(ret)); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -9977,7 +10418,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignerProvider_1derive_1cha LDKThirtyTwoBytes channel_keys_id_ref; CHECK((*env)->GetArrayLength(env, channel_keys_id) == 32); (*env)->GetByteArrayRegion(env, channel_keys_id, 0, 32, channel_keys_id_ref.data); - LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner"); + LDKEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner"); *ret_ret = (this_arg_conv->derive_channel_signer)(this_arg_conv->this_arg, channel_value_satoshis, channel_keys_id_ref); return tag_ptr(ret_ret, true); } @@ -9989,7 +10430,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignerProvider_1read_1chan_ LDKu8slice reader_ref; reader_ref.datalen = (*env)->GetArrayLength(env, reader); reader_ref.data = (*env)->GetByteArrayElements (env, reader, NULL); - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ), "LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ"); + LDKCResult_EcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_EcdsaChannelSignerDecodeErrorZ), "LDKCResult_EcdsaChannelSignerDecodeErrorZ"); *ret_conv = (this_arg_conv->read_chan_signer)(this_arg_conv->this_arg, reader_ref); (*env)->ReleaseByteArrayElements(env, reader, (int8_t*)reader_ref.data, 0); return tag_ptr(ret_conv, true); @@ -10102,6 +10543,7 @@ typedef struct LDKMessageRouter_JCalls { jweak o; jmethodID find_path_meth; jmethodID create_blinded_paths_meth; + jmethodID create_compact_blinded_paths_meth; } LDKMessageRouter_JCalls; static void LDKMessageRouter_JCalls_free(void* this_arg) { LDKMessageRouter_JCalls *j_calls = (LDKMessageRouter_JCalls*) this_arg; @@ -10161,7 +10603,7 @@ LDKCResult_OnionMessagePathNoneZ find_path_LDKMessageRouter_jcall(const void* th } return ret_conv; } -LDKCResult_CVec_BlindedPathZNoneZ create_blinded_paths_LDKMessageRouter_jcall(const void* this_arg, LDKPublicKey recipient, LDKCVec_PublicKeyZ peers) { +LDKCResult_CVec_BlindedMessagePathZNoneZ create_blinded_paths_LDKMessageRouter_jcall(const void* this_arg, LDKPublicKey recipient, LDKMessageContext context, LDKCVec_PublicKeyZ peers) { LDKMessageRouter_JCalls *j_calls = (LDKMessageRouter_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -10172,6 +10614,9 @@ LDKCResult_CVec_BlindedPathZNoneZ create_blinded_paths_LDKMessageRouter_jcall(co } int8_tArray recipient_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, recipient_arr, 0, 33, recipient.compressed_form); + LDKMessageContext *context_copy = MALLOC(sizeof(LDKMessageContext), "LDKMessageContext"); + *context_copy = context; + int64_t context_ref = tag_ptr(context_copy, true); LDKCVec_PublicKeyZ peers_var = peers; jobjectArray peers_arr = NULL; peers_arr = (*env)->NewObjectArray(env, peers_var.datalen, arr_of_B_clz, NULL); @@ -10185,14 +10630,57 @@ LDKCResult_CVec_BlindedPathZNoneZ create_blinded_paths_LDKMessageRouter_jcall(co FREE(peers_var.data); jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->create_blinded_paths_meth, recipient_arr, peers_arr); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->create_blinded_paths_meth, recipient_arr, context_ref, peers_arr); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); (*env)->FatalError(env, "A call to create_blinded_paths in LDKMessageRouter from rust threw an exception."); } void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); - LDKCResult_CVec_BlindedPathZNoneZ ret_conv = *(LDKCResult_CVec_BlindedPathZNoneZ*)(ret_ptr); + LDKCResult_CVec_BlindedMessagePathZNoneZ ret_conv = *(LDKCResult_CVec_BlindedMessagePathZNoneZ*)(ret_ptr); + FREE(untag_ptr(ret)); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } + return ret_conv; +} +LDKCResult_CVec_BlindedMessagePathZNoneZ create_compact_blinded_paths_LDKMessageRouter_jcall(const void* this_arg, LDKPublicKey recipient, LDKMessageContext context, LDKCVec_MessageForwardNodeZ peers) { + LDKMessageRouter_JCalls *j_calls = (LDKMessageRouter_JCalls*) this_arg; + JNIEnv *env; + jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK); + } else { + DO_ASSERT(get_jenv_res == JNI_OK); + } + int8_tArray recipient_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, recipient_arr, 0, 33, recipient.compressed_form); + LDKMessageContext *context_copy = MALLOC(sizeof(LDKMessageContext), "LDKMessageContext"); + *context_copy = context; + int64_t context_ref = tag_ptr(context_copy, true); + LDKCVec_MessageForwardNodeZ peers_var = peers; + int64_tArray peers_arr = NULL; + peers_arr = (*env)->NewLongArray(env, peers_var.datalen); + int64_t *peers_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, peers_arr, NULL); + for (size_t u = 0; u < peers_var.datalen; u++) { + LDKMessageForwardNode peers_conv_20_var = peers_var.data[u]; + int64_t peers_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(peers_conv_20_var); + peers_conv_20_ref = tag_ptr(peers_conv_20_var.inner, peers_conv_20_var.is_owned); + peers_arr_ptr[u] = peers_conv_20_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, peers_arr, peers_arr_ptr, 0); + FREE(peers_var.data); + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->create_compact_blinded_paths_meth, recipient_arr, context_ref, peers_arr); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to create_compact_blinded_paths in LDKMessageRouter from rust threw an exception."); + } + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_CVec_BlindedMessagePathZNoneZ ret_conv = *(LDKCResult_CVec_BlindedMessagePathZNoneZ*)(ret_ptr); FREE(untag_ptr(ret)); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -10212,13 +10700,16 @@ static inline LDKMessageRouter LDKMessageRouter_init (JNIEnv *env, jclass clz, j calls->o = (*env)->NewWeakGlobalRef(env, o); calls->find_path_meth = (*env)->GetMethodID(env, c, "find_path", "([B[[BJ)J"); CHECK(calls->find_path_meth != NULL); - calls->create_blinded_paths_meth = (*env)->GetMethodID(env, c, "create_blinded_paths", "([B[[B)J"); + calls->create_blinded_paths_meth = (*env)->GetMethodID(env, c, "create_blinded_paths", "([BJ[[B)J"); CHECK(calls->create_blinded_paths_meth != NULL); + calls->create_compact_blinded_paths_meth = (*env)->GetMethodID(env, c, "create_compact_blinded_paths", "([BJ[J)J"); + CHECK(calls->create_compact_blinded_paths_meth != NULL); LDKMessageRouter ret = { .this_arg = (void*) calls, .find_path = find_path_LDKMessageRouter_jcall, .create_blinded_paths = create_blinded_paths_LDKMessageRouter_jcall, + .create_compact_blinded_paths = create_compact_blinded_paths_LDKMessageRouter_jcall, .free = LDKMessageRouter_JCalls_free, }; return ret; @@ -10257,13 +10748,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageRouter_1find_1path(J return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageRouter_1create_1blinded_1paths(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray recipient, jobjectArray peers) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageRouter_1create_1blinded_1paths(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray recipient, int64_t context, jobjectArray peers) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKMessageRouter* this_arg_conv = (LDKMessageRouter*)this_arg_ptr; LDKPublicKey recipient_ref; CHECK((*env)->GetArrayLength(env, recipient) == 33); (*env)->GetByteArrayRegion(env, recipient, 0, 33, recipient_ref.compressed_form); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKMessageContext context_conv = *(LDKMessageContext*)(context_ptr); + context_conv = MessageContext_clone((LDKMessageContext*)untag_ptr(context)); LDKCVec_PublicKeyZ peers_constr; peers_constr.datalen = (*env)->GetArrayLength(env, peers); if (peers_constr.datalen > 0) @@ -10277,8 +10772,41 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageRouter_1create_1blin (*env)->GetByteArrayRegion(env, peers_conv_8, 0, 33, peers_conv_8_ref.compressed_form); peers_constr.data[i] = peers_conv_8_ref; } - LDKCResult_CVec_BlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPathZNoneZ), "LDKCResult_CVec_BlindedPathZNoneZ"); - *ret_conv = (this_arg_conv->create_blinded_paths)(this_arg_conv->this_arg, recipient_ref, peers_constr); + LDKCResult_CVec_BlindedMessagePathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedMessagePathZNoneZ), "LDKCResult_CVec_BlindedMessagePathZNoneZ"); + *ret_conv = (this_arg_conv->create_blinded_paths)(this_arg_conv->this_arg, recipient_ref, context_conv, peers_constr); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageRouter_1create_1compact_1blinded_1paths(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray recipient, int64_t context, int64_tArray peers) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKMessageRouter* this_arg_conv = (LDKMessageRouter*)this_arg_ptr; + LDKPublicKey recipient_ref; + CHECK((*env)->GetArrayLength(env, recipient) == 33); + (*env)->GetByteArrayRegion(env, recipient, 0, 33, recipient_ref.compressed_form); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKMessageContext context_conv = *(LDKMessageContext*)(context_ptr); + context_conv = MessageContext_clone((LDKMessageContext*)untag_ptr(context)); + LDKCVec_MessageForwardNodeZ peers_constr; + peers_constr.datalen = (*env)->GetArrayLength(env, peers); + if (peers_constr.datalen > 0) + peers_constr.data = MALLOC(peers_constr.datalen * sizeof(LDKMessageForwardNode), "LDKCVec_MessageForwardNodeZ Elements"); + else + peers_constr.data = NULL; + int64_t* peers_vals = (*env)->GetLongArrayElements (env, peers, NULL); + for (size_t u = 0; u < peers_constr.datalen; u++) { + int64_t peers_conv_20 = peers_vals[u]; + LDKMessageForwardNode peers_conv_20_conv; + peers_conv_20_conv.inner = untag_ptr(peers_conv_20); + peers_conv_20_conv.is_owned = ptr_is_owned(peers_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(peers_conv_20_conv); + peers_conv_20_conv = MessageForwardNode_clone(&peers_conv_20_conv); + peers_constr.data[u] = peers_conv_20_conv; + } + (*env)->ReleaseLongArrayElements(env, peers, peers_vals, 0); + LDKCResult_CVec_BlindedMessagePathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedMessagePathZNoneZ), "LDKCResult_CVec_BlindedMessagePathZNoneZ"); + *ret_conv = (this_arg_conv->create_compact_blinded_paths)(this_arg_conv->this_arg, recipient_ref, context_conv, peers_constr); return tag_ptr(ret_conv, true); } @@ -10414,7 +10942,7 @@ LDKCResult_RouteLightningErrorZ find_route_with_id_LDKRouter_jcall(const void* t } return ret_conv; } -LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ create_blinded_payment_paths_LDKRouter_jcall(const void* this_arg, LDKPublicKey recipient, LDKCVec_ChannelDetailsZ first_hops, LDKReceiveTlvs tlvs, uint64_t amount_msats) { +LDKCResult_CVec_BlindedPaymentPathZNoneZ create_blinded_payment_paths_LDKRouter_jcall(const void* this_arg, LDKPublicKey recipient, LDKCVec_ChannelDetailsZ first_hops, LDKReceiveTlvs tlvs, uint64_t amount_msats) { LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -10452,7 +10980,7 @@ LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ create_blinded_payment_ } void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ ret_conv = *(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ*)(ret_ptr); + LDKCResult_CVec_BlindedPaymentPathZNoneZ ret_conv = *(LDKCResult_CVec_BlindedPaymentPathZNoneZ*)(ret_ptr); FREE(untag_ptr(ret)); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -10621,7 +11149,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1create_1blinded_1pa tlvs_conv.is_owned = ptr_is_owned(tlvs); CHECK_INNER_FIELD_ACCESS_OR_NULL(tlvs_conv); tlvs_conv = ReceiveTlvs_clone(&tlvs_conv); - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ), "LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ"); + LDKCResult_CVec_BlindedPaymentPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPaymentPathZNoneZ), "LDKCResult_CVec_BlindedPaymentPathZNoneZ"); *ret_conv = (this_arg_conv->create_blinded_payment_paths)(this_arg_conv->this_arg, recipient_ref, first_hops_constr, tlvs_conv, amount_msats); return tag_ptr(ret_conv, true); } @@ -11029,6 +11557,29 @@ static inline LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ CVec_C2 } return ret; } +static inline void CResult_NoneReplayEventZ_get_ok(LDKCResult_NoneReplayEventZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneReplayEventZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NoneReplayEventZ* owner_conv = (LDKCResult_NoneReplayEventZ*)untag_ptr(owner); + CResult_NoneReplayEventZ_get_ok(owner_conv); +} + +static inline struct LDKReplayEvent CResult_NoneReplayEventZ_get_err(LDKCResult_NoneReplayEventZ *NONNULL_PTR owner){ + LDKReplayEvent ret = *owner->contents.err; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneReplayEventZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NoneReplayEventZ* owner_conv = (LDKCResult_NoneReplayEventZ*)untag_ptr(owner); + LDKReplayEvent ret_var = CResult_NoneReplayEventZ_get_err(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + static inline LDKCVec_CommitmentTransactionZ CVec_CommitmentTransactionZ_clone(const LDKCVec_CommitmentTransactionZ *orig) { LDKCVec_CommitmentTransactionZ ret = { .data = MALLOC(sizeof(LDKCommitmentTransaction) * orig->datalen, "LDKCVec_CommitmentTransactionZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -11114,12 +11665,12 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKBalance_init (JNIEnv * LDKBalance_ClaimableOnChannelClose_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$ClaimableOnChannelClose")); CHECK(LDKBalance_ClaimableOnChannelClose_class != NULL); - LDKBalance_ClaimableOnChannelClose_meth = (*env)->GetMethodID(env, LDKBalance_ClaimableOnChannelClose_class, "", "(J)V"); + LDKBalance_ClaimableOnChannelClose_meth = (*env)->GetMethodID(env, LDKBalance_ClaimableOnChannelClose_class, "", "(JJJJJJ)V"); CHECK(LDKBalance_ClaimableOnChannelClose_meth != NULL); LDKBalance_ClaimableAwaitingConfirmations_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$ClaimableAwaitingConfirmations")); CHECK(LDKBalance_ClaimableAwaitingConfirmations_class != NULL); - LDKBalance_ClaimableAwaitingConfirmations_meth = (*env)->GetMethodID(env, LDKBalance_ClaimableAwaitingConfirmations_class, "", "(JI)V"); + LDKBalance_ClaimableAwaitingConfirmations_meth = (*env)->GetMethodID(env, LDKBalance_ClaimableAwaitingConfirmations_class, "", "(JILorg/ldk/enums/BalanceSource;)V"); CHECK(LDKBalance_ClaimableAwaitingConfirmations_meth != NULL); LDKBalance_ContentiousClaimable_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$ContentiousClaimable")); @@ -11129,7 +11680,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKBalance_init (JNIEnv * LDKBalance_MaybeTimeoutClaimableHTLC_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$MaybeTimeoutClaimableHTLC")); CHECK(LDKBalance_MaybeTimeoutClaimableHTLC_class != NULL); - LDKBalance_MaybeTimeoutClaimableHTLC_meth = (*env)->GetMethodID(env, LDKBalance_MaybeTimeoutClaimableHTLC_class, "", "(JI[B)V"); + LDKBalance_MaybeTimeoutClaimableHTLC_meth = (*env)->GetMethodID(env, LDKBalance_MaybeTimeoutClaimableHTLC_class, "", "(JI[BZ)V"); CHECK(LDKBalance_MaybeTimeoutClaimableHTLC_meth != NULL); LDKBalance_MaybePreimageClaimableHTLC_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$MaybePreimageClaimableHTLC")); @@ -11147,12 +11698,18 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBalance_1ref_1from_1ptr( switch(obj->tag) { case LDKBalance_ClaimableOnChannelClose: { int64_t amount_satoshis_conv = obj->claimable_on_channel_close.amount_satoshis; - return (*env)->NewObject(env, LDKBalance_ClaimableOnChannelClose_class, LDKBalance_ClaimableOnChannelClose_meth, amount_satoshis_conv); + int64_t transaction_fee_satoshis_conv = obj->claimable_on_channel_close.transaction_fee_satoshis; + int64_t outbound_payment_htlc_rounded_msat_conv = obj->claimable_on_channel_close.outbound_payment_htlc_rounded_msat; + int64_t outbound_forwarded_htlc_rounded_msat_conv = obj->claimable_on_channel_close.outbound_forwarded_htlc_rounded_msat; + int64_t inbound_claiming_htlc_rounded_msat_conv = obj->claimable_on_channel_close.inbound_claiming_htlc_rounded_msat; + int64_t inbound_htlc_rounded_msat_conv = obj->claimable_on_channel_close.inbound_htlc_rounded_msat; + return (*env)->NewObject(env, LDKBalance_ClaimableOnChannelClose_class, LDKBalance_ClaimableOnChannelClose_meth, amount_satoshis_conv, transaction_fee_satoshis_conv, outbound_payment_htlc_rounded_msat_conv, outbound_forwarded_htlc_rounded_msat_conv, inbound_claiming_htlc_rounded_msat_conv, inbound_htlc_rounded_msat_conv); } case LDKBalance_ClaimableAwaitingConfirmations: { int64_t amount_satoshis_conv = obj->claimable_awaiting_confirmations.amount_satoshis; int32_t confirmation_height_conv = obj->claimable_awaiting_confirmations.confirmation_height; - return (*env)->NewObject(env, LDKBalance_ClaimableAwaitingConfirmations_class, LDKBalance_ClaimableAwaitingConfirmations_meth, amount_satoshis_conv, confirmation_height_conv); + jclass source_conv = LDKBalanceSource_to_java(env, obj->claimable_awaiting_confirmations.source); + return (*env)->NewObject(env, LDKBalance_ClaimableAwaitingConfirmations_class, LDKBalance_ClaimableAwaitingConfirmations_meth, amount_satoshis_conv, confirmation_height_conv, source_conv); } case LDKBalance_ContentiousClaimable: { int64_t amount_satoshis_conv = obj->contentious_claimable.amount_satoshis; @@ -11168,7 +11725,8 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBalance_1ref_1from_1ptr( int32_t claimable_height_conv = obj->maybe_timeout_claimable_htlc.claimable_height; int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->maybe_timeout_claimable_htlc.payment_hash.data); - return (*env)->NewObject(env, LDKBalance_MaybeTimeoutClaimableHTLC_class, LDKBalance_MaybeTimeoutClaimableHTLC_meth, amount_satoshis_conv, claimable_height_conv, payment_hash_arr); + jboolean outbound_payment_conv = obj->maybe_timeout_claimable_htlc.outbound_payment; + return (*env)->NewObject(env, LDKBalance_MaybeTimeoutClaimableHTLC_class, LDKBalance_MaybeTimeoutClaimableHTLC_meth, amount_satoshis_conv, claimable_height_conv, payment_hash_arr, outbound_payment_conv); } case LDKBalance_MaybePreimageClaimableHTLC: { int64_t amount_satoshis_conv = obj->maybe_preimage_claimable_htlc.amount_satoshis; @@ -11420,48 +11978,12 @@ static inline LDKCVec_C2Tuple_PublicKeyTypeZZ CVec_C2Tuple_PublicKeyTypeZZ_clone } return ret; } -static inline struct LDKPublicKey C2Tuple_PublicKeyCVec_SocketAddressZZ_get_a(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *NONNULL_PTR owner){ - return owner->a; -} -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyCVec_1SocketAddressZZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* owner_conv = (LDKC2Tuple_PublicKeyCVec_SocketAddressZZ*)untag_ptr(owner); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, C2Tuple_PublicKeyCVec_SocketAddressZZ_get_a(owner_conv).compressed_form); - return ret_arr; -} - -static inline struct LDKCVec_SocketAddressZ C2Tuple_PublicKeyCVec_SocketAddressZZ_get_b(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *NONNULL_PTR owner){ - return CVec_SocketAddressZ_clone(&owner->b); -} -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyCVec_1SocketAddressZZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* owner_conv = (LDKC2Tuple_PublicKeyCVec_SocketAddressZZ*)untag_ptr(owner); - LDKCVec_SocketAddressZ ret_var = C2Tuple_PublicKeyCVec_SocketAddressZZ_get_b(owner_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t p = 0; p < ret_var.datalen; p++) { - LDKSocketAddress *ret_conv_15_copy = MALLOC(sizeof(LDKSocketAddress), "LDKSocketAddress"); - *ret_conv_15_copy = ret_var.data[p]; - int64_t ret_conv_15_ref = tag_ptr(ret_conv_15_copy, true); - ret_arr_ptr[p] = ret_conv_15_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; -} - -static inline LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ CVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ_clone(const LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ *orig) { - LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ) * orig->datalen, "LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C2Tuple_PublicKeyCVec_SocketAddressZZ_clone(&orig->data[i]); - } - return ret; -} typedef struct LDKOnionMessageContents_JCalls { atomic_size_t refcnt; JavaVM *vm; jweak o; jmethodID tlv_type_meth; + jmethodID msg_type_meth; jmethodID write_meth; jmethodID debug_str_meth; } LDKOnionMessageContents_JCalls; @@ -11503,6 +12025,28 @@ uint64_t tlv_type_LDKOnionMessageContents_jcall(const void* this_arg) { } return ret; } +LDKStr msg_type_LDKOnionMessageContents_jcall(const void* this_arg) { + LDKOnionMessageContents_JCalls *j_calls = (LDKOnionMessageContents_JCalls*) this_arg; + JNIEnv *env; + jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK); + } else { + DO_ASSERT(get_jenv_res == JNI_OK); + } + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + jstring ret = (*env)->CallObjectMethod(env, obj, j_calls->msg_type_meth); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to msg_type in LDKOnionMessageContents from rust threw an exception."); + } + LDKStr ret_conv = java_to_owned_str(env, ret); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } + return ret_conv; +} LDKCVec_u8Z write_LDKOnionMessageContents_jcall(const void* this_arg) { LDKOnionMessageContents_JCalls *j_calls = (LDKOnionMessageContents_JCalls*) this_arg; JNIEnv *env; @@ -11563,6 +12107,8 @@ static inline LDKOnionMessageContents LDKOnionMessageContents_init (JNIEnv *env, calls->o = (*env)->NewWeakGlobalRef(env, o); calls->tlv_type_meth = (*env)->GetMethodID(env, c, "tlv_type", "()J"); CHECK(calls->tlv_type_meth != NULL); + calls->msg_type_meth = (*env)->GetMethodID(env, c, "msg_type", "()Ljava/lang/String;"); + CHECK(calls->msg_type_meth != NULL); calls->write_meth = (*env)->GetMethodID(env, c, "write", "()[B"); CHECK(calls->write_meth != NULL); calls->debug_str_meth = (*env)->GetMethodID(env, c, "debug_str", "()Ljava/lang/String;"); @@ -11571,6 +12117,7 @@ static inline LDKOnionMessageContents LDKOnionMessageContents_init (JNIEnv *env, LDKOnionMessageContents ret = { .this_arg = (void*) calls, .tlv_type = tlv_type_LDKOnionMessageContents_jcall, + .msg_type = msg_type_LDKOnionMessageContents_jcall, .write = write_LDKOnionMessageContents_jcall, .debug_str = debug_str_LDKOnionMessageContents_jcall, .cloned = LDKOnionMessageContents_JCalls_cloned, @@ -11591,6 +12138,16 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1tlv_1 return ret_conv; } +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1msg_1type(JNIEnv *env, jclass clz, int64_t this_arg) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKOnionMessageContents* this_arg_conv = (LDKOnionMessageContents*)this_arg_ptr; + LDKStr ret_str = (this_arg_conv->msg_type)(this_arg_conv->this_arg); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1write(JNIEnv *env, jclass clz, int64_t this_arg) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } @@ -11612,6 +12169,61 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1debug return ret_conv; } +static inline struct LDKOnionMessageContents C2Tuple_OnionMessageContentsResponseInstructionZ_get_a(LDKC2Tuple_OnionMessageContentsResponseInstructionZ *NONNULL_PTR owner){ + return OnionMessageContents_clone(&owner->a); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OnionMessageContentsResponseInstructionZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_OnionMessageContentsResponseInstructionZ* owner_conv = (LDKC2Tuple_OnionMessageContentsResponseInstructionZ*)untag_ptr(owner); + LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *ret_ret = C2Tuple_OnionMessageContentsResponseInstructionZ_get_a(owner_conv); + return tag_ptr(ret_ret, true); +} + +static inline struct LDKResponseInstruction C2Tuple_OnionMessageContentsResponseInstructionZ_get_b(LDKC2Tuple_OnionMessageContentsResponseInstructionZ *NONNULL_PTR owner){ + LDKResponseInstruction ret = owner->b; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OnionMessageContentsResponseInstructionZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_OnionMessageContentsResponseInstructionZ* owner_conv = (LDKC2Tuple_OnionMessageContentsResponseInstructionZ*)untag_ptr(owner); + LDKResponseInstruction ret_var = C2Tuple_OnionMessageContentsResponseInstructionZ_get_b(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static jclass LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Some_class = NULL; +static jmethodID LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Some_meth = NULL; +static jclass LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_None_class = NULL; +static jmethodID LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C2Tuple_1OnionMessageContentsResponseInstructionZZ_init (JNIEnv *env, jclass clz) { + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ$Some")); + CHECK(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Some_class != NULL); + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Some_meth != NULL); + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ$None")); + CHECK(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_None_class != NULL); + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_None_class, "", "()V"); + CHECK(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1OnionMessageContentsResponseInstructionZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ *obj = (LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Some: { + LDKC2Tuple_OnionMessageContentsResponseInstructionZ* some_conv = MALLOC(sizeof(LDKC2Tuple_OnionMessageContentsResponseInstructionZ), "LDKC2Tuple_OnionMessageContentsResponseInstructionZ"); + *some_conv = obj->some; + *some_conv = C2Tuple_OnionMessageContentsResponseInstructionZ_clone(some_conv); + return (*env)->NewObject(env, LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Some_class, LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Some_meth, tag_ptr(some_conv, true)); + } + case LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_None: { + return (*env)->NewObject(env, LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_None_class, LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_None_meth); + } + default: abort(); + } +} static jclass LDKCOption_OnionMessageContentsZ_Some_class = NULL; static jmethodID LDKCOption_OnionMessageContentsZ_Some_meth = NULL; static jclass LDKCOption_OnionMessageContentsZ_None_class = NULL; @@ -11666,45 +12278,31 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1OnionMess return ret_ref; } -static inline struct LDKOnionMessageContents C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_a(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *NONNULL_PTR owner){ +static inline struct LDKOnionMessageContents C2Tuple_OnionMessageContentsMessageSendInstructionsZ_get_a(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ *NONNULL_PTR owner){ return OnionMessageContents_clone(&owner->a); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OnionMessageContentsDestinationBlindedPathZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ* owner_conv = (LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ*)untag_ptr(owner); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OnionMessageContentsMessageSendInstructionsZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ* owner_conv = (LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ*)untag_ptr(owner); LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); - *ret_ret = C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_a(owner_conv); + *ret_ret = C2Tuple_OnionMessageContentsMessageSendInstructionsZ_get_a(owner_conv); return tag_ptr(ret_ret, true); } -static inline struct LDKDestination C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_b(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *NONNULL_PTR owner){ - return Destination_clone(&owner->b); +static inline struct LDKMessageSendInstructions C2Tuple_OnionMessageContentsMessageSendInstructionsZ_get_b(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ *NONNULL_PTR owner){ + return MessageSendInstructions_clone(&owner->b); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OnionMessageContentsDestinationBlindedPathZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ* owner_conv = (LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ*)untag_ptr(owner); - LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); - *ret_copy = C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_b(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OnionMessageContentsMessageSendInstructionsZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ* owner_conv = (LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ*)untag_ptr(owner); + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = C2Tuple_OnionMessageContentsMessageSendInstructionsZ_get_b(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline struct LDKBlindedPath C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_c(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *NONNULL_PTR owner){ - LDKBlindedPath ret = owner->c; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OnionMessageContentsDestinationBlindedPathZ_1get_1c(JNIEnv *env, jclass clz, int64_t owner) { - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ* owner_conv = (LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ*)untag_ptr(owner); - LDKBlindedPath ret_var = C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_c(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ CVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ_clone(const LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ *orig) { - LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ) * orig->datalen, "LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ clone bytes"), .datalen = orig->datalen }; +static inline LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ CVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ_clone(const LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ *orig) { + LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ) * orig->datalen, "LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone(&orig->data[i]); + ret.data[i] = C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone(&orig->data[i]); } return ret; } @@ -12079,36 +12677,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestBolt1 return ret_conv; } -static jclass LDKCOption_SecretKeyZ_Some_class = NULL; -static jmethodID LDKCOption_SecretKeyZ_Some_meth = NULL; -static jclass LDKCOption_SecretKeyZ_None_class = NULL; -static jmethodID LDKCOption_SecretKeyZ_None_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1SecretKeyZ_init (JNIEnv *env, jclass clz) { - LDKCOption_SecretKeyZ_Some_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_SecretKeyZ$Some")); - CHECK(LDKCOption_SecretKeyZ_Some_class != NULL); - LDKCOption_SecretKeyZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_SecretKeyZ_Some_class, "", "([B)V"); - CHECK(LDKCOption_SecretKeyZ_Some_meth != NULL); - LDKCOption_SecretKeyZ_None_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_SecretKeyZ$None")); - CHECK(LDKCOption_SecretKeyZ_None_class != NULL); - LDKCOption_SecretKeyZ_None_meth = (*env)->GetMethodID(env, LDKCOption_SecretKeyZ_None_class, "", "()V"); - CHECK(LDKCOption_SecretKeyZ_None_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1SecretKeyZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKCOption_SecretKeyZ *obj = (LDKCOption_SecretKeyZ*)untag_ptr(ptr); - switch(obj->tag) { - case LDKCOption_SecretKeyZ_Some: { - int8_tArray some_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, some_arr, 0, 32, obj->some.bytes); - return (*env)->NewObject(env, LDKCOption_SecretKeyZ_Some_class, LDKCOption_SecretKeyZ_Some_meth, some_arr); - } - case LDKCOption_SecretKeyZ_None: { - return (*env)->NewObject(env, LDKCOption_SecretKeyZ_None_class, LDKCOption_SecretKeyZ_None_meth); - } - default: abort(); - } -} static inline struct LDKInvoiceWithExplicitSigningPubkeyBuilder CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ LDKInvoiceWithExplicitSigningPubkeyBuilder ret = *owner->contents.result; ret.is_owned = false; @@ -12424,28 +12992,28 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StfuDecodeErrorZ_1 return ret_ref; } -static inline struct LDKSplice CResult_SpliceDecodeErrorZ_get_ok(LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR owner){ - LDKSplice ret = *owner->contents.result; +static inline struct LDKSpliceInit CResult_SpliceInitDecodeErrorZ_get_ok(LDKCResult_SpliceInitDecodeErrorZ *NONNULL_PTR owner){ + LDKSpliceInit ret = *owner->contents.result; ret.is_owned = false; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_SpliceDecodeErrorZ* owner_conv = (LDKCResult_SpliceDecodeErrorZ*)untag_ptr(owner); - LDKSplice ret_var = CResult_SpliceDecodeErrorZ_get_ok(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceInitDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_SpliceInitDecodeErrorZ* owner_conv = (LDKCResult_SpliceInitDecodeErrorZ*)untag_ptr(owner); + LDKSpliceInit ret_var = CResult_SpliceInitDecodeErrorZ_get_ok(owner_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline struct LDKDecodeError CResult_SpliceDecodeErrorZ_get_err(LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_SpliceInitDecodeErrorZ_get_err(LDKCResult_SpliceInitDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return DecodeError_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_SpliceDecodeErrorZ* owner_conv = (LDKCResult_SpliceDecodeErrorZ*)untag_ptr(owner); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceInitDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_SpliceInitDecodeErrorZ* owner_conv = (LDKCResult_SpliceInitDecodeErrorZ*)untag_ptr(owner); LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_SpliceDecodeErrorZ_get_err(owner_conv); + *ret_copy = CResult_SpliceInitDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -12840,6 +13408,32 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRa return ret_ref; } +static inline struct LDKCommitmentSignedBatch CResult_CommitmentSignedBatchDecodeErrorZ_get_ok(LDKCResult_CommitmentSignedBatchDecodeErrorZ *NONNULL_PTR owner){ + LDKCommitmentSignedBatch ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedBatchDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_CommitmentSignedBatchDecodeErrorZ* owner_conv = (LDKCResult_CommitmentSignedBatchDecodeErrorZ*)untag_ptr(owner); + LDKCommitmentSignedBatch ret_var = CResult_CommitmentSignedBatchDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_CommitmentSignedBatchDecodeErrorZ_get_err(LDKCResult_CommitmentSignedBatchDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedBatchDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_CommitmentSignedBatchDecodeErrorZ* owner_conv = (LDKCResult_CommitmentSignedBatchDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_CommitmentSignedBatchDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline struct LDKCommitmentSigned CResult_CommitmentSignedDecodeErrorZ_get_ok(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR owner){ LDKCommitmentSigned ret = *owner->contents.result; ret.is_owned = false; @@ -13672,68 +14266,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFil return ret_ref; } -static inline LDKCVec_PhantomRouteHintsZ CVec_PhantomRouteHintsZ_clone(const LDKCVec_PhantomRouteHintsZ *orig) { - LDKCVec_PhantomRouteHintsZ ret = { .data = MALLOC(sizeof(LDKPhantomRouteHints) * orig->datalen, "LDKCVec_PhantomRouteHintsZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = PhantomRouteHints_clone(&orig->data[i]); - } - return ret; -} -static jclass LDKSignOrCreationError_SignError_class = NULL; -static jmethodID LDKSignOrCreationError_SignError_meth = NULL; -static jclass LDKSignOrCreationError_CreationError_class = NULL; -static jmethodID LDKSignOrCreationError_CreationError_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKSignOrCreationError_init (JNIEnv *env, jclass clz) { - LDKSignOrCreationError_SignError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSignOrCreationError$SignError")); - CHECK(LDKSignOrCreationError_SignError_class != NULL); - LDKSignOrCreationError_SignError_meth = (*env)->GetMethodID(env, LDKSignOrCreationError_SignError_class, "", "()V"); - CHECK(LDKSignOrCreationError_SignError_meth != NULL); - LDKSignOrCreationError_CreationError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSignOrCreationError$CreationError")); - CHECK(LDKSignOrCreationError_CreationError_class != NULL); - LDKSignOrCreationError_CreationError_meth = (*env)->GetMethodID(env, LDKSignOrCreationError_CreationError_class, "", "(Lorg/ldk/enums/CreationError;)V"); - CHECK(LDKSignOrCreationError_CreationError_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSignOrCreationError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKSignOrCreationError *obj = (LDKSignOrCreationError*)untag_ptr(ptr); - switch(obj->tag) { - case LDKSignOrCreationError_SignError: { - return (*env)->NewObject(env, LDKSignOrCreationError_SignError_class, LDKSignOrCreationError_SignError_meth); - } - case LDKSignOrCreationError_CreationError: { - jclass creation_error_conv = LDKCreationError_to_java(env, obj->creation_error); - return (*env)->NewObject(env, LDKSignOrCreationError_CreationError_class, LDKSignOrCreationError_CreationError_meth, creation_error_conv); - } - default: abort(); - } -} -static inline struct LDKBolt11Invoice CResult_Bolt11InvoiceSignOrCreationErrorZ_get_ok(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){ - LDKBolt11Invoice ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(owner); - LDKBolt11Invoice ret_var = CResult_Bolt11InvoiceSignOrCreationErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline struct LDKSignOrCreationError CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return SignOrCreationError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(owner); - LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError"); - *ret_copy = CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - static jclass LDKCOption_InboundHTLCStateDetailsZ_Some_class = NULL; static jmethodID LDKCOption_InboundHTLCStateDetailsZ_Some_meth = NULL; static jclass LDKCOption_InboundHTLCStateDetailsZ_None_class = NULL; @@ -14035,6 +14567,82 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelShutdownSta return ret_ref; } +static inline struct LDKHeldHtlcAvailable CResult_HeldHtlcAvailableDecodeErrorZ_get_ok(LDKCResult_HeldHtlcAvailableDecodeErrorZ *NONNULL_PTR owner){ + LDKHeldHtlcAvailable ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HeldHtlcAvailableDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_HeldHtlcAvailableDecodeErrorZ* owner_conv = (LDKCResult_HeldHtlcAvailableDecodeErrorZ*)untag_ptr(owner); + LDKHeldHtlcAvailable ret_var = CResult_HeldHtlcAvailableDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_HeldHtlcAvailableDecodeErrorZ_get_err(LDKCResult_HeldHtlcAvailableDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HeldHtlcAvailableDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_HeldHtlcAvailableDecodeErrorZ* owner_conv = (LDKCResult_HeldHtlcAvailableDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_HeldHtlcAvailableDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKReleaseHeldHtlc CResult_ReleaseHeldHtlcDecodeErrorZ_get_ok(LDKCResult_ReleaseHeldHtlcDecodeErrorZ *NONNULL_PTR owner){ + LDKReleaseHeldHtlc ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReleaseHeldHtlcDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* owner_conv = (LDKCResult_ReleaseHeldHtlcDecodeErrorZ*)untag_ptr(owner); + LDKReleaseHeldHtlc ret_var = CResult_ReleaseHeldHtlcDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_ReleaseHeldHtlcDecodeErrorZ_get_err(LDKCResult_ReleaseHeldHtlcDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReleaseHeldHtlcDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* owner_conv = (LDKCResult_ReleaseHeldHtlcDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ReleaseHeldHtlcDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKAsyncPaymentsMessage CResult_AsyncPaymentsMessageDecodeErrorZ_get_ok(LDKCResult_AsyncPaymentsMessageDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return AsyncPaymentsMessage_clone(&*owner->contents.result); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsMessageDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* owner_conv = (LDKCResult_AsyncPaymentsMessageDecodeErrorZ*)untag_ptr(owner); + LDKAsyncPaymentsMessage *ret_copy = MALLOC(sizeof(LDKAsyncPaymentsMessage), "LDKAsyncPaymentsMessage"); + *ret_copy = CResult_AsyncPaymentsMessageDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_AsyncPaymentsMessageDecodeErrorZ_get_err(LDKCResult_AsyncPaymentsMessageDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsMessageDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* owner_conv = (LDKCResult_AsyncPaymentsMessageDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_AsyncPaymentsMessageDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline struct LDKOffersMessage CResult_OffersMessageDecodeErrorZ_get_ok(LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return OffersMessage_clone(&*owner->contents.result); @@ -14479,6 +15087,65 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInva return ret_ref; } +static jclass LDKFundingInfo_Tx_class = NULL; +static jmethodID LDKFundingInfo_Tx_meth = NULL; +static jclass LDKFundingInfo_OutPoint_class = NULL; +static jmethodID LDKFundingInfo_OutPoint_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKFundingInfo_init (JNIEnv *env, jclass clz) { + LDKFundingInfo_Tx_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKFundingInfo$Tx")); + CHECK(LDKFundingInfo_Tx_class != NULL); + LDKFundingInfo_Tx_meth = (*env)->GetMethodID(env, LDKFundingInfo_Tx_class, "", "([B)V"); + CHECK(LDKFundingInfo_Tx_meth != NULL); + LDKFundingInfo_OutPoint_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKFundingInfo$OutPoint")); + CHECK(LDKFundingInfo_OutPoint_class != NULL); + LDKFundingInfo_OutPoint_meth = (*env)->GetMethodID(env, LDKFundingInfo_OutPoint_class, "", "(J)V"); + CHECK(LDKFundingInfo_OutPoint_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFundingInfo_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKFundingInfo *obj = (LDKFundingInfo*)untag_ptr(ptr); + switch(obj->tag) { + case LDKFundingInfo_Tx: { + LDKTransaction transaction_var = obj->tx.transaction; + int8_tArray transaction_arr = (*env)->NewByteArray(env, transaction_var.datalen); + (*env)->SetByteArrayRegion(env, transaction_arr, 0, transaction_var.datalen, transaction_var.data); + return (*env)->NewObject(env, LDKFundingInfo_Tx_class, LDKFundingInfo_Tx_meth, transaction_arr); + } + case LDKFundingInfo_OutPoint: { + LDKOutPoint outpoint_var = obj->out_point.outpoint; + int64_t outpoint_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_var); + outpoint_ref = tag_ptr(outpoint_var.inner, false); + return (*env)->NewObject(env, LDKFundingInfo_OutPoint_class, LDKFundingInfo_OutPoint_meth, outpoint_ref); + } + default: abort(); + } +} +static inline struct LDKFundingInfo CResult_FundingInfoDecodeErrorZ_get_ok(LDKCResult_FundingInfoDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return FundingInfo_clone(&*owner->contents.result); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_FundingInfoDecodeErrorZ* owner_conv = (LDKCResult_FundingInfoDecodeErrorZ*)untag_ptr(owner); + LDKFundingInfo *ret_copy = MALLOC(sizeof(LDKFundingInfo), "LDKFundingInfo"); + *ret_copy = CResult_FundingInfoDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_FundingInfoDecodeErrorZ_get_err(LDKCResult_FundingInfoDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_FundingInfoDecodeErrorZ* owner_conv = (LDKCResult_FundingInfoDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_FundingInfoDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static jclass LDKPaymentPurpose_Bolt11InvoicePayment_class = NULL; static jmethodID LDKPaymentPurpose_Bolt11InvoicePayment_meth = NULL; static jclass LDKPaymentPurpose_Bolt12OfferPayment_class = NULL; @@ -14853,24 +15520,55 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDesti return ret_ref; } -static inline enum LDKPaymentFailureReason CResult_PaymentFailureReasonDecodeErrorZ_get_ok(LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR owner){ +static jclass LDKCOption_PaymentFailureReasonZ_Some_class = NULL; +static jmethodID LDKCOption_PaymentFailureReasonZ_Some_meth = NULL; +static jclass LDKCOption_PaymentFailureReasonZ_None_class = NULL; +static jmethodID LDKCOption_PaymentFailureReasonZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1PaymentFailureReasonZ_init (JNIEnv *env, jclass clz) { + LDKCOption_PaymentFailureReasonZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_PaymentFailureReasonZ$Some")); + CHECK(LDKCOption_PaymentFailureReasonZ_Some_class != NULL); + LDKCOption_PaymentFailureReasonZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_PaymentFailureReasonZ_Some_class, "", "(Lorg/ldk/enums/PaymentFailureReason;)V"); + CHECK(LDKCOption_PaymentFailureReasonZ_Some_meth != NULL); + LDKCOption_PaymentFailureReasonZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_PaymentFailureReasonZ$None")); + CHECK(LDKCOption_PaymentFailureReasonZ_None_class != NULL); + LDKCOption_PaymentFailureReasonZ_None_meth = (*env)->GetMethodID(env, LDKCOption_PaymentFailureReasonZ_None_class, "", "()V"); + CHECK(LDKCOption_PaymentFailureReasonZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1PaymentFailureReasonZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_PaymentFailureReasonZ *obj = (LDKCOption_PaymentFailureReasonZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_PaymentFailureReasonZ_Some: { + jclass some_conv = LDKPaymentFailureReason_to_java(env, obj->some); + return (*env)->NewObject(env, LDKCOption_PaymentFailureReasonZ_Some_class, LDKCOption_PaymentFailureReasonZ_Some_meth, some_conv); + } + case LDKCOption_PaymentFailureReasonZ_None: { + return (*env)->NewObject(env, LDKCOption_PaymentFailureReasonZ_None_class, LDKCOption_PaymentFailureReasonZ_None_meth); + } + default: abort(); + } +} +static inline struct LDKCOption_PaymentFailureReasonZ CResult_COption_PaymentFailureReasonZDecodeErrorZ_get_ok(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return PaymentFailureReason_clone(&*owner->contents.result); + return COption_PaymentFailureReasonZ_clone(&*owner->contents.result); } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentFailureReasonDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_PaymentFailureReasonDecodeErrorZ* owner_conv = (LDKCResult_PaymentFailureReasonDecodeErrorZ*)untag_ptr(owner); - jclass ret_conv = LDKPaymentFailureReason_to_java(env, CResult_PaymentFailureReasonDecodeErrorZ_get_ok(owner_conv)); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PaymentFailureReasonZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* owner_conv = (LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ*)untag_ptr(owner); + LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); + *ret_copy = CResult_COption_PaymentFailureReasonZDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -static inline struct LDKDecodeError CResult_PaymentFailureReasonDecodeErrorZ_get_err(LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_COption_PaymentFailureReasonZDecodeErrorZ_get_err(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return DecodeError_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentFailureReasonDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_PaymentFailureReasonDecodeErrorZ* owner_conv = (LDKCResult_PaymentFailureReasonDecodeErrorZ*)untag_ptr(owner); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PaymentFailureReasonZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* owner_conv = (LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ*)untag_ptr(owner); LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_PaymentFailureReasonDecodeErrorZ_get_err(owner_conv); + *ret_copy = CResult_COption_PaymentFailureReasonZDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -14912,35 +15610,6 @@ static inline LDKCVec_ClaimedHTLCZ CVec_ClaimedHTLCZ_clone(const LDKCVec_Claimed } return ret; } -static jclass LDKCOption_PaymentFailureReasonZ_Some_class = NULL; -static jmethodID LDKCOption_PaymentFailureReasonZ_Some_meth = NULL; -static jclass LDKCOption_PaymentFailureReasonZ_None_class = NULL; -static jmethodID LDKCOption_PaymentFailureReasonZ_None_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1PaymentFailureReasonZ_init (JNIEnv *env, jclass clz) { - LDKCOption_PaymentFailureReasonZ_Some_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_PaymentFailureReasonZ$Some")); - CHECK(LDKCOption_PaymentFailureReasonZ_Some_class != NULL); - LDKCOption_PaymentFailureReasonZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_PaymentFailureReasonZ_Some_class, "", "(Lorg/ldk/enums/PaymentFailureReason;)V"); - CHECK(LDKCOption_PaymentFailureReasonZ_Some_meth != NULL); - LDKCOption_PaymentFailureReasonZ_None_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_PaymentFailureReasonZ$None")); - CHECK(LDKCOption_PaymentFailureReasonZ_None_class != NULL); - LDKCOption_PaymentFailureReasonZ_None_meth = (*env)->GetMethodID(env, LDKCOption_PaymentFailureReasonZ_None_class, "", "()V"); - CHECK(LDKCOption_PaymentFailureReasonZ_None_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1PaymentFailureReasonZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKCOption_PaymentFailureReasonZ *obj = (LDKCOption_PaymentFailureReasonZ*)untag_ptr(ptr); - switch(obj->tag) { - case LDKCOption_PaymentFailureReasonZ_Some: { - jclass some_conv = LDKPaymentFailureReason_to_java(env, obj->some); - return (*env)->NewObject(env, LDKCOption_PaymentFailureReasonZ_Some_class, LDKCOption_PaymentFailureReasonZ_Some_meth, some_conv); - } - case LDKCOption_PaymentFailureReasonZ_None: { - return (*env)->NewObject(env, LDKCOption_PaymentFailureReasonZ_None_class, LDKCOption_PaymentFailureReasonZ_None_meth); - } - default: abort(); - } -} static jclass LDKBumpTransactionEvent_ChannelClose_class = NULL; static jmethodID LDKBumpTransactionEvent_ChannelClose_meth = NULL; static jclass LDKBumpTransactionEvent_HTLCResolution_class = NULL; @@ -15022,14 +15691,16 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBumpTransactionEvent_1re } static jclass LDKEvent_FundingGenerationReady_class = NULL; static jmethodID LDKEvent_FundingGenerationReady_meth = NULL; +static jclass LDKEvent_FundingTxBroadcastSafe_class = NULL; +static jmethodID LDKEvent_FundingTxBroadcastSafe_meth = NULL; static jclass LDKEvent_PaymentClaimable_class = NULL; static jmethodID LDKEvent_PaymentClaimable_meth = NULL; static jclass LDKEvent_PaymentClaimed_class = NULL; static jmethodID LDKEvent_PaymentClaimed_meth = NULL; static jclass LDKEvent_ConnectionNeeded_class = NULL; static jmethodID LDKEvent_ConnectionNeeded_meth = NULL; -static jclass LDKEvent_InvoiceRequestFailed_class = NULL; -static jmethodID LDKEvent_InvoiceRequestFailed_meth = NULL; +static jclass LDKEvent_InvoiceReceived_class = NULL; +static jmethodID LDKEvent_InvoiceReceived_meth = NULL; static jclass LDKEvent_PaymentSent_class = NULL; static jmethodID LDKEvent_PaymentSent_meth = NULL; static jclass LDKEvent_PaymentFailed_class = NULL; @@ -15064,12 +15735,21 @@ static jclass LDKEvent_HTLCHandlingFailed_class = NULL; static jmethodID LDKEvent_HTLCHandlingFailed_meth = NULL; static jclass LDKEvent_BumpTransaction_class = NULL; static jmethodID LDKEvent_BumpTransaction_meth = NULL; +static jclass LDKEvent_OnionMessageIntercepted_class = NULL; +static jmethodID LDKEvent_OnionMessageIntercepted_meth = NULL; +static jclass LDKEvent_OnionMessagePeerConnected_class = NULL; +static jmethodID LDKEvent_OnionMessagePeerConnected_meth = NULL; JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *env, jclass clz) { LDKEvent_FundingGenerationReady_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$FundingGenerationReady")); CHECK(LDKEvent_FundingGenerationReady_class != NULL); LDKEvent_FundingGenerationReady_meth = (*env)->GetMethodID(env, LDKEvent_FundingGenerationReady_class, "", "(J[BJ[B[B)V"); CHECK(LDKEvent_FundingGenerationReady_meth != NULL); + LDKEvent_FundingTxBroadcastSafe_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$FundingTxBroadcastSafe")); + CHECK(LDKEvent_FundingTxBroadcastSafe_class != NULL); + LDKEvent_FundingTxBroadcastSafe_meth = (*env)->GetMethodID(env, LDKEvent_FundingTxBroadcastSafe_class, "", "(J[BJ[BJ)V"); + CHECK(LDKEvent_FundingTxBroadcastSafe_meth != NULL); LDKEvent_PaymentClaimable_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentClaimable")); CHECK(LDKEvent_PaymentClaimable_class != NULL); @@ -15078,18 +15758,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *en LDKEvent_PaymentClaimed_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentClaimed")); CHECK(LDKEvent_PaymentClaimed_class != NULL); - LDKEvent_PaymentClaimed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentClaimed_class, "", "([B[BJJ[JJ)V"); + LDKEvent_PaymentClaimed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentClaimed_class, "", "([B[BJJ[JJJ)V"); CHECK(LDKEvent_PaymentClaimed_meth != NULL); LDKEvent_ConnectionNeeded_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$ConnectionNeeded")); CHECK(LDKEvent_ConnectionNeeded_class != NULL); LDKEvent_ConnectionNeeded_meth = (*env)->GetMethodID(env, LDKEvent_ConnectionNeeded_class, "", "([B[J)V"); CHECK(LDKEvent_ConnectionNeeded_meth != NULL); - LDKEvent_InvoiceRequestFailed_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$InvoiceRequestFailed")); - CHECK(LDKEvent_InvoiceRequestFailed_class != NULL); - LDKEvent_InvoiceRequestFailed_meth = (*env)->GetMethodID(env, LDKEvent_InvoiceRequestFailed_class, "", "([B)V"); - CHECK(LDKEvent_InvoiceRequestFailed_meth != NULL); + LDKEvent_InvoiceReceived_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$InvoiceReceived")); + CHECK(LDKEvent_InvoiceReceived_class != NULL); + LDKEvent_InvoiceReceived_meth = (*env)->GetMethodID(env, LDKEvent_InvoiceReceived_class, "", "([BJJJ)V"); + CHECK(LDKEvent_InvoiceReceived_meth != NULL); LDKEvent_PaymentSent_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentSent")); CHECK(LDKEvent_PaymentSent_class != NULL); @@ -15098,7 +15778,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *en LDKEvent_PaymentFailed_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentFailed")); CHECK(LDKEvent_PaymentFailed_class != NULL); - LDKEvent_PaymentFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentFailed_class, "", "([B[BJ)V"); + LDKEvent_PaymentFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentFailed_class, "", "([BJJ)V"); CHECK(LDKEvent_PaymentFailed_meth != NULL); LDKEvent_PaymentPathSuccessful_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentPathSuccessful")); @@ -15158,12 +15838,12 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *en LDKEvent_DiscardFunding_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$DiscardFunding")); CHECK(LDKEvent_DiscardFunding_class != NULL); - LDKEvent_DiscardFunding_meth = (*env)->GetMethodID(env, LDKEvent_DiscardFunding_class, "", "(J[B)V"); + LDKEvent_DiscardFunding_meth = (*env)->GetMethodID(env, LDKEvent_DiscardFunding_class, "", "(JJ)V"); CHECK(LDKEvent_DiscardFunding_meth != NULL); LDKEvent_OpenChannelRequest_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$OpenChannelRequest")); CHECK(LDKEvent_OpenChannelRequest_class != NULL); - LDKEvent_OpenChannelRequest_meth = (*env)->GetMethodID(env, LDKEvent_OpenChannelRequest_class, "", "(J[BJJJ)V"); + LDKEvent_OpenChannelRequest_meth = (*env)->GetMethodID(env, LDKEvent_OpenChannelRequest_class, "", "(J[BJJJZJ)V"); CHECK(LDKEvent_OpenChannelRequest_meth != NULL); LDKEvent_HTLCHandlingFailed_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$HTLCHandlingFailed")); @@ -15175,6 +15855,16 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *en CHECK(LDKEvent_BumpTransaction_class != NULL); LDKEvent_BumpTransaction_meth = (*env)->GetMethodID(env, LDKEvent_BumpTransaction_class, "", "(J)V"); CHECK(LDKEvent_BumpTransaction_meth != NULL); + LDKEvent_OnionMessageIntercepted_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$OnionMessageIntercepted")); + CHECK(LDKEvent_OnionMessageIntercepted_class != NULL); + LDKEvent_OnionMessageIntercepted_meth = (*env)->GetMethodID(env, LDKEvent_OnionMessageIntercepted_class, "", "([BJ)V"); + CHECK(LDKEvent_OnionMessageIntercepted_meth != NULL); + LDKEvent_OnionMessagePeerConnected_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$OnionMessagePeerConnected")); + CHECK(LDKEvent_OnionMessagePeerConnected_class != NULL); + LDKEvent_OnionMessagePeerConnected_meth = (*env)->GetMethodID(env, LDKEvent_OnionMessagePeerConnected_class, "", "([B)V"); + CHECK(LDKEvent_OnionMessagePeerConnected_meth != NULL); } JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -15194,6 +15884,25 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN (*env)->SetByteArrayRegion(env, user_channel_id_arr, 0, 16, obj->funding_generation_ready.user_channel_id.le_bytes); return (*env)->NewObject(env, LDKEvent_FundingGenerationReady_class, LDKEvent_FundingGenerationReady_meth, temporary_channel_id_ref, counterparty_node_id_arr, channel_value_satoshis_conv, output_script_arr, user_channel_id_arr); } + case LDKEvent_FundingTxBroadcastSafe: { + LDKChannelId channel_id_var = obj->funding_tx_broadcast_safe.channel_id; + int64_t channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); + channel_id_ref = tag_ptr(channel_id_var.inner, false); + int8_tArray user_channel_id_arr = (*env)->NewByteArray(env, 16); + (*env)->SetByteArrayRegion(env, user_channel_id_arr, 0, 16, obj->funding_tx_broadcast_safe.user_channel_id.le_bytes); + LDKOutPoint funding_txo_var = obj->funding_tx_broadcast_safe.funding_txo; + int64_t funding_txo_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var); + funding_txo_ref = tag_ptr(funding_txo_var.inner, false); + int8_tArray counterparty_node_id_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, counterparty_node_id_arr, 0, 33, obj->funding_tx_broadcast_safe.counterparty_node_id.compressed_form); + LDKChannelId former_temporary_channel_id_var = obj->funding_tx_broadcast_safe.former_temporary_channel_id; + int64_t former_temporary_channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(former_temporary_channel_id_var); + former_temporary_channel_id_ref = tag_ptr(former_temporary_channel_id_var.inner, false); + return (*env)->NewObject(env, LDKEvent_FundingTxBroadcastSafe_class, LDKEvent_FundingTxBroadcastSafe_meth, channel_id_ref, user_channel_id_arr, funding_txo_ref, counterparty_node_id_arr, former_temporary_channel_id_ref); + } case LDKEvent_PaymentClaimable: { int8_tArray receiver_node_id_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, receiver_node_id_arr, 0, 33, obj->payment_claimable.receiver_node_id.compressed_form); @@ -15234,7 +15943,11 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN } (*env)->ReleasePrimitiveArrayCritical(env, htlcs_arr, htlcs_arr_ptr, 0); int64_t sender_intended_total_msat_ref = tag_ptr(&obj->payment_claimed.sender_intended_total_msat, false); - return (*env)->NewObject(env, LDKEvent_PaymentClaimed_class, LDKEvent_PaymentClaimed_meth, receiver_node_id_arr, payment_hash_arr, amount_msat_conv, purpose_ref, htlcs_arr, sender_intended_total_msat_ref); + LDKRecipientOnionFields onion_fields_var = obj->payment_claimed.onion_fields; + int64_t onion_fields_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(onion_fields_var); + onion_fields_ref = tag_ptr(onion_fields_var.inner, false); + return (*env)->NewObject(env, LDKEvent_PaymentClaimed_class, LDKEvent_PaymentClaimed_meth, receiver_node_id_arr, payment_hash_arr, amount_msat_conv, purpose_ref, htlcs_arr, sender_intended_total_msat_ref, onion_fields_ref); } case LDKEvent_ConnectionNeeded: { int8_tArray node_id_arr = (*env)->NewByteArray(env, 33); @@ -15250,10 +15963,19 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN (*env)->ReleasePrimitiveArrayCritical(env, addresses_arr, addresses_arr_ptr, 0); return (*env)->NewObject(env, LDKEvent_ConnectionNeeded_class, LDKEvent_ConnectionNeeded_meth, node_id_arr, addresses_arr); } - case LDKEvent_InvoiceRequestFailed: { + case LDKEvent_InvoiceReceived: { int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->invoice_request_failed.payment_id.data); - return (*env)->NewObject(env, LDKEvent_InvoiceRequestFailed_class, LDKEvent_InvoiceRequestFailed_meth, payment_id_arr); + (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->invoice_received.payment_id.data); + LDKBolt12Invoice invoice_var = obj->invoice_received.invoice; + int64_t invoice_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_var); + invoice_ref = tag_ptr(invoice_var.inner, false); + int64_t context_ref = tag_ptr(&obj->invoice_received.context, false); + LDKResponder responder_var = obj->invoice_received.responder; + int64_t responder_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(responder_var); + responder_ref = tag_ptr(responder_var.inner, false); + return (*env)->NewObject(env, LDKEvent_InvoiceReceived_class, LDKEvent_InvoiceReceived_meth, payment_id_arr, invoice_ref, context_ref, responder_ref); } case LDKEvent_PaymentSent: { int64_t payment_id_ref = tag_ptr(&obj->payment_sent.payment_id, false); @@ -15267,10 +15989,9 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN case LDKEvent_PaymentFailed: { int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_failed.payment_id.data); - int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_failed.payment_hash.data); + int64_t payment_hash_ref = tag_ptr(&obj->payment_failed.payment_hash, false); int64_t reason_ref = tag_ptr(&obj->payment_failed.reason, false); - return (*env)->NewObject(env, LDKEvent_PaymentFailed_class, LDKEvent_PaymentFailed_meth, payment_id_arr, payment_hash_arr, reason_ref); + return (*env)->NewObject(env, LDKEvent_PaymentFailed_class, LDKEvent_PaymentFailed_meth, payment_id_arr, payment_hash_ref, reason_ref); } case LDKEvent_PaymentPathSuccessful: { int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); @@ -15425,10 +16146,8 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN int64_t channel_id_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); channel_id_ref = tag_ptr(channel_id_var.inner, false); - LDKTransaction transaction_var = obj->discard_funding.transaction; - int8_tArray transaction_arr = (*env)->NewByteArray(env, transaction_var.datalen); - (*env)->SetByteArrayRegion(env, transaction_arr, 0, transaction_var.datalen, transaction_var.data); - return (*env)->NewObject(env, LDKEvent_DiscardFunding_class, LDKEvent_DiscardFunding_meth, channel_id_ref, transaction_arr); + int64_t funding_info_ref = tag_ptr(&obj->discard_funding.funding_info, false); + return (*env)->NewObject(env, LDKEvent_DiscardFunding_class, LDKEvent_DiscardFunding_meth, channel_id_ref, funding_info_ref); } case LDKEvent_OpenChannelRequest: { LDKChannelId temporary_channel_id_var = obj->open_channel_request.temporary_channel_id; @@ -15443,7 +16162,12 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN int64_t channel_type_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_var); channel_type_ref = tag_ptr(channel_type_var.inner, false); - return (*env)->NewObject(env, LDKEvent_OpenChannelRequest_class, LDKEvent_OpenChannelRequest_meth, temporary_channel_id_ref, counterparty_node_id_arr, funding_satoshis_conv, push_msat_conv, channel_type_ref); + jboolean is_announced_conv = obj->open_channel_request.is_announced; + LDKChannelParameters params_var = obj->open_channel_request.params; + int64_t params_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_var); + params_ref = tag_ptr(params_var.inner, false); + return (*env)->NewObject(env, LDKEvent_OpenChannelRequest_class, LDKEvent_OpenChannelRequest_meth, temporary_channel_id_ref, counterparty_node_id_arr, funding_satoshis_conv, push_msat_conv, channel_type_ref, is_announced_conv, params_ref); } case LDKEvent_HTLCHandlingFailed: { LDKChannelId prev_channel_id_var = obj->htlc_handling_failed.prev_channel_id; @@ -15457,6 +16181,20 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN int64_t bump_transaction_ref = tag_ptr(&obj->bump_transaction, false); return (*env)->NewObject(env, LDKEvent_BumpTransaction_class, LDKEvent_BumpTransaction_meth, bump_transaction_ref); } + case LDKEvent_OnionMessageIntercepted: { + int8_tArray peer_node_id_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, peer_node_id_arr, 0, 33, obj->onion_message_intercepted.peer_node_id.compressed_form); + LDKOnionMessage message_var = obj->onion_message_intercepted.message; + int64_t message_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_var); + message_ref = tag_ptr(message_var.inner, false); + return (*env)->NewObject(env, LDKEvent_OnionMessageIntercepted_class, LDKEvent_OnionMessageIntercepted_meth, peer_node_id_arr, message_ref); + } + case LDKEvent_OnionMessagePeerConnected: { + int8_tArray peer_node_id_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, peer_node_id_arr, 0, 33, obj->onion_message_peer_connected.peer_node_id.compressed_form); + return (*env)->NewObject(env, LDKEvent_OnionMessagePeerConnected_class, LDKEvent_OnionMessagePeerConnected_meth, peer_node_id_arr); + } default: abort(); } } @@ -15513,6 +16251,39 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDec return ret_ref; } +static inline struct LDKNonce CResult_NonceDecodeErrorZ_get_ok(LDKCResult_NonceDecodeErrorZ *NONNULL_PTR owner){ + LDKNonce ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonceDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NonceDecodeErrorZ* owner_conv = (LDKCResult_NonceDecodeErrorZ*)untag_ptr(owner); + LDKNonce ret_var = CResult_NonceDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_NonceDecodeErrorZ_get_err(LDKCResult_NonceDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonceDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NonceDecodeErrorZ* owner_conv = (LDKCResult_NonceDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_NonceDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline LDKCVec_RouteHintHopZ CVec_RouteHintHopZ_clone(const LDKCVec_RouteHintHopZ *orig) { + LDKCVec_RouteHintHopZ ret = { .data = MALLOC(sizeof(LDKRouteHintHop) * orig->datalen, "LDKCVec_RouteHintHopZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = RouteHintHop_clone(&orig->data[i]); + } + return ret; +} static jclass LDKBolt11ParseError_Bech32Error_class = NULL; static jmethodID LDKBolt11ParseError_Bech32Error_meth = NULL; static jclass LDKBolt11ParseError_ParseAmountError_class = NULL; @@ -16047,6 +16818,32 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BigSizeDecodeError return ret_ref; } +static inline struct LDKUntrustedString CResult_UntrustedStringDecodeErrorZ_get_ok(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR owner){ + LDKUntrustedString ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UntrustedStringDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_UntrustedStringDecodeErrorZ* owner_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(owner); + LDKUntrustedString ret_var = CResult_UntrustedStringDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_UntrustedStringDecodeErrorZ_get_err(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UntrustedStringDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_UntrustedStringDecodeErrorZ* owner_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_UntrustedStringDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline struct LDKHostname CResult_HostnameDecodeErrorZ_get_ok(LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR owner){ LDKHostname ret = *owner->contents.result; ret.is_owned = false; @@ -16122,32 +16919,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenL return ret_ref; } -static inline struct LDKUntrustedString CResult_UntrustedStringDecodeErrorZ_get_ok(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR owner){ - LDKUntrustedString ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UntrustedStringDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_UntrustedStringDecodeErrorZ* owner_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(owner); - LDKUntrustedString ret_var = CResult_UntrustedStringDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline struct LDKDecodeError CResult_UntrustedStringDecodeErrorZ_get_err(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UntrustedStringDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_UntrustedStringDecodeErrorZ* owner_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_UntrustedStringDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - static inline struct LDKChannelId CResult_ChannelIdDecodeErrorZ_get_ok(LDKCResult_ChannelIdDecodeErrorZ *NONNULL_PTR owner){ LDKChannelId ret = *owner->contents.result; ret.is_owned = false; @@ -16193,6 +16964,62 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1_1u832u16Z_1get_1b return ret_conv; } +static inline struct LDKBlindedPayInfo CResult_BlindedPayInfoDecodeErrorZ_get_ok(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR owner){ + LDKBlindedPayInfo ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_BlindedPayInfoDecodeErrorZ* owner_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(owner); + LDKBlindedPayInfo ret_var = CResult_BlindedPayInfoDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_BlindedPayInfoDecodeErrorZ_get_err(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_BlindedPayInfoDecodeErrorZ* owner_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_BlindedPayInfoDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKBlindedPaymentPath CResult_BlindedPaymentPathNoneZ_get_ok(LDKCResult_BlindedPaymentPathNoneZ *NONNULL_PTR owner){ + LDKBlindedPaymentPath ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPaymentPathNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_BlindedPaymentPathNoneZ* owner_conv = (LDKCResult_BlindedPaymentPathNoneZ*)untag_ptr(owner); + LDKBlindedPaymentPath ret_var = CResult_BlindedPaymentPathNoneZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline void CResult_BlindedPaymentPathNoneZ_get_err(LDKCResult_BlindedPaymentPathNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPaymentPathNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_BlindedPaymentPathNoneZ* owner_conv = (LDKCResult_BlindedPaymentPathNoneZ*)untag_ptr(owner); + CResult_BlindedPaymentPathNoneZ_get_err(owner_conv); +} + +static inline LDKCVec_PaymentForwardNodeZ CVec_PaymentForwardNodeZ_clone(const LDKCVec_PaymentForwardNodeZ *orig) { + LDKCVec_PaymentForwardNodeZ ret = { .data = MALLOC(sizeof(LDKPaymentForwardNode) * orig->datalen, "LDKCVec_PaymentForwardNodeZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = PaymentForwardNode_clone(&orig->data[i]); + } + return ret; +} static inline struct LDKPaymentRelay CResult_PaymentRelayDecodeErrorZ_get_ok(LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR owner){ LDKPaymentRelay ret = *owner->contents.result; ret.is_owned = false; @@ -16347,85 +17174,61 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12RefundContex return ret_ref; } -static inline struct LDKStr CResult_StrSecp256k1ErrorZ_get_ok(LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_CResult_1StrSecp256k1ErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_StrSecp256k1ErrorZ* owner_conv = (LDKCResult_StrSecp256k1ErrorZ*)untag_ptr(owner); - LDKStr ret_str = CResult_StrSecp256k1ErrorZ_get_ok(owner_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - return ret_conv; -} - -static inline enum LDKSecp256k1Error CResult_StrSecp256k1ErrorZ_get_err(LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; -} -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1StrSecp256k1ErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_StrSecp256k1ErrorZ* owner_conv = (LDKCResult_StrSecp256k1ErrorZ*)untag_ptr(owner); - jclass ret_conv = LDKSecp256k1Error_to_java(env, CResult_StrSecp256k1ErrorZ_get_err(owner_conv)); - return ret_conv; -} - -static inline struct LDKThirtyTwoBytes C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_a(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR owner){ - return ThirtyTwoBytes_clone(&owner->a); -} -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* owner_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(owner); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_a(owner_conv).data); - return ret_arr; -} - -static inline struct LDKRecipientOnionFields C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_b(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR owner){ - LDKRecipientOnionFields ret = owner->b; +static inline struct LDKResponder CResult_ResponderDecodeErrorZ_get_ok(LDKCResult_ResponderDecodeErrorZ *NONNULL_PTR owner){ + LDKResponder ret = *owner->contents.result; ret.is_owned = false; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* owner_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(owner); - LDKRecipientOnionFields ret_var = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_b(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ResponderDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_ResponderDecodeErrorZ* owner_conv = (LDKCResult_ResponderDecodeErrorZ*)untag_ptr(owner); + LDKResponder ret_var = CResult_ResponderDecodeErrorZ_get_ok(owner_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline struct LDKRouteParameters C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_c(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR owner){ - LDKRouteParameters ret = owner->c; - ret.is_owned = false; - return ret; +static inline struct LDKDecodeError CResult_ResponderDecodeErrorZ_get_err(LDKCResult_ResponderDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1get_1c(JNIEnv *env, jclass clz, int64_t owner) { - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* owner_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(owner); - LDKRouteParameters ret_var = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_c(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ResponderDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_ResponderDecodeErrorZ* owner_conv = (LDKCResult_ResponderDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ResponderDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_ok(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(&*owner->contents.result); +static jclass LDKCOption_MessageContextZ_Some_class = NULL; +static jmethodID LDKCOption_MessageContextZ_Some_meth = NULL; +static jclass LDKCOption_MessageContextZ_None_class = NULL; +static jmethodID LDKCOption_MessageContextZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1MessageContextZ_init (JNIEnv *env, jclass clz) { + LDKCOption_MessageContextZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_MessageContextZ$Some")); + CHECK(LDKCOption_MessageContextZ_Some_class != NULL); + LDKCOption_MessageContextZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_MessageContextZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_MessageContextZ_Some_meth != NULL); + LDKCOption_MessageContextZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_MessageContextZ$None")); + CHECK(LDKCOption_MessageContextZ_None_class != NULL); + LDKCOption_MessageContextZ_None_meth = (*env)->GetMethodID(env, LDKCOption_MessageContextZ_None_class, "", "()V"); + CHECK(LDKCOption_MessageContextZ_None_meth != NULL); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* owner_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(owner); - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ), "LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ"); - *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_ok(owner_conv); - return tag_ptr(ret_conv, true); -} - -static inline void CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_err(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; -} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* owner_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(owner); - CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_err(owner_conv); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1MessageContextZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_MessageContextZ *obj = (LDKCOption_MessageContextZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_MessageContextZ_Some: { + int64_t some_ref = tag_ptr(&obj->some, false); + return (*env)->NewObject(env, LDKCOption_MessageContextZ_Some_class, LDKCOption_MessageContextZ_Some_meth, some_ref); + } + case LDKCOption_MessageContextZ_None: { + return (*env)->NewObject(env, LDKCOption_MessageContextZ_None_class, LDKCOption_MessageContextZ_None_meth); + } + default: abort(); + } } - static inline struct LDKPublicKey C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_get_a(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *NONNULL_PTR owner){ return owner->a; } @@ -16670,7 +17473,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPeeledOnion_init (JNIE LDKPeeledOnion_Receive_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPeeledOnion$Receive")); CHECK(LDKPeeledOnion_Receive_class != NULL); - LDKPeeledOnion_Receive_meth = (*env)->GetMethodID(env, LDKPeeledOnion_Receive_class, "", "(J[BJ)V"); + LDKPeeledOnion_Receive_meth = (*env)->GetMethodID(env, LDKPeeledOnion_Receive_class, "", "(JJJ)V"); CHECK(LDKPeeledOnion_Receive_meth != NULL); } JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPeeledOnion_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { @@ -16686,13 +17489,12 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPeeledOnion_1ref_1from_1 } case LDKPeeledOnion_Receive: { int64_t _0_ref = tag_ptr(&obj->receive._0, false); - int8_tArray _1_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, _1_arr, 0, 32, obj->receive._1.data); - LDKBlindedPath _2_var = obj->receive._2; + int64_t _1_ref = tag_ptr(&obj->receive._1, false); + LDKBlindedMessagePath _2_var = obj->receive._2; int64_t _2_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(_2_var); _2_ref = tag_ptr(_2_var.inner, false); - return (*env)->NewObject(env, LDKPeeledOnion_Receive_class, LDKPeeledOnion_Receive_meth, _0_ref, _1_arr, _2_ref); + return (*env)->NewObject(env, LDKPeeledOnion_Receive_class, LDKPeeledOnion_Receive_meth, _0_ref, _1_ref, _2_ref); } default: abort(); } @@ -16772,104 +17574,111 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SendSuccessSendErr return ret_ref; } -static inline struct LDKBlindedPath CResult_BlindedPathNoneZ_get_ok(LDKCResult_BlindedPathNoneZ *NONNULL_PTR owner){ - LDKBlindedPath ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_BlindedPathNoneZ* owner_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(owner); - LDKBlindedPath ret_var = CResult_BlindedPathNoneZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline void CResult_BlindedPathNoneZ_get_err(LDKCResult_BlindedPathNoneZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; -} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_BlindedPathNoneZ* owner_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(owner); - CResult_BlindedPathNoneZ_get_err(owner_conv); -} - -static inline struct LDKC2Tuple_BlindedPayInfoBlindedPathZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_get_ok(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR owner){ +static inline void CResult_NoneSendErrorZ_get_ok(LDKCResult_NoneSendErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return C2Tuple_BlindedPayInfoBlindedPathZ_clone(&*owner->contents.result); + return *owner->contents.result; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlindedPayInfoBlindedPathZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* owner_conv = (LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ*)untag_ptr(owner); - LDKC2Tuple_BlindedPayInfoBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ"); - *ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_get_ok(owner_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NoneSendErrorZ* owner_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(owner); + CResult_NoneSendErrorZ_get_ok(owner_conv); } -static inline void CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_get_err(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR owner){ +static inline struct LDKSendError CResult_NoneSendErrorZ_get_err(LDKCResult_NoneSendErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); - return *owner->contents.err; + return SendError_clone(&*owner->contents.err); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlindedPayInfoBlindedPathZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* owner_conv = (LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ*)untag_ptr(owner); - CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_get_err(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NoneSendErrorZ* owner_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(owner); + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = CResult_NoneSendErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -static inline LDKCVec_ForwardNodeZ CVec_ForwardNodeZ_clone(const LDKCVec_ForwardNodeZ *orig) { - LDKCVec_ForwardNodeZ ret = { .data = MALLOC(sizeof(LDKForwardNode) * orig->datalen, "LDKCVec_ForwardNodeZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = ForwardNode_clone(&orig->data[i]); - } - return ret; -} -static inline struct LDKBlindedPath CResult_BlindedPathDecodeErrorZ_get_ok(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR owner){ - LDKBlindedPath ret = *owner->contents.result; +static inline struct LDKBlindedHop CResult_BlindedHopDecodeErrorZ_get_ok(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){ + LDKBlindedHop ret = *owner->contents.result; ret.is_owned = false; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_BlindedPathDecodeErrorZ* owner_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(owner); - LDKBlindedPath ret_var = CResult_BlindedPathDecodeErrorZ_get_ok(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner); + LDKBlindedHop ret_var = CResult_BlindedHopDecodeErrorZ_get_ok(owner_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline struct LDKDecodeError CResult_BlindedPathDecodeErrorZ_get_err(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_BlindedHopDecodeErrorZ_get_err(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return DecodeError_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_BlindedPathDecodeErrorZ* owner_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(owner); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner); LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_BlindedPathDecodeErrorZ_get_err(owner_conv); + *ret_copy = CResult_BlindedHopDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline struct LDKBlindedHop CResult_BlindedHopDecodeErrorZ_get_ok(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){ - LDKBlindedHop ret = *owner->contents.result; +static inline LDKCVec_PhantomRouteHintsZ CVec_PhantomRouteHintsZ_clone(const LDKCVec_PhantomRouteHintsZ *orig) { + LDKCVec_PhantomRouteHintsZ ret = { .data = MALLOC(sizeof(LDKPhantomRouteHints) * orig->datalen, "LDKCVec_PhantomRouteHintsZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = PhantomRouteHints_clone(&orig->data[i]); + } + return ret; +} +static jclass LDKSignOrCreationError_SignError_class = NULL; +static jmethodID LDKSignOrCreationError_SignError_meth = NULL; +static jclass LDKSignOrCreationError_CreationError_class = NULL; +static jmethodID LDKSignOrCreationError_CreationError_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKSignOrCreationError_init (JNIEnv *env, jclass clz) { + LDKSignOrCreationError_SignError_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSignOrCreationError$SignError")); + CHECK(LDKSignOrCreationError_SignError_class != NULL); + LDKSignOrCreationError_SignError_meth = (*env)->GetMethodID(env, LDKSignOrCreationError_SignError_class, "", "()V"); + CHECK(LDKSignOrCreationError_SignError_meth != NULL); + LDKSignOrCreationError_CreationError_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSignOrCreationError$CreationError")); + CHECK(LDKSignOrCreationError_CreationError_class != NULL); + LDKSignOrCreationError_CreationError_meth = (*env)->GetMethodID(env, LDKSignOrCreationError_CreationError_class, "", "(Lorg/ldk/enums/CreationError;)V"); + CHECK(LDKSignOrCreationError_CreationError_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSignOrCreationError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKSignOrCreationError *obj = (LDKSignOrCreationError*)untag_ptr(ptr); + switch(obj->tag) { + case LDKSignOrCreationError_SignError: { + return (*env)->NewObject(env, LDKSignOrCreationError_SignError_class, LDKSignOrCreationError_SignError_meth); + } + case LDKSignOrCreationError_CreationError: { + jclass creation_error_conv = LDKCreationError_to_java(env, obj->creation_error); + return (*env)->NewObject(env, LDKSignOrCreationError_CreationError_class, LDKSignOrCreationError_CreationError_meth, creation_error_conv); + } + default: abort(); + } +} +static inline struct LDKBolt11Invoice CResult_Bolt11InvoiceSignOrCreationErrorZ_get_ok(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){ + LDKBolt11Invoice ret = *owner->contents.result; ret.is_owned = false; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner); - LDKBlindedHop ret_var = CResult_BlindedHopDecodeErrorZ_get_ok(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(owner); + LDKBolt11Invoice ret_var = CResult_Bolt11InvoiceSignOrCreationErrorZ_get_ok(owner_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline struct LDKDecodeError CResult_BlindedHopDecodeErrorZ_get_err(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKSignOrCreationError CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); + return SignOrCreationError_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_BlindedHopDecodeErrorZ_get_err(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(owner); + LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError"); + *ret_copy = CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -17951,55 +18760,142 @@ static inline LDKCVec_C2Tuple_OutPointChannelIdZZ CVec_C2Tuple_OutPointChannelId } return ret; } -static inline LDKCVec_MonitorUpdateIdZ CVec_MonitorUpdateIdZ_clone(const LDKCVec_MonitorUpdateIdZ *orig) { - LDKCVec_MonitorUpdateIdZ ret = { .data = MALLOC(sizeof(LDKMonitorUpdateId) * orig->datalen, "LDKCVec_MonitorUpdateIdZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = MonitorUpdateId_clone(&orig->data[i]); - } - return ret; -} -static inline struct LDKOutPoint C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR owner){ +static inline struct LDKOutPoint C2Tuple_OutPointCVec_u64ZZ_get_a(LDKC2Tuple_OutPointCVec_u64ZZ *NONNULL_PTR owner){ LDKOutPoint ret = owner->a; ret.is_owned = false; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* owner_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(owner); - LDKOutPoint ret_var = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1u64ZZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_OutPointCVec_u64ZZ* owner_conv = (LDKC2Tuple_OutPointCVec_u64ZZ*)untag_ptr(owner); + LDKOutPoint ret_var = C2Tuple_OutPointCVec_u64ZZ_get_a(owner_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline struct LDKCVec_MonitorUpdateIdZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR owner){ - return CVec_MonitorUpdateIdZ_clone(&owner->b); +static inline struct LDKCVec_u64Z C2Tuple_OutPointCVec_u64ZZ_get_b(LDKC2Tuple_OutPointCVec_u64ZZ *NONNULL_PTR owner){ + return CVec_u64Z_clone(&owner->b); } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* owner_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(owner); - LDKCVec_MonitorUpdateIdZ ret_var = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(owner_conv); +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1u64ZZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_OutPointCVec_u64ZZ* owner_conv = (LDKC2Tuple_OutPointCVec_u64ZZ*)untag_ptr(owner); + LDKCVec_u64Z ret_var = C2Tuple_OutPointCVec_u64ZZ_get_b(owner_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t r = 0; r < ret_var.datalen; r++) { - LDKMonitorUpdateId ret_conv_17_var = ret_var.data[r]; - int64_t ret_conv_17_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_17_var); - ret_conv_17_ref = tag_ptr(ret_conv_17_var.inner, ret_conv_17_var.is_owned); - ret_arr_ptr[r] = ret_conv_17_ref; + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; } (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); FREE(ret_var.data); return ret_arr; } -static inline LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_clone(const LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ *orig) { - LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ) * orig->datalen, "LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ clone bytes"), .datalen = orig->datalen }; +static inline LDKCVec_C2Tuple_OutPointCVec_u64ZZZ CVec_C2Tuple_OutPointCVec_u64ZZZ_clone(const LDKCVec_C2Tuple_OutPointCVec_u64ZZZ *orig) { + LDKCVec_C2Tuple_OutPointCVec_u64ZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_u64ZZ) * orig->datalen, "LDKCVec_C2Tuple_OutPointCVec_u64ZZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(&orig->data[i]); + ret.data[i] = C2Tuple_OutPointCVec_u64ZZ_clone(&orig->data[i]); } return ret; } +static inline struct LDKBlindedMessagePath CResult_BlindedMessagePathDecodeErrorZ_get_ok(LDKCResult_BlindedMessagePathDecodeErrorZ *NONNULL_PTR owner){ + LDKBlindedMessagePath ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_BlindedMessagePathDecodeErrorZ* owner_conv = (LDKCResult_BlindedMessagePathDecodeErrorZ*)untag_ptr(owner); + LDKBlindedMessagePath ret_var = CResult_BlindedMessagePathDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_BlindedMessagePathDecodeErrorZ_get_err(LDKCResult_BlindedMessagePathDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_BlindedMessagePathDecodeErrorZ* owner_conv = (LDKCResult_BlindedMessagePathDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_BlindedMessagePathDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKBlindedMessagePath CResult_BlindedMessagePathNoneZ_get_ok(LDKCResult_BlindedMessagePathNoneZ *NONNULL_PTR owner){ + LDKBlindedMessagePath ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_BlindedMessagePathNoneZ* owner_conv = (LDKCResult_BlindedMessagePathNoneZ*)untag_ptr(owner); + LDKBlindedMessagePath ret_var = CResult_BlindedMessagePathNoneZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline void CResult_BlindedMessagePathNoneZ_get_err(LDKCResult_BlindedMessagePathNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_BlindedMessagePathNoneZ* owner_conv = (LDKCResult_BlindedMessagePathNoneZ*)untag_ptr(owner); + CResult_BlindedMessagePathNoneZ_get_err(owner_conv); +} + +static inline struct LDKMessageContext CResult_MessageContextDecodeErrorZ_get_ok(LDKCResult_MessageContextDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return MessageContext_clone(&*owner->contents.result); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1MessageContextDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_MessageContextDecodeErrorZ* owner_conv = (LDKCResult_MessageContextDecodeErrorZ*)untag_ptr(owner); + LDKMessageContext *ret_copy = MALLOC(sizeof(LDKMessageContext), "LDKMessageContext"); + *ret_copy = CResult_MessageContextDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_MessageContextDecodeErrorZ_get_err(LDKCResult_MessageContextDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1MessageContextDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_MessageContextDecodeErrorZ* owner_conv = (LDKCResult_MessageContextDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_MessageContextDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKOffersContext CResult_OffersContextDecodeErrorZ_get_ok(LDKCResult_OffersContextDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return OffersContext_clone(&*owner->contents.result); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OffersContextDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_OffersContextDecodeErrorZ* owner_conv = (LDKCResult_OffersContextDecodeErrorZ*)untag_ptr(owner); + LDKOffersContext *ret_copy = MALLOC(sizeof(LDKOffersContext), "LDKOffersContext"); + *ret_copy = CResult_OffersContextDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_OffersContextDecodeErrorZ_get_err(LDKCResult_OffersContextDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OffersContextDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_OffersContextDecodeErrorZ* owner_conv = (LDKCResult_OffersContextDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_OffersContextDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + typedef struct LDKPersister_JCalls { atomic_size_t refcnt; JavaVM *vm; @@ -18209,7 +19105,7 @@ static void LDKPersist_JCalls_free(void* this_arg) { FREE(j_calls); } } -LDKChannelMonitorUpdateStatus persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_funding_outpoint, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) { +LDKChannelMonitorUpdateStatus persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_funding_outpoint, const LDKChannelMonitor * monitor) { LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -18222,18 +19118,14 @@ LDKChannelMonitorUpdateStatus persist_new_channel_LDKPersist_jcall(const void* t int64_t channel_funding_outpoint_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_funding_outpoint_var); channel_funding_outpoint_ref = tag_ptr(channel_funding_outpoint_var.inner, channel_funding_outpoint_var.is_owned); - LDKChannelMonitor data_var = *data; - int64_t data_ref = 0; - data_var = ChannelMonitor_clone(&data_var); - CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var); - data_ref = tag_ptr(data_var.inner, data_var.is_owned); - LDKMonitorUpdateId update_id_var = update_id; - int64_t update_id_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var); - update_id_ref = tag_ptr(update_id_var.inner, update_id_var.is_owned); + LDKChannelMonitor monitor_var = *monitor; + int64_t monitor_ref = 0; + monitor_var = ChannelMonitor_clone(&monitor_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_var); + monitor_ref = tag_ptr(monitor_var.inner, monitor_var.is_owned); jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - jclass ret = (*env)->CallObjectMethod(env, obj, j_calls->persist_new_channel_meth, channel_funding_outpoint_ref, data_ref, update_id_ref); + jclass ret = (*env)->CallObjectMethod(env, obj, j_calls->persist_new_channel_meth, channel_funding_outpoint_ref, monitor_ref); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); (*env)->FatalError(env, "A call to persist_new_channel in LDKPersist from rust threw an exception."); @@ -18244,7 +19136,7 @@ LDKChannelMonitorUpdateStatus persist_new_channel_LDKPersist_jcall(const void* t } return ret_conv; } -LDKChannelMonitorUpdateStatus update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_funding_outpoint, LDKChannelMonitorUpdate update, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) { +LDKChannelMonitorUpdateStatus update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_funding_outpoint, LDKChannelMonitorUpdate monitor_update, const LDKChannelMonitor * monitor) { LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -18257,22 +19149,18 @@ LDKChannelMonitorUpdateStatus update_persisted_channel_LDKPersist_jcall(const vo int64_t channel_funding_outpoint_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_funding_outpoint_var); channel_funding_outpoint_ref = tag_ptr(channel_funding_outpoint_var.inner, channel_funding_outpoint_var.is_owned); - LDKChannelMonitorUpdate update_var = update; - int64_t update_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var); - update_ref = tag_ptr(update_var.inner, update_var.is_owned); - LDKChannelMonitor data_var = *data; - int64_t data_ref = 0; - data_var = ChannelMonitor_clone(&data_var); - CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var); - data_ref = tag_ptr(data_var.inner, data_var.is_owned); - LDKMonitorUpdateId update_id_var = update_id; - int64_t update_id_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var); - update_id_ref = tag_ptr(update_id_var.inner, update_id_var.is_owned); + LDKChannelMonitorUpdate monitor_update_var = monitor_update; + int64_t monitor_update_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_update_var); + monitor_update_ref = tag_ptr(monitor_update_var.inner, monitor_update_var.is_owned); + LDKChannelMonitor monitor_var = *monitor; + int64_t monitor_ref = 0; + monitor_var = ChannelMonitor_clone(&monitor_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_var); + monitor_ref = tag_ptr(monitor_var.inner, monitor_var.is_owned); jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - jclass ret = (*env)->CallObjectMethod(env, obj, j_calls->update_persisted_channel_meth, channel_funding_outpoint_ref, update_ref, data_ref, update_id_ref); + jclass ret = (*env)->CallObjectMethod(env, obj, j_calls->update_persisted_channel_meth, channel_funding_outpoint_ref, monitor_update_ref, monitor_ref); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); (*env)->FatalError(env, "A call to update_persisted_channel in LDKPersist from rust threw an exception."); @@ -18318,9 +19206,9 @@ static inline LDKPersist LDKPersist_init (JNIEnv *env, jclass clz, jobject o) { atomic_init(&calls->refcnt, 1); DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->persist_new_channel_meth = (*env)->GetMethodID(env, c, "persist_new_channel", "(JJJ)Lorg/ldk/enums/ChannelMonitorUpdateStatus;"); + calls->persist_new_channel_meth = (*env)->GetMethodID(env, c, "persist_new_channel", "(JJ)Lorg/ldk/enums/ChannelMonitorUpdateStatus;"); CHECK(calls->persist_new_channel_meth != NULL); - calls->update_persisted_channel_meth = (*env)->GetMethodID(env, c, "update_persisted_channel", "(JJJJ)Lorg/ldk/enums/ChannelMonitorUpdateStatus;"); + calls->update_persisted_channel_meth = (*env)->GetMethodID(env, c, "update_persisted_channel", "(JJJ)Lorg/ldk/enums/ChannelMonitorUpdateStatus;"); CHECK(calls->update_persisted_channel_meth != NULL); calls->archive_persisted_channel_meth = (*env)->GetMethodID(env, c, "archive_persisted_channel", "(J)V"); CHECK(calls->archive_persisted_channel_meth != NULL); @@ -18339,7 +19227,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKPersist_1new(JNIEnv *env *res_ptr = LDKPersist_init(env, clz, o); return tag_ptr(res_ptr, true); } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Persist_1persist_1new_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_funding_outpoint, int64_t data, int64_t update_id) { +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Persist_1persist_1new_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_funding_outpoint, int64_t monitor) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr; @@ -18348,21 +19236,16 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Persist_1persist_1new_1chann channel_funding_outpoint_conv.is_owned = ptr_is_owned(channel_funding_outpoint); CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_funding_outpoint_conv); channel_funding_outpoint_conv = OutPoint_clone(&channel_funding_outpoint_conv); - LDKChannelMonitor data_conv; - data_conv.inner = untag_ptr(data); - data_conv.is_owned = ptr_is_owned(data); - CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv); - data_conv.is_owned = false; - LDKMonitorUpdateId update_id_conv; - update_id_conv.inner = untag_ptr(update_id); - update_id_conv.is_owned = ptr_is_owned(update_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv); - update_id_conv = MonitorUpdateId_clone(&update_id_conv); - jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, (this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_funding_outpoint_conv, &data_conv, update_id_conv)); + LDKChannelMonitor monitor_conv; + monitor_conv.inner = untag_ptr(monitor); + monitor_conv.is_owned = ptr_is_owned(monitor); + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_conv); + monitor_conv.is_owned = false; + jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, (this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_funding_outpoint_conv, &monitor_conv)); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Persist_1update_1persisted_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_funding_outpoint, int64_t update, int64_t data, int64_t update_id) { +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Persist_1update_1persisted_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_funding_outpoint, int64_t monitor_update, int64_t monitor) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr; @@ -18371,22 +19254,17 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Persist_1update_1persisted_1 channel_funding_outpoint_conv.is_owned = ptr_is_owned(channel_funding_outpoint); CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_funding_outpoint_conv); channel_funding_outpoint_conv = OutPoint_clone(&channel_funding_outpoint_conv); - LDKChannelMonitorUpdate update_conv; - update_conv.inner = untag_ptr(update); - update_conv.is_owned = ptr_is_owned(update); - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv); - update_conv = ChannelMonitorUpdate_clone(&update_conv); - LDKChannelMonitor data_conv; - data_conv.inner = untag_ptr(data); - data_conv.is_owned = ptr_is_owned(data); - CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv); - data_conv.is_owned = false; - LDKMonitorUpdateId update_id_conv; - update_id_conv.inner = untag_ptr(update_id); - update_id_conv.is_owned = ptr_is_owned(update_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv); - update_id_conv = MonitorUpdateId_clone(&update_id_conv); - jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, (this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_funding_outpoint_conv, update_conv, &data_conv, update_id_conv)); + LDKChannelMonitorUpdate monitor_update_conv; + monitor_update_conv.inner = untag_ptr(monitor_update); + monitor_update_conv.is_owned = ptr_is_owned(monitor_update); + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_update_conv); + monitor_update_conv = ChannelMonitorUpdate_clone(&monitor_update_conv); + LDKChannelMonitor monitor_conv; + monitor_conv.inner = untag_ptr(monitor); + monitor_conv.is_owned = ptr_is_owned(monitor); + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_conv); + monitor_conv.is_owned = false; + jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, (this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_funding_outpoint_conv, monitor_update_conv, &monitor_conv)); return ret_conv; } @@ -18962,7 +19840,7 @@ static void LDKEventHandler_JCalls_free(void* this_arg) { FREE(j_calls); } } -void handle_event_LDKEventHandler_jcall(const void* this_arg, LDKEvent event) { +LDKCResult_NoneReplayEventZ handle_event_LDKEventHandler_jcall(const void* this_arg, LDKEvent event) { LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -18976,14 +19854,19 @@ void handle_event_LDKEventHandler_jcall(const void* this_arg, LDKEvent event) { int64_t event_ref = tag_ptr(event_copy, true); jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - (*env)->CallVoidMethod(env, obj, j_calls->handle_event_meth, event_ref); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_event_meth, event_ref); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); (*env)->FatalError(env, "A call to handle_event in LDKEventHandler from rust threw an exception."); } + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_NoneReplayEventZ ret_conv = *(LDKCResult_NoneReplayEventZ*)(ret_ptr); + FREE(untag_ptr(ret)); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } + return ret_conv; } static void LDKEventHandler_JCalls_cloned(LDKEventHandler* new_obj) { LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) new_obj->this_arg; @@ -18996,7 +19879,7 @@ static inline LDKEventHandler LDKEventHandler_init (JNIEnv *env, jclass clz, job atomic_init(&calls->refcnt, 1); DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->handle_event_meth = (*env)->GetMethodID(env, c, "handle_event", "(J)V"); + calls->handle_event_meth = (*env)->GetMethodID(env, c, "handle_event", "(J)J"); CHECK(calls->handle_event_meth != NULL); LDKEventHandler ret = { @@ -19011,7 +19894,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKEventHandler_1new(JNIEnv *res_ptr = LDKEventHandler_init(env, clz, o); return tag_ptr(res_ptr, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventHandler_1handle_1event(JNIEnv *env, jclass clz, int64_t this_arg, int64_t event) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EventHandler_1handle_1event(JNIEnv *env, jclass clz, int64_t this_arg, int64_t event) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKEventHandler* this_arg_conv = (LDKEventHandler*)this_arg_ptr; @@ -19019,7 +19902,9 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventHandler_1handle_1event(JN CHECK_ACCESS(event_ptr); LDKEvent event_conv = *(LDKEvent*)(event_ptr); event_conv = Event_clone((LDKEvent*)untag_ptr(event)); - (this_arg_conv->handle_event)(this_arg_conv->this_arg, event_conv); + LDKCResult_NoneReplayEventZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneReplayEventZ), "LDKCResult_NoneReplayEventZ"); + *ret_conv = (this_arg_conv->handle_event)(this_arg_conv->this_arg, event_conv); + return tag_ptr(ret_conv, true); } typedef struct LDKEventsProvider_JCalls { @@ -20932,7 +21817,7 @@ static void LDKOffersMessageHandler_JCalls_free(void* this_arg) { FREE(j_calls); } } -LDKCOption_OffersMessageZ handle_message_LDKOffersMessageHandler_jcall(const void* this_arg, LDKOffersMessage message) { +LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ handle_message_LDKOffersMessageHandler_jcall(const void* this_arg, LDKOffersMessage message, LDKCOption_OffersContextZ context, LDKResponder responder) { LDKOffersMessageHandler_JCalls *j_calls = (LDKOffersMessageHandler_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -20944,23 +21829,30 @@ LDKCOption_OffersMessageZ handle_message_LDKOffersMessageHandler_jcall(const voi LDKOffersMessage *message_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); *message_copy = message; int64_t message_ref = tag_ptr(message_copy, true); + LDKCOption_OffersContextZ *context_copy = MALLOC(sizeof(LDKCOption_OffersContextZ), "LDKCOption_OffersContextZ"); + *context_copy = context; + int64_t context_ref = tag_ptr(context_copy, true); + LDKResponder responder_var = responder; + int64_t responder_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(responder_var); + responder_ref = tag_ptr(responder_var.inner, responder_var.is_owned); jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_message_meth, message_ref); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_message_meth, message_ref, context_ref, responder_ref); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); (*env)->FatalError(env, "A call to handle_message in LDKOffersMessageHandler from rust threw an exception."); } void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); - LDKCOption_OffersMessageZ ret_conv = *(LDKCOption_OffersMessageZ*)(ret_ptr); + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ ret_conv = *(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ*)(ret_ptr); FREE(untag_ptr(ret)); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } return ret_conv; } -LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ release_pending_messages_LDKOffersMessageHandler_jcall(const void* this_arg) { +LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ release_pending_messages_LDKOffersMessageHandler_jcall(const void* this_arg) { LDKOffersMessageHandler_JCalls *j_calls = (LDKOffersMessageHandler_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -20976,20 +21868,20 @@ LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ release_pending_messages_L (*env)->ExceptionDescribe(env); (*env)->FatalError(env, "A call to release_pending_messages in LDKOffersMessageHandler from rust threw an exception."); } - LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ ret_constr; + LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ ret_constr; ret_constr.datalen = (*env)->GetArrayLength(env, ret); if (ret_constr.datalen > 0) - ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC3Tuple_OffersMessageDestinationBlindedPathZ), "LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ Elements"); + ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_OffersMessageMessageSendInstructionsZ), "LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ Elements"); else ret_constr.data = NULL; int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL); - for (size_t x = 0; x < ret_constr.datalen; x++) { - int64_t ret_conv_49 = ret_vals[x]; - void* ret_conv_49_ptr = untag_ptr(ret_conv_49); - CHECK_ACCESS(ret_conv_49_ptr); - LDKC3Tuple_OffersMessageDestinationBlindedPathZ ret_conv_49_conv = *(LDKC3Tuple_OffersMessageDestinationBlindedPathZ*)(ret_conv_49_ptr); - FREE(untag_ptr(ret_conv_49)); - ret_constr.data[x] = ret_conv_49_conv; + for (size_t w = 0; w < ret_constr.datalen; w++) { + int64_t ret_conv_48 = ret_vals[w]; + void* ret_conv_48_ptr = untag_ptr(ret_conv_48); + CHECK_ACCESS(ret_conv_48_ptr); + LDKC2Tuple_OffersMessageMessageSendInstructionsZ ret_conv_48_conv = *(LDKC2Tuple_OffersMessageMessageSendInstructionsZ*)(ret_conv_48_ptr); + FREE(untag_ptr(ret_conv_48)); + ret_constr.data[w] = ret_conv_48_conv; } (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0); if (get_jenv_res == JNI_EDETACHED) { @@ -21008,7 +21900,7 @@ static inline LDKOffersMessageHandler LDKOffersMessageHandler_init (JNIEnv *env, atomic_init(&calls->refcnt, 1); DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->handle_message_meth = (*env)->GetMethodID(env, c, "handle_message", "(J)J"); + calls->handle_message_meth = (*env)->GetMethodID(env, c, "handle_message", "(JJJ)J"); CHECK(calls->handle_message_meth != NULL); calls->release_pending_messages_meth = (*env)->GetMethodID(env, c, "release_pending_messages", "()[J"); CHECK(calls->release_pending_messages_meth != NULL); @@ -21026,7 +21918,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKOffersMessageHandler_1ne *res_ptr = LDKOffersMessageHandler_init(env, clz, o); return tag_ptr(res_ptr, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessageHandler_1handle_1message(JNIEnv *env, jclass clz, int64_t this_arg, int64_t message) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessageHandler_1handle_1message(JNIEnv *env, jclass clz, int64_t this_arg, int64_t message, int64_t context, int64_t responder) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKOffersMessageHandler* this_arg_conv = (LDKOffersMessageHandler*)this_arg_ptr; @@ -21034,8 +21926,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessageHandler_1handl CHECK_ACCESS(message_ptr); LDKOffersMessage message_conv = *(LDKOffersMessage*)(message_ptr); message_conv = OffersMessage_clone((LDKOffersMessage*)untag_ptr(message)); - LDKCOption_OffersMessageZ *ret_copy = MALLOC(sizeof(LDKCOption_OffersMessageZ), "LDKCOption_OffersMessageZ"); - *ret_copy = (this_arg_conv->handle_message)(this_arg_conv->this_arg, message_conv); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKCOption_OffersContextZ context_conv = *(LDKCOption_OffersContextZ*)(context_ptr); + context_conv = COption_OffersContextZ_clone((LDKCOption_OffersContextZ*)untag_ptr(context)); + LDKResponder responder_conv; + responder_conv.inner = untag_ptr(responder); + responder_conv.is_owned = ptr_is_owned(responder); + CHECK_INNER_FIELD_ACCESS_OR_NULL(responder_conv); + responder_conv = Responder_clone(&responder_conv); + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ), "LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ"); + *ret_copy = (this_arg_conv->handle_message)(this_arg_conv->this_arg, message_conv, context_conv, responder_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -21044,14 +21945,215 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_OffersMessageHandler_1 void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKOffersMessageHandler* this_arg_conv = (LDKOffersMessageHandler*)this_arg_ptr; - LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ ret_var = (this_arg_conv->release_pending_messages)(this_arg_conv->this_arg); + LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ ret_var = (this_arg_conv->release_pending_messages)(this_arg_conv->this_arg); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t x = 0; x < ret_var.datalen; x++) { - LDKC3Tuple_OffersMessageDestinationBlindedPathZ* ret_conv_49_conv = MALLOC(sizeof(LDKC3Tuple_OffersMessageDestinationBlindedPathZ), "LDKC3Tuple_OffersMessageDestinationBlindedPathZ"); - *ret_conv_49_conv = ret_var.data[x]; - ret_arr_ptr[x] = tag_ptr(ret_conv_49_conv, true); + for (size_t w = 0; w < ret_var.datalen; w++) { + LDKC2Tuple_OffersMessageMessageSendInstructionsZ* ret_conv_48_conv = MALLOC(sizeof(LDKC2Tuple_OffersMessageMessageSendInstructionsZ), "LDKC2Tuple_OffersMessageMessageSendInstructionsZ"); + *ret_conv_48_conv = ret_var.data[w]; + ret_arr_ptr[w] = tag_ptr(ret_conv_48_conv, true); + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; +} + +typedef struct LDKAsyncPaymentsMessageHandler_JCalls { + atomic_size_t refcnt; + JavaVM *vm; + jweak o; + jmethodID held_htlc_available_meth; + jmethodID release_held_htlc_meth; + jmethodID release_pending_messages_meth; +} LDKAsyncPaymentsMessageHandler_JCalls; +static void LDKAsyncPaymentsMessageHandler_JCalls_free(void* this_arg) { + LDKAsyncPaymentsMessageHandler_JCalls *j_calls = (LDKAsyncPaymentsMessageHandler_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + JNIEnv *env; + jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK); + } else { + DO_ASSERT(get_jenv_res == JNI_OK); + } + (*env)->DeleteWeakGlobalRef(env, j_calls->o); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } + FREE(j_calls); + } +} +LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ held_htlc_available_LDKAsyncPaymentsMessageHandler_jcall(const void* this_arg, LDKHeldHtlcAvailable message, LDKResponder responder) { + LDKAsyncPaymentsMessageHandler_JCalls *j_calls = (LDKAsyncPaymentsMessageHandler_JCalls*) this_arg; + JNIEnv *env; + jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK); + } else { + DO_ASSERT(get_jenv_res == JNI_OK); + } + LDKHeldHtlcAvailable message_var = message; + int64_t message_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_var); + message_ref = tag_ptr(message_var.inner, message_var.is_owned); + LDKResponder responder_var = responder; + int64_t responder_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(responder_var); + responder_ref = tag_ptr(responder_var.inner, responder_var.is_owned); + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->held_htlc_available_meth, message_ref, responder_ref); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to held_htlc_available in LDKAsyncPaymentsMessageHandler from rust threw an exception."); + } + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ ret_conv = *(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ*)(ret_ptr); + FREE(untag_ptr(ret)); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } + return ret_conv; +} +void release_held_htlc_LDKAsyncPaymentsMessageHandler_jcall(const void* this_arg, LDKReleaseHeldHtlc message) { + LDKAsyncPaymentsMessageHandler_JCalls *j_calls = (LDKAsyncPaymentsMessageHandler_JCalls*) this_arg; + JNIEnv *env; + jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK); + } else { + DO_ASSERT(get_jenv_res == JNI_OK); + } + LDKReleaseHeldHtlc message_var = message; + int64_t message_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_var); + message_ref = tag_ptr(message_var.inner, message_var.is_owned); + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + (*env)->CallVoidMethod(env, obj, j_calls->release_held_htlc_meth, message_ref); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to release_held_htlc in LDKAsyncPaymentsMessageHandler from rust threw an exception."); + } + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } +} +LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ release_pending_messages_LDKAsyncPaymentsMessageHandler_jcall(const void* this_arg) { + LDKAsyncPaymentsMessageHandler_JCalls *j_calls = (LDKAsyncPaymentsMessageHandler_JCalls*) this_arg; + JNIEnv *env; + jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK); + } else { + DO_ASSERT(get_jenv_res == JNI_OK); + } + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->release_pending_messages_meth); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to release_pending_messages in LDKAsyncPaymentsMessageHandler from rust threw an exception."); + } + LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ ret_constr; + ret_constr.datalen = (*env)->GetArrayLength(env, ret); + if (ret_constr.datalen > 0) + ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ), "LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ Elements"); + else + ret_constr.data = NULL; + int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL); + for (size_t d = 0; d < ret_constr.datalen; d++) { + int64_t ret_conv_55 = ret_vals[d]; + void* ret_conv_55_ptr = untag_ptr(ret_conv_55); + CHECK_ACCESS(ret_conv_55_ptr); + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ ret_conv_55_conv = *(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ*)(ret_conv_55_ptr); + FREE(untag_ptr(ret_conv_55)); + ret_constr.data[d] = ret_conv_55_conv; + } + (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } + return ret_constr; +} +static void LDKAsyncPaymentsMessageHandler_JCalls_cloned(LDKAsyncPaymentsMessageHandler* new_obj) { + LDKAsyncPaymentsMessageHandler_JCalls *j_calls = (LDKAsyncPaymentsMessageHandler_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +} +static inline LDKAsyncPaymentsMessageHandler LDKAsyncPaymentsMessageHandler_init (JNIEnv *env, jclass clz, jobject o) { + jclass c = (*env)->GetObjectClass(env, o); + CHECK(c != NULL); + LDKAsyncPaymentsMessageHandler_JCalls *calls = MALLOC(sizeof(LDKAsyncPaymentsMessageHandler_JCalls), "LDKAsyncPaymentsMessageHandler_JCalls"); + atomic_init(&calls->refcnt, 1); + DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); + calls->o = (*env)->NewWeakGlobalRef(env, o); + calls->held_htlc_available_meth = (*env)->GetMethodID(env, c, "held_htlc_available", "(JJ)J"); + CHECK(calls->held_htlc_available_meth != NULL); + calls->release_held_htlc_meth = (*env)->GetMethodID(env, c, "release_held_htlc", "(J)V"); + CHECK(calls->release_held_htlc_meth != NULL); + calls->release_pending_messages_meth = (*env)->GetMethodID(env, c, "release_pending_messages", "()[J"); + CHECK(calls->release_pending_messages_meth != NULL); + + LDKAsyncPaymentsMessageHandler ret = { + .this_arg = (void*) calls, + .held_htlc_available = held_htlc_available_LDKAsyncPaymentsMessageHandler_jcall, + .release_held_htlc = release_held_htlc_LDKAsyncPaymentsMessageHandler_jcall, + .release_pending_messages = release_pending_messages_LDKAsyncPaymentsMessageHandler_jcall, + .free = LDKAsyncPaymentsMessageHandler_JCalls_free, + }; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKAsyncPaymentsMessageHandler_1new(JNIEnv *env, jclass clz, jobject o) { + LDKAsyncPaymentsMessageHandler *res_ptr = MALLOC(sizeof(LDKAsyncPaymentsMessageHandler), "LDKAsyncPaymentsMessageHandler"); + *res_ptr = LDKAsyncPaymentsMessageHandler_init(env, clz, o); + return tag_ptr(res_ptr, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessageHandler_1held_1htlc_1available(JNIEnv *env, jclass clz, int64_t this_arg, int64_t message, int64_t responder) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKAsyncPaymentsMessageHandler* this_arg_conv = (LDKAsyncPaymentsMessageHandler*)this_arg_ptr; + LDKHeldHtlcAvailable message_conv; + message_conv.inner = untag_ptr(message); + message_conv.is_owned = ptr_is_owned(message); + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_conv); + message_conv = HeldHtlcAvailable_clone(&message_conv); + LDKResponder responder_conv; + responder_conv.inner = untag_ptr(responder); + responder_conv.is_owned = ptr_is_owned(responder); + CHECK_INNER_FIELD_ACCESS_OR_NULL(responder_conv); + responder_conv = Responder_clone(&responder_conv); + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ), "LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ"); + *ret_copy = (this_arg_conv->held_htlc_available)(this_arg_conv->this_arg, message_conv, responder_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessageHandler_1release_1held_1htlc(JNIEnv *env, jclass clz, int64_t this_arg, int64_t message) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKAsyncPaymentsMessageHandler* this_arg_conv = (LDKAsyncPaymentsMessageHandler*)this_arg_ptr; + LDKReleaseHeldHtlc message_conv; + message_conv.inner = untag_ptr(message); + message_conv.is_owned = ptr_is_owned(message); + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_conv); + message_conv = ReleaseHeldHtlc_clone(&message_conv); + (this_arg_conv->release_held_htlc)(this_arg_conv->this_arg, message_conv); +} + +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessageHandler_1release_1pending_1messages(JNIEnv *env, jclass clz, int64_t this_arg) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKAsyncPaymentsMessageHandler* this_arg_conv = (LDKAsyncPaymentsMessageHandler*)this_arg_ptr; + LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ ret_var = (this_arg_conv->release_pending_messages)(this_arg_conv->this_arg); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t d = 0; d < ret_var.datalen; d++) { + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ* ret_conv_55_conv = MALLOC(sizeof(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ), "LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ"); + *ret_conv_55_conv = ret_var.data[d]; + ret_arr_ptr[d] = tag_ptr(ret_conv_55_conv, true); } (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); FREE(ret_var.data); @@ -21811,7 +22913,6 @@ typedef struct LDKOnionMessageHandler_JCalls { atomic_size_t refcnt; JavaVM *vm; jweak o; - jmethodID get_and_clear_connections_needed_meth; jmethodID handle_onion_message_meth; jmethodID next_onion_message_for_peer_meth; jmethodID peer_connected_meth; @@ -21837,43 +22938,6 @@ static void LDKOnionMessageHandler_JCalls_free(void* this_arg) { FREE(j_calls); } } -LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ get_and_clear_connections_needed_LDKOnionMessageHandler_jcall(const void* this_arg) { - LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg; - JNIEnv *env; - jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK); - } else { - DO_ASSERT(get_jenv_res == JNI_OK); - } - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_and_clear_connections_needed_meth); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to get_and_clear_connections_needed in LDKOnionMessageHandler from rust threw an exception."); - } - LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ ret_constr; - ret_constr.datalen = (*env)->GetArrayLength(env, ret); - if (ret_constr.datalen > 0) - ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ), "LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ Elements"); - else - ret_constr.data = NULL; - int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL); - for (size_t o = 0; o < ret_constr.datalen; o++) { - int64_t ret_conv_40 = ret_vals[o]; - void* ret_conv_40_ptr = untag_ptr(ret_conv_40); - CHECK_ACCESS(ret_conv_40_ptr); - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ ret_conv_40_conv = *(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ*)(ret_conv_40_ptr); - FREE(untag_ptr(ret_conv_40)); - ret_constr.data[o] = ret_conv_40_conv; - } - (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); - } - return ret_constr; -} void handle_onion_message_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey peer_node_id, const LDKOnionMessage * msg) { LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg; JNIEnv *env; @@ -22066,8 +23130,6 @@ static inline LDKOnionMessageHandler LDKOnionMessageHandler_init (JNIEnv *env, j atomic_init(&calls->refcnt, 1); DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->get_and_clear_connections_needed_meth = (*env)->GetMethodID(env, c, "get_and_clear_connections_needed", "()[J"); - CHECK(calls->get_and_clear_connections_needed_meth != NULL); calls->handle_onion_message_meth = (*env)->GetMethodID(env, c, "handle_onion_message", "([BJ)V"); CHECK(calls->handle_onion_message_meth != NULL); calls->next_onion_message_for_peer_meth = (*env)->GetMethodID(env, c, "next_onion_message_for_peer", "([B)J"); @@ -22085,7 +23147,6 @@ static inline LDKOnionMessageHandler LDKOnionMessageHandler_init (JNIEnv *env, j LDKOnionMessageHandler ret = { .this_arg = (void*) calls, - .get_and_clear_connections_needed = get_and_clear_connections_needed_LDKOnionMessageHandler_jcall, .handle_onion_message = handle_onion_message_LDKOnionMessageHandler_jcall, .next_onion_message_for_peer = next_onion_message_for_peer_LDKOnionMessageHandler_jcall, .peer_connected = peer_connected_LDKOnionMessageHandler_jcall, @@ -22102,24 +23163,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKOnionMessageHandler_1new *res_ptr = LDKOnionMessageHandler_init(env, clz, o); return tag_ptr(res_ptr, true); } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_OnionMessageHandler_1get_1and_1clear_1connections_1needed(JNIEnv *env, jclass clz, int64_t this_arg) { - void* this_arg_ptr = untag_ptr(this_arg); - if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr; - LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ ret_var = (this_arg_conv->get_and_clear_connections_needed)(this_arg_conv->this_arg); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t o = 0; o < ret_var.datalen; o++) { - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* ret_conv_40_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ), "LDKC2Tuple_PublicKeyCVec_SocketAddressZZ"); - *ret_conv_40_conv = ret_var.data[o]; - ret_arr_ptr[o] = tag_ptr(ret_conv_40_conv, true); - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; -} - JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessageHandler_1handle_1onion_1message(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray peer_node_id, int64_t msg) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } @@ -22306,6 +23349,8 @@ typedef struct LDKCustomMessageHandler_JCalls { LDKCustomMessageReader_JCalls* CustomMessageReader; jmethodID handle_custom_message_meth; jmethodID get_and_clear_pending_msg_meth; + jmethodID peer_disconnected_meth; + jmethodID peer_connected_meth; jmethodID provided_node_features_meth; jmethodID provided_init_features_meth; } LDKCustomMessageHandler_JCalls; @@ -22392,6 +23437,61 @@ LDKCVec_C2Tuple_PublicKeyTypeZZ get_and_clear_pending_msg_LDKCustomMessageHandle } return ret_constr; } +void peer_disconnected_LDKCustomMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id) { + LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg; + JNIEnv *env; + jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK); + } else { + DO_ASSERT(get_jenv_res == JNI_OK); + } + int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form); + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + (*env)->CallVoidMethod(env, obj, j_calls->peer_disconnected_meth, their_node_id_arr); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to peer_disconnected in LDKCustomMessageHandler from rust threw an exception."); + } + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } +} +LDKCResult_NoneNoneZ peer_connected_LDKCustomMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * msg, bool inbound) { + LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg; + JNIEnv *env; + jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK); + } else { + DO_ASSERT(get_jenv_res == JNI_OK); + } + int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form); + LDKInit msg_var = *msg; + int64_t msg_ref = 0; + msg_var = Init_clone(&msg_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); + msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); + jboolean inbound_conv = inbound; + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->peer_connected_meth, their_node_id_arr, msg_ref, inbound_conv); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to peer_connected in LDKCustomMessageHandler from rust threw an exception."); + } + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr); + FREE(untag_ptr(ret)); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } + return ret_conv; +} LDKNodeFeatures provided_node_features_LDKCustomMessageHandler_jcall(const void* this_arg) { LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg; JNIEnv *env; @@ -22460,6 +23560,10 @@ static inline LDKCustomMessageHandler LDKCustomMessageHandler_init (JNIEnv *env, CHECK(calls->handle_custom_message_meth != NULL); calls->get_and_clear_pending_msg_meth = (*env)->GetMethodID(env, c, "get_and_clear_pending_msg", "()[J"); CHECK(calls->get_and_clear_pending_msg_meth != NULL); + calls->peer_disconnected_meth = (*env)->GetMethodID(env, c, "peer_disconnected", "([B)V"); + CHECK(calls->peer_disconnected_meth != NULL); + calls->peer_connected_meth = (*env)->GetMethodID(env, c, "peer_connected", "([BJZ)J"); + CHECK(calls->peer_connected_meth != NULL); calls->provided_node_features_meth = (*env)->GetMethodID(env, c, "provided_node_features", "()J"); CHECK(calls->provided_node_features_meth != NULL); calls->provided_init_features_meth = (*env)->GetMethodID(env, c, "provided_init_features", "([B)J"); @@ -22469,6 +23573,8 @@ static inline LDKCustomMessageHandler LDKCustomMessageHandler_init (JNIEnv *env, .this_arg = (void*) calls, .handle_custom_message = handle_custom_message_LDKCustomMessageHandler_jcall, .get_and_clear_pending_msg = get_and_clear_pending_msg_LDKCustomMessageHandler_jcall, + .peer_disconnected = peer_disconnected_LDKCustomMessageHandler_jcall, + .peer_connected = peer_connected_LDKCustomMessageHandler_jcall, .provided_node_features = provided_node_features_LDKCustomMessageHandler_jcall, .provided_init_features = provided_init_features_LDKCustomMessageHandler_jcall, .free = LDKCustomMessageHandler_JCalls_free, @@ -22523,6 +23629,33 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CustomMessageHandler_1 return ret_arr; } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomMessageHandler_1peer_1disconnected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr; + LDKPublicKey their_node_id_ref; + CHECK((*env)->GetArrayLength(env, their_node_id) == 33); + (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form); + (this_arg_conv->peer_disconnected)(this_arg_conv->this_arg, their_node_id_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CustomMessageHandler_1peer_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg, jboolean inbound) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr; + LDKPublicKey their_node_id_ref; + CHECK((*env)->GetArrayLength(env, their_node_id) == 33); + (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form); + LDKInit msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv, inbound); + return tag_ptr(ret_conv, true); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CustomMessageHandler_1provided_1node_1features(JNIEnv *env, jclass clz, int64_t this_arg) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } @@ -22573,7 +23706,7 @@ static void LDKCustomOnionMessageHandler_JCalls_free(void* this_arg) { FREE(j_calls); } } -LDKCOption_OnionMessageContentsZ handle_custom_message_LDKCustomOnionMessageHandler_jcall(const void* this_arg, LDKOnionMessageContents msg) { +LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ handle_custom_message_LDKCustomOnionMessageHandler_jcall(const void* this_arg, LDKOnionMessageContents message, LDKCOption_CVec_u8ZZ context, LDKResponder responder) { LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -22582,18 +23715,25 @@ LDKCOption_OnionMessageContentsZ handle_custom_message_LDKCustomOnionMessageHand } else { DO_ASSERT(get_jenv_res == JNI_OK); } - LDKOnionMessageContents* msg_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); - *msg_ret = msg; + LDKOnionMessageContents* message_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *message_ret = message; + LDKCOption_CVec_u8ZZ *context_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *context_copy = context; + int64_t context_ref = tag_ptr(context_copy, true); + LDKResponder responder_var = responder; + int64_t responder_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(responder_var); + responder_ref = tag_ptr(responder_var.inner, responder_var.is_owned); jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_custom_message_meth, tag_ptr(msg_ret, true)); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_custom_message_meth, tag_ptr(message_ret, true), context_ref, responder_ref); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); (*env)->FatalError(env, "A call to handle_custom_message in LDKCustomOnionMessageHandler from rust threw an exception."); } void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); - LDKCOption_OnionMessageContentsZ ret_conv = *(LDKCOption_OnionMessageContentsZ*)(ret_ptr); + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ ret_conv = *(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ*)(ret_ptr); FREE(untag_ptr(ret)); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -22629,7 +23769,7 @@ LDKCResult_COption_OnionMessageContentsZDecodeErrorZ read_custom_message_LDKCust } return ret_conv; } -LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ release_pending_custom_messages_LDKCustomOnionMessageHandler_jcall(const void* this_arg) { +LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ release_pending_custom_messages_LDKCustomOnionMessageHandler_jcall(const void* this_arg) { LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -22645,20 +23785,20 @@ LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ release_pending_cus (*env)->ExceptionDescribe(env); (*env)->FatalError(env, "A call to release_pending_custom_messages in LDKCustomOnionMessageHandler from rust threw an exception."); } - LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ ret_constr; + LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ ret_constr; ret_constr.datalen = (*env)->GetArrayLength(env, ret); if (ret_constr.datalen > 0) - ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ), "LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ Elements"); + ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ), "LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ Elements"); else ret_constr.data = NULL; int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL); - for (size_t e = 0; e < ret_constr.datalen; e++) { - int64_t ret_conv_56 = ret_vals[e]; - void* ret_conv_56_ptr = untag_ptr(ret_conv_56); - CHECK_ACCESS(ret_conv_56_ptr); - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ ret_conv_56_conv = *(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ*)(ret_conv_56_ptr); - FREE(untag_ptr(ret_conv_56)); - ret_constr.data[e] = ret_conv_56_conv; + for (size_t d = 0; d < ret_constr.datalen; d++) { + int64_t ret_conv_55 = ret_vals[d]; + void* ret_conv_55_ptr = untag_ptr(ret_conv_55); + CHECK_ACCESS(ret_conv_55_ptr); + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ ret_conv_55_conv = *(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ*)(ret_conv_55_ptr); + FREE(untag_ptr(ret_conv_55)); + ret_constr.data[d] = ret_conv_55_conv; } (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0); if (get_jenv_res == JNI_EDETACHED) { @@ -22677,7 +23817,7 @@ static inline LDKCustomOnionMessageHandler LDKCustomOnionMessageHandler_init (JN atomic_init(&calls->refcnt, 1); DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->handle_custom_message_meth = (*env)->GetMethodID(env, c, "handle_custom_message", "(J)J"); + calls->handle_custom_message_meth = (*env)->GetMethodID(env, c, "handle_custom_message", "(JJJ)J"); CHECK(calls->handle_custom_message_meth != NULL); calls->read_custom_message_meth = (*env)->GetMethodID(env, c, "read_custom_message", "(J[B)J"); CHECK(calls->read_custom_message_meth != NULL); @@ -22698,19 +23838,28 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCustomOnionMessageHandle *res_ptr = LDKCustomOnionMessageHandler_init(env, clz, o); return tag_ptr(res_ptr, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageHandler_1handle_1custom_1message(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageHandler_1handle_1custom_1message(JNIEnv *env, jclass clz, int64_t this_arg, int64_t message, int64_t context, int64_t responder) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKCustomOnionMessageHandler* this_arg_conv = (LDKCustomOnionMessageHandler*)this_arg_ptr; - void* msg_ptr = untag_ptr(msg); - CHECK_ACCESS(msg_ptr); - LDKOnionMessageContents msg_conv = *(LDKOnionMessageContents*)(msg_ptr); - if (msg_conv.free == LDKOnionMessageContents_JCalls_free) { + void* message_ptr = untag_ptr(message); + CHECK_ACCESS(message_ptr); + LDKOnionMessageContents message_conv = *(LDKOnionMessageContents*)(message_ptr); + if (message_conv.free == LDKOnionMessageContents_JCalls_free) { // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKOnionMessageContents_JCalls_cloned(&msg_conv); + LDKOnionMessageContents_JCalls_cloned(&message_conv); } - LDKCOption_OnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_OnionMessageContentsZ), "LDKCOption_OnionMessageContentsZ"); - *ret_copy = (this_arg_conv->handle_custom_message)(this_arg_conv->this_arg, msg_conv); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKCOption_CVec_u8ZZ context_conv = *(LDKCOption_CVec_u8ZZ*)(context_ptr); + context_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(context)); + LDKResponder responder_conv; + responder_conv.inner = untag_ptr(responder); + responder_conv.is_owned = ptr_is_owned(responder); + CHECK_INNER_FIELD_ACCESS_OR_NULL(responder_conv); + responder_conv = Responder_clone(&responder_conv); + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ), "LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ"); + *ret_copy = (this_arg_conv->handle_custom_message)(this_arg_conv->this_arg, message_conv, context_conv, responder_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -22732,14 +23881,14 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageHand void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKCustomOnionMessageHandler* this_arg_conv = (LDKCustomOnionMessageHandler*)this_arg_ptr; - LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ ret_var = (this_arg_conv->release_pending_custom_messages)(this_arg_conv->this_arg); + LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ ret_var = (this_arg_conv->release_pending_custom_messages)(this_arg_conv->this_arg); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t e = 0; e < ret_var.datalen; e++) { - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ* ret_conv_56_conv = MALLOC(sizeof(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ), "LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ"); - *ret_conv_56_conv = ret_var.data[e]; - ret_arr_ptr[e] = tag_ptr(ret_conv_56_conv, true); + for (size_t d = 0; d < ret_var.datalen; d++) { + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ* ret_conv_55_conv = MALLOC(sizeof(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ), "LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ"); + *ret_conv_55_conv = ret_var.data[d]; + ret_arr_ptr[d] = tag_ptr(ret_conv_55_conv, true); } (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); FREE(ret_var.data); @@ -22924,6 +24073,55 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1hash(JNIE return ret_conv; } +static jclass LDKBolt12PaymentError_UnexpectedInvoice_class = NULL; +static jmethodID LDKBolt12PaymentError_UnexpectedInvoice_meth = NULL; +static jclass LDKBolt12PaymentError_DuplicateInvoice_class = NULL; +static jmethodID LDKBolt12PaymentError_DuplicateInvoice_meth = NULL; +static jclass LDKBolt12PaymentError_UnknownRequiredFeatures_class = NULL; +static jmethodID LDKBolt12PaymentError_UnknownRequiredFeatures_meth = NULL; +static jclass LDKBolt12PaymentError_SendingFailed_class = NULL; +static jmethodID LDKBolt12PaymentError_SendingFailed_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKBolt12PaymentError_init (JNIEnv *env, jclass clz) { + LDKBolt12PaymentError_UnexpectedInvoice_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt12PaymentError$UnexpectedInvoice")); + CHECK(LDKBolt12PaymentError_UnexpectedInvoice_class != NULL); + LDKBolt12PaymentError_UnexpectedInvoice_meth = (*env)->GetMethodID(env, LDKBolt12PaymentError_UnexpectedInvoice_class, "", "()V"); + CHECK(LDKBolt12PaymentError_UnexpectedInvoice_meth != NULL); + LDKBolt12PaymentError_DuplicateInvoice_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt12PaymentError$DuplicateInvoice")); + CHECK(LDKBolt12PaymentError_DuplicateInvoice_class != NULL); + LDKBolt12PaymentError_DuplicateInvoice_meth = (*env)->GetMethodID(env, LDKBolt12PaymentError_DuplicateInvoice_class, "", "()V"); + CHECK(LDKBolt12PaymentError_DuplicateInvoice_meth != NULL); + LDKBolt12PaymentError_UnknownRequiredFeatures_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt12PaymentError$UnknownRequiredFeatures")); + CHECK(LDKBolt12PaymentError_UnknownRequiredFeatures_class != NULL); + LDKBolt12PaymentError_UnknownRequiredFeatures_meth = (*env)->GetMethodID(env, LDKBolt12PaymentError_UnknownRequiredFeatures_class, "", "()V"); + CHECK(LDKBolt12PaymentError_UnknownRequiredFeatures_meth != NULL); + LDKBolt12PaymentError_SendingFailed_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt12PaymentError$SendingFailed")); + CHECK(LDKBolt12PaymentError_SendingFailed_class != NULL); + LDKBolt12PaymentError_SendingFailed_meth = (*env)->GetMethodID(env, LDKBolt12PaymentError_SendingFailed_class, "", "(Lorg/ldk/enums/RetryableSendFailure;)V"); + CHECK(LDKBolt12PaymentError_SendingFailed_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBolt12PaymentError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKBolt12PaymentError *obj = (LDKBolt12PaymentError*)untag_ptr(ptr); + switch(obj->tag) { + case LDKBolt12PaymentError_UnexpectedInvoice: { + return (*env)->NewObject(env, LDKBolt12PaymentError_UnexpectedInvoice_class, LDKBolt12PaymentError_UnexpectedInvoice_meth); + } + case LDKBolt12PaymentError_DuplicateInvoice: { + return (*env)->NewObject(env, LDKBolt12PaymentError_DuplicateInvoice_class, LDKBolt12PaymentError_DuplicateInvoice_meth); + } + case LDKBolt12PaymentError_UnknownRequiredFeatures: { + return (*env)->NewObject(env, LDKBolt12PaymentError_UnknownRequiredFeatures_class, LDKBolt12PaymentError_UnknownRequiredFeatures_meth); + } + case LDKBolt12PaymentError_SendingFailed: { + jclass sending_failed_conv = LDKRetryableSendFailure_to_java(env, obj->sending_failed); + return (*env)->NewObject(env, LDKBolt12PaymentError_SendingFailed_class, LDKBolt12PaymentError_SendingFailed_meth, sending_failed_conv); + } + default: abort(); + } +} typedef struct LDKSignBolt12InvoiceFn_JCalls { atomic_size_t refcnt; JavaVM *vm; @@ -23232,15 +24430,16 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPayee_1ref_1from_1ptr(JN LDKPayee *obj = (LDKPayee*)untag_ptr(ptr); switch(obj->tag) { case LDKPayee_Blinded: { - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ route_hints_var = obj->blinded.route_hints; + LDKCVec_BlindedPaymentPathZ route_hints_var = obj->blinded.route_hints; int64_tArray route_hints_arr = NULL; route_hints_arr = (*env)->NewLongArray(env, route_hints_var.datalen); int64_t *route_hints_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, route_hints_arr, NULL); - for (size_t l = 0; l < route_hints_var.datalen; l++) { - LDKC2Tuple_BlindedPayInfoBlindedPathZ* route_hints_conv_37_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ"); - *route_hints_conv_37_conv = route_hints_var.data[l]; - *route_hints_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone(route_hints_conv_37_conv); - route_hints_arr_ptr[l] = tag_ptr(route_hints_conv_37_conv, true); + for (size_t u = 0; u < route_hints_var.datalen; u++) { + LDKBlindedPaymentPath route_hints_conv_20_var = route_hints_var.data[u]; + int64_t route_hints_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_hints_conv_20_var); + route_hints_conv_20_ref = tag_ptr(route_hints_conv_20_var.inner, false); + route_hints_arr_ptr[u] = route_hints_conv_20_ref; } (*env)->ReleasePrimitiveArrayCritical(env, route_hints_arr, route_hints_arr_ptr, 0); LDKBolt12InvoiceFeatures features_var = obj->blinded.features; @@ -24288,24 +25487,78 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1clone(JNIEnv return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1BlindedPathZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_BlindedPathZ _res_constr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1BlindedMessagePathZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_BlindedMessagePathZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKBlindedPath), "LDKCVec_BlindedPathZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKBlindedMessagePath), "LDKCVec_BlindedMessagePathZ Elements"); else _res_constr.data = NULL; int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t n = 0; n < _res_constr.datalen; n++) { - int64_t _res_conv_13 = _res_vals[n]; - LDKBlindedPath _res_conv_13_conv; - _res_conv_13_conv.inner = untag_ptr(_res_conv_13); - _res_conv_13_conv.is_owned = ptr_is_owned(_res_conv_13); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_13_conv); - _res_constr.data[n] = _res_conv_13_conv; + for (size_t u = 0; u < _res_constr.datalen; u++) { + int64_t _res_conv_20 = _res_vals[u]; + LDKBlindedMessagePath _res_conv_20_conv; + _res_conv_20_conv.inner = untag_ptr(_res_conv_20); + _res_conv_20_conv.is_owned = ptr_is_owned(_res_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_20_conv); + _res_constr.data[u] = _res_conv_20_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_BlindedPathZ_free(_res_constr); + CVec_BlindedMessagePathZ_free(_res_constr); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RefundDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKRefund o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = Refund_clone(&o_conv); + LDKCResult_RefundDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundDecodeErrorZ), "LDKCResult_RefundDecodeErrorZ"); + *ret_conv = CResult_RefundDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RefundDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_RefundDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundDecodeErrorZ), "LDKCResult_RefundDecodeErrorZ"); + *ret_conv = CResult_RefundDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RefundDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RefundDecodeErrorZ* o_conv = (LDKCResult_RefundDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_RefundDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RefundDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_RefundDecodeErrorZ _res_conv = *(LDKCResult_RefundDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_RefundDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_RefundDecodeErrorZ_clone_ptr(LDKCResult_RefundDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RefundDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundDecodeErrorZ), "LDKCResult_RefundDecodeErrorZ"); + *ret_conv = CResult_RefundDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RefundDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RefundDecodeErrorZ* arg_conv = (LDKCResult_RefundDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_RefundDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RefundDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_RefundDecodeErrorZ* orig_conv = (LDKCResult_RefundDecodeErrorZ*)untag_ptr(orig); + LDKCResult_RefundDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundDecodeErrorZ), "LDKCResult_RefundDecodeErrorZ"); + *ret_conv = CResult_RefundDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RefundBolt12ParseErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { @@ -24909,6 +26162,21 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SchnorrSignatureNo return tag_ptr(ret_conv, true); } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1StrZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) { + LDKCVec_StrZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKStr), "LDKCVec_StrZ Elements"); + else + _res_constr.data = NULL; + for (size_t i = 0; i < _res_constr.datalen; i++) { + jstring _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i); + LDKStr dummy = { .chars = NULL, .len = 0, .chars_is_owned = false }; + _res_constr.data[i] = dummy; + } + CVec_StrZ_free(_res_constr); +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ThirtyTwoBytesZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) { LDKCVec_ThirtyTwoBytesZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); @@ -25124,57 +26392,57 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesNone return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKBlindedPayInfo o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKBolt12Invoice o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = BlindedPayInfo_clone(&o_conv); - LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); - *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_ok(o_conv); + o_conv = Bolt12Invoice_clone(&o_conv); + LDKCResult_Bolt12InvoiceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceDecodeErrorZ), "LDKCResult_Bolt12InvoiceDecodeErrorZ"); + *ret_conv = CResult_Bolt12InvoiceDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); - *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_err(e_conv); + LDKCResult_Bolt12InvoiceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceDecodeErrorZ), "LDKCResult_Bolt12InvoiceDecodeErrorZ"); + *ret_conv = CResult_Bolt12InvoiceDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_BlindedPayInfoDecodeErrorZ* o_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_BlindedPayInfoDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_Bolt12InvoiceDecodeErrorZ* o_conv = (LDKCResult_Bolt12InvoiceDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_Bolt12InvoiceDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_BlindedPayInfoDecodeErrorZ _res_conv = *(LDKCResult_BlindedPayInfoDecodeErrorZ*)(_res_ptr); + LDKCResult_Bolt12InvoiceDecodeErrorZ _res_conv = *(LDKCResult_Bolt12InvoiceDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_BlindedPayInfoDecodeErrorZ_free(_res_conv); + CResult_Bolt12InvoiceDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_BlindedPayInfoDecodeErrorZ_clone_ptr(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); - *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_clone(arg); +static inline uint64_t CResult_Bolt12InvoiceDecodeErrorZ_clone_ptr(LDKCResult_Bolt12InvoiceDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_Bolt12InvoiceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceDecodeErrorZ), "LDKCResult_Bolt12InvoiceDecodeErrorZ"); + *ret_conv = CResult_Bolt12InvoiceDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_BlindedPayInfoDecodeErrorZ* arg_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_BlindedPayInfoDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_Bolt12InvoiceDecodeErrorZ* arg_conv = (LDKCResult_Bolt12InvoiceDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_Bolt12InvoiceDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_BlindedPayInfoDecodeErrorZ* orig_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(orig); - LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); - *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_Bolt12InvoiceDecodeErrorZ* orig_conv = (LDKCResult_Bolt12InvoiceDecodeErrorZ*)untag_ptr(orig); + LDKCResult_Bolt12InvoiceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceDecodeErrorZ), "LDKCResult_Bolt12InvoiceDecodeErrorZ"); + *ret_conv = CResult_Bolt12InvoiceDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -25616,51 +26884,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCDescriptorDeco return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1ok(JNIEnv *env, jclass clz) { - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = CResult_NoneNoneZ_ok(); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = CResult_NoneNoneZ_err(); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_NoneNoneZ* o_conv = (LDKCResult_NoneNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_NoneNoneZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_NoneNoneZ _res_conv = *(LDKCResult_NoneNoneZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_NoneNoneZ_free(_res_conv); -} - -static inline uint64_t CResult_NoneNoneZ_clone_ptr(LDKCResult_NoneNoneZ *NONNULL_PTR arg) { - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = CResult_NoneNoneZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_NoneNoneZ* arg_conv = (LDKCResult_NoneNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_NoneNoneZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_NoneNoneZ* orig_conv = (LDKCResult_NoneNoneZ*)untag_ptr(orig); - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = CResult_NoneNoneZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) { LDKPublicKey o_ref; CHECK((*env)->GetArrayLength(env, o) == 33); @@ -25709,6 +26932,99 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1cl return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832NoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) { + LDKThirtyTwoBytes o_ref; + CHECK((*env)->GetArrayLength(env, o) == 32); + (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.data); + LDKCResult__u832NoneZ* ret_conv = MALLOC(sizeof(LDKCResult__u832NoneZ), "LDKCResult__u832NoneZ"); + *ret_conv = CResult__u832NoneZ_ok(o_ref); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832NoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult__u832NoneZ* ret_conv = MALLOC(sizeof(LDKCResult__u832NoneZ), "LDKCResult__u832NoneZ"); + *ret_conv = CResult__u832NoneZ_err(); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832NoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult__u832NoneZ* o_conv = (LDKCResult__u832NoneZ*)untag_ptr(o); + jboolean ret_conv = CResult__u832NoneZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832NoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult__u832NoneZ _res_conv = *(LDKCResult__u832NoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult__u832NoneZ_free(_res_conv); +} + +static inline uint64_t CResult__u832NoneZ_clone_ptr(LDKCResult__u832NoneZ *NONNULL_PTR arg) { + LDKCResult__u832NoneZ* ret_conv = MALLOC(sizeof(LDKCResult__u832NoneZ), "LDKCResult__u832NoneZ"); + *ret_conv = CResult__u832NoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832NoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult__u832NoneZ* arg_conv = (LDKCResult__u832NoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult__u832NoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832NoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult__u832NoneZ* orig_conv = (LDKCResult__u832NoneZ*)untag_ptr(orig); + LDKCResult__u832NoneZ* ret_conv = MALLOC(sizeof(LDKCResult__u832NoneZ), "LDKCResult__u832NoneZ"); + *ret_conv = CResult__u832NoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1ok(JNIEnv *env, jclass clz) { + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = CResult_NoneNoneZ_ok(); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = CResult_NoneNoneZ_err(); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneNoneZ* o_conv = (LDKCResult_NoneNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_NoneNoneZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_NoneNoneZ _res_conv = *(LDKCResult_NoneNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_NoneNoneZ_free(_res_conv); +} + +static inline uint64_t CResult_NoneNoneZ_clone_ptr(LDKCResult_NoneNoneZ *NONNULL_PTR arg) { + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = CResult_NoneNoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NoneNoneZ* arg_conv = (LDKCResult_NoneNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_NoneNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_NoneNoneZ* orig_conv = (LDKCResult_NoneNoneZ*)untag_ptr(orig); + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = CResult_NoneNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1BigEndianScalarZ_1some(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -25756,23 +27072,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1BigEndianScalarZ_1 return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1U5Z_1free(JNIEnv *env, jclass clz, jobjectArray _res) { - LDKCVec_U5Z _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKU5), "LDKCVec_U5Z Elements"); - else - _res_constr.data = NULL; - int8_t* _res_vals = (*env)->GetByteArrayElements (env, _res, NULL); - for (size_t h = 0; h < _res_constr.datalen; h++) { - int8_t _res_conv_7 = _res_vals[h]; - - _res_constr.data[h] = (LDKU5){ ._0 = _res_conv_7 }; - } - (*env)->ReleaseByteArrayElements(env, _res, _res_vals, 0); - CVec_U5Z_free(_res_constr); -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) { LDKRecoverableSignature o_ref; CHECK((*env)->GetArrayLength(env, o) == 68); @@ -25919,59 +27218,59 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1 return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1EcdsaChannelSignerDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); - LDKWriteableEcdsaChannelSigner o_conv = *(LDKWriteableEcdsaChannelSigner*)(o_ptr); - if (o_conv.free == LDKWriteableEcdsaChannelSigner_JCalls_free) { + LDKEcdsaChannelSigner o_conv = *(LDKEcdsaChannelSigner*)(o_ptr); + if (o_conv.free == LDKEcdsaChannelSigner_JCalls_free) { // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKWriteableEcdsaChannelSigner_JCalls_cloned(&o_conv); + LDKEcdsaChannelSigner_JCalls_cloned(&o_conv); } - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ), "LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ"); - *ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(o_conv); + LDKCResult_EcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_EcdsaChannelSignerDecodeErrorZ), "LDKCResult_EcdsaChannelSignerDecodeErrorZ"); + *ret_conv = CResult_EcdsaChannelSignerDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1EcdsaChannelSignerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ), "LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ"); - *ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err(e_conv); + LDKCResult_EcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_EcdsaChannelSignerDecodeErrorZ), "LDKCResult_EcdsaChannelSignerDecodeErrorZ"); + *ret_conv = CResult_EcdsaChannelSignerDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* o_conv = (LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1EcdsaChannelSignerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_EcdsaChannelSignerDecodeErrorZ* o_conv = (LDKCResult_EcdsaChannelSignerDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_EcdsaChannelSignerDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1EcdsaChannelSignerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ _res_conv = *(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)(_res_ptr); + LDKCResult_EcdsaChannelSignerDecodeErrorZ _res_conv = *(LDKCResult_EcdsaChannelSignerDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free(_res_conv); + CResult_EcdsaChannelSignerDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone_ptr(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ), "LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ"); - *ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(arg); +static inline uint64_t CResult_EcdsaChannelSignerDecodeErrorZ_clone_ptr(LDKCResult_EcdsaChannelSignerDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_EcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_EcdsaChannelSignerDecodeErrorZ), "LDKCResult_EcdsaChannelSignerDecodeErrorZ"); + *ret_conv = CResult_EcdsaChannelSignerDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* arg_conv = (LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1EcdsaChannelSignerDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_EcdsaChannelSignerDecodeErrorZ* arg_conv = (LDKCResult_EcdsaChannelSignerDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_EcdsaChannelSignerDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* orig_conv = (LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)untag_ptr(orig); - LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ), "LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ"); - *ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1EcdsaChannelSignerDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_EcdsaChannelSignerDecodeErrorZ* orig_conv = (LDKCResult_EcdsaChannelSignerDecodeErrorZ*)untag_ptr(orig); + LDKCResult_EcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_EcdsaChannelSignerDecodeErrorZ), "LDKCResult_EcdsaChannelSignerDecodeErrorZ"); + *ret_conv = CResult_EcdsaChannelSignerDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -26455,6 +27754,101 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneIOErrorZ_1clon return tag_ptr(ret_conv, true); } +static inline uint64_t C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone_ptr(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR arg) { + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ), "LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ"); + *ret_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* arg_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(arg); + int64_t ret_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* orig_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(orig); + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ), "LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ"); + *ret_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b, int64_t c) { + LDKThirtyTwoBytes a_ref; + CHECK((*env)->GetArrayLength(env, a) == 32); + (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data); + LDKRecipientOnionFields b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv = RecipientOnionFields_clone(&b_conv); + LDKRouteParameters c_conv; + c_conv.inner = untag_ptr(c); + c_conv.is_owned = ptr_is_owned(c); + CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv); + c_conv = RouteParameters_clone(&c_conv); + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ), "LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ"); + *ret_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new(a_ref, b_conv, c_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ _res_conv = *(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(_res_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ o_conv = *(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)(o_ptr); + o_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone((LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(o)); + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); + *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); + *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err(); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* o_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ _res_conv = *(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(_res_conv); +} + +static inline uint64_t CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone_ptr(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR arg) { + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); + *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* arg_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* orig_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(orig); + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); + *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { LDKCVec_ChannelDetailsZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); @@ -26530,127 +27924,85 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErro return tag_ptr(ret_conv, true); } -static inline uint64_t C2Tuple_BlindedPayInfoBlindedPathZ_clone_ptr(LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR arg) { - LDKC2Tuple_BlindedPayInfoBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ"); - *ret_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlindedPayInfoBlindedPathZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC2Tuple_BlindedPayInfoBlindedPathZ* arg_conv = (LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(arg); - int64_t ret_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlindedPayInfoBlindedPathZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC2Tuple_BlindedPayInfoBlindedPathZ* orig_conv = (LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(orig); - LDKC2Tuple_BlindedPayInfoBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ"); - *ret_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlindedPayInfoBlindedPathZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKBlindedPayInfo a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = BlindedPayInfo_clone(&a_conv); - LDKBlindedPath b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv = BlindedPath_clone(&b_conv); - LDKC2Tuple_BlindedPayInfoBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ"); - *ret_conv = C2Tuple_BlindedPayInfoBlindedPathZ_new(a_conv, b_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlindedPayInfoBlindedPathZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ _res_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(_res_ptr); - FREE(untag_ptr(_res)); - C2Tuple_BlindedPayInfoBlindedPathZ_free(_res_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1BlindedPayInfoBlindedPathZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ _res_constr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1BlindedPaymentPathZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_BlindedPaymentPathZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); else _res_constr.data = NULL; int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t l = 0; l < _res_constr.datalen; l++) { - int64_t _res_conv_37 = _res_vals[l]; - void* _res_conv_37_ptr = untag_ptr(_res_conv_37); - CHECK_ACCESS(_res_conv_37_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ _res_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(_res_conv_37_ptr); - FREE(untag_ptr(_res_conv_37)); - _res_constr.data[l] = _res_conv_37_conv; + for (size_t u = 0; u < _res_constr.datalen; u++) { + int64_t _res_conv_20 = _res_vals[u]; + LDKBlindedPaymentPath _res_conv_20_conv; + _res_conv_20_conv.inner = untag_ptr(_res_conv_20); + _res_conv_20_conv.is_owned = ptr_is_owned(_res_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_20_conv); + _res_constr.data[u] = _res_conv_20_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_free(_res_constr); + CVec_BlindedPaymentPathZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlindedPayInfoBlindedPathZZNoneZ_1ok(JNIEnv *env, jclass clz, int64_tArray o) { - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ o_constr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPaymentPathZNoneZ_1ok(JNIEnv *env, jclass clz, int64_tArray o) { + LDKCVec_BlindedPaymentPathZ o_constr; o_constr.datalen = (*env)->GetArrayLength(env, o); if (o_constr.datalen > 0) - o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); + o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); else o_constr.data = NULL; int64_t* o_vals = (*env)->GetLongArrayElements (env, o, NULL); - for (size_t l = 0; l < o_constr.datalen; l++) { - int64_t o_conv_37 = o_vals[l]; - void* o_conv_37_ptr = untag_ptr(o_conv_37); - CHECK_ACCESS(o_conv_37_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ o_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(o_conv_37_ptr); - o_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(o_conv_37)); - o_constr.data[l] = o_conv_37_conv; + for (size_t u = 0; u < o_constr.datalen; u++) { + int64_t o_conv_20 = o_vals[u]; + LDKBlindedPaymentPath o_conv_20_conv; + o_conv_20_conv.inner = untag_ptr(o_conv_20); + o_conv_20_conv.is_owned = ptr_is_owned(o_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv_20_conv); + o_conv_20_conv = BlindedPaymentPath_clone(&o_conv_20_conv); + o_constr.data[u] = o_conv_20_conv; } (*env)->ReleaseLongArrayElements(env, o, o_vals, 0); - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ), "LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ"); - *ret_conv = CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_ok(o_constr); + LDKCResult_CVec_BlindedPaymentPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPaymentPathZNoneZ), "LDKCResult_CVec_BlindedPaymentPathZNoneZ"); + *ret_conv = CResult_CVec_BlindedPaymentPathZNoneZ_ok(o_constr); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlindedPayInfoBlindedPathZZNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ), "LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ"); - *ret_conv = CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_err(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPaymentPathZNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_CVec_BlindedPaymentPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPaymentPathZNoneZ), "LDKCResult_CVec_BlindedPaymentPathZNoneZ"); + *ret_conv = CResult_CVec_BlindedPaymentPathZNoneZ_err(); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlindedPayInfoBlindedPathZZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* o_conv = (LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPaymentPathZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_CVec_BlindedPaymentPathZNoneZ* o_conv = (LDKCResult_CVec_BlindedPaymentPathZNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_CVec_BlindedPaymentPathZNoneZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlindedPayInfoBlindedPathZZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPaymentPathZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ _res_conv = *(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ*)(_res_ptr); + LDKCResult_CVec_BlindedPaymentPathZNoneZ _res_conv = *(LDKCResult_CVec_BlindedPaymentPathZNoneZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_free(_res_conv); + CResult_CVec_BlindedPaymentPathZNoneZ_free(_res_conv); } -static inline uint64_t CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone_ptr(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR arg) { - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ), "LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ"); - *ret_conv = CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone(arg); +static inline uint64_t CResult_CVec_BlindedPaymentPathZNoneZ_clone_ptr(LDKCResult_CVec_BlindedPaymentPathZNoneZ *NONNULL_PTR arg) { + LDKCResult_CVec_BlindedPaymentPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPaymentPathZNoneZ), "LDKCResult_CVec_BlindedPaymentPathZNoneZ"); + *ret_conv = CResult_CVec_BlindedPaymentPathZNoneZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlindedPayInfoBlindedPathZZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* arg_conv = (LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPaymentPathZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_CVec_BlindedPaymentPathZNoneZ* arg_conv = (LDKCResult_CVec_BlindedPaymentPathZNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_CVec_BlindedPaymentPathZNoneZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlindedPayInfoBlindedPathZZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* orig_conv = (LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ*)untag_ptr(orig); - LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ), "LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ"); - *ret_conv = CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPaymentPathZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_CVec_BlindedPaymentPathZNoneZ* orig_conv = (LDKCResult_CVec_BlindedPaymentPathZNoneZ*)untag_ptr(orig); + LDKCResult_CVec_BlindedPaymentPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPaymentPathZNoneZ), "LDKCResult_CVec_BlindedPaymentPathZNoneZ"); + *ret_conv = CResult_CVec_BlindedPaymentPathZNoneZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -26721,68 +28073,88 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNo return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPathZNoneZ_1ok(JNIEnv *env, jclass clz, int64_tArray o) { - LDKCVec_BlindedPathZ o_constr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1ok(JNIEnv *env, jclass clz, int64_tArray o) { + LDKCVec_BlindedMessagePathZ o_constr; o_constr.datalen = (*env)->GetArrayLength(env, o); if (o_constr.datalen > 0) - o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKBlindedPath), "LDKCVec_BlindedPathZ Elements"); + o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKBlindedMessagePath), "LDKCVec_BlindedMessagePathZ Elements"); else o_constr.data = NULL; int64_t* o_vals = (*env)->GetLongArrayElements (env, o, NULL); - for (size_t n = 0; n < o_constr.datalen; n++) { - int64_t o_conv_13 = o_vals[n]; - LDKBlindedPath o_conv_13_conv; - o_conv_13_conv.inner = untag_ptr(o_conv_13); - o_conv_13_conv.is_owned = ptr_is_owned(o_conv_13); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv_13_conv); - o_conv_13_conv = BlindedPath_clone(&o_conv_13_conv); - o_constr.data[n] = o_conv_13_conv; + for (size_t u = 0; u < o_constr.datalen; u++) { + int64_t o_conv_20 = o_vals[u]; + LDKBlindedMessagePath o_conv_20_conv; + o_conv_20_conv.inner = untag_ptr(o_conv_20); + o_conv_20_conv.is_owned = ptr_is_owned(o_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv_20_conv); + o_conv_20_conv = BlindedMessagePath_clone(&o_conv_20_conv); + o_constr.data[u] = o_conv_20_conv; } (*env)->ReleaseLongArrayElements(env, o, o_vals, 0); - LDKCResult_CVec_BlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPathZNoneZ), "LDKCResult_CVec_BlindedPathZNoneZ"); - *ret_conv = CResult_CVec_BlindedPathZNoneZ_ok(o_constr); + LDKCResult_CVec_BlindedMessagePathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedMessagePathZNoneZ), "LDKCResult_CVec_BlindedMessagePathZNoneZ"); + *ret_conv = CResult_CVec_BlindedMessagePathZNoneZ_ok(o_constr); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPathZNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_CVec_BlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPathZNoneZ), "LDKCResult_CVec_BlindedPathZNoneZ"); - *ret_conv = CResult_CVec_BlindedPathZNoneZ_err(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_CVec_BlindedMessagePathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedMessagePathZNoneZ), "LDKCResult_CVec_BlindedMessagePathZNoneZ"); + *ret_conv = CResult_CVec_BlindedMessagePathZNoneZ_err(); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPathZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_CVec_BlindedPathZNoneZ* o_conv = (LDKCResult_CVec_BlindedPathZNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_CVec_BlindedPathZNoneZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_CVec_BlindedMessagePathZNoneZ* o_conv = (LDKCResult_CVec_BlindedMessagePathZNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_CVec_BlindedMessagePathZNoneZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPathZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_CVec_BlindedPathZNoneZ _res_conv = *(LDKCResult_CVec_BlindedPathZNoneZ*)(_res_ptr); + LDKCResult_CVec_BlindedMessagePathZNoneZ _res_conv = *(LDKCResult_CVec_BlindedMessagePathZNoneZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_CVec_BlindedPathZNoneZ_free(_res_conv); + CResult_CVec_BlindedMessagePathZNoneZ_free(_res_conv); } -static inline uint64_t CResult_CVec_BlindedPathZNoneZ_clone_ptr(LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR arg) { - LDKCResult_CVec_BlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPathZNoneZ), "LDKCResult_CVec_BlindedPathZNoneZ"); - *ret_conv = CResult_CVec_BlindedPathZNoneZ_clone(arg); +static inline uint64_t CResult_CVec_BlindedMessagePathZNoneZ_clone_ptr(LDKCResult_CVec_BlindedMessagePathZNoneZ *NONNULL_PTR arg) { + LDKCResult_CVec_BlindedMessagePathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedMessagePathZNoneZ), "LDKCResult_CVec_BlindedMessagePathZNoneZ"); + *ret_conv = CResult_CVec_BlindedMessagePathZNoneZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPathZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_CVec_BlindedPathZNoneZ* arg_conv = (LDKCResult_CVec_BlindedPathZNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_CVec_BlindedPathZNoneZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_CVec_BlindedMessagePathZNoneZ* arg_conv = (LDKCResult_CVec_BlindedMessagePathZNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_CVec_BlindedMessagePathZNoneZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPathZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_CVec_BlindedPathZNoneZ* orig_conv = (LDKCResult_CVec_BlindedPathZNoneZ*)untag_ptr(orig); - LDKCResult_CVec_BlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPathZNoneZ), "LDKCResult_CVec_BlindedPathZNoneZ"); - *ret_conv = CResult_CVec_BlindedPathZNoneZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_CVec_BlindedMessagePathZNoneZ* orig_conv = (LDKCResult_CVec_BlindedMessagePathZNoneZ*)untag_ptr(orig); + LDKCResult_CVec_BlindedMessagePathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedMessagePathZNoneZ), "LDKCResult_CVec_BlindedMessagePathZNoneZ"); + *ret_conv = CResult_CVec_BlindedMessagePathZNoneZ_clone(orig_conv); return tag_ptr(ret_conv, true); } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MessageForwardNodeZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_MessageForwardNodeZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMessageForwardNode), "LDKCVec_MessageForwardNodeZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t u = 0; u < _res_constr.datalen; u++) { + int64_t _res_conv_20 = _res_vals[u]; + LDKMessageForwardNode _res_conv_20_conv; + _res_conv_20_conv.inner = untag_ptr(_res_conv_20); + _res_conv_20_conv.is_owned = ptr_is_owned(_res_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_20_conv); + _res_constr.data[u] = _res_conv_20_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_MessageForwardNodeZ_free(_res_constr); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKInFlightHtlcs o_conv; o_conv.inner = untag_ptr(o); @@ -27203,26 +28575,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintZ_1free(JNIEnv CVec_RouteHintZ_free(_res_constr); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintHopZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_RouteHintHopZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t o = 0; o < _res_constr.datalen; o++) { - int64_t _res_conv_14 = _res_vals[o]; - LDKRouteHintHop _res_conv_14_conv; - _res_conv_14_conv.inner = untag_ptr(_res_conv_14); - _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv); - _res_constr.data[o] = _res_conv_14_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_RouteHintHopZ_free(_res_constr); -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKRouteHint o_conv; o_conv.inner = untag_ptr(o); @@ -28551,6 +29903,60 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithExp CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_free(_res_conv); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OfferDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKOffer o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = Offer_clone(&o_conv); + LDKCResult_OfferDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferDecodeErrorZ), "LDKCResult_OfferDecodeErrorZ"); + *ret_conv = CResult_OfferDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OfferDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_OfferDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferDecodeErrorZ), "LDKCResult_OfferDecodeErrorZ"); + *ret_conv = CResult_OfferDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OfferDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_OfferDecodeErrorZ* o_conv = (LDKCResult_OfferDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OfferDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OfferDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_OfferDecodeErrorZ _res_conv = *(LDKCResult_OfferDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_OfferDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_OfferDecodeErrorZ_clone_ptr(LDKCResult_OfferDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OfferDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferDecodeErrorZ), "LDKCResult_OfferDecodeErrorZ"); + *ret_conv = CResult_OfferDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OfferDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_OfferDecodeErrorZ* arg_conv = (LDKCResult_OfferDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OfferDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OfferDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_OfferDecodeErrorZ* orig_conv = (LDKCResult_OfferDecodeErrorZ*)untag_ptr(orig); + LDKCResult_OfferDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferDecodeErrorZ), "LDKCResult_OfferDecodeErrorZ"); + *ret_conv = CResult_OfferDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OfferBolt12ParseErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKOffer o_conv; o_conv.inner = untag_ptr(o); @@ -29237,11 +30643,10 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SocketAddressZ_1free(JNI } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKNodeAnnouncementInfo o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = NodeAnnouncementInfo_clone(&o_conv); + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKNodeAnnouncementInfo o_conv = *(LDKNodeAnnouncementInfo*)(o_ptr); + o_conv = NodeAnnouncementInfo_clone((LDKNodeAnnouncementInfo*)untag_ptr(o)); LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); @@ -29344,6 +30749,53 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErr return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NodeAnnouncementInfoZ_1some(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKNodeAnnouncementInfo o_conv = *(LDKNodeAnnouncementInfo*)(o_ptr); + o_conv = NodeAnnouncementInfo_clone((LDKNodeAnnouncementInfo*)untag_ptr(o)); + LDKCOption_NodeAnnouncementInfoZ *ret_copy = MALLOC(sizeof(LDKCOption_NodeAnnouncementInfoZ), "LDKCOption_NodeAnnouncementInfoZ"); + *ret_copy = COption_NodeAnnouncementInfoZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NodeAnnouncementInfoZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_NodeAnnouncementInfoZ *ret_copy = MALLOC(sizeof(LDKCOption_NodeAnnouncementInfoZ), "LDKCOption_NodeAnnouncementInfoZ"); + *ret_copy = COption_NodeAnnouncementInfoZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NodeAnnouncementInfoZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_NodeAnnouncementInfoZ _res_conv = *(LDKCOption_NodeAnnouncementInfoZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_NodeAnnouncementInfoZ_free(_res_conv); +} + +static inline uint64_t COption_NodeAnnouncementInfoZ_clone_ptr(LDKCOption_NodeAnnouncementInfoZ *NONNULL_PTR arg) { + LDKCOption_NodeAnnouncementInfoZ *ret_copy = MALLOC(sizeof(LDKCOption_NodeAnnouncementInfoZ), "LDKCOption_NodeAnnouncementInfoZ"); + *ret_copy = COption_NodeAnnouncementInfoZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NodeAnnouncementInfoZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_NodeAnnouncementInfoZ* arg_conv = (LDKCOption_NodeAnnouncementInfoZ*)untag_ptr(arg); + int64_t ret_conv = COption_NodeAnnouncementInfoZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NodeAnnouncementInfoZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_NodeAnnouncementInfoZ* orig_conv = (LDKCOption_NodeAnnouncementInfoZ*)untag_ptr(orig); + LDKCOption_NodeAnnouncementInfoZ *ret_copy = MALLOC(sizeof(LDKCOption_NodeAnnouncementInfoZ), "LDKCOption_NodeAnnouncementInfoZ"); + *ret_copy = COption_NodeAnnouncementInfoZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKNodeInfo o_conv; o_conv.inner = untag_ptr(o); @@ -30667,117 +32119,352 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesAPIE return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1OffersMessageZ_1some(JNIEnv *env, jclass clz, int64_t o) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1OffersContextZ_1some(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); - LDKOffersMessage o_conv = *(LDKOffersMessage*)(o_ptr); - o_conv = OffersMessage_clone((LDKOffersMessage*)untag_ptr(o)); - LDKCOption_OffersMessageZ *ret_copy = MALLOC(sizeof(LDKCOption_OffersMessageZ), "LDKCOption_OffersMessageZ"); - *ret_copy = COption_OffersMessageZ_some(o_conv); + LDKOffersContext o_conv = *(LDKOffersContext*)(o_ptr); + o_conv = OffersContext_clone((LDKOffersContext*)untag_ptr(o)); + LDKCOption_OffersContextZ *ret_copy = MALLOC(sizeof(LDKCOption_OffersContextZ), "LDKCOption_OffersContextZ"); + *ret_copy = COption_OffersContextZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1OffersContextZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_OffersContextZ *ret_copy = MALLOC(sizeof(LDKCOption_OffersContextZ), "LDKCOption_OffersContextZ"); + *ret_copy = COption_OffersContextZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1OffersContextZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_OffersContextZ _res_conv = *(LDKCOption_OffersContextZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_OffersContextZ_free(_res_conv); +} + +static inline uint64_t COption_OffersContextZ_clone_ptr(LDKCOption_OffersContextZ *NONNULL_PTR arg) { + LDKCOption_OffersContextZ *ret_copy = MALLOC(sizeof(LDKCOption_OffersContextZ), "LDKCOption_OffersContextZ"); + *ret_copy = COption_OffersContextZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1OffersContextZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_OffersContextZ* arg_conv = (LDKCOption_OffersContextZ*)untag_ptr(arg); + int64_t ret_conv = COption_OffersContextZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1OffersContextZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_OffersContextZ* orig_conv = (LDKCOption_OffersContextZ*)untag_ptr(orig); + LDKCOption_OffersContextZ *ret_copy = MALLOC(sizeof(LDKCOption_OffersContextZ), "LDKCOption_OffersContextZ"); + *ret_copy = COption_OffersContextZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline uint64_t C2Tuple_OffersMessageResponseInstructionZ_clone_ptr(LDKC2Tuple_OffersMessageResponseInstructionZ *NONNULL_PTR arg) { + LDKC2Tuple_OffersMessageResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OffersMessageResponseInstructionZ), "LDKC2Tuple_OffersMessageResponseInstructionZ"); + *ret_conv = C2Tuple_OffersMessageResponseInstructionZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OffersMessageResponseInstructionZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_OffersMessageResponseInstructionZ* arg_conv = (LDKC2Tuple_OffersMessageResponseInstructionZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_OffersMessageResponseInstructionZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OffersMessageResponseInstructionZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_OffersMessageResponseInstructionZ* orig_conv = (LDKC2Tuple_OffersMessageResponseInstructionZ*)untag_ptr(orig); + LDKC2Tuple_OffersMessageResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OffersMessageResponseInstructionZ), "LDKC2Tuple_OffersMessageResponseInstructionZ"); + *ret_conv = C2Tuple_OffersMessageResponseInstructionZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OffersMessageResponseInstructionZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKOffersMessage a_conv = *(LDKOffersMessage*)(a_ptr); + a_conv = OffersMessage_clone((LDKOffersMessage*)untag_ptr(a)); + LDKResponseInstruction b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv = ResponseInstruction_clone(&b_conv); + LDKC2Tuple_OffersMessageResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OffersMessageResponseInstructionZ), "LDKC2Tuple_OffersMessageResponseInstructionZ"); + *ret_conv = C2Tuple_OffersMessageResponseInstructionZ_new(a_conv, b_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OffersMessageResponseInstructionZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKC2Tuple_OffersMessageResponseInstructionZ _res_conv = *(LDKC2Tuple_OffersMessageResponseInstructionZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_OffersMessageResponseInstructionZ_free(_res_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1OffersMessageResponseInstructionZZ_1some(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_OffersMessageResponseInstructionZ o_conv = *(LDKC2Tuple_OffersMessageResponseInstructionZ*)(o_ptr); + o_conv = C2Tuple_OffersMessageResponseInstructionZ_clone((LDKC2Tuple_OffersMessageResponseInstructionZ*)untag_ptr(o)); + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ), "LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_OffersMessageResponseInstructionZZ_some(o_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1OffersMessageZ_1none(JNIEnv *env, jclass clz) { - LDKCOption_OffersMessageZ *ret_copy = MALLOC(sizeof(LDKCOption_OffersMessageZ), "LDKCOption_OffersMessageZ"); - *ret_copy = COption_OffersMessageZ_none(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1OffersMessageResponseInstructionZZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ), "LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_OffersMessageResponseInstructionZZ_none(); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1OffersMessageZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1OffersMessageResponseInstructionZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCOption_OffersMessageZ _res_conv = *(LDKCOption_OffersMessageZ*)(_res_ptr); + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ _res_conv = *(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_OffersMessageZ_free(_res_conv); + COption_C2Tuple_OffersMessageResponseInstructionZZ_free(_res_conv); } -static inline uint64_t COption_OffersMessageZ_clone_ptr(LDKCOption_OffersMessageZ *NONNULL_PTR arg) { - LDKCOption_OffersMessageZ *ret_copy = MALLOC(sizeof(LDKCOption_OffersMessageZ), "LDKCOption_OffersMessageZ"); - *ret_copy = COption_OffersMessageZ_clone(arg); +static inline uint64_t COption_C2Tuple_OffersMessageResponseInstructionZZ_clone_ptr(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ *NONNULL_PTR arg) { + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ), "LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_OffersMessageResponseInstructionZZ_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1OffersMessageZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCOption_OffersMessageZ* arg_conv = (LDKCOption_OffersMessageZ*)untag_ptr(arg); - int64_t ret_conv = COption_OffersMessageZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1OffersMessageResponseInstructionZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ* arg_conv = (LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ*)untag_ptr(arg); + int64_t ret_conv = COption_C2Tuple_OffersMessageResponseInstructionZZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1OffersMessageZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCOption_OffersMessageZ* orig_conv = (LDKCOption_OffersMessageZ*)untag_ptr(orig); - LDKCOption_OffersMessageZ *ret_copy = MALLOC(sizeof(LDKCOption_OffersMessageZ), "LDKCOption_OffersMessageZ"); - *ret_copy = COption_OffersMessageZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1OffersMessageResponseInstructionZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ* orig_conv = (LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ*)untag_ptr(orig); + LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ), "LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_OffersMessageResponseInstructionZZ_clone(orig_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline uint64_t C3Tuple_OffersMessageDestinationBlindedPathZ_clone_ptr(LDKC3Tuple_OffersMessageDestinationBlindedPathZ *NONNULL_PTR arg) { - LDKC3Tuple_OffersMessageDestinationBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OffersMessageDestinationBlindedPathZ), "LDKC3Tuple_OffersMessageDestinationBlindedPathZ"); - *ret_conv = C3Tuple_OffersMessageDestinationBlindedPathZ_clone(arg); +static inline uint64_t C2Tuple_OffersMessageMessageSendInstructionsZ_clone_ptr(LDKC2Tuple_OffersMessageMessageSendInstructionsZ *NONNULL_PTR arg) { + LDKC2Tuple_OffersMessageMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OffersMessageMessageSendInstructionsZ), "LDKC2Tuple_OffersMessageMessageSendInstructionsZ"); + *ret_conv = C2Tuple_OffersMessageMessageSendInstructionsZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OffersMessageDestinationBlindedPathZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC3Tuple_OffersMessageDestinationBlindedPathZ* arg_conv = (LDKC3Tuple_OffersMessageDestinationBlindedPathZ*)untag_ptr(arg); - int64_t ret_conv = C3Tuple_OffersMessageDestinationBlindedPathZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OffersMessageMessageSendInstructionsZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_OffersMessageMessageSendInstructionsZ* arg_conv = (LDKC2Tuple_OffersMessageMessageSendInstructionsZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_OffersMessageMessageSendInstructionsZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OffersMessageDestinationBlindedPathZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC3Tuple_OffersMessageDestinationBlindedPathZ* orig_conv = (LDKC3Tuple_OffersMessageDestinationBlindedPathZ*)untag_ptr(orig); - LDKC3Tuple_OffersMessageDestinationBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OffersMessageDestinationBlindedPathZ), "LDKC3Tuple_OffersMessageDestinationBlindedPathZ"); - *ret_conv = C3Tuple_OffersMessageDestinationBlindedPathZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OffersMessageMessageSendInstructionsZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_OffersMessageMessageSendInstructionsZ* orig_conv = (LDKC2Tuple_OffersMessageMessageSendInstructionsZ*)untag_ptr(orig); + LDKC2Tuple_OffersMessageMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OffersMessageMessageSendInstructionsZ), "LDKC2Tuple_OffersMessageMessageSendInstructionsZ"); + *ret_conv = C2Tuple_OffersMessageMessageSendInstructionsZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OffersMessageDestinationBlindedPathZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b, int64_t c) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OffersMessageMessageSendInstructionsZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b) { void* a_ptr = untag_ptr(a); CHECK_ACCESS(a_ptr); LDKOffersMessage a_conv = *(LDKOffersMessage*)(a_ptr); a_conv = OffersMessage_clone((LDKOffersMessage*)untag_ptr(a)); void* b_ptr = untag_ptr(b); CHECK_ACCESS(b_ptr); - LDKDestination b_conv = *(LDKDestination*)(b_ptr); - b_conv = Destination_clone((LDKDestination*)untag_ptr(b)); - LDKBlindedPath c_conv; - c_conv.inner = untag_ptr(c); - c_conv.is_owned = ptr_is_owned(c); - CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv); - c_conv = BlindedPath_clone(&c_conv); - LDKC3Tuple_OffersMessageDestinationBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OffersMessageDestinationBlindedPathZ), "LDKC3Tuple_OffersMessageDestinationBlindedPathZ"); - *ret_conv = C3Tuple_OffersMessageDestinationBlindedPathZ_new(a_conv, b_conv, c_conv); + LDKMessageSendInstructions b_conv = *(LDKMessageSendInstructions*)(b_ptr); + b_conv = MessageSendInstructions_clone((LDKMessageSendInstructions*)untag_ptr(b)); + LDKC2Tuple_OffersMessageMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OffersMessageMessageSendInstructionsZ), "LDKC2Tuple_OffersMessageMessageSendInstructionsZ"); + *ret_conv = C2Tuple_OffersMessageMessageSendInstructionsZ_new(a_conv, b_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OffersMessageDestinationBlindedPathZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OffersMessageMessageSendInstructionsZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKC3Tuple_OffersMessageDestinationBlindedPathZ _res_conv = *(LDKC3Tuple_OffersMessageDestinationBlindedPathZ*)(_res_ptr); + LDKC2Tuple_OffersMessageMessageSendInstructionsZ _res_conv = *(LDKC2Tuple_OffersMessageMessageSendInstructionsZ*)(_res_ptr); FREE(untag_ptr(_res)); - C3Tuple_OffersMessageDestinationBlindedPathZ_free(_res_conv); + C2Tuple_OffersMessageMessageSendInstructionsZ_free(_res_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C3Tuple_1OffersMessageDestinationBlindedPathZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ _res_constr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1OffersMessageMessageSendInstructionsZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC3Tuple_OffersMessageDestinationBlindedPathZ), "LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OffersMessageMessageSendInstructionsZ), "LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ Elements"); else _res_constr.data = NULL; int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t x = 0; x < _res_constr.datalen; x++) { - int64_t _res_conv_49 = _res_vals[x]; - void* _res_conv_49_ptr = untag_ptr(_res_conv_49); - CHECK_ACCESS(_res_conv_49_ptr); - LDKC3Tuple_OffersMessageDestinationBlindedPathZ _res_conv_49_conv = *(LDKC3Tuple_OffersMessageDestinationBlindedPathZ*)(_res_conv_49_ptr); - FREE(untag_ptr(_res_conv_49)); - _res_constr.data[x] = _res_conv_49_conv; + for (size_t w = 0; w < _res_constr.datalen; w++) { + int64_t _res_conv_48 = _res_vals[w]; + void* _res_conv_48_ptr = untag_ptr(_res_conv_48); + CHECK_ACCESS(_res_conv_48_ptr); + LDKC2Tuple_OffersMessageMessageSendInstructionsZ _res_conv_48_conv = *(LDKC2Tuple_OffersMessageMessageSendInstructionsZ*)(_res_conv_48_ptr); + FREE(untag_ptr(_res_conv_48)); + _res_constr.data[w] = _res_conv_48_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_C3Tuple_OffersMessageDestinationBlindedPathZZ_free(_res_constr); + CVec_C2Tuple_OffersMessageMessageSendInstructionsZZ_free(_res_constr); +} + +static inline uint64_t C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone_ptr(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ *NONNULL_PTR arg) { + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ), "LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ"); + *ret_conv = C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1ReleaseHeldHtlcResponseInstructionZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ* arg_conv = (LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1ReleaseHeldHtlcResponseInstructionZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ* orig_conv = (LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ*)untag_ptr(orig); + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ), "LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ"); + *ret_conv = C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1ReleaseHeldHtlcResponseInstructionZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKReleaseHeldHtlc a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = ReleaseHeldHtlc_clone(&a_conv); + LDKResponseInstruction b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv = ResponseInstruction_clone(&b_conv); + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ), "LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ"); + *ret_conv = C2Tuple_ReleaseHeldHtlcResponseInstructionZ_new(a_conv, b_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1ReleaseHeldHtlcResponseInstructionZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ _res_conv = *(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_ReleaseHeldHtlcResponseInstructionZ_free(_res_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1ReleaseHeldHtlcResponseInstructionZZ_1some(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ o_conv = *(LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ*)(o_ptr); + o_conv = C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone((LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ*)untag_ptr(o)); + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ), "LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1ReleaseHeldHtlcResponseInstructionZZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ), "LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1ReleaseHeldHtlcResponseInstructionZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ _res_conv = *(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_free(_res_conv); +} + +static inline uint64_t COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone_ptr(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ *NONNULL_PTR arg) { + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ), "LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1ReleaseHeldHtlcResponseInstructionZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ* arg_conv = (LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ*)untag_ptr(arg); + int64_t ret_conv = COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1ReleaseHeldHtlcResponseInstructionZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ* orig_conv = (LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ*)untag_ptr(orig); + LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ), "LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline uint64_t C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone_ptr(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ *NONNULL_PTR arg) { + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ), "LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ"); + *ret_conv = C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1AsyncPaymentsMessageMessageSendInstructionsZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ* arg_conv = (LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1AsyncPaymentsMessageMessageSendInstructionsZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ* orig_conv = (LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ*)untag_ptr(orig); + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ), "LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ"); + *ret_conv = C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1AsyncPaymentsMessageMessageSendInstructionsZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKAsyncPaymentsMessage a_conv = *(LDKAsyncPaymentsMessage*)(a_ptr); + a_conv = AsyncPaymentsMessage_clone((LDKAsyncPaymentsMessage*)untag_ptr(a)); + void* b_ptr = untag_ptr(b); + CHECK_ACCESS(b_ptr); + LDKMessageSendInstructions b_conv = *(LDKMessageSendInstructions*)(b_ptr); + b_conv = MessageSendInstructions_clone((LDKMessageSendInstructions*)untag_ptr(b)); + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ), "LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ"); + *ret_conv = C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_new(a_conv, b_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1AsyncPaymentsMessageMessageSendInstructionsZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ _res_conv = *(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_free(_res_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1AsyncPaymentsMessageMessageSendInstructionsZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ), "LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t d = 0; d < _res_constr.datalen; d++) { + int64_t _res_conv_55 = _res_vals[d]; + void* _res_conv_55_ptr = untag_ptr(_res_conv_55); + CHECK_ACCESS(_res_conv_55_ptr); + LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ _res_conv_55_conv = *(LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ*)(_res_conv_55_ptr); + FREE(untag_ptr(_res_conv_55)); + _res_constr.data[d] = _res_conv_55_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ_free(_res_constr); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { @@ -31757,6 +33444,56 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1ThirtyTwoBytesC CVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ_free(_res_constr); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneReplayEventZ_1ok(JNIEnv *env, jclass clz) { + LDKCResult_NoneReplayEventZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneReplayEventZ), "LDKCResult_NoneReplayEventZ"); + *ret_conv = CResult_NoneReplayEventZ_ok(); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneReplayEventZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKReplayEvent e_conv; + e_conv.inner = untag_ptr(e); + e_conv.is_owned = ptr_is_owned(e); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = ReplayEvent_clone(&e_conv); + LDKCResult_NoneReplayEventZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneReplayEventZ), "LDKCResult_NoneReplayEventZ"); + *ret_conv = CResult_NoneReplayEventZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneReplayEventZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneReplayEventZ* o_conv = (LDKCResult_NoneReplayEventZ*)untag_ptr(o); + jboolean ret_conv = CResult_NoneReplayEventZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneReplayEventZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_NoneReplayEventZ _res_conv = *(LDKCResult_NoneReplayEventZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_NoneReplayEventZ_free(_res_conv); +} + +static inline uint64_t CResult_NoneReplayEventZ_clone_ptr(LDKCResult_NoneReplayEventZ *NONNULL_PTR arg) { + LDKCResult_NoneReplayEventZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneReplayEventZ), "LDKCResult_NoneReplayEventZ"); + *ret_conv = CResult_NoneReplayEventZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneReplayEventZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NoneReplayEventZ* arg_conv = (LDKCResult_NoneReplayEventZ*)untag_ptr(arg); + int64_t ret_conv = CResult_NoneReplayEventZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneReplayEventZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_NoneReplayEventZ* orig_conv = (LDKCResult_NoneReplayEventZ*)untag_ptr(orig); + LDKCResult_NoneReplayEventZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneReplayEventZ), "LDKCResult_NoneReplayEventZ"); + *ret_conv = CResult_NoneReplayEventZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CommitmentTransactionZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { LDKCVec_CommitmentTransactionZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); @@ -32083,76 +33820,96 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1PublicKeyTypeZZ CVec_C2Tuple_PublicKeyTypeZZ_free(_res_constr); } -static inline uint64_t C2Tuple_PublicKeyCVec_SocketAddressZZ_clone_ptr(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *NONNULL_PTR arg) { - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ), "LDKC2Tuple_PublicKeyCVec_SocketAddressZZ"); - *ret_conv = C2Tuple_PublicKeyCVec_SocketAddressZZ_clone(arg); +static inline uint64_t C2Tuple_OnionMessageContentsResponseInstructionZ_clone_ptr(LDKC2Tuple_OnionMessageContentsResponseInstructionZ *NONNULL_PTR arg) { + LDKC2Tuple_OnionMessageContentsResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OnionMessageContentsResponseInstructionZ), "LDKC2Tuple_OnionMessageContentsResponseInstructionZ"); + *ret_conv = C2Tuple_OnionMessageContentsResponseInstructionZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyCVec_1SocketAddressZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* arg_conv = (LDKC2Tuple_PublicKeyCVec_SocketAddressZZ*)untag_ptr(arg); - int64_t ret_conv = C2Tuple_PublicKeyCVec_SocketAddressZZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OnionMessageContentsResponseInstructionZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_OnionMessageContentsResponseInstructionZ* arg_conv = (LDKC2Tuple_OnionMessageContentsResponseInstructionZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_OnionMessageContentsResponseInstructionZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyCVec_1SocketAddressZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* orig_conv = (LDKC2Tuple_PublicKeyCVec_SocketAddressZZ*)untag_ptr(orig); - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ), "LDKC2Tuple_PublicKeyCVec_SocketAddressZZ"); - *ret_conv = C2Tuple_PublicKeyCVec_SocketAddressZZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OnionMessageContentsResponseInstructionZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_OnionMessageContentsResponseInstructionZ* orig_conv = (LDKC2Tuple_OnionMessageContentsResponseInstructionZ*)untag_ptr(orig); + LDKC2Tuple_OnionMessageContentsResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OnionMessageContentsResponseInstructionZ), "LDKC2Tuple_OnionMessageContentsResponseInstructionZ"); + *ret_conv = C2Tuple_OnionMessageContentsResponseInstructionZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyCVec_1SocketAddressZZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_tArray b) { - LDKPublicKey a_ref; - CHECK((*env)->GetArrayLength(env, a) == 33); - (*env)->GetByteArrayRegion(env, a, 0, 33, a_ref.compressed_form); - LDKCVec_SocketAddressZ b_constr; - b_constr.datalen = (*env)->GetArrayLength(env, b); - if (b_constr.datalen > 0) - b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKSocketAddress), "LDKCVec_SocketAddressZ Elements"); - else - b_constr.data = NULL; - int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL); - for (size_t p = 0; p < b_constr.datalen; p++) { - int64_t b_conv_15 = b_vals[p]; - void* b_conv_15_ptr = untag_ptr(b_conv_15); - CHECK_ACCESS(b_conv_15_ptr); - LDKSocketAddress b_conv_15_conv = *(LDKSocketAddress*)(b_conv_15_ptr); - b_conv_15_conv = SocketAddress_clone((LDKSocketAddress*)untag_ptr(b_conv_15)); - b_constr.data[p] = b_conv_15_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OnionMessageContentsResponseInstructionZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKOnionMessageContents a_conv = *(LDKOnionMessageContents*)(a_ptr); + if (a_conv.free == LDKOnionMessageContents_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOnionMessageContents_JCalls_cloned(&a_conv); } - (*env)->ReleaseLongArrayElements(env, b, b_vals, 0); - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ), "LDKC2Tuple_PublicKeyCVec_SocketAddressZZ"); - *ret_conv = C2Tuple_PublicKeyCVec_SocketAddressZZ_new(a_ref, b_constr); + LDKResponseInstruction b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv = ResponseInstruction_clone(&b_conv); + LDKC2Tuple_OnionMessageContentsResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OnionMessageContentsResponseInstructionZ), "LDKC2Tuple_OnionMessageContentsResponseInstructionZ"); + *ret_conv = C2Tuple_OnionMessageContentsResponseInstructionZ_new(a_conv, b_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyCVec_1SocketAddressZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OnionMessageContentsResponseInstructionZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ _res_conv = *(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ*)(_res_ptr); + LDKC2Tuple_OnionMessageContentsResponseInstructionZ _res_conv = *(LDKC2Tuple_OnionMessageContentsResponseInstructionZ*)(_res_ptr); FREE(untag_ptr(_res)); - C2Tuple_PublicKeyCVec_SocketAddressZZ_free(_res_conv); + C2Tuple_OnionMessageContentsResponseInstructionZ_free(_res_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1PublicKeyCVec_1SocketAddressZZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ), "LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t o = 0; o < _res_constr.datalen; o++) { - int64_t _res_conv_40 = _res_vals[o]; - void* _res_conv_40_ptr = untag_ptr(_res_conv_40); - CHECK_ACCESS(_res_conv_40_ptr); - LDKC2Tuple_PublicKeyCVec_SocketAddressZZ _res_conv_40_conv = *(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ*)(_res_conv_40_ptr); - FREE(untag_ptr(_res_conv_40)); - _res_constr.data[o] = _res_conv_40_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ_free(_res_constr); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1OnionMessageContentsResponseInstructionZZ_1some(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_OnionMessageContentsResponseInstructionZ o_conv = *(LDKC2Tuple_OnionMessageContentsResponseInstructionZ*)(o_ptr); + o_conv = C2Tuple_OnionMessageContentsResponseInstructionZ_clone((LDKC2Tuple_OnionMessageContentsResponseInstructionZ*)untag_ptr(o)); + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ), "LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1OnionMessageContentsResponseInstructionZZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ), "LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1OnionMessageContentsResponseInstructionZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ _res_conv = *(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_free(_res_conv); +} + +static inline uint64_t COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone_ptr(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ *NONNULL_PTR arg) { + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ), "LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1OnionMessageContentsResponseInstructionZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ* arg_conv = (LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ*)untag_ptr(arg); + int64_t ret_conv = COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1OnionMessageContentsResponseInstructionZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ* orig_conv = (LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ*)untag_ptr(orig); + LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ), "LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1OnionMessageContentsZ_1some(JNIEnv *env, jclass clz, int64_t o) { @@ -32258,25 +34015,25 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1OnionMess return tag_ptr(ret_conv, true); } -static inline uint64_t C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone_ptr(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *NONNULL_PTR arg) { - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ), "LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ"); - *ret_conv = C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone(arg); +static inline uint64_t C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone_ptr(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ *NONNULL_PTR arg) { + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ), "LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ"); + *ret_conv = C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OnionMessageContentsDestinationBlindedPathZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ* arg_conv = (LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ*)untag_ptr(arg); - int64_t ret_conv = C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OnionMessageContentsMessageSendInstructionsZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ* arg_conv = (LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OnionMessageContentsDestinationBlindedPathZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ* orig_conv = (LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ*)untag_ptr(orig); - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ), "LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ"); - *ret_conv = C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OnionMessageContentsMessageSendInstructionsZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ* orig_conv = (LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ*)untag_ptr(orig); + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ), "LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ"); + *ret_conv = C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OnionMessageContentsDestinationBlindedPathZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b, int64_t c) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OnionMessageContentsMessageSendInstructionsZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b) { void* a_ptr = untag_ptr(a); CHECK_ACCESS(a_ptr); LDKOnionMessageContents a_conv = *(LDKOnionMessageContents*)(a_ptr); @@ -32286,45 +34043,40 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OnionMessageConten } void* b_ptr = untag_ptr(b); CHECK_ACCESS(b_ptr); - LDKDestination b_conv = *(LDKDestination*)(b_ptr); - b_conv = Destination_clone((LDKDestination*)untag_ptr(b)); - LDKBlindedPath c_conv; - c_conv.inner = untag_ptr(c); - c_conv.is_owned = ptr_is_owned(c); - CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv); - c_conv = BlindedPath_clone(&c_conv); - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ), "LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ"); - *ret_conv = C3Tuple_OnionMessageContentsDestinationBlindedPathZ_new(a_conv, b_conv, c_conv); + LDKMessageSendInstructions b_conv = *(LDKMessageSendInstructions*)(b_ptr); + b_conv = MessageSendInstructions_clone((LDKMessageSendInstructions*)untag_ptr(b)); + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ), "LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ"); + *ret_conv = C2Tuple_OnionMessageContentsMessageSendInstructionsZ_new(a_conv, b_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OnionMessageContentsDestinationBlindedPathZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OnionMessageContentsMessageSendInstructionsZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ _res_conv = *(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ*)(_res_ptr); + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ _res_conv = *(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ*)(_res_ptr); FREE(untag_ptr(_res)); - C3Tuple_OnionMessageContentsDestinationBlindedPathZ_free(_res_conv); + C2Tuple_OnionMessageContentsMessageSendInstructionsZ_free(_res_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C3Tuple_1OnionMessageContentsDestinationBlindedPathZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ _res_constr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1OnionMessageContentsMessageSendInstructionsZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ), "LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ), "LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ Elements"); else _res_constr.data = NULL; int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t e = 0; e < _res_constr.datalen; e++) { - int64_t _res_conv_56 = _res_vals[e]; - void* _res_conv_56_ptr = untag_ptr(_res_conv_56); - CHECK_ACCESS(_res_conv_56_ptr); - LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ _res_conv_56_conv = *(LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ*)(_res_conv_56_ptr); - FREE(untag_ptr(_res_conv_56)); - _res_constr.data[e] = _res_conv_56_conv; + for (size_t d = 0; d < _res_constr.datalen; d++) { + int64_t _res_conv_55 = _res_vals[d]; + void* _res_conv_55_ptr = untag_ptr(_res_conv_55); + CHECK_ACCESS(_res_conv_55_ptr); + LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ _res_conv_55_conv = *(LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ*)(_res_conv_55_ptr); + FREE(untag_ptr(_res_conv_55)); + _res_constr.data[d] = _res_conv_55_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ_free(_res_constr); + CVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ_free(_res_constr); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1some(JNIEnv *env, jclass clz, int64_t o) { @@ -32732,21 +34484,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZIOErrorZ_ return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1StrZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) { - LDKCVec_StrZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKStr), "LDKCVec_StrZ Elements"); - else - _res_constr.data = NULL; - for (size_t i = 0; i < _res_constr.datalen; i++) { - jstring _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i); - LDKStr dummy = { .chars = NULL, .len = 0, .chars_is_owned = false }; - _res_constr.data[i] = dummy; - } - CVec_StrZ_free(_res_constr); -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1StrZIOErrorZ_1ok(JNIEnv *env, jclass clz, jobjectArray o) { LDKCVec_StrZ o_constr; o_constr.datalen = (*env)->GetArrayLength(env, o); @@ -33038,52 +34775,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestBolt return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1SecretKeyZ_1some(JNIEnv *env, jclass clz, int8_tArray o) { - LDKSecretKey o_ref; - CHECK((*env)->GetArrayLength(env, o) == 32); - (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.bytes); - LDKCOption_SecretKeyZ *ret_copy = MALLOC(sizeof(LDKCOption_SecretKeyZ), "LDKCOption_SecretKeyZ"); - *ret_copy = COption_SecretKeyZ_some(o_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1SecretKeyZ_1none(JNIEnv *env, jclass clz) { - LDKCOption_SecretKeyZ *ret_copy = MALLOC(sizeof(LDKCOption_SecretKeyZ), "LDKCOption_SecretKeyZ"); - *ret_copy = COption_SecretKeyZ_none(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1SecretKeyZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCOption_SecretKeyZ _res_conv = *(LDKCOption_SecretKeyZ*)(_res_ptr); - FREE(untag_ptr(_res)); - COption_SecretKeyZ_free(_res_conv); -} - -static inline uint64_t COption_SecretKeyZ_clone_ptr(LDKCOption_SecretKeyZ *NONNULL_PTR arg) { - LDKCOption_SecretKeyZ *ret_copy = MALLOC(sizeof(LDKCOption_SecretKeyZ), "LDKCOption_SecretKeyZ"); - *ret_copy = COption_SecretKeyZ_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1SecretKeyZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCOption_SecretKeyZ* arg_conv = (LDKCOption_SecretKeyZ*)untag_ptr(arg); - int64_t ret_conv = COption_SecretKeyZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1SecretKeyZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCOption_SecretKeyZ* orig_conv = (LDKCOption_SecretKeyZ*)untag_ptr(orig); - LDKCOption_SecretKeyZ *ret_copy = MALLOC(sizeof(LDKCOption_SecretKeyZ), "LDKCOption_SecretKeyZ"); - *ret_copy = COption_SecretKeyZ_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKInvoiceWithExplicitSigningPubkeyBuilder o_conv; o_conv.inner = untag_ptr(o); @@ -33724,57 +35415,57 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StfuDecodeErrorZ_1 return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKSplice o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceInitDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKSpliceInit o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = Splice_clone(&o_conv); - LDKCResult_SpliceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceDecodeErrorZ), "LDKCResult_SpliceDecodeErrorZ"); - *ret_conv = CResult_SpliceDecodeErrorZ_ok(o_conv); + o_conv = SpliceInit_clone(&o_conv); + LDKCResult_SpliceInitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceInitDecodeErrorZ), "LDKCResult_SpliceInitDecodeErrorZ"); + *ret_conv = CResult_SpliceInitDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceInitDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_SpliceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceDecodeErrorZ), "LDKCResult_SpliceDecodeErrorZ"); - *ret_conv = CResult_SpliceDecodeErrorZ_err(e_conv); + LDKCResult_SpliceInitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceInitDecodeErrorZ), "LDKCResult_SpliceInitDecodeErrorZ"); + *ret_conv = CResult_SpliceInitDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_SpliceDecodeErrorZ* o_conv = (LDKCResult_SpliceDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_SpliceDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceInitDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_SpliceInitDecodeErrorZ* o_conv = (LDKCResult_SpliceInitDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_SpliceInitDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceInitDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_SpliceDecodeErrorZ _res_conv = *(LDKCResult_SpliceDecodeErrorZ*)(_res_ptr); + LDKCResult_SpliceInitDecodeErrorZ _res_conv = *(LDKCResult_SpliceInitDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_SpliceDecodeErrorZ_free(_res_conv); + CResult_SpliceInitDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_SpliceDecodeErrorZ_clone_ptr(LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_SpliceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceDecodeErrorZ), "LDKCResult_SpliceDecodeErrorZ"); - *ret_conv = CResult_SpliceDecodeErrorZ_clone(arg); +static inline uint64_t CResult_SpliceInitDecodeErrorZ_clone_ptr(LDKCResult_SpliceInitDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_SpliceInitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceInitDecodeErrorZ), "LDKCResult_SpliceInitDecodeErrorZ"); + *ret_conv = CResult_SpliceInitDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_SpliceDecodeErrorZ* arg_conv = (LDKCResult_SpliceDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_SpliceDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceInitDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_SpliceInitDecodeErrorZ* arg_conv = (LDKCResult_SpliceInitDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_SpliceInitDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_SpliceDecodeErrorZ* orig_conv = (LDKCResult_SpliceDecodeErrorZ*)untag_ptr(orig); - LDKCResult_SpliceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceDecodeErrorZ), "LDKCResult_SpliceDecodeErrorZ"); - *ret_conv = CResult_SpliceDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceInitDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_SpliceInitDecodeErrorZ* orig_conv = (LDKCResult_SpliceInitDecodeErrorZ*)untag_ptr(orig); + LDKCResult_SpliceInitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceInitDecodeErrorZ), "LDKCResult_SpliceInitDecodeErrorZ"); + *ret_conv = CResult_SpliceInitDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -34588,6 +36279,60 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRa return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedBatchDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCommitmentSignedBatch o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = CommitmentSignedBatch_clone(&o_conv); + LDKCResult_CommitmentSignedBatchDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedBatchDecodeErrorZ), "LDKCResult_CommitmentSignedBatchDecodeErrorZ"); + *ret_conv = CResult_CommitmentSignedBatchDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedBatchDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_CommitmentSignedBatchDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedBatchDecodeErrorZ), "LDKCResult_CommitmentSignedBatchDecodeErrorZ"); + *ret_conv = CResult_CommitmentSignedBatchDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedBatchDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_CommitmentSignedBatchDecodeErrorZ* o_conv = (LDKCResult_CommitmentSignedBatchDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_CommitmentSignedBatchDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedBatchDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_CommitmentSignedBatchDecodeErrorZ _res_conv = *(LDKCResult_CommitmentSignedBatchDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_CommitmentSignedBatchDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_CommitmentSignedBatchDecodeErrorZ_clone_ptr(LDKCResult_CommitmentSignedBatchDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_CommitmentSignedBatchDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedBatchDecodeErrorZ), "LDKCResult_CommitmentSignedBatchDecodeErrorZ"); + *ret_conv = CResult_CommitmentSignedBatchDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedBatchDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_CommitmentSignedBatchDecodeErrorZ* arg_conv = (LDKCResult_CommitmentSignedBatchDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_CommitmentSignedBatchDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedBatchDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_CommitmentSignedBatchDecodeErrorZ* orig_conv = (LDKCResult_CommitmentSignedBatchDecodeErrorZ*)untag_ptr(orig); + LDKCResult_CommitmentSignedBatchDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedBatchDecodeErrorZ), "LDKCResult_CommitmentSignedBatchDecodeErrorZ"); + *ret_conv = CResult_CommitmentSignedBatchDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKCommitmentSigned o_conv; o_conv.inner = untag_ptr(o); @@ -36316,80 +38061,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFil return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PhantomRouteHintsZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_PhantomRouteHintsZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t t = 0; t < _res_constr.datalen; t++) { - int64_t _res_conv_19 = _res_vals[t]; - LDKPhantomRouteHints _res_conv_19_conv; - _res_conv_19_conv.inner = untag_ptr(_res_conv_19); - _res_conv_19_conv.is_owned = ptr_is_owned(_res_conv_19); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_19_conv); - _res_constr.data[t] = _res_conv_19_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_PhantomRouteHintsZ_free(_res_constr); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKBolt11Invoice o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = Bolt11Invoice_clone(&o_conv); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKSignOrCreationError e_conv = *(LDKSignOrCreationError*)(e_ptr); - e_conv = SignOrCreationError_clone((LDKSignOrCreationError*)untag_ptr(e)); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* o_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ _res_conv = *(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_Bolt11InvoiceSignOrCreationErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_Bolt11InvoiceSignOrCreationErrorZ_clone_ptr(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR arg) { - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* arg_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* orig_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(orig); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1InboundHTLCStateDetailsZ_1some(JNIEnv *env, jclass clz, jclass o) { LDKInboundHTLCStateDetails o_conv = LDKInboundHTLCStateDetails_from_java(env, o); LDKCOption_InboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_InboundHTLCStateDetailsZ), "LDKCOption_InboundHTLCStateDetailsZ"); @@ -37008,6 +38679,167 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1FutureZ_1free(JNIEnv *en CVec_FutureZ_free(_res_constr); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HeldHtlcAvailableDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKHeldHtlcAvailable o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = HeldHtlcAvailable_clone(&o_conv); + LDKCResult_HeldHtlcAvailableDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HeldHtlcAvailableDecodeErrorZ), "LDKCResult_HeldHtlcAvailableDecodeErrorZ"); + *ret_conv = CResult_HeldHtlcAvailableDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HeldHtlcAvailableDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_HeldHtlcAvailableDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HeldHtlcAvailableDecodeErrorZ), "LDKCResult_HeldHtlcAvailableDecodeErrorZ"); + *ret_conv = CResult_HeldHtlcAvailableDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HeldHtlcAvailableDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_HeldHtlcAvailableDecodeErrorZ* o_conv = (LDKCResult_HeldHtlcAvailableDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_HeldHtlcAvailableDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HeldHtlcAvailableDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_HeldHtlcAvailableDecodeErrorZ _res_conv = *(LDKCResult_HeldHtlcAvailableDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_HeldHtlcAvailableDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_HeldHtlcAvailableDecodeErrorZ_clone_ptr(LDKCResult_HeldHtlcAvailableDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HeldHtlcAvailableDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HeldHtlcAvailableDecodeErrorZ), "LDKCResult_HeldHtlcAvailableDecodeErrorZ"); + *ret_conv = CResult_HeldHtlcAvailableDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HeldHtlcAvailableDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_HeldHtlcAvailableDecodeErrorZ* arg_conv = (LDKCResult_HeldHtlcAvailableDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_HeldHtlcAvailableDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HeldHtlcAvailableDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_HeldHtlcAvailableDecodeErrorZ* orig_conv = (LDKCResult_HeldHtlcAvailableDecodeErrorZ*)untag_ptr(orig); + LDKCResult_HeldHtlcAvailableDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HeldHtlcAvailableDecodeErrorZ), "LDKCResult_HeldHtlcAvailableDecodeErrorZ"); + *ret_conv = CResult_HeldHtlcAvailableDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReleaseHeldHtlcDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKReleaseHeldHtlc o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = ReleaseHeldHtlc_clone(&o_conv); + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReleaseHeldHtlcDecodeErrorZ), "LDKCResult_ReleaseHeldHtlcDecodeErrorZ"); + *ret_conv = CResult_ReleaseHeldHtlcDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReleaseHeldHtlcDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReleaseHeldHtlcDecodeErrorZ), "LDKCResult_ReleaseHeldHtlcDecodeErrorZ"); + *ret_conv = CResult_ReleaseHeldHtlcDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ReleaseHeldHtlcDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* o_conv = (LDKCResult_ReleaseHeldHtlcDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ReleaseHeldHtlcDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ReleaseHeldHtlcDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_ReleaseHeldHtlcDecodeErrorZ _res_conv = *(LDKCResult_ReleaseHeldHtlcDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_ReleaseHeldHtlcDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_ReleaseHeldHtlcDecodeErrorZ_clone_ptr(LDKCResult_ReleaseHeldHtlcDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReleaseHeldHtlcDecodeErrorZ), "LDKCResult_ReleaseHeldHtlcDecodeErrorZ"); + *ret_conv = CResult_ReleaseHeldHtlcDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReleaseHeldHtlcDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* arg_conv = (LDKCResult_ReleaseHeldHtlcDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ReleaseHeldHtlcDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReleaseHeldHtlcDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* orig_conv = (LDKCResult_ReleaseHeldHtlcDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReleaseHeldHtlcDecodeErrorZ), "LDKCResult_ReleaseHeldHtlcDecodeErrorZ"); + *ret_conv = CResult_ReleaseHeldHtlcDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsMessageDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKAsyncPaymentsMessage o_conv = *(LDKAsyncPaymentsMessage*)(o_ptr); + o_conv = AsyncPaymentsMessage_clone((LDKAsyncPaymentsMessage*)untag_ptr(o)); + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AsyncPaymentsMessageDecodeErrorZ), "LDKCResult_AsyncPaymentsMessageDecodeErrorZ"); + *ret_conv = CResult_AsyncPaymentsMessageDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsMessageDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AsyncPaymentsMessageDecodeErrorZ), "LDKCResult_AsyncPaymentsMessageDecodeErrorZ"); + *ret_conv = CResult_AsyncPaymentsMessageDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsMessageDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* o_conv = (LDKCResult_AsyncPaymentsMessageDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_AsyncPaymentsMessageDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsMessageDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_AsyncPaymentsMessageDecodeErrorZ _res_conv = *(LDKCResult_AsyncPaymentsMessageDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_AsyncPaymentsMessageDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_AsyncPaymentsMessageDecodeErrorZ_clone_ptr(LDKCResult_AsyncPaymentsMessageDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AsyncPaymentsMessageDecodeErrorZ), "LDKCResult_AsyncPaymentsMessageDecodeErrorZ"); + *ret_conv = CResult_AsyncPaymentsMessageDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsMessageDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* arg_conv = (LDKCResult_AsyncPaymentsMessageDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_AsyncPaymentsMessageDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsMessageDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* orig_conv = (LDKCResult_AsyncPaymentsMessageDecodeErrorZ*)untag_ptr(orig); + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AsyncPaymentsMessageDecodeErrorZ), "LDKCResult_AsyncPaymentsMessageDecodeErrorZ"); + *ret_conv = CResult_AsyncPaymentsMessageDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OffersMessageDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -37866,6 +39698,59 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TransactionZ_1free(JNIEn CVec_TransactionZ_free(_res_constr); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKFundingInfo o_conv = *(LDKFundingInfo*)(o_ptr); + o_conv = FundingInfo_clone((LDKFundingInfo*)untag_ptr(o)); + LDKCResult_FundingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingInfoDecodeErrorZ), "LDKCResult_FundingInfoDecodeErrorZ"); + *ret_conv = CResult_FundingInfoDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_FundingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingInfoDecodeErrorZ), "LDKCResult_FundingInfoDecodeErrorZ"); + *ret_conv = CResult_FundingInfoDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FundingInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_FundingInfoDecodeErrorZ* o_conv = (LDKCResult_FundingInfoDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_FundingInfoDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_FundingInfoDecodeErrorZ _res_conv = *(LDKCResult_FundingInfoDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_FundingInfoDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_FundingInfoDecodeErrorZ_clone_ptr(LDKCResult_FundingInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_FundingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingInfoDecodeErrorZ), "LDKCResult_FundingInfoDecodeErrorZ"); + *ret_conv = CResult_FundingInfoDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_FundingInfoDecodeErrorZ* arg_conv = (LDKCResult_FundingInfoDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_FundingInfoDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_FundingInfoDecodeErrorZ* orig_conv = (LDKCResult_FundingInfoDecodeErrorZ*)untag_ptr(orig); + LDKCResult_FundingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingInfoDecodeErrorZ), "LDKCResult_FundingInfoDecodeErrorZ"); + *ret_conv = CResult_FundingInfoDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -38273,53 +40158,100 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDesti return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentFailureReasonDecodeErrorZ_1ok(JNIEnv *env, jclass clz, jclass o) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1PaymentFailureReasonZ_1some(JNIEnv *env, jclass clz, jclass o) { LDKPaymentFailureReason o_conv = LDKPaymentFailureReason_from_java(env, o); - LDKCResult_PaymentFailureReasonDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentFailureReasonDecodeErrorZ), "LDKCResult_PaymentFailureReasonDecodeErrorZ"); - *ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_ok(o_conv); + LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); + *ret_copy = COption_PaymentFailureReasonZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1PaymentFailureReasonZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); + *ret_copy = COption_PaymentFailureReasonZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1PaymentFailureReasonZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_PaymentFailureReasonZ _res_conv = *(LDKCOption_PaymentFailureReasonZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_PaymentFailureReasonZ_free(_res_conv); +} + +static inline uint64_t COption_PaymentFailureReasonZ_clone_ptr(LDKCOption_PaymentFailureReasonZ *NONNULL_PTR arg) { + LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); + *ret_copy = COption_PaymentFailureReasonZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1PaymentFailureReasonZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_PaymentFailureReasonZ* arg_conv = (LDKCOption_PaymentFailureReasonZ*)untag_ptr(arg); + int64_t ret_conv = COption_PaymentFailureReasonZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1PaymentFailureReasonZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_PaymentFailureReasonZ* orig_conv = (LDKCOption_PaymentFailureReasonZ*)untag_ptr(orig); + LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); + *ret_copy = COption_PaymentFailureReasonZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PaymentFailureReasonZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKCOption_PaymentFailureReasonZ o_conv = *(LDKCOption_PaymentFailureReasonZ*)(o_ptr); + o_conv = COption_PaymentFailureReasonZ_clone((LDKCOption_PaymentFailureReasonZ*)untag_ptr(o)); + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ), "LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_PaymentFailureReasonZDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentFailureReasonDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PaymentFailureReasonZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_PaymentFailureReasonDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentFailureReasonDecodeErrorZ), "LDKCResult_PaymentFailureReasonDecodeErrorZ"); - *ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_err(e_conv); + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ), "LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_PaymentFailureReasonZDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentFailureReasonDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_PaymentFailureReasonDecodeErrorZ* o_conv = (LDKCResult_PaymentFailureReasonDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PaymentFailureReasonZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* o_conv = (LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_COption_PaymentFailureReasonZDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentFailureReasonDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PaymentFailureReasonZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_PaymentFailureReasonDecodeErrorZ _res_conv = *(LDKCResult_PaymentFailureReasonDecodeErrorZ*)(_res_ptr); + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ _res_conv = *(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_PaymentFailureReasonDecodeErrorZ_free(_res_conv); + CResult_COption_PaymentFailureReasonZDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_PaymentFailureReasonDecodeErrorZ_clone_ptr(LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_PaymentFailureReasonDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentFailureReasonDecodeErrorZ), "LDKCResult_PaymentFailureReasonDecodeErrorZ"); - *ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_clone(arg); +static inline uint64_t CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone_ptr(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ), "LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentFailureReasonDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_PaymentFailureReasonDecodeErrorZ* arg_conv = (LDKCResult_PaymentFailureReasonDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PaymentFailureReasonZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* arg_conv = (LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentFailureReasonDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_PaymentFailureReasonDecodeErrorZ* orig_conv = (LDKCResult_PaymentFailureReasonDecodeErrorZ*)untag_ptr(orig); - LDKCResult_PaymentFailureReasonDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentFailureReasonDecodeErrorZ), "LDKCResult_PaymentFailureReasonDecodeErrorZ"); - *ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PaymentFailureReasonZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* orig_conv = (LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ*)untag_ptr(orig); + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ), "LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -38389,50 +40321,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ClaimedHTLCZ_1free(JNIEn CVec_ClaimedHTLCZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1PaymentFailureReasonZ_1some(JNIEnv *env, jclass clz, jclass o) { - LDKPaymentFailureReason o_conv = LDKPaymentFailureReason_from_java(env, o); - LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); - *ret_copy = COption_PaymentFailureReasonZ_some(o_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1PaymentFailureReasonZ_1none(JNIEnv *env, jclass clz) { - LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); - *ret_copy = COption_PaymentFailureReasonZ_none(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1PaymentFailureReasonZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCOption_PaymentFailureReasonZ _res_conv = *(LDKCOption_PaymentFailureReasonZ*)(_res_ptr); - FREE(untag_ptr(_res)); - COption_PaymentFailureReasonZ_free(_res_conv); -} - -static inline uint64_t COption_PaymentFailureReasonZ_clone_ptr(LDKCOption_PaymentFailureReasonZ *NONNULL_PTR arg) { - LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); - *ret_copy = COption_PaymentFailureReasonZ_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1PaymentFailureReasonZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCOption_PaymentFailureReasonZ* arg_conv = (LDKCOption_PaymentFailureReasonZ*)untag_ptr(arg); - int64_t ret_conv = COption_PaymentFailureReasonZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1PaymentFailureReasonZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCOption_PaymentFailureReasonZ* orig_conv = (LDKCOption_PaymentFailureReasonZ*)untag_ptr(orig); - LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); - *ret_copy = COption_PaymentFailureReasonZ_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1some(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -38533,6 +40421,80 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDec return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonceDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKNonce o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = Nonce_clone(&o_conv); + LDKCResult_NonceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonceDecodeErrorZ), "LDKCResult_NonceDecodeErrorZ"); + *ret_conv = CResult_NonceDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonceDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_NonceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonceDecodeErrorZ), "LDKCResult_NonceDecodeErrorZ"); + *ret_conv = CResult_NonceDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonceDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NonceDecodeErrorZ* o_conv = (LDKCResult_NonceDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_NonceDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonceDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_NonceDecodeErrorZ _res_conv = *(LDKCResult_NonceDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_NonceDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_NonceDecodeErrorZ_clone_ptr(LDKCResult_NonceDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NonceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonceDecodeErrorZ), "LDKCResult_NonceDecodeErrorZ"); + *ret_conv = CResult_NonceDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonceDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NonceDecodeErrorZ* arg_conv = (LDKCResult_NonceDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_NonceDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonceDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_NonceDecodeErrorZ* orig_conv = (LDKCResult_NonceDecodeErrorZ*)untag_ptr(orig); + LDKCResult_NonceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonceDecodeErrorZ), "LDKCResult_NonceDecodeErrorZ"); + *ret_conv = CResult_NonceDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintHopZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_RouteHintHopZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t o = 0; o < _res_constr.datalen; o++) { + int64_t _res_conv_14 = _res_vals[o]; + LDKRouteHintHop _res_conv_14_conv; + _res_conv_14_conv.inner = untag_ptr(_res_conv_14); + _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv); + _res_constr.data[o] = _res_conv_14_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_RouteHintHopZ_free(_res_constr); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixBolt11ParseErrorZ_1ok(JNIEnv *env, jclass clz, jclass o) { LDKSiPrefix o_conv = LDKSiPrefix_from_java(env, o); LDKCResult_SiPrefixBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixBolt11ParseErrorZ), "LDKCResult_SiPrefixBolt11ParseErrorZ"); @@ -39166,164 +41128,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BigSizeDecodeError return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HostnameDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKHostname o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = Hostname_clone(&o_conv); - LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); - *ret_conv = CResult_HostnameDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HostnameDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); - e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); - *ret_conv = CResult_HostnameDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HostnameDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_HostnameDecodeErrorZ* o_conv = (LDKCResult_HostnameDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_HostnameDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HostnameDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_HostnameDecodeErrorZ _res_conv = *(LDKCResult_HostnameDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_HostnameDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_HostnameDecodeErrorZ_clone_ptr(LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); - *ret_conv = CResult_HostnameDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HostnameDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_HostnameDecodeErrorZ* arg_conv = (LDKCResult_HostnameDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_HostnameDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HostnameDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_HostnameDecodeErrorZ* orig_conv = (LDKCResult_HostnameDecodeErrorZ*)untag_ptr(orig); - LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); - *ret_conv = CResult_HostnameDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKTransactionU16LenLimited o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = TransactionU16LenLimited_clone(&o_conv); - LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); - *ret_conv = CResult_TransactionU16LenLimitedNoneZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); - *ret_conv = CResult_TransactionU16LenLimitedNoneZ_err(); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_TransactionU16LenLimitedNoneZ* o_conv = (LDKCResult_TransactionU16LenLimitedNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_TransactionU16LenLimitedNoneZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_TransactionU16LenLimitedNoneZ _res_conv = *(LDKCResult_TransactionU16LenLimitedNoneZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_TransactionU16LenLimitedNoneZ_free(_res_conv); -} - -static inline uint64_t CResult_TransactionU16LenLimitedNoneZ_clone_ptr(LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR arg) { - LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); - *ret_conv = CResult_TransactionU16LenLimitedNoneZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_TransactionU16LenLimitedNoneZ* arg_conv = (LDKCResult_TransactionU16LenLimitedNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_TransactionU16LenLimitedNoneZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_TransactionU16LenLimitedNoneZ* orig_conv = (LDKCResult_TransactionU16LenLimitedNoneZ*)untag_ptr(orig); - LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); - *ret_conv = CResult_TransactionU16LenLimitedNoneZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKTransactionU16LenLimited o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = TransactionU16LenLimited_clone(&o_conv); - LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); - *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); - e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); - *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_TransactionU16LenLimitedDecodeErrorZ* o_conv = (LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_TransactionU16LenLimitedDecodeErrorZ _res_conv = *(LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_TransactionU16LenLimitedDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_TransactionU16LenLimitedDecodeErrorZ_clone_ptr(LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); - *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_TransactionU16LenLimitedDecodeErrorZ* arg_conv = (LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_TransactionU16LenLimitedDecodeErrorZ* orig_conv = (LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)untag_ptr(orig); - LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); - *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UntrustedStringDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKUntrustedString o_conv; o_conv.inner = untag_ptr(o); @@ -39378,6 +41182,164 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UntrustedStringDec return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HostnameDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKHostname o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = Hostname_clone(&o_conv); + LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); + *ret_conv = CResult_HostnameDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HostnameDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); + *ret_conv = CResult_HostnameDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HostnameDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_HostnameDecodeErrorZ* o_conv = (LDKCResult_HostnameDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_HostnameDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HostnameDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_HostnameDecodeErrorZ _res_conv = *(LDKCResult_HostnameDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_HostnameDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_HostnameDecodeErrorZ_clone_ptr(LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); + *ret_conv = CResult_HostnameDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HostnameDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_HostnameDecodeErrorZ* arg_conv = (LDKCResult_HostnameDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_HostnameDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HostnameDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_HostnameDecodeErrorZ* orig_conv = (LDKCResult_HostnameDecodeErrorZ*)untag_ptr(orig); + LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); + *ret_conv = CResult_HostnameDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKTransactionU16LenLimited o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = TransactionU16LenLimited_clone(&o_conv); + LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); + *ret_conv = CResult_TransactionU16LenLimitedNoneZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); + *ret_conv = CResult_TransactionU16LenLimitedNoneZ_err(); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_TransactionU16LenLimitedNoneZ* o_conv = (LDKCResult_TransactionU16LenLimitedNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_TransactionU16LenLimitedNoneZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_TransactionU16LenLimitedNoneZ _res_conv = *(LDKCResult_TransactionU16LenLimitedNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_TransactionU16LenLimitedNoneZ_free(_res_conv); +} + +static inline uint64_t CResult_TransactionU16LenLimitedNoneZ_clone_ptr(LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR arg) { + LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); + *ret_conv = CResult_TransactionU16LenLimitedNoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_TransactionU16LenLimitedNoneZ* arg_conv = (LDKCResult_TransactionU16LenLimitedNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_TransactionU16LenLimitedNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_TransactionU16LenLimitedNoneZ* orig_conv = (LDKCResult_TransactionU16LenLimitedNoneZ*)untag_ptr(orig); + LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); + *ret_conv = CResult_TransactionU16LenLimitedNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKTransactionU16LenLimited o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = TransactionU16LenLimited_clone(&o_conv); + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); + *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); + *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* o_conv = (LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_TransactionU16LenLimitedDecodeErrorZ _res_conv = *(LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_TransactionU16LenLimitedDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_TransactionU16LenLimitedDecodeErrorZ_clone_ptr(LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); + *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* arg_conv = (LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* orig_conv = (LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)untag_ptr(orig); + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); + *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelIdDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKChannelId o_conv; o_conv.inner = untag_ptr(o); @@ -39468,6 +41430,130 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1_1u832u16Z_1free(JNIE C2Tuple__u832u16Z_free(_res_conv); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKBlindedPayInfo o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = BlindedPayInfo_clone(&o_conv); + LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); + *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); + *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_BlindedPayInfoDecodeErrorZ* o_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_BlindedPayInfoDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_BlindedPayInfoDecodeErrorZ _res_conv = *(LDKCResult_BlindedPayInfoDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_BlindedPayInfoDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_BlindedPayInfoDecodeErrorZ_clone_ptr(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); + *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_BlindedPayInfoDecodeErrorZ* arg_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BlindedPayInfoDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_BlindedPayInfoDecodeErrorZ* orig_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(orig); + LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); + *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPaymentPathNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKBlindedPaymentPath o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = BlindedPaymentPath_clone(&o_conv); + LDKCResult_BlindedPaymentPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPaymentPathNoneZ), "LDKCResult_BlindedPaymentPathNoneZ"); + *ret_conv = CResult_BlindedPaymentPathNoneZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPaymentPathNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_BlindedPaymentPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPaymentPathNoneZ), "LDKCResult_BlindedPaymentPathNoneZ"); + *ret_conv = CResult_BlindedPaymentPathNoneZ_err(); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPaymentPathNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_BlindedPaymentPathNoneZ* o_conv = (LDKCResult_BlindedPaymentPathNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_BlindedPaymentPathNoneZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPaymentPathNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_BlindedPaymentPathNoneZ _res_conv = *(LDKCResult_BlindedPaymentPathNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_BlindedPaymentPathNoneZ_free(_res_conv); +} + +static inline uint64_t CResult_BlindedPaymentPathNoneZ_clone_ptr(LDKCResult_BlindedPaymentPathNoneZ *NONNULL_PTR arg) { + LDKCResult_BlindedPaymentPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPaymentPathNoneZ), "LDKCResult_BlindedPaymentPathNoneZ"); + *ret_conv = CResult_BlindedPaymentPathNoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPaymentPathNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_BlindedPaymentPathNoneZ* arg_conv = (LDKCResult_BlindedPaymentPathNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BlindedPaymentPathNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPaymentPathNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_BlindedPaymentPathNoneZ* orig_conv = (LDKCResult_BlindedPaymentPathNoneZ*)untag_ptr(orig); + LDKCResult_BlindedPaymentPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPaymentPathNoneZ), "LDKCResult_BlindedPaymentPathNoneZ"); + *ret_conv = CResult_BlindedPaymentPathNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PaymentForwardNodeZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_PaymentForwardNodeZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPaymentForwardNode), "LDKCVec_PaymentForwardNodeZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t u = 0; u < _res_constr.datalen; u++) { + int64_t _res_conv_20 = _res_vals[u]; + LDKPaymentForwardNode _res_conv_20_conv; + _res_conv_20_conv.inner = untag_ptr(_res_conv_20); + _res_conv_20_conv.is_owned = ptr_is_owned(_res_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_20_conv); + _res_constr.data[u] = _res_conv_20_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_PaymentForwardNodeZ_free(_res_constr); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentRelayDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKPaymentRelay o_conv; o_conv.inner = untag_ptr(o); @@ -39791,196 +41877,155 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12RefundContex return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StrSecp256k1ErrorZ_1ok(JNIEnv *env, jclass clz, jstring o) { - LDKStr o_conv = java_to_owned_str(env, o); - LDKCResult_StrSecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StrSecp256k1ErrorZ), "LDKCResult_StrSecp256k1ErrorZ"); - *ret_conv = CResult_StrSecp256k1ErrorZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKTxOut o_conv = *(LDKTxOut*)(o_ptr); + o_conv = TxOut_clone((LDKTxOut*)untag_ptr(o)); + LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); + *ret_conv = CResult_TxOutUtxoLookupErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StrSecp256k1ErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { - LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e); - LDKCResult_StrSecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StrSecp256k1ErrorZ), "LDKCResult_StrSecp256k1ErrorZ"); - *ret_conv = CResult_StrSecp256k1ErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { + LDKUtxoLookupError e_conv = LDKUtxoLookupError_from_java(env, e); + LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); + *ret_conv = CResult_TxOutUtxoLookupErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1StrSecp256k1ErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_StrSecp256k1ErrorZ* o_conv = (LDKCResult_StrSecp256k1ErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_StrSecp256k1ErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_TxOutUtxoLookupErrorZ* o_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_TxOutUtxoLookupErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StrSecp256k1ErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_StrSecp256k1ErrorZ _res_conv = *(LDKCResult_StrSecp256k1ErrorZ*)(_res_ptr); + LDKCResult_TxOutUtxoLookupErrorZ _res_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_StrSecp256k1ErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_StrSecp256k1ErrorZ_clone_ptr(LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR arg) { - LDKCResult_StrSecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StrSecp256k1ErrorZ), "LDKCResult_StrSecp256k1ErrorZ"); - *ret_conv = CResult_StrSecp256k1ErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StrSecp256k1ErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_StrSecp256k1ErrorZ* arg_conv = (LDKCResult_StrSecp256k1ErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_StrSecp256k1ErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StrSecp256k1ErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_StrSecp256k1ErrorZ* orig_conv = (LDKCResult_StrSecp256k1ErrorZ*)untag_ptr(orig); - LDKCResult_StrSecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StrSecp256k1ErrorZ), "LDKCResult_StrSecp256k1ErrorZ"); - *ret_conv = CResult_StrSecp256k1ErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); + CResult_TxOutUtxoLookupErrorZ_free(_res_conv); } -static inline uint64_t C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone_ptr(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR arg) { - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ), "LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ"); - *ret_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(arg); +static inline uint64_t CResult_TxOutUtxoLookupErrorZ_clone_ptr(LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR arg) { + LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); + *ret_conv = CResult_TxOutUtxoLookupErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* arg_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(arg); - int64_t ret_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_TxOutUtxoLookupErrorZ* arg_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_TxOutUtxoLookupErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* orig_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(orig); - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ), "LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ"); - *ret_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b, int64_t c) { - LDKThirtyTwoBytes a_ref; - CHECK((*env)->GetArrayLength(env, a) == 32); - (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data); - LDKRecipientOnionFields b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv = RecipientOnionFields_clone(&b_conv); - LDKRouteParameters c_conv; - c_conv.inner = untag_ptr(c); - c_conv.is_owned = ptr_is_owned(c); - CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv); - c_conv = RouteParameters_clone(&c_conv); - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ), "LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ"); - *ret_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new(a_ref, b_conv, c_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_TxOutUtxoLookupErrorZ* orig_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(orig); + LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); + *ret_conv = CResult_TxOutUtxoLookupErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ _res_conv = *(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)(_res_ptr); - FREE(untag_ptr(_res)); - C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(_res_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ o_conv = *(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)(o_ptr); - o_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone((LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(o)); - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); - *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ResponderDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKResponder o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = Responder_clone(&o_conv); + LDKCResult_ResponderDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ResponderDecodeErrorZ), "LDKCResult_ResponderDecodeErrorZ"); + *ret_conv = CResult_ResponderDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); - *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ResponderDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_ResponderDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ResponderDecodeErrorZ), "LDKCResult_ResponderDecodeErrorZ"); + *ret_conv = CResult_ResponderDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* o_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ResponderDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ResponderDecodeErrorZ* o_conv = (LDKCResult_ResponderDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ResponderDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ResponderDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ _res_conv = *(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)(_res_ptr); + LDKCResult_ResponderDecodeErrorZ _res_conv = *(LDKCResult_ResponderDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(_res_conv); + CResult_ResponderDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone_ptr(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR arg) { - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); - *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone(arg); +static inline uint64_t CResult_ResponderDecodeErrorZ_clone_ptr(LDKCResult_ResponderDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ResponderDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ResponderDecodeErrorZ), "LDKCResult_ResponderDecodeErrorZ"); + *ret_conv = CResult_ResponderDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* arg_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ResponderDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ResponderDecodeErrorZ* arg_conv = (LDKCResult_ResponderDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ResponderDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* orig_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(orig); - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); - *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ResponderDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_ResponderDecodeErrorZ* orig_conv = (LDKCResult_ResponderDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ResponderDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ResponderDecodeErrorZ), "LDKCResult_ResponderDecodeErrorZ"); + *ret_conv = CResult_ResponderDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MessageContextZ_1some(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); - LDKTxOut o_conv = *(LDKTxOut*)(o_ptr); - o_conv = TxOut_clone((LDKTxOut*)untag_ptr(o)); - LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); - *ret_conv = CResult_TxOutUtxoLookupErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { - LDKUtxoLookupError e_conv = LDKUtxoLookupError_from_java(env, e); - LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); - *ret_conv = CResult_TxOutUtxoLookupErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); + LDKMessageContext o_conv = *(LDKMessageContext*)(o_ptr); + o_conv = MessageContext_clone((LDKMessageContext*)untag_ptr(o)); + LDKCOption_MessageContextZ *ret_copy = MALLOC(sizeof(LDKCOption_MessageContextZ), "LDKCOption_MessageContextZ"); + *ret_copy = COption_MessageContextZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_TxOutUtxoLookupErrorZ* o_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_TxOutUtxoLookupErrorZ_is_ok(o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MessageContextZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_MessageContextZ *ret_copy = MALLOC(sizeof(LDKCOption_MessageContextZ), "LDKCOption_MessageContextZ"); + *ret_copy = COption_MessageContextZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1MessageContextZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_TxOutUtxoLookupErrorZ _res_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(_res_ptr); + LDKCOption_MessageContextZ _res_conv = *(LDKCOption_MessageContextZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_TxOutUtxoLookupErrorZ_free(_res_conv); + COption_MessageContextZ_free(_res_conv); } -static inline uint64_t CResult_TxOutUtxoLookupErrorZ_clone_ptr(LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR arg) { - LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); - *ret_conv = CResult_TxOutUtxoLookupErrorZ_clone(arg); - return tag_ptr(ret_conv, true); +static inline uint64_t COption_MessageContextZ_clone_ptr(LDKCOption_MessageContextZ *NONNULL_PTR arg) { + LDKCOption_MessageContextZ *ret_copy = MALLOC(sizeof(LDKCOption_MessageContextZ), "LDKCOption_MessageContextZ"); + *ret_copy = COption_MessageContextZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_TxOutUtxoLookupErrorZ* arg_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_TxOutUtxoLookupErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MessageContextZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_MessageContextZ* arg_conv = (LDKCOption_MessageContextZ*)untag_ptr(arg); + int64_t ret_conv = COption_MessageContextZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_TxOutUtxoLookupErrorZ* orig_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(orig); - LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); - *ret_conv = CResult_TxOutUtxoLookupErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MessageContextZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_MessageContextZ* orig_conv = (LDKCOption_MessageContextZ*)untag_ptr(orig); + LDKCOption_MessageContextZ *ret_copy = MALLOC(sizeof(LDKCOption_MessageContextZ), "LDKCOption_MessageContextZ"); + *ret_copy = COption_MessageContextZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } static inline uint64_t C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone_ptr(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *NONNULL_PTR arg) { @@ -40183,265 +42228,215 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SendSuccessSendErr return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKBlindedPath o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = BlindedPath_clone(&o_conv); - LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); - *ret_conv = CResult_BlindedPathNoneZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1ok(JNIEnv *env, jclass clz) { + LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ"); + *ret_conv = CResult_NoneSendErrorZ_ok(); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); - *ret_conv = CResult_BlindedPathNoneZ_err(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKSendError e_conv = *(LDKSendError*)(e_ptr); + e_conv = SendError_clone((LDKSendError*)untag_ptr(e)); + LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ"); + *ret_conv = CResult_NoneSendErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_BlindedPathNoneZ* o_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_BlindedPathNoneZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneSendErrorZ* o_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_NoneSendErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_BlindedPathNoneZ _res_conv = *(LDKCResult_BlindedPathNoneZ*)(_res_ptr); + LDKCResult_NoneSendErrorZ _res_conv = *(LDKCResult_NoneSendErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_BlindedPathNoneZ_free(_res_conv); + CResult_NoneSendErrorZ_free(_res_conv); } -static inline uint64_t CResult_BlindedPathNoneZ_clone_ptr(LDKCResult_BlindedPathNoneZ *NONNULL_PTR arg) { - LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); - *ret_conv = CResult_BlindedPathNoneZ_clone(arg); +static inline uint64_t CResult_NoneSendErrorZ_clone_ptr(LDKCResult_NoneSendErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ"); + *ret_conv = CResult_NoneSendErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_BlindedPathNoneZ* arg_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_BlindedPathNoneZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NoneSendErrorZ* arg_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_NoneSendErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_BlindedPathNoneZ* orig_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(orig); - LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); - *ret_conv = CResult_BlindedPathNoneZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_NoneSendErrorZ* orig_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(orig); + LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ"); + *ret_conv = CResult_NoneSendErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlindedPayInfoBlindedPathZNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ o_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(o_ptr); - o_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(o)); - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ), "LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ"); - *ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKBlindedHop o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = BlindedHop_clone(&o_conv); + LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); + *ret_conv = CResult_BlindedHopDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlindedPayInfoBlindedPathZNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ), "LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ"); - *ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_err(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); + *ret_conv = CResult_BlindedHopDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlindedPayInfoBlindedPathZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* o_conv = (LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_BlindedHopDecodeErrorZ* o_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_BlindedHopDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlindedPayInfoBlindedPathZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ _res_conv = *(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ*)(_res_ptr); + LDKCResult_BlindedHopDecodeErrorZ _res_conv = *(LDKCResult_BlindedHopDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free(_res_conv); + CResult_BlindedHopDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone_ptr(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR arg) { - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ), "LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ"); - *ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(arg); +static inline uint64_t CResult_BlindedHopDecodeErrorZ_clone_ptr(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); + *ret_conv = CResult_BlindedHopDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlindedPayInfoBlindedPathZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* arg_conv = (LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_BlindedHopDecodeErrorZ* arg_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BlindedHopDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlindedPayInfoBlindedPathZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* orig_conv = (LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ*)untag_ptr(orig); - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ), "LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ"); - *ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_BlindedHopDecodeErrorZ* orig_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(orig); + LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); + *ret_conv = CResult_BlindedHopDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ForwardNodeZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_ForwardNodeZ _res_constr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PhantomRouteHintsZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_PhantomRouteHintsZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKForwardNode), "LDKCVec_ForwardNodeZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements"); else _res_constr.data = NULL; int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t n = 0; n < _res_constr.datalen; n++) { - int64_t _res_conv_13 = _res_vals[n]; - LDKForwardNode _res_conv_13_conv; - _res_conv_13_conv.inner = untag_ptr(_res_conv_13); - _res_conv_13_conv.is_owned = ptr_is_owned(_res_conv_13); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_13_conv); - _res_constr.data[n] = _res_conv_13_conv; + for (size_t t = 0; t < _res_constr.datalen; t++) { + int64_t _res_conv_19 = _res_vals[t]; + LDKPhantomRouteHints _res_conv_19_conv; + _res_conv_19_conv.inner = untag_ptr(_res_conv_19); + _res_conv_19_conv.is_owned = ptr_is_owned(_res_conv_19); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_19_conv); + _res_constr.data[t] = _res_conv_19_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_ForwardNodeZ_free(_res_constr); + CVec_PhantomRouteHintsZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKBlindedPath o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKBolt11Invoice o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = BlindedPath_clone(&o_conv); - LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ"); - *ret_conv = CResult_BlindedPathDecodeErrorZ_ok(o_conv); + o_conv = Bolt11Invoice_clone(&o_conv); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); - LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); - e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ"); - *ret_conv = CResult_BlindedPathDecodeErrorZ_err(e_conv); + LDKSignOrCreationError e_conv = *(LDKSignOrCreationError*)(e_ptr); + e_conv = SignOrCreationError_clone((LDKSignOrCreationError*)untag_ptr(e)); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_BlindedPathDecodeErrorZ* o_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_BlindedPathDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* o_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_BlindedPathDecodeErrorZ _res_conv = *(LDKCResult_BlindedPathDecodeErrorZ*)(_res_ptr); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ _res_conv = *(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_BlindedPathDecodeErrorZ_free(_res_conv); + CResult_Bolt11InvoiceSignOrCreationErrorZ_free(_res_conv); } -static inline uint64_t CResult_BlindedPathDecodeErrorZ_clone_ptr(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ"); - *ret_conv = CResult_BlindedPathDecodeErrorZ_clone(arg); +static inline uint64_t CResult_Bolt11InvoiceSignOrCreationErrorZ_clone_ptr(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_BlindedPathDecodeErrorZ* arg_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_BlindedPathDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* arg_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_BlindedPathDecodeErrorZ* orig_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(orig); - LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ"); - *ret_conv = CResult_BlindedPathDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* orig_conv = (LDKCResult_Bolt11InvoiceSignOrCreationErrorZ*)untag_ptr(orig); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKBlindedHop o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceErrorDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKInvoiceError o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = BlindedHop_clone(&o_conv); - LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); - *ret_conv = CResult_BlindedHopDecodeErrorZ_ok(o_conv); + o_conv = InvoiceError_clone(&o_conv); + LDKCResult_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); + *ret_conv = CResult_InvoiceErrorDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceErrorDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); - *ret_conv = CResult_BlindedHopDecodeErrorZ_err(e_conv); + LDKCResult_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); + *ret_conv = CResult_InvoiceErrorDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_BlindedHopDecodeErrorZ* o_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_BlindedHopDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceErrorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InvoiceErrorDecodeErrorZ* o_conv = (LDKCResult_InvoiceErrorDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceErrorDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceErrorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_BlindedHopDecodeErrorZ _res_conv = *(LDKCResult_BlindedHopDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_BlindedHopDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_BlindedHopDecodeErrorZ_clone_ptr(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); - *ret_conv = CResult_BlindedHopDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_BlindedHopDecodeErrorZ* arg_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_BlindedHopDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_BlindedHopDecodeErrorZ* orig_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(orig); - LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); - *ret_conv = CResult_BlindedHopDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceErrorDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKInvoiceError o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = InvoiceError_clone(&o_conv); - LDKCResult_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); - *ret_conv = CResult_InvoiceErrorDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceErrorDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); - e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); - *ret_conv = CResult_InvoiceErrorDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceErrorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_InvoiceErrorDecodeErrorZ* o_conv = (LDKCResult_InvoiceErrorDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_InvoiceErrorDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceErrorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_InvoiceErrorDecodeErrorZ _res_conv = *(LDKCResult_InvoiceErrorDecodeErrorZ*)(_res_ptr); + LDKCResult_InvoiceErrorDecodeErrorZ _res_conv = *(LDKCResult_InvoiceErrorDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); CResult_InvoiceErrorDecodeErrorZ_free(_res_conv); } @@ -41139,99 +43134,284 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1OutPointChannel CVec_C2Tuple_OutPointChannelIdZZ_free(_res_constr); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MonitorUpdateIdZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_MonitorUpdateIdZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMonitorUpdateId), "LDKCVec_MonitorUpdateIdZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t r = 0; r < _res_constr.datalen; r++) { - int64_t _res_conv_17 = _res_vals[r]; - LDKMonitorUpdateId _res_conv_17_conv; - _res_conv_17_conv.inner = untag_ptr(_res_conv_17); - _res_conv_17_conv.is_owned = ptr_is_owned(_res_conv_17); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_17_conv); - _res_constr.data[r] = _res_conv_17_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_MonitorUpdateIdZ_free(_res_constr); -} - -static inline uint64_t C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR arg) { - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ"); - *ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(arg); +static inline uint64_t C2Tuple_OutPointCVec_u64ZZ_clone_ptr(LDKC2Tuple_OutPointCVec_u64ZZ *NONNULL_PTR arg) { + LDKC2Tuple_OutPointCVec_u64ZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_u64ZZ), "LDKC2Tuple_OutPointCVec_u64ZZ"); + *ret_conv = C2Tuple_OutPointCVec_u64ZZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* arg_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(arg); - int64_t ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1u64ZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_OutPointCVec_u64ZZ* arg_conv = (LDKC2Tuple_OutPointCVec_u64ZZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_OutPointCVec_u64ZZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* orig_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(orig); - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ"); - *ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1u64ZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_OutPointCVec_u64ZZ* orig_conv = (LDKC2Tuple_OutPointCVec_u64ZZ*)untag_ptr(orig); + LDKC2Tuple_OutPointCVec_u64ZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_u64ZZ), "LDKC2Tuple_OutPointCVec_u64ZZ"); + *ret_conv = C2Tuple_OutPointCVec_u64ZZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_tArray b) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1u64ZZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_tArray b) { LDKOutPoint a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = OutPoint_clone(&a_conv); - LDKCVec_MonitorUpdateIdZ b_constr; + LDKCVec_u64Z b_constr; b_constr.datalen = (*env)->GetArrayLength(env, b); if (b_constr.datalen > 0) - b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKMonitorUpdateId), "LDKCVec_MonitorUpdateIdZ Elements"); + b_constr.data = MALLOC(b_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); else b_constr.data = NULL; int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL); - for (size_t r = 0; r < b_constr.datalen; r++) { - int64_t b_conv_17 = b_vals[r]; - LDKMonitorUpdateId b_conv_17_conv; - b_conv_17_conv.inner = untag_ptr(b_conv_17); - b_conv_17_conv.is_owned = ptr_is_owned(b_conv_17); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv_17_conv); - b_conv_17_conv = MonitorUpdateId_clone(&b_conv_17_conv); - b_constr.data[r] = b_conv_17_conv; + for (size_t g = 0; g < b_constr.datalen; g++) { + int64_t b_conv_6 = b_vals[g]; + b_constr.data[g] = b_conv_6; } (*env)->ReleaseLongArrayElements(env, b, b_vals, 0); - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ"); - *ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(a_conv, b_constr); + LDKC2Tuple_OutPointCVec_u64ZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_u64ZZ), "LDKC2Tuple_OutPointCVec_u64ZZ"); + *ret_conv = C2Tuple_OutPointCVec_u64ZZ_new(a_conv, b_constr); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1u64ZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res_conv = *(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)(_res_ptr); + LDKC2Tuple_OutPointCVec_u64ZZ _res_conv = *(LDKC2Tuple_OutPointCVec_u64ZZ*)(_res_ptr); FREE(untag_ptr(_res)); - C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(_res_conv); + C2Tuple_OutPointCVec_u64ZZ_free(_res_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1OutPointCVec_1MonitorUpdateIdZZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ _res_constr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1OutPointCVec_1u64ZZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C2Tuple_OutPointCVec_u64ZZZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OutPointCVec_u64ZZ), "LDKCVec_C2Tuple_OutPointCVec_u64ZZZ Elements"); else _res_constr.data = NULL; int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t p = 0; p < _res_constr.datalen; p++) { - int64_t _res_conv_41 = _res_vals[p]; - void* _res_conv_41_ptr = untag_ptr(_res_conv_41); - CHECK_ACCESS(_res_conv_41_ptr); - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res_conv_41_conv = *(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)(_res_conv_41_ptr); - FREE(untag_ptr(_res_conv_41)); - _res_constr.data[p] = _res_conv_41_conv; + for (size_t d = 0; d < _res_constr.datalen; d++) { + int64_t _res_conv_29 = _res_vals[d]; + void* _res_conv_29_ptr = untag_ptr(_res_conv_29); + CHECK_ACCESS(_res_conv_29_ptr); + LDKC2Tuple_OutPointCVec_u64ZZ _res_conv_29_conv = *(LDKC2Tuple_OutPointCVec_u64ZZ*)(_res_conv_29_ptr); + FREE(untag_ptr(_res_conv_29)); + _res_constr.data[d] = _res_conv_29_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(_res_constr); + CVec_C2Tuple_OutPointCVec_u64ZZZ_free(_res_constr); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKBlindedMessagePath o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = BlindedMessagePath_clone(&o_conv); + LDKCResult_BlindedMessagePathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathDecodeErrorZ), "LDKCResult_BlindedMessagePathDecodeErrorZ"); + *ret_conv = CResult_BlindedMessagePathDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_BlindedMessagePathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathDecodeErrorZ), "LDKCResult_BlindedMessagePathDecodeErrorZ"); + *ret_conv = CResult_BlindedMessagePathDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_BlindedMessagePathDecodeErrorZ* o_conv = (LDKCResult_BlindedMessagePathDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_BlindedMessagePathDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_BlindedMessagePathDecodeErrorZ _res_conv = *(LDKCResult_BlindedMessagePathDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_BlindedMessagePathDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_BlindedMessagePathDecodeErrorZ_clone_ptr(LDKCResult_BlindedMessagePathDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_BlindedMessagePathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathDecodeErrorZ), "LDKCResult_BlindedMessagePathDecodeErrorZ"); + *ret_conv = CResult_BlindedMessagePathDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_BlindedMessagePathDecodeErrorZ* arg_conv = (LDKCResult_BlindedMessagePathDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BlindedMessagePathDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_BlindedMessagePathDecodeErrorZ* orig_conv = (LDKCResult_BlindedMessagePathDecodeErrorZ*)untag_ptr(orig); + LDKCResult_BlindedMessagePathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathDecodeErrorZ), "LDKCResult_BlindedMessagePathDecodeErrorZ"); + *ret_conv = CResult_BlindedMessagePathDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKBlindedMessagePath o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = BlindedMessagePath_clone(&o_conv); + LDKCResult_BlindedMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathNoneZ), "LDKCResult_BlindedMessagePathNoneZ"); + *ret_conv = CResult_BlindedMessagePathNoneZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_BlindedMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathNoneZ), "LDKCResult_BlindedMessagePathNoneZ"); + *ret_conv = CResult_BlindedMessagePathNoneZ_err(); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_BlindedMessagePathNoneZ* o_conv = (LDKCResult_BlindedMessagePathNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_BlindedMessagePathNoneZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_BlindedMessagePathNoneZ _res_conv = *(LDKCResult_BlindedMessagePathNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_BlindedMessagePathNoneZ_free(_res_conv); +} + +static inline uint64_t CResult_BlindedMessagePathNoneZ_clone_ptr(LDKCResult_BlindedMessagePathNoneZ *NONNULL_PTR arg) { + LDKCResult_BlindedMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathNoneZ), "LDKCResult_BlindedMessagePathNoneZ"); + *ret_conv = CResult_BlindedMessagePathNoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_BlindedMessagePathNoneZ* arg_conv = (LDKCResult_BlindedMessagePathNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BlindedMessagePathNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_BlindedMessagePathNoneZ* orig_conv = (LDKCResult_BlindedMessagePathNoneZ*)untag_ptr(orig); + LDKCResult_BlindedMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathNoneZ), "LDKCResult_BlindedMessagePathNoneZ"); + *ret_conv = CResult_BlindedMessagePathNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1MessageContextDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKMessageContext o_conv = *(LDKMessageContext*)(o_ptr); + o_conv = MessageContext_clone((LDKMessageContext*)untag_ptr(o)); + LDKCResult_MessageContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_MessageContextDecodeErrorZ), "LDKCResult_MessageContextDecodeErrorZ"); + *ret_conv = CResult_MessageContextDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1MessageContextDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_MessageContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_MessageContextDecodeErrorZ), "LDKCResult_MessageContextDecodeErrorZ"); + *ret_conv = CResult_MessageContextDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1MessageContextDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_MessageContextDecodeErrorZ* o_conv = (LDKCResult_MessageContextDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_MessageContextDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1MessageContextDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_MessageContextDecodeErrorZ _res_conv = *(LDKCResult_MessageContextDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_MessageContextDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_MessageContextDecodeErrorZ_clone_ptr(LDKCResult_MessageContextDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_MessageContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_MessageContextDecodeErrorZ), "LDKCResult_MessageContextDecodeErrorZ"); + *ret_conv = CResult_MessageContextDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1MessageContextDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_MessageContextDecodeErrorZ* arg_conv = (LDKCResult_MessageContextDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_MessageContextDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1MessageContextDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_MessageContextDecodeErrorZ* orig_conv = (LDKCResult_MessageContextDecodeErrorZ*)untag_ptr(orig); + LDKCResult_MessageContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_MessageContextDecodeErrorZ), "LDKCResult_MessageContextDecodeErrorZ"); + *ret_conv = CResult_MessageContextDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OffersContextDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKOffersContext o_conv = *(LDKOffersContext*)(o_ptr); + o_conv = OffersContext_clone((LDKOffersContext*)untag_ptr(o)); + LDKCResult_OffersContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersContextDecodeErrorZ), "LDKCResult_OffersContextDecodeErrorZ"); + *ret_conv = CResult_OffersContextDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OffersContextDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_OffersContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersContextDecodeErrorZ), "LDKCResult_OffersContextDecodeErrorZ"); + *ret_conv = CResult_OffersContextDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OffersContextDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_OffersContextDecodeErrorZ* o_conv = (LDKCResult_OffersContextDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OffersContextDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OffersContextDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_OffersContextDecodeErrorZ _res_conv = *(LDKCResult_OffersContextDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_OffersContextDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_OffersContextDecodeErrorZ_clone_ptr(LDKCResult_OffersContextDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OffersContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersContextDecodeErrorZ), "LDKCResult_OffersContextDecodeErrorZ"); + *ret_conv = CResult_OffersContextDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OffersContextDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_OffersContextDecodeErrorZ* arg_conv = (LDKCResult_OffersContextDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OffersContextDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OffersContextDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_OffersContextDecodeErrorZ* orig_conv = (LDKCResult_OffersContextDecodeErrorZ*)untag_ptr(orig); + LDKCResult_OffersContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersContextDecodeErrorZ), "LDKCResult_OffersContextDecodeErrorZ"); + *ret_conv = CResult_OffersContextDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_APIError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -41453,6 +43633,29 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BigSize_1read(JNIEnv *env, return tag_ptr(ret_conv, true); } +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UntrustedString_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKUntrustedString obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = UntrustedString_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UntrustedString_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ"); + *ret_conv = UntrustedString_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Hostname_1free(JNIEnv *env, jclass clz, int64_t this_obj) { LDKHostname this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -41684,7 +43887,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TransactionU16LenLimited_1r return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_sign(JNIEnv *env, jclass clz, int8_tArray msg, int8_tArray sk) { +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_sign(JNIEnv *env, jclass clz, int8_tArray msg, int8_tArray sk) { LDKu8slice msg_ref; msg_ref.datalen = (*env)->GetArrayLength(env, msg); msg_ref.data = (*env)->GetByteArrayElements (env, msg, NULL); @@ -41692,10 +43895,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_sign(JNIEnv *env, jclass cl CHECK((*env)->GetArrayLength(env, sk) == 32); (*env)->GetByteArrayRegion(env, sk, 0, 32, sk_arr); uint8_t (*sk_ref)[32] = &sk_arr; - LDKCResult_StrSecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StrSecp256k1ErrorZ), "LDKCResult_StrSecp256k1ErrorZ"); - *ret_conv = sign(msg_ref, sk_ref); + LDKStr ret_str = sign(msg_ref, sk_ref); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); (*env)->ReleaseByteArrayElements(env, msg, (int8_t*)msg_ref.data, 0); - return tag_ptr(ret_conv, true); + return ret_conv; } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_recover_1pk(JNIEnv *env, jclass clz, int8_tArray msg, jstring sig) { @@ -41722,31 +43926,6 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_verify(JNIEnv *env, jclass return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_construct_1invoice_1preimage(JNIEnv *env, jclass clz, int8_tArray hrp_bytes, jobjectArray data_without_signature) { - LDKu8slice hrp_bytes_ref; - hrp_bytes_ref.datalen = (*env)->GetArrayLength(env, hrp_bytes); - hrp_bytes_ref.data = (*env)->GetByteArrayElements (env, hrp_bytes, NULL); - LDKCVec_U5Z data_without_signature_constr; - data_without_signature_constr.datalen = (*env)->GetArrayLength(env, data_without_signature); - if (data_without_signature_constr.datalen > 0) - data_without_signature_constr.data = MALLOC(data_without_signature_constr.datalen * sizeof(LDKU5), "LDKCVec_U5Z Elements"); - else - data_without_signature_constr.data = NULL; - int8_t* data_without_signature_vals = (*env)->GetByteArrayElements (env, data_without_signature, NULL); - for (size_t h = 0; h < data_without_signature_constr.datalen; h++) { - int8_t data_without_signature_conv_7 = data_without_signature_vals[h]; - - data_without_signature_constr.data[h] = (LDKU5){ ._0 = data_without_signature_conv_7 }; - } - (*env)->ReleaseByteArrayElements(env, data_without_signature, data_without_signature_vals, 0); - LDKCVec_u8Z ret_var = construct_invoice_preimage(hrp_bytes_ref, data_without_signature_constr); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - (*env)->ReleaseByteArrayElements(env, hrp_bytes, (int8_t*)hrp_bytes_ref.data, 0); - return ret_arr; -} - JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KVStore_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -41800,7 +43979,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdatingPersister_1free MonitorUpdatingPersister_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdatingPersister_1new(JNIEnv *env, jclass clz, int64_t kv_store, int64_t logger, int64_t maximum_pending_updates, int64_t entropy_source, int64_t signer_provider) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdatingPersister_1new(JNIEnv *env, jclass clz, int64_t kv_store, int64_t logger, int64_t maximum_pending_updates, int64_t entropy_source, int64_t signer_provider, int64_t broadcaster, int64_t fee_estimator) { void* kv_store_ptr = untag_ptr(kv_store); CHECK_ACCESS(kv_store_ptr); LDKKVStore kv_store_conv = *(LDKKVStore*)(kv_store_ptr); @@ -41829,45 +44008,47 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdatingPersister_1n // If this_arg is a JCalls struct, then we need to increment the refcnt in it. LDKSignerProvider_JCalls_cloned(&signer_provider_conv); } - LDKMonitorUpdatingPersister ret_var = MonitorUpdatingPersister_new(kv_store_conv, logger_conv, maximum_pending_updates, entropy_source_conv, signer_provider_conv); + void* broadcaster_ptr = untag_ptr(broadcaster); + CHECK_ACCESS(broadcaster_ptr); + LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); + if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); + } + void* fee_estimator_ptr = untag_ptr(fee_estimator); + CHECK_ACCESS(fee_estimator_ptr); + LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); + if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); + } + LDKMonitorUpdatingPersister ret_var = MonitorUpdatingPersister_new(kv_store_conv, logger_conv, maximum_pending_updates, entropy_source_conv, signer_provider_conv, broadcaster_conv, fee_estimator_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdatingPersister_1read_1all_1channel_1monitors_1with_1updates(JNIEnv *env, jclass clz, int64_t this_arg, int64_t broadcaster, int64_t fee_estimator) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdatingPersister_1read_1all_1channel_1monitors_1with_1updates(JNIEnv *env, jclass clz, int64_t this_arg) { LDKMonitorUpdatingPersister this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - void* broadcaster_ptr = untag_ptr(broadcaster); - if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); } - LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; - void* fee_estimator_ptr = untag_ptr(fee_estimator); - if (ptr_is_owned(fee_estimator)) { CHECK_ACCESS(fee_estimator_ptr); } - LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ), "LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ"); - *ret_conv = MonitorUpdatingPersister_read_all_channel_monitors_with_updates(&this_arg_conv, broadcaster_conv, fee_estimator_conv); + *ret_conv = MonitorUpdatingPersister_read_all_channel_monitors_with_updates(&this_arg_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdatingPersister_1read_1channel_1monitor_1with_1updates(JNIEnv *env, jclass clz, int64_t this_arg, int64_t broadcaster, int64_t fee_estimator, jstring monitor_key) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdatingPersister_1read_1channel_1monitor_1with_1updates(JNIEnv *env, jclass clz, int64_t this_arg, jstring monitor_key) { LDKMonitorUpdatingPersister this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - void* broadcaster_ptr = untag_ptr(broadcaster); - if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); } - LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; - void* fee_estimator_ptr = untag_ptr(fee_estimator); - if (ptr_is_owned(fee_estimator)) { CHECK_ACCESS(fee_estimator_ptr); } - LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; LDKStr monitor_key_conv = java_to_owned_str(env, monitor_key); LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ), "LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ"); - *ret_conv = MonitorUpdatingPersister_read_channel_monitor_with_updates(&this_arg_conv, broadcaster_conv, fee_estimator_conv, monitor_key_conv); + *ret_conv = MonitorUpdatingPersister_read_channel_monitor_with_updates(&this_arg_conv, monitor_key_conv); return tag_ptr(ret_conv, true); } @@ -41942,186 +44123,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_scid_1from_1parts(JNIEnv *e return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UntrustedString_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKUntrustedString this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - UntrustedString_free(this_obj_conv); -} - -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_UntrustedString_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUntrustedString this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKStr ret_str = UntrustedString_get_a(&this_ptr_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UntrustedString_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { - LDKUntrustedString this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKStr val_conv = java_to_owned_str(env, val); - UntrustedString_set_a(&this_ptr_conv, val_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UntrustedString_1new(JNIEnv *env, jclass clz, jstring a_arg) { - LDKStr a_arg_conv = java_to_owned_str(env, a_arg); - LDKUntrustedString ret_var = UntrustedString_new(a_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline uint64_t UntrustedString_clone_ptr(LDKUntrustedString *NONNULL_PTR arg) { - LDKUntrustedString ret_var = UntrustedString_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UntrustedString_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKUntrustedString arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = UntrustedString_clone_ptr(&arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UntrustedString_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKUntrustedString orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKUntrustedString ret_var = UntrustedString_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UntrustedString_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKUntrustedString a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKUntrustedString b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = UntrustedString_eq(&a_conv, &b_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UntrustedString_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKUntrustedString o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = UntrustedString_hash(&o_conv); - return ret_conv; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UntrustedString_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKUntrustedString obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = UntrustedString_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UntrustedString_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ"); - *ret_conv = UntrustedString_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_UntrustedString_1to_1str(JNIEnv *env, jclass clz, int64_t o) { - LDKUntrustedString o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = UntrustedString_to_str(&o_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PrintableString_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKPrintableString this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PrintableString_free(this_obj_conv); -} - -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_PrintableString_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPrintableString this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKStr ret_str = PrintableString_get_a(&this_ptr_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PrintableString_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { - LDKPrintableString this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKStr val_conv = java_to_owned_str(env, val); - PrintableString_set_a(&this_ptr_conv, val_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrintableString_1new(JNIEnv *env, jclass clz, jstring a_arg) { - LDKStr a_arg_conv = java_to_owned_str(env, a_arg); - LDKPrintableString ret_var = PrintableString_new(a_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_PrintableString_1to_1str(JNIEnv *env, jclass clz, int64_t o) { - LDKPrintableString o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = PrintableString_to_str(&o_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; -} - JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TrackedSpendableOutput_1free(JNIEnv *env, jclass clz, int64_t this_obj) { LDKTrackedSpendableOutput this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -42837,6 +44838,29 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sleeper_1from_1two_1futures return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sleeper_1from_1three_1futures(JNIEnv *env, jclass clz, int64_t fut_a, int64_t fut_b, int64_t fut_c) { + LDKFuture fut_a_conv; + fut_a_conv.inner = untag_ptr(fut_a); + fut_a_conv.is_owned = ptr_is_owned(fut_a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(fut_a_conv); + fut_a_conv.is_owned = false; + LDKFuture fut_b_conv; + fut_b_conv.inner = untag_ptr(fut_b); + fut_b_conv.is_owned = ptr_is_owned(fut_b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(fut_b_conv); + fut_b_conv.is_owned = false; + LDKFuture fut_c_conv; + fut_c_conv.inner = untag_ptr(fut_c); + fut_c_conv.is_owned = ptr_is_owned(fut_c); + CHECK_INNER_FIELD_ACCESS_OR_NULL(fut_c_conv); + fut_c_conv.is_owned = false; + LDKSleeper ret_var = Sleeper_from_three_futures(&fut_a_conv, &fut_b_conv, &fut_c_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sleeper_1new(JNIEnv *env, jclass clz, int64_tArray futures) { LDKCVec_FutureZ futures_constr; futures_constr.datalen = (*env)->GetArrayLength(env, futures); @@ -43107,7 +45131,32 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1line(JNIEnv *env, Record_set_line(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Record_1new(JNIEnv *env, jclass clz, jclass level_arg, int8_tArray peer_id_arg, int64_t channel_id_arg, jstring args_arg, jstring module_path_arg, jstring file_arg, int32_t line_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Record_1get_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); + *ret_copy = Record_get_payment_hash(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_ThirtyTwoBytesZ val_conv = *(LDKCOption_ThirtyTwoBytesZ*)(val_ptr); + val_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(val)); + Record_set_payment_hash(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Record_1new(JNIEnv *env, jclass clz, jclass level_arg, int8_tArray peer_id_arg, int64_t channel_id_arg, jstring args_arg, jstring module_path_arg, jstring file_arg, int32_t line_arg, int64_t payment_hash_arg) { LDKLevel level_arg_conv = LDKLevel_from_java(env, level_arg); LDKPublicKey peer_id_arg_ref; CHECK((*env)->GetArrayLength(env, peer_id_arg) == 33); @@ -43120,7 +45169,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Record_1new(JNIEnv *env, jc LDKStr args_arg_conv = java_to_owned_str(env, args_arg); LDKStr module_path_arg_conv = java_to_owned_str(env, module_path_arg); LDKStr file_arg_conv = java_to_owned_str(env, file_arg); - LDKRecord ret_var = Record_new(level_arg_conv, peer_id_arg_ref, channel_id_arg_conv, args_arg_conv, module_path_arg_conv, file_arg_conv, line_arg); + void* payment_hash_arg_ptr = untag_ptr(payment_hash_arg); + CHECK_ACCESS(payment_hash_arg_ptr); + LDKCOption_ThirtyTwoBytesZ payment_hash_arg_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_arg_ptr); + payment_hash_arg_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash_arg)); + LDKRecord ret_var = Record_new(level_arg_conv, peer_id_arg_ref, channel_id_arg_conv, args_arg_conv, module_path_arg_conv, file_arg_conv, line_arg, payment_hash_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -43269,23 +45322,23 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1n ChannelHandshakeConfig_set_negotiate_scid_privacy(&this_ptr_conv, val); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1announced_1channel(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1announce_1for_1forwarding(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - jboolean ret_conv = ChannelHandshakeConfig_get_announced_channel(&this_ptr_conv); + jboolean ret_conv = ChannelHandshakeConfig_get_announce_for_forwarding(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1announced_1channel(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1announce_1for_1forwarding(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelHandshakeConfig_set_announced_channel(&this_ptr_conv, val); + ChannelHandshakeConfig_set_announce_for_forwarding(&this_ptr_conv, val); } JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1commit_1upfront_1shutdown_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -43364,8 +45417,8 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1o ChannelHandshakeConfig_set_our_max_accepted_htlcs(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1new(JNIEnv *env, jclass clz, int32_t minimum_depth_arg, int16_t our_to_self_delay_arg, int64_t our_htlc_minimum_msat_arg, int8_t max_inbound_htlc_value_in_flight_percent_of_channel_arg, jboolean negotiate_scid_privacy_arg, jboolean announced_channel_arg, jboolean commit_upfront_shutdown_pubkey_arg, int32_t their_channel_reserve_proportional_millionths_arg, jboolean negotiate_anchors_zero_fee_htlc_tx_arg, int16_t our_max_accepted_htlcs_arg) { - LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg, max_inbound_htlc_value_in_flight_percent_of_channel_arg, negotiate_scid_privacy_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg, their_channel_reserve_proportional_millionths_arg, negotiate_anchors_zero_fee_htlc_tx_arg, our_max_accepted_htlcs_arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1new(JNIEnv *env, jclass clz, int32_t minimum_depth_arg, int16_t our_to_self_delay_arg, int64_t our_htlc_minimum_msat_arg, int8_t max_inbound_htlc_value_in_flight_percent_of_channel_arg, jboolean negotiate_scid_privacy_arg, jboolean announce_for_forwarding_arg, jboolean commit_upfront_shutdown_pubkey_arg, int32_t their_channel_reserve_proportional_millionths_arg, jboolean negotiate_anchors_zero_fee_htlc_tx_arg, int16_t our_max_accepted_htlcs_arg) { + LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg, max_inbound_htlc_value_in_flight_percent_of_channel_arg, negotiate_scid_privacy_arg, announce_for_forwarding_arg, commit_upfront_shutdown_pubkey_arg, their_channel_reserve_proportional_millionths_arg, negotiate_anchors_zero_fee_htlc_tx_arg, our_max_accepted_htlcs_arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -44114,14 +46167,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfigUpdate_1new(JN return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfigUpdate_1default(JNIEnv *env, jclass clz) { - LDKChannelConfigUpdate ret_var = ChannelConfigUpdate_default(); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1free(JNIEnv *env, jclass clz, int64_t this_obj) { LDKUserConfig this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -44306,7 +46351,26 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1accept_1mpp_1 UserConfig_set_accept_mpp_keysend(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1new(JNIEnv *env, jclass clz, int64_t channel_handshake_config_arg, int64_t channel_handshake_limits_arg, int64_t channel_config_arg, jboolean accept_forwards_to_priv_channels_arg, jboolean accept_inbound_channels_arg, jboolean manually_accept_inbound_channels_arg, jboolean accept_intercept_htlcs_arg, jboolean accept_mpp_keysend_arg) { +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1manually_1handle_1bolt12_1invoices(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + jboolean ret_conv = UserConfig_get_manually_handle_bolt12_invoices(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1manually_1handle_1bolt12_1invoices(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + UserConfig_set_manually_handle_bolt12_invoices(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1new(JNIEnv *env, jclass clz, int64_t channel_handshake_config_arg, int64_t channel_handshake_limits_arg, int64_t channel_config_arg, jboolean accept_forwards_to_priv_channels_arg, jboolean accept_inbound_channels_arg, jboolean manually_accept_inbound_channels_arg, jboolean accept_intercept_htlcs_arg, jboolean accept_mpp_keysend_arg, jboolean manually_handle_bolt12_invoices_arg) { LDKChannelHandshakeConfig channel_handshake_config_arg_conv; channel_handshake_config_arg_conv.inner = untag_ptr(channel_handshake_config_arg); channel_handshake_config_arg_conv.is_owned = ptr_is_owned(channel_handshake_config_arg); @@ -44322,7 +46386,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1new(JNIEnv *env channel_config_arg_conv.is_owned = ptr_is_owned(channel_config_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_config_arg_conv); channel_config_arg_conv = ChannelConfig_clone(&channel_config_arg_conv); - LDKUserConfig ret_var = UserConfig_new(channel_handshake_config_arg_conv, channel_handshake_limits_arg_conv, channel_config_arg_conv, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg, manually_accept_inbound_channels_arg, accept_intercept_htlcs_arg, accept_mpp_keysend_arg); + LDKUserConfig ret_var = UserConfig_new(channel_handshake_config_arg_conv, channel_handshake_limits_arg_conv, channel_config_arg_conv, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg, manually_accept_inbound_channels_arg, accept_intercept_htlcs_arg, accept_mpp_keysend_arg, manually_handle_bolt12_invoices_arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -44756,8 +46820,13 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1clone(JN return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1on_1chain_1sweep(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_on_chain_sweep()); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1maximum_1fee_1estimate(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_maximum_fee_estimate()); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1urgent_1on_1chain_1sweep(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_urgent_on_chain_sweep()); return ret_conv; } @@ -44813,69 +46882,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1free(JNIEnv *env FeeEstimator_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKMonitorUpdateId this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - MonitorUpdateId_free(this_obj_conv); -} - -static inline uint64_t MonitorUpdateId_clone_ptr(LDKMonitorUpdateId *NONNULL_PTR arg) { - LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKMonitorUpdateId arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = MonitorUpdateId_clone_ptr(&arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKMonitorUpdateId orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKMonitorUpdateId o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = MonitorUpdateId_hash(&o_conv); - return ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKMonitorUpdateId a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKMonitorUpdateId b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = MonitorUpdateId_eq(&a_conv, &b_conv); - return ret_conv; -} - JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Persist_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -45028,14 +47034,14 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1list_1pe this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ret_var = ChainMonitor_list_pending_monitor_updates(&this_arg_conv); + LDKCVec_C2Tuple_OutPointCVec_u64ZZZ ret_var = ChainMonitor_list_pending_monitor_updates(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t p = 0; p < ret_var.datalen; p++) { - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv_41_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ"); - *ret_conv_41_conv = ret_var.data[p]; - ret_arr_ptr[p] = tag_ptr(ret_conv_41_conv, true); + for (size_t d = 0; d < ret_var.datalen; d++) { + LDKC2Tuple_OutPointCVec_u64ZZ* ret_conv_29_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_u64ZZ), "LDKC2Tuple_OutPointCVec_u64ZZ"); + *ret_conv_29_conv = ret_var.data[d]; + ret_arr_ptr[d] = tag_ptr(ret_conv_29_conv, true); } (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); FREE(ret_var.data); @@ -45053,13 +47059,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1channel_1moni funding_txo_conv.is_owned = ptr_is_owned(funding_txo); CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); funding_txo_conv = OutPoint_clone(&funding_txo_conv); - LDKMonitorUpdateId completed_update_id_conv; - completed_update_id_conv.inner = untag_ptr(completed_update_id); - completed_update_id_conv.is_owned = ptr_is_owned(completed_update_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(completed_update_id_conv); - completed_update_id_conv = MonitorUpdateId_clone(&completed_update_id_conv); LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id_conv); + *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id); return tag_ptr(ret_conv, true); } @@ -45467,6 +47468,39 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1read(JNIEnv *en return tag_ptr(ret_conv, true); } +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_BalanceSource_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBalanceSource* orig_conv = (LDKBalanceSource*)untag_ptr(orig); + jclass ret_conv = LDKBalanceSource_to_java(env, BalanceSource_clone(orig_conv)); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_BalanceSource_1holder_1force_1closed(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBalanceSource_to_java(env, BalanceSource_holder_force_closed()); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_BalanceSource_1counterparty_1force_1closed(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBalanceSource_to_java(env, BalanceSource_counterparty_force_closed()); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_BalanceSource_1coop_1close(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBalanceSource_to_java(env, BalanceSource_coop_close()); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_BalanceSource_1htlc(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBalanceSource_to_java(env, BalanceSource_htlc()); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BalanceSource_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKBalanceSource* a_conv = (LDKBalanceSource*)untag_ptr(a); + LDKBalanceSource* b_conv = (LDKBalanceSource*)untag_ptr(b); + jboolean ret_conv = BalanceSource_eq(a_conv, b_conv); + return ret_conv; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Balance_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -45496,16 +47530,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1clone(JNIEnv *env, return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1claimable_1on_1channel_1close(JNIEnv *env, jclass clz, int64_t amount_satoshis) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1claimable_1on_1channel_1close(JNIEnv *env, jclass clz, int64_t amount_satoshis, int64_t transaction_fee_satoshis, int64_t outbound_payment_htlc_rounded_msat, int64_t outbound_forwarded_htlc_rounded_msat, int64_t inbound_claiming_htlc_rounded_msat, int64_t inbound_htlc_rounded_msat) { LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_claimable_on_channel_close(amount_satoshis); + *ret_copy = Balance_claimable_on_channel_close(amount_satoshis, transaction_fee_satoshis, outbound_payment_htlc_rounded_msat, outbound_forwarded_htlc_rounded_msat, inbound_claiming_htlc_rounded_msat, inbound_htlc_rounded_msat); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1claimable_1awaiting_1confirmations(JNIEnv *env, jclass clz, int64_t amount_satoshis, int32_t confirmation_height) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1claimable_1awaiting_1confirmations(JNIEnv *env, jclass clz, int64_t amount_satoshis, int32_t confirmation_height, jclass source) { + LDKBalanceSource source_conv = LDKBalanceSource_from_java(env, source); LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_claimable_awaiting_confirmations(amount_satoshis, confirmation_height); + *ret_copy = Balance_claimable_awaiting_confirmations(amount_satoshis, confirmation_height, source_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -45523,12 +47558,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1contentious_1claim return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1maybe_1timeout_1claimable_1htlc(JNIEnv *env, jclass clz, int64_t amount_satoshis, int32_t claimable_height, int8_tArray payment_hash) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1maybe_1timeout_1claimable_1htlc(JNIEnv *env, jclass clz, int64_t amount_satoshis, int32_t claimable_height, int8_tArray payment_hash, jboolean outbound_payment) { LDKThirtyTwoBytes payment_hash_ref; CHECK((*env)->GetArrayLength(env, payment_hash) == 32); (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_maybe_timeout_claimable_htlc(amount_satoshis, claimable_height, payment_hash_ref); + *ret_copy = Balance_maybe_timeout_claimable_htlc(amount_satoshis, claimable_height, payment_hash_ref, outbound_payment); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -45729,7 +47764,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1a return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1process_1pending_1events(JNIEnv *env, jclass clz, int64_t this_arg, int64_t handler) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1process_1pending_1events(JNIEnv *env, jclass clz, int64_t this_arg, int64_t handler) { LDKChannelMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -45738,7 +47773,9 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1process_1pendi void* handler_ptr = untag_ptr(handler); if (ptr_is_owned(handler)) { CHECK_ACCESS(handler_ptr); } LDKEventHandler* handler_conv = (LDKEventHandler*)handler_ptr; - ChannelMonitor_process_pending_events(&this_arg_conv, handler_conv); + LDKCResult_NoneReplayEventZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneReplayEventZ), "LDKCResult_NoneReplayEventZ"); + *ret_conv = ChannelMonitor_process_pending_events(&this_arg_conv, handler_conv); + return tag_ptr(ret_conv, true); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1initial_1counterparty_1commitment_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { @@ -46100,6 +48137,16 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1rebroadcast_1p ChannelMonitor_rebroadcast_pending_claims(&this_arg_conv, broadcaster_conv, fee_estimator_conv, logger_conv); } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1has_1pending_1claims(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelMonitor_has_pending_claims(&this_arg_conv); + return ret_conv; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1signer_1unblocked(JNIEnv *env, jclass clz, int64_t this_arg, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { LDKChannelMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -46503,11 +48550,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_peel_1payment_1onion(JNIEnv CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv.is_owned = false; void* node_signer_ptr = untag_ptr(node_signer); - if (ptr_is_owned(node_signer)) { CHECK_ACCESS(node_signer_ptr); } - LDKNodeSigner* node_signer_conv = (LDKNodeSigner*)node_signer_ptr; + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } void* logger_ptr = untag_ptr(logger); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } LDKCResult_PendingHTLCInfoInboundHTLCErrZ* ret_conv = MALLOC(sizeof(LDKCResult_PendingHTLCInfoInboundHTLCErrZ), "LDKCResult_PendingHTLCInfoInboundHTLCErrZ"); *ret_conv = peel_payment_onion(&msg_conv, node_signer_conv, logger_conv, cur_height, accept_mpp_keysend, allow_skimmed_fees); return tag_ptr(ret_conv, true); @@ -46684,12 +48739,38 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedForward_1set_1failure(J BlindedForward_set_failure(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedForward_1new(JNIEnv *env, jclass clz, int8_tArray inbound_blinding_point_arg, jclass failure_arg) { +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedForward_1get_1next_1blinding_1override(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBlindedForward this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, BlindedForward_get_next_blinding_override(&this_ptr_conv).compressed_form); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedForward_1set_1next_1blinding_1override(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKBlindedForward this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + BlindedForward_set_next_blinding_override(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedForward_1new(JNIEnv *env, jclass clz, int8_tArray inbound_blinding_point_arg, jclass failure_arg, int8_tArray next_blinding_override_arg) { LDKPublicKey inbound_blinding_point_arg_ref; CHECK((*env)->GetArrayLength(env, inbound_blinding_point_arg) == 33); (*env)->GetByteArrayRegion(env, inbound_blinding_point_arg, 0, 33, inbound_blinding_point_arg_ref.compressed_form); LDKBlindedFailure failure_arg_conv = LDKBlindedFailure_from_java(env, failure_arg); - LDKBlindedForward ret_var = BlindedForward_new(inbound_blinding_point_arg_ref, failure_arg_conv); + LDKPublicKey next_blinding_override_arg_ref; + CHECK((*env)->GetArrayLength(env, next_blinding_override_arg) == 33); + (*env)->GetByteArrayRegion(env, next_blinding_override_arg, 0, 33, next_blinding_override_arg_ref.compressed_form); + LDKBlindedForward ret_var = BlindedForward_new(inbound_blinding_point_arg_ref, failure_arg_conv, next_blinding_override_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -47657,7 +49738,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1close_1chan return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1broadcasting_1latest_1txn(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_id, int8_tArray counterparty_node_id) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1broadcasting_1latest_1txn(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_id, int8_tArray counterparty_node_id, jstring error_message) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -47671,12 +49752,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1clos LDKPublicKey counterparty_node_id_ref; CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); + LDKStr error_message_conv = java_to_owned_str(env, error_message); LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_force_close_broadcasting_latest_txn(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref); + *ret_conv = ChannelManager_force_close_broadcasting_latest_txn(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref, error_message_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1without_1broadcasting_1txn(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_id, int8_tArray counterparty_node_id) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1without_1broadcasting_1txn(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_id, int8_tArray counterparty_node_id, jstring error_message) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -47690,27 +49772,30 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1clos LDKPublicKey counterparty_node_id_ref; CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); + LDKStr error_message_conv = java_to_owned_str(env, error_message); LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_force_close_without_broadcasting_txn(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref); + *ret_conv = ChannelManager_force_close_without_broadcasting_txn(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref, error_message_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1all_1channels_1broadcasting_1latest_1txn(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1all_1channels_1broadcasting_1latest_1txn(JNIEnv *env, jclass clz, int64_t this_arg, jstring error_message) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelManager_force_close_all_channels_broadcasting_latest_txn(&this_arg_conv); + LDKStr error_message_conv = java_to_owned_str(env, error_message); + ChannelManager_force_close_all_channels_broadcasting_latest_txn(&this_arg_conv, error_message_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1all_1channels_1without_1broadcasting_1txn(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1all_1channels_1without_1broadcasting_1txn(JNIEnv *env, jclass clz, int64_t this_arg, jstring error_message) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelManager_force_close_all_channels_without_broadcasting_txn(&this_arg_conv); + LDKStr error_message_conv = java_to_owned_str(env, error_message); + ChannelManager_force_close_all_channels_without_broadcasting_txn(&this_arg_conv, error_message_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payment_1with_1route(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_hash, int64_t recipient_onion, int8_tArray payment_id) { @@ -47723,7 +49808,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payme route_conv.inner = untag_ptr(route); route_conv.is_owned = ptr_is_owned(route); CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); - route_conv.is_owned = false; + route_conv = Route_clone(&route_conv); LDKThirtyTwoBytes payment_hash_ref; CHECK((*env)->GetArrayLength(env, payment_hash) == 32); (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); @@ -47736,7 +49821,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payme CHECK((*env)->GetArrayLength(env, payment_id) == 32); (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); - *ret_conv = ChannelManager_send_payment_with_route(&this_arg_conv, &route_conv, payment_hash_ref, recipient_onion_conv, payment_id_ref); + *ret_conv = ChannelManager_send_payment_with_route(&this_arg_conv, route_conv, payment_hash_ref, recipient_onion_conv, payment_id_ref); return tag_ptr(ret_conv, true); } @@ -47907,7 +49992,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1funding_1tr temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); - temporary_channel_id_conv.is_owned = false; + temporary_channel_id_conv = ChannelId_clone(&temporary_channel_id_conv); LDKPublicKey counterparty_node_id_ref; CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); @@ -47917,7 +50002,31 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1funding_1tr (*env)->GetByteArrayRegion(env, funding_transaction, 0, funding_transaction_ref.datalen, funding_transaction_ref.data); funding_transaction_ref.data_is_owned = true; LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_funding_transaction_generated(&this_arg_conv, &temporary_channel_id_conv, counterparty_node_id_ref, funding_transaction_ref); + *ret_conv = ChannelManager_funding_transaction_generated(&this_arg_conv, temporary_channel_id_conv, counterparty_node_id_ref, funding_transaction_ref); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1unsafe_1manual_1funding_1transaction_1generated(JNIEnv *env, jclass clz, int64_t this_arg, int64_t temporary_channel_id, int8_tArray counterparty_node_id, int64_t funding) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelId temporary_channel_id_conv; + temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); + temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); + temporary_channel_id_conv = ChannelId_clone(&temporary_channel_id_conv); + LDKPublicKey counterparty_node_id_ref; + CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); + (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); + LDKOutPoint funding_conv; + funding_conv.inner = untag_ptr(funding); + funding_conv.is_owned = ptr_is_owned(funding); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_conv); + funding_conv = OutPoint_clone(&funding_conv); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_unsafe_manual_funding_transaction_generated(&this_arg_conv, temporary_channel_id_conv, counterparty_node_id_ref, funding_conv); return tag_ptr(ret_conv, true); } @@ -48188,14 +50297,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1accept_1inb return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1offer_1builder(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1offer_1builder(JNIEnv *env, jclass clz, int64_t this_arg, int64_t absolute_expiry) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; + void* absolute_expiry_ptr = untag_ptr(absolute_expiry); + CHECK_ACCESS(absolute_expiry_ptr); + LDKCOption_u64Z absolute_expiry_conv = *(LDKCOption_u64Z*)(absolute_expiry_ptr); + absolute_expiry_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(absolute_expiry)); LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ"); - *ret_conv = ChannelManager_create_offer_builder(&this_arg_conv); + *ret_conv = ChannelManager_create_offer_builder(&this_arg_conv, absolute_expiry_conv); return tag_ptr(ret_conv, true); } @@ -48534,6 +50647,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1OffersM return tag_ptr(ret_ret, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1AsyncPaymentsMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKAsyncPaymentsMessageHandler* ret_ret = MALLOC(sizeof(LDKAsyncPaymentsMessageHandler), "LDKAsyncPaymentsMessageHandler"); + *ret_ret = ChannelManager_as_AsyncPaymentsMessageHandler(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1NodeIdLookUp(JNIEnv *env, jclass clz, int64_t this_arg) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -51336,23 +53460,23 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1usabl ChannelDetails_set_is_usable(&this_ptr_conv, val); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1public(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1announced(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - jboolean ret_conv = ChannelDetails_get_is_public(&this_ptr_conv); + jboolean ret_conv = ChannelDetails_get_is_announced(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1public(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1announced(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelDetails_set_is_public(&this_ptr_conv, val); + ChannelDetails_set_is_announced(&this_ptr_conv, val); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -51528,7 +53652,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1pending_1 ChannelDetails_set_pending_outbound_htlcs(&this_ptr_conv, val_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new(JNIEnv *env, jclass clz, int64_t channel_id_arg, int64_t counterparty_arg, int64_t funding_txo_arg, int64_t channel_type_arg, int64_t short_channel_id_arg, int64_t outbound_scid_alias_arg, int64_t inbound_scid_alias_arg, int64_t channel_value_satoshis_arg, int64_t unspendable_punishment_reserve_arg, int8_tArray user_channel_id_arg, int64_t feerate_sat_per_1000_weight_arg, int64_t balance_msat_arg, int64_t outbound_capacity_msat_arg, int64_t next_outbound_htlc_limit_msat_arg, int64_t next_outbound_htlc_minimum_msat_arg, int64_t inbound_capacity_msat_arg, int64_t confirmations_required_arg, int64_t confirmations_arg, int64_t force_close_spend_delay_arg, jboolean is_outbound_arg, jboolean is_channel_ready_arg, int64_t channel_shutdown_state_arg, jboolean is_usable_arg, jboolean is_public_arg, int64_t inbound_htlc_minimum_msat_arg, int64_t inbound_htlc_maximum_msat_arg, int64_t config_arg, int64_tArray pending_inbound_htlcs_arg, int64_tArray pending_outbound_htlcs_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new(JNIEnv *env, jclass clz, int64_t channel_id_arg, int64_t counterparty_arg, int64_t funding_txo_arg, int64_t channel_type_arg, int64_t short_channel_id_arg, int64_t outbound_scid_alias_arg, int64_t inbound_scid_alias_arg, int64_t channel_value_satoshis_arg, int64_t unspendable_punishment_reserve_arg, int8_tArray user_channel_id_arg, int64_t feerate_sat_per_1000_weight_arg, int64_t balance_msat_arg, int64_t outbound_capacity_msat_arg, int64_t next_outbound_htlc_limit_msat_arg, int64_t next_outbound_htlc_minimum_msat_arg, int64_t inbound_capacity_msat_arg, int64_t confirmations_required_arg, int64_t confirmations_arg, int64_t force_close_spend_delay_arg, jboolean is_outbound_arg, jboolean is_channel_ready_arg, int64_t channel_shutdown_state_arg, jboolean is_usable_arg, jboolean is_announced_arg, int64_t inbound_htlc_minimum_msat_arg, int64_t inbound_htlc_maximum_msat_arg, int64_t config_arg, int64_tArray pending_inbound_htlcs_arg, int64_tArray pending_outbound_htlcs_arg) { LDKChannelId channel_id_arg_conv; channel_id_arg_conv.inner = untag_ptr(channel_id_arg); channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); @@ -51564,6 +53688,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new(JNIEnv void* unspendable_punishment_reserve_arg_ptr = untag_ptr(unspendable_punishment_reserve_arg); CHECK_ACCESS(unspendable_punishment_reserve_arg_ptr); LDKCOption_u64Z unspendable_punishment_reserve_arg_conv = *(LDKCOption_u64Z*)(unspendable_punishment_reserve_arg_ptr); + unspendable_punishment_reserve_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(unspendable_punishment_reserve_arg)); LDKU128 user_channel_id_arg_ref; CHECK((*env)->GetArrayLength(env, user_channel_id_arg) == 16); (*env)->GetByteArrayRegion(env, user_channel_id_arg, 0, 16, user_channel_id_arg_ref.le_bytes); @@ -51634,7 +53759,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new(JNIEnv pending_outbound_htlcs_arg_constr.data[v] = pending_outbound_htlcs_arg_conv_21_conv; } (*env)->ReleaseLongArrayElements(env, pending_outbound_htlcs_arg, pending_outbound_htlcs_arg_vals, 0); - LDKChannelDetails ret_var = ChannelDetails_new(channel_id_arg_conv, counterparty_arg_conv, funding_txo_arg_conv, channel_type_arg_conv, short_channel_id_arg_conv, outbound_scid_alias_arg_conv, inbound_scid_alias_arg_conv, channel_value_satoshis_arg, unspendable_punishment_reserve_arg_conv, user_channel_id_arg_ref, feerate_sat_per_1000_weight_arg_conv, balance_msat_arg, outbound_capacity_msat_arg, next_outbound_htlc_limit_msat_arg, next_outbound_htlc_minimum_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg_conv, confirmations_arg_conv, force_close_spend_delay_arg_conv, is_outbound_arg, is_channel_ready_arg, channel_shutdown_state_arg_conv, is_usable_arg, is_public_arg, inbound_htlc_minimum_msat_arg_conv, inbound_htlc_maximum_msat_arg_conv, config_arg_conv, pending_inbound_htlcs_arg_constr, pending_outbound_htlcs_arg_constr); + LDKChannelDetails ret_var = ChannelDetails_new(channel_id_arg_conv, counterparty_arg_conv, funding_txo_arg_conv, channel_type_arg_conv, short_channel_id_arg_conv, outbound_scid_alias_arg_conv, inbound_scid_alias_arg_conv, channel_value_satoshis_arg, unspendable_punishment_reserve_arg_conv, user_channel_id_arg_ref, feerate_sat_per_1000_weight_arg_conv, balance_msat_arg, outbound_capacity_msat_arg, next_outbound_htlc_limit_msat_arg, next_outbound_htlc_minimum_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg_conv, confirmations_arg_conv, force_close_spend_delay_arg_conv, is_outbound_arg, is_channel_ready_arg, channel_shutdown_state_arg_conv, is_usable_arg, is_announced_arg, inbound_htlc_minimum_msat_arg_conv, inbound_htlc_maximum_msat_arg_conv, config_arg_conv, pending_inbound_htlcs_arg_constr, pending_outbound_htlcs_arg_constr); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -52036,6 +54161,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1new(JNIEnv *env, jcla void* remote_network_address_arg_ptr = untag_ptr(remote_network_address_arg); CHECK_ACCESS(remote_network_address_arg_ptr); LDKCOption_SocketAddressZ remote_network_address_arg_conv = *(LDKCOption_SocketAddressZ*)(remote_network_address_arg_ptr); + remote_network_address_arg_conv = COption_SocketAddressZ_clone((LDKCOption_SocketAddressZ*)untag_ptr(remote_network_address_arg)); LDKInit ret_var = Init_new(features_arg_conv, networks_arg_conv, remote_network_address_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); @@ -53047,6 +55173,204 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CommonOpenChannelFields_1e return ret_conv; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommonOpenChannelFields_1channel_1parameters(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKCommonOpenChannelFields this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelParameters ret_var = CommonOpenChannelFields_channel_parameters(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelParameters this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelParameters_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1get_1dust_1limit_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ChannelParameters_get_dust_limit_satoshis(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1set_1dust_1limit_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelParameters_set_dust_limit_satoshis(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1get_1max_1htlc_1value_1in_1flight_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ChannelParameters_get_max_htlc_value_in_flight_msat(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1set_1max_1htlc_1value_1in_1flight_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelParameters_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ChannelParameters_get_htlc_minimum_msat(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelParameters_set_htlc_minimum_msat(&this_ptr_conv, val); +} + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1get_1commitment_1feerate_1sat_1per_11000_1weight(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = ChannelParameters_get_commitment_feerate_sat_per_1000_weight(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1set_1commitment_1feerate_1sat_1per_11000_1weight(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelParameters_set_commitment_feerate_sat_per_1000_weight(&this_ptr_conv, val); +} + +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1get_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int16_t ret_conv = ChannelParameters_get_to_self_delay(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1set_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelParameters_set_to_self_delay(&this_ptr_conv, val); +} + +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1get_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int16_t ret_conv = ChannelParameters_get_max_accepted_htlcs(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1set_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKChannelParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelParameters_set_max_accepted_htlcs(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1new(JNIEnv *env, jclass clz, int64_t dust_limit_satoshis_arg, int64_t max_htlc_value_in_flight_msat_arg, int64_t htlc_minimum_msat_arg, int32_t commitment_feerate_sat_per_1000_weight_arg, int16_t to_self_delay_arg, int16_t max_accepted_htlcs_arg) { + LDKChannelParameters ret_var = ChannelParameters_new(dust_limit_satoshis_arg, max_htlc_value_in_flight_msat_arg, htlc_minimum_msat_arg, commitment_feerate_sat_per_1000_weight_arg, to_self_delay_arg, max_accepted_htlcs_arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t ChannelParameters_clone_ptr(LDKChannelParameters *NONNULL_PTR arg) { + LDKChannelParameters ret_var = ChannelParameters_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelParameters arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = ChannelParameters_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelParameters orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKChannelParameters ret_var = ChannelParameters_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKChannelParameters o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = ChannelParameters_hash(&o_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKChannelParameters a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKChannelParameters b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ChannelParameters_eq(&a_conv, &b_conv); + return ret_conv; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1free(JNIEnv *env, jclass clz, int64_t this_obj) { LDKOpenChannel this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -54674,29 +56998,29 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Stfu_1eq(JNIEnv *env, jcla return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Splice_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKSplice this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceInit_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKSpliceInit this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Splice_free(this_obj_conv); + SpliceInit_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Splice_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKSplice this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpliceInit_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelId ret_var = Splice_get_channel_id(&this_ptr_conv); + LDKChannelId ret_var = SpliceInit_get_channel_id(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Splice_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKSplice this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceInit_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -54706,173 +57030,168 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Splice_1set_1channel_1id(JNIEn val_conv.is_owned = ptr_is_owned(val); CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelId_clone(&val_conv); - Splice_set_channel_id(&this_ptr_conv, val_conv); + SpliceInit_set_channel_id(&this_ptr_conv, val_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Splice_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKSplice this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpliceInit_1get_1funding_1contribution_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *Splice_get_chain_hash(&this_ptr_conv)); - return ret_arr; + int64_t ret_conv = SpliceInit_get_funding_contribution_satoshis(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Splice_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKSplice this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceInit_1set_1funding_1contribution_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - Splice_set_chain_hash(&this_ptr_conv, val_ref); + SpliceInit_set_funding_contribution_satoshis(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Splice_1get_1relative_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKSplice this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_SpliceInit_1get_1funding_1feerate_1perkw(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = Splice_get_relative_satoshis(&this_ptr_conv); + int32_t ret_conv = SpliceInit_get_funding_feerate_perkw(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Splice_1set_1relative_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKSplice this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceInit_1set_1funding_1feerate_1perkw(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - Splice_set_relative_satoshis(&this_ptr_conv, val); + SpliceInit_set_funding_feerate_perkw(&this_ptr_conv, val); } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_Splice_1get_1funding_1feerate_1perkw(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKSplice this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_SpliceInit_1get_1locktime(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int32_t ret_conv = Splice_get_funding_feerate_perkw(&this_ptr_conv); + int32_t ret_conv = SpliceInit_get_locktime(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Splice_1set_1funding_1feerate_1perkw(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKSplice this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceInit_1set_1locktime(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - Splice_set_funding_feerate_perkw(&this_ptr_conv, val); + SpliceInit_set_locktime(&this_ptr_conv, val); } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_Splice_1get_1locktime(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKSplice this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SpliceInit_1get_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int32_t ret_conv = Splice_get_locktime(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, SpliceInit_get_funding_pubkey(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Splice_1set_1locktime(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKSplice this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceInit_1set_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - Splice_set_locktime(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + SpliceInit_set_funding_pubkey(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Splice_1get_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKSplice this_ptr_conv; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SpliceInit_1get_1require_1confirmed_1inputs(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Splice_get_funding_pubkey(&this_ptr_conv).compressed_form); - return ret_arr; + jclass ret_conv = LDKCOption_NoneZ_to_java(env, SpliceInit_get_require_confirmed_inputs(&this_ptr_conv)); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Splice_1set_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKSplice this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceInit_1set_1require_1confirmed_1inputs(JNIEnv *env, jclass clz, int64_t this_ptr, jclass val) { + LDKSpliceInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - Splice_set_funding_pubkey(&this_ptr_conv, val_ref); + LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_java(env, val); + SpliceInit_set_require_confirmed_inputs(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Splice_1new(JNIEnv *env, jclass clz, int64_t channel_id_arg, int8_tArray chain_hash_arg, int64_t relative_satoshis_arg, int32_t funding_feerate_perkw_arg, int32_t locktime_arg, int8_tArray funding_pubkey_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpliceInit_1new(JNIEnv *env, jclass clz, int64_t channel_id_arg, int64_t funding_contribution_satoshis_arg, int32_t funding_feerate_perkw_arg, int32_t locktime_arg, int8_tArray funding_pubkey_arg, jclass require_confirmed_inputs_arg) { LDKChannelId channel_id_arg_conv; channel_id_arg_conv.inner = untag_ptr(channel_id_arg); channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); - LDKThirtyTwoBytes chain_hash_arg_ref; - CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32); - (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data); LDKPublicKey funding_pubkey_arg_ref; CHECK((*env)->GetArrayLength(env, funding_pubkey_arg) == 33); (*env)->GetByteArrayRegion(env, funding_pubkey_arg, 0, 33, funding_pubkey_arg_ref.compressed_form); - LDKSplice ret_var = Splice_new(channel_id_arg_conv, chain_hash_arg_ref, relative_satoshis_arg, funding_feerate_perkw_arg, locktime_arg, funding_pubkey_arg_ref); + LDKCOption_NoneZ require_confirmed_inputs_arg_conv = LDKCOption_NoneZ_from_java(env, require_confirmed_inputs_arg); + LDKSpliceInit ret_var = SpliceInit_new(channel_id_arg_conv, funding_contribution_satoshis_arg, funding_feerate_perkw_arg, locktime_arg, funding_pubkey_arg_ref, require_confirmed_inputs_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t Splice_clone_ptr(LDKSplice *NONNULL_PTR arg) { - LDKSplice ret_var = Splice_clone(arg); +static inline uint64_t SpliceInit_clone_ptr(LDKSpliceInit *NONNULL_PTR arg) { + LDKSpliceInit ret_var = SpliceInit_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Splice_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKSplice arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpliceInit_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKSpliceInit arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Splice_clone_ptr(&arg_conv); + int64_t ret_conv = SpliceInit_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Splice_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKSplice orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpliceInit_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKSpliceInit orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKSplice ret_var = Splice_clone(&orig_conv); + LDKSpliceInit ret_var = SpliceInit_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Splice_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKSplice a_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SpliceInit_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKSpliceInit a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKSplice b_conv; + LDKSpliceInit b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = Splice_eq(&a_conv, &b_conv); + jboolean ret_conv = SpliceInit_eq(&a_conv, &b_conv); return ret_conv; } @@ -54911,84 +57230,79 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceAck_1set_1channel_1id(JN SpliceAck_set_channel_id(&this_ptr_conv, val_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SpliceAck_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpliceAck_1get_1funding_1contribution_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKSpliceAck this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *SpliceAck_get_chain_hash(&this_ptr_conv)); - return ret_arr; + int64_t ret_conv = SpliceAck_get_funding_contribution_satoshis(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceAck_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceAck_1set_1funding_1contribution_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { LDKSpliceAck this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - SpliceAck_set_chain_hash(&this_ptr_conv, val_ref); + SpliceAck_set_funding_contribution_satoshis(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpliceAck_1get_1relative_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SpliceAck_1get_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKSpliceAck this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = SpliceAck_get_relative_satoshis(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, SpliceAck_get_funding_pubkey(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceAck_1set_1relative_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceAck_1set_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { LDKSpliceAck this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - SpliceAck_set_relative_satoshis(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + SpliceAck_set_funding_pubkey(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SpliceAck_1get_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SpliceAck_1get_1require_1confirmed_1inputs(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKSpliceAck this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, SpliceAck_get_funding_pubkey(&this_ptr_conv).compressed_form); - return ret_arr; + jclass ret_conv = LDKCOption_NoneZ_to_java(env, SpliceAck_get_require_confirmed_inputs(&this_ptr_conv)); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceAck_1set_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceAck_1set_1require_1confirmed_1inputs(JNIEnv *env, jclass clz, int64_t this_ptr, jclass val) { LDKSpliceAck this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - SpliceAck_set_funding_pubkey(&this_ptr_conv, val_ref); + LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_java(env, val); + SpliceAck_set_require_confirmed_inputs(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpliceAck_1new(JNIEnv *env, jclass clz, int64_t channel_id_arg, int8_tArray chain_hash_arg, int64_t relative_satoshis_arg, int8_tArray funding_pubkey_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpliceAck_1new(JNIEnv *env, jclass clz, int64_t channel_id_arg, int64_t funding_contribution_satoshis_arg, int8_tArray funding_pubkey_arg, jclass require_confirmed_inputs_arg) { LDKChannelId channel_id_arg_conv; channel_id_arg_conv.inner = untag_ptr(channel_id_arg); channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); - LDKThirtyTwoBytes chain_hash_arg_ref; - CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32); - (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data); LDKPublicKey funding_pubkey_arg_ref; CHECK((*env)->GetArrayLength(env, funding_pubkey_arg) == 33); (*env)->GetByteArrayRegion(env, funding_pubkey_arg, 0, 33, funding_pubkey_arg_ref.compressed_form); - LDKSpliceAck ret_var = SpliceAck_new(channel_id_arg_conv, chain_hash_arg_ref, relative_satoshis_arg, funding_pubkey_arg_ref); + LDKCOption_NoneZ require_confirmed_inputs_arg_conv = LDKCOption_NoneZ_from_java(env, require_confirmed_inputs_arg); + LDKSpliceAck ret_var = SpliceAck_new(channel_id_arg_conv, funding_contribution_satoshis_arg, funding_pubkey_arg_ref, require_confirmed_inputs_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -55075,13 +57389,39 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceLocked_1set_1channel_1id SpliceLocked_set_channel_id(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpliceLocked_1new(JNIEnv *env, jclass clz, int64_t channel_id_arg) { +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SpliceLocked_1get_1splice_1txid(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKSpliceLocked this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *SpliceLocked_get_splice_txid(&this_ptr_conv)); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceLocked_1set_1splice_1txid(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKSpliceLocked this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + SpliceLocked_set_splice_txid(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpliceLocked_1new(JNIEnv *env, jclass clz, int64_t channel_id_arg, int8_tArray splice_txid_arg) { LDKChannelId channel_id_arg_conv; channel_id_arg_conv.inner = untag_ptr(channel_id_arg); channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); - LDKSpliceLocked ret_var = SpliceLocked_new(channel_id_arg_conv); + LDKThirtyTwoBytes splice_txid_arg_ref; + CHECK((*env)->GetArrayLength(env, splice_txid_arg) == 32); + (*env)->GetByteArrayRegion(env, splice_txid_arg, 0, 32, splice_txid_arg_ref.data); + LDKSpliceLocked ret_var = SpliceLocked_new(channel_id_arg_conv, splice_txid_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -55252,7 +57592,32 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxAddInput_1set_1sequence(JNIE TxAddInput_set_sequence(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxAddInput_1new(JNIEnv *env, jclass clz, int64_t channel_id_arg, int64_t serial_id_arg, int64_t prevtx_arg, int32_t prevtx_out_arg, int32_t sequence_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxAddInput_1get_1shared_1input_1txid(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKTxAddInput this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); + *ret_copy = TxAddInput_get_shared_input_txid(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxAddInput_1set_1shared_1input_1txid(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKTxAddInput this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_ThirtyTwoBytesZ val_conv = *(LDKCOption_ThirtyTwoBytesZ*)(val_ptr); + val_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(val)); + TxAddInput_set_shared_input_txid(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxAddInput_1new(JNIEnv *env, jclass clz, int64_t channel_id_arg, int64_t serial_id_arg, int64_t prevtx_arg, int32_t prevtx_out_arg, int32_t sequence_arg, int64_t shared_input_txid_arg) { LDKChannelId channel_id_arg_conv; channel_id_arg_conv.inner = untag_ptr(channel_id_arg); channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); @@ -55263,7 +57628,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxAddInput_1new(JNIEnv *env prevtx_arg_conv.is_owned = ptr_is_owned(prevtx_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(prevtx_arg_conv); prevtx_arg_conv = TransactionU16LenLimited_clone(&prevtx_arg_conv); - LDKTxAddInput ret_var = TxAddInput_new(channel_id_arg_conv, serial_id_arg, prevtx_arg_conv, prevtx_out_arg, sequence_arg); + void* shared_input_txid_arg_ptr = untag_ptr(shared_input_txid_arg); + CHECK_ACCESS(shared_input_txid_arg_ptr); + LDKCOption_ThirtyTwoBytesZ shared_input_txid_arg_conv = *(LDKCOption_ThirtyTwoBytesZ*)(shared_input_txid_arg_ptr); + shared_input_txid_arg_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(shared_input_txid_arg)); + LDKTxAddInput ret_var = TxAddInput_new(channel_id_arg_conv, serial_id_arg, prevtx_arg_conv, prevtx_out_arg, sequence_arg, shared_input_txid_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -55947,19 +58316,19 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxSignatures_1set_1witnesses(J TxSignatures_set_witnesses(&this_ptr_conv, val_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxSignatures_1get_1funding_1outpoint_1sig(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxSignatures_1get_1shared_1input_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKTxSignatures this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; LDKCOption_ECDSASignatureZ *ret_copy = MALLOC(sizeof(LDKCOption_ECDSASignatureZ), "LDKCOption_ECDSASignatureZ"); - *ret_copy = TxSignatures_get_funding_outpoint_sig(&this_ptr_conv); + *ret_copy = TxSignatures_get_shared_input_signature(&this_ptr_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxSignatures_1set_1funding_1outpoint_1sig(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxSignatures_1set_1shared_1input_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { LDKTxSignatures this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); @@ -55969,10 +58338,10 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxSignatures_1set_1funding_1ou CHECK_ACCESS(val_ptr); LDKCOption_ECDSASignatureZ val_conv = *(LDKCOption_ECDSASignatureZ*)(val_ptr); val_conv = COption_ECDSASignatureZ_clone((LDKCOption_ECDSASignatureZ*)untag_ptr(val)); - TxSignatures_set_funding_outpoint_sig(&this_ptr_conv, val_conv); + TxSignatures_set_shared_input_signature(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxSignatures_1new(JNIEnv *env, jclass clz, int64_t channel_id_arg, int8_tArray tx_hash_arg, jobjectArray witnesses_arg, int64_t funding_outpoint_sig_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxSignatures_1new(JNIEnv *env, jclass clz, int64_t channel_id_arg, int8_tArray tx_hash_arg, jobjectArray witnesses_arg, int64_t shared_input_signature_arg) { LDKChannelId channel_id_arg_conv; channel_id_arg_conv.inner = untag_ptr(channel_id_arg); channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); @@ -55996,11 +58365,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxSignatures_1new(JNIEnv *e witnesses_arg_conv_8_ref.data_is_owned = true; witnesses_arg_constr.data[i] = witnesses_arg_conv_8_ref; } - void* funding_outpoint_sig_arg_ptr = untag_ptr(funding_outpoint_sig_arg); - CHECK_ACCESS(funding_outpoint_sig_arg_ptr); - LDKCOption_ECDSASignatureZ funding_outpoint_sig_arg_conv = *(LDKCOption_ECDSASignatureZ*)(funding_outpoint_sig_arg_ptr); - funding_outpoint_sig_arg_conv = COption_ECDSASignatureZ_clone((LDKCOption_ECDSASignatureZ*)untag_ptr(funding_outpoint_sig_arg)); - LDKTxSignatures ret_var = TxSignatures_new(channel_id_arg_conv, tx_hash_arg_ref, witnesses_arg_constr, funding_outpoint_sig_arg_conv); + void* shared_input_signature_arg_ptr = untag_ptr(shared_input_signature_arg); + CHECK_ACCESS(shared_input_signature_arg_ptr); + LDKCOption_ECDSASignatureZ shared_input_signature_arg_conv = *(LDKCOption_ECDSASignatureZ*)(shared_input_signature_arg_ptr); + shared_input_signature_arg_conv = COption_ECDSASignatureZ_clone((LDKCOption_ECDSASignatureZ*)untag_ptr(shared_input_signature_arg)); + LDKTxSignatures ret_var = TxSignatures_new(channel_id_arg_conv, tx_hash_arg_ref, witnesses_arg_constr, shared_input_signature_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -57706,6 +60075,122 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1e return ret_conv; } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSignedBatch_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKCommitmentSignedBatch this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + CommitmentSignedBatch_free(this_obj_conv); +} + +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_CommitmentSignedBatch_1get_1batch_1size(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKCommitmentSignedBatch this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int16_t ret_conv = CommitmentSignedBatch_get_batch_size(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSignedBatch_1set_1batch_1size(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKCommitmentSignedBatch this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + CommitmentSignedBatch_set_batch_size(&this_ptr_conv, val); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSignedBatch_1get_1funding_1txid(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKCommitmentSignedBatch this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *CommitmentSignedBatch_get_funding_txid(&this_ptr_conv)); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSignedBatch_1set_1funding_1txid(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKCommitmentSignedBatch this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + CommitmentSignedBatch_set_funding_txid(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSignedBatch_1new(JNIEnv *env, jclass clz, int16_t batch_size_arg, int8_tArray funding_txid_arg) { + LDKThirtyTwoBytes funding_txid_arg_ref; + CHECK((*env)->GetArrayLength(env, funding_txid_arg) == 32); + (*env)->GetByteArrayRegion(env, funding_txid_arg, 0, 32, funding_txid_arg_ref.data); + LDKCommitmentSignedBatch ret_var = CommitmentSignedBatch_new(batch_size_arg, funding_txid_arg_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t CommitmentSignedBatch_clone_ptr(LDKCommitmentSignedBatch *NONNULL_PTR arg) { + LDKCommitmentSignedBatch ret_var = CommitmentSignedBatch_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSignedBatch_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCommitmentSignedBatch arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = CommitmentSignedBatch_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSignedBatch_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCommitmentSignedBatch orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKCommitmentSignedBatch ret_var = CommitmentSignedBatch_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSignedBatch_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKCommitmentSignedBatch o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = CommitmentSignedBatch_hash(&o_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CommitmentSignedBatch_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKCommitmentSignedBatch a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKCommitmentSignedBatch b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = CommitmentSignedBatch_eq(&a_conv, &b_conv); + return ret_conv; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1free(JNIEnv *env, jclass clz, int64_t this_obj) { LDKCommitmentSigned this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -57806,7 +60291,34 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1htlc_1s CommitmentSigned_set_htlc_signatures(&this_ptr_conv, val_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1new(JNIEnv *env, jclass clz, int64_t channel_id_arg, int8_tArray signature_arg, jobjectArray htlc_signatures_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1batch(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKCommitmentSigned this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCommitmentSignedBatch ret_var = CommitmentSigned_get_batch(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1batch(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKCommitmentSigned this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCommitmentSignedBatch val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = CommitmentSignedBatch_clone(&val_conv); + CommitmentSigned_set_batch(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1new(JNIEnv *env, jclass clz, int64_t channel_id_arg, int8_tArray signature_arg, jobjectArray htlc_signatures_arg, int64_t batch_arg) { LDKChannelId channel_id_arg_conv; channel_id_arg_conv.inner = untag_ptr(channel_id_arg); channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); @@ -57828,7 +60340,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1new(JNIEn (*env)->GetByteArrayRegion(env, htlc_signatures_arg_conv_8, 0, 64, htlc_signatures_arg_conv_8_ref.compact_form); htlc_signatures_arg_constr.data[i] = htlc_signatures_arg_conv_8_ref; } - LDKCommitmentSigned ret_var = CommitmentSigned_new(channel_id_arg_conv, signature_arg_ref, htlc_signatures_arg_constr); + LDKCommitmentSignedBatch batch_arg_conv; + batch_arg_conv.inner = untag_ptr(batch_arg); + batch_arg_conv.is_owned = ptr_is_owned(batch_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(batch_arg_conv); + batch_arg_conv = CommitmentSignedBatch_clone(&batch_arg_conv); + LDKCommitmentSigned ret_var = CommitmentSigned_new(channel_id_arg_conv, signature_arg_ref, htlc_signatures_arg_constr, batch_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -59079,6 +61596,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1n void* addresses_arg_conv_15_ptr = untag_ptr(addresses_arg_conv_15); CHECK_ACCESS(addresses_arg_conv_15_ptr); LDKSocketAddress addresses_arg_conv_15_conv = *(LDKSocketAddress*)(addresses_arg_conv_15_ptr); + addresses_arg_conv_15_conv = SocketAddress_clone((LDKSocketAddress*)untag_ptr(addresses_arg_conv_15)); addresses_arg_constr.data[p] = addresses_arg_conv_15_conv; } (*env)->ReleaseLongArrayElements(env, addresses_arg, addresses_arg_vals, 0); @@ -59863,23 +62381,42 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1ti UnsignedChannelUpdate_set_timestamp(&this_ptr_conv, val); } -JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1flags(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1message_1flags(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedChannelUpdate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_t ret_conv = UnsignedChannelUpdate_get_message_flags(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1message_1flags(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) { + LDKUnsignedChannelUpdate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + UnsignedChannelUpdate_set_message_flags(&this_ptr_conv, val); +} + +JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1channel_1flags(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_t ret_conv = UnsignedChannelUpdate_get_flags(&this_ptr_conv); + int8_t ret_conv = UnsignedChannelUpdate_get_channel_flags(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1flags(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1channel_1flags(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) { LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - UnsignedChannelUpdate_set_flags(&this_ptr_conv, val); + UnsignedChannelUpdate_set_channel_flags(&this_ptr_conv, val); } JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -60003,7 +62540,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1ex UnsignedChannelUpdate_set_excess_data(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1new(JNIEnv *env, jclass clz, int8_tArray chain_hash_arg, int64_t short_channel_id_arg, int32_t timestamp_arg, int8_t flags_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg, int32_t fee_base_msat_arg, int32_t fee_proportional_millionths_arg, int8_tArray excess_data_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1new(JNIEnv *env, jclass clz, int8_tArray chain_hash_arg, int64_t short_channel_id_arg, int32_t timestamp_arg, int8_t message_flags_arg, int8_t channel_flags_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg, int32_t fee_base_msat_arg, int32_t fee_proportional_millionths_arg, int8_tArray excess_data_arg) { LDKThirtyTwoBytes chain_hash_arg_ref; CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32); (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data); @@ -60011,7 +62548,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1new( excess_data_arg_ref.datalen = (*env)->GetArrayLength(env, excess_data_arg); excess_data_arg_ref.data = MALLOC(excess_data_arg_ref.datalen, "LDKCVec_u8Z Bytes"); (*env)->GetByteArrayRegion(env, excess_data_arg, 0, excess_data_arg_ref.datalen, excess_data_arg_ref.data); - LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_new(chain_hash_arg_ref, short_channel_id_arg, timestamp_arg, flags_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, fee_base_msat_arg, fee_proportional_millionths_arg, excess_data_arg_ref); + LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_new(chain_hash_arg_ref, short_channel_id_arg, timestamp_arg, message_flags_arg, channel_flags_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, fee_base_msat_arg, fee_proportional_millionths_arg, excess_data_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -62051,25 +64588,25 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Stfu_1read(JNIEnv *env, jcl return tag_ptr(ret_conv, true); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Splice_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKSplice obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SpliceInit_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKSpliceInit obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = Splice_write(&obj_conv); + LDKCVec_u8Z ret_var = SpliceInit_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Splice_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpliceInit_1read(JNIEnv *env, jclass clz, int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_SpliceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceDecodeErrorZ), "LDKCResult_SpliceDecodeErrorZ"); - *ret_conv = Splice_read(ser_ref); + LDKCResult_SpliceInitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceInitDecodeErrorZ), "LDKCResult_SpliceInitDecodeErrorZ"); + *ret_conv = SpliceInit_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } @@ -62419,6 +64956,29 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1read return tag_ptr(ret_conv, true); } +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSignedBatch_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKCommitmentSignedBatch obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = CommitmentSignedBatch_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSignedBatch_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_CommitmentSignedBatchDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedBatchDecodeErrorZ), "LDKCResult_CommitmentSignedBatchDecodeErrorZ"); + *ret_conv = CommitmentSignedBatch_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); +} + JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1write(JNIEnv *env, jclass clz, int64_t obj) { LDKCommitmentSigned obj_conv; obj_conv.inner = untag_ptr(obj); @@ -63190,17 +65750,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1new return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1EventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKIgnoringMessageHandler this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); - *ret_ret = IgnoringMessageHandler_as_EventsProvider(&this_arg_conv); - return tag_ptr(ret_ret, true); -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) { LDKIgnoringMessageHandler this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -63245,6 +65794,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_ return tag_ptr(ret_ret, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1AsyncPaymentsMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKIgnoringMessageHandler this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKAsyncPaymentsMessageHandler* ret_ret = MALLOC(sizeof(LDKAsyncPaymentsMessageHandler), "LDKAsyncPaymentsMessageHandler"); + *ret_ret = IgnoringMessageHandler_as_AsyncPaymentsMessageHandler(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1CustomOnionMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) { LDKIgnoringMessageHandler this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -63608,6 +66168,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerDetails_1new(JNIEnv *en void* socket_address_arg_ptr = untag_ptr(socket_address_arg); CHECK_ACCESS(socket_address_arg_ptr); LDKCOption_SocketAddressZ socket_address_arg_conv = *(LDKCOption_SocketAddressZ*)(socket_address_arg_ptr); + socket_address_arg_conv = COption_SocketAddressZ_clone((LDKCOption_SocketAddressZ*)untag_ptr(socket_address_arg)); LDKInitFeatures init_features_arg_conv; init_features_arg_conv.inner = untag_ptr(init_features_arg); init_features_arg_conv.is_owned = ptr_is_owned(init_features_arg); @@ -63775,6 +66336,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1outbound_ void* remote_network_address_ptr = untag_ptr(remote_network_address); CHECK_ACCESS(remote_network_address_ptr); LDKCOption_SocketAddressZ remote_network_address_conv = *(LDKCOption_SocketAddressZ*)(remote_network_address_ptr); + remote_network_address_conv = COption_SocketAddressZ_clone((LDKCOption_SocketAddressZ*)untag_ptr(remote_network_address)); LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); *ret_conv = PeerManager_new_outbound_connection(&this_arg_conv, their_node_id_ref, descriptor_conv, remote_network_address_conv); return tag_ptr(ret_conv, true); @@ -63796,6 +66358,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1inbound_1 void* remote_network_address_ptr = untag_ptr(remote_network_address); CHECK_ACCESS(remote_network_address_ptr); LDKCOption_SocketAddressZ remote_network_address_conv = *(LDKCOption_SocketAddressZ*)(remote_network_address_ptr); + remote_network_address_conv = COption_SocketAddressZ_clone((LDKCOption_SocketAddressZ*)untag_ptr(remote_network_address)); LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); *ret_conv = PeerManager_new_inbound_connection(&this_arg_conv, descriptor_conv, remote_network_address_conv); return tag_ptr(ret_conv, true); @@ -63908,6 +66471,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1broadcast_1node_1 void* addresses_conv_15_ptr = untag_ptr(addresses_conv_15); CHECK_ACCESS(addresses_conv_15_ptr); LDKSocketAddress addresses_conv_15_conv = *(LDKSocketAddress*)(addresses_conv_15_ptr); + addresses_conv_15_conv = SocketAddress_clone((LDKSocketAddress*)untag_ptr(addresses_conv_15)); addresses_constr.data[p] = addresses_conv_15_conv; } (*env)->ReleaseLongArrayElements(env, addresses, addresses_vals, 0); @@ -64885,6 +67449,16 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1eq return ret_conv; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1to_1bitcoin_1amount(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKHTLCOutputInCommitment this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int64_t ret_conv = HTLCOutputInCommitment_to_bitcoin_amount(&this_arg_conv); + return ret_conv; +} + JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1write(JNIEnv *env, jclass clz, int64_t obj) { LDKHTLCOutputInCommitment obj_conv; obj_conv.inner = untag_ptr(obj); @@ -66387,7752 +68961,8409 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_get_1commitment_1transactio return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKInitFeatures a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKInitFeatures b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = InitFeatures_eq(&a_conv, &b_conv); - return ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InitFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKInitFeatures obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = InitFeatures_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKNodeFeatures a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKNodeFeatures b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_eq(&a_conv, &b_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); + *ret_conv = InitFeatures_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKChannelFeatures a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKChannelFeatures b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = ChannelFeatures_eq(&a_conv, &b_conv); - return ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelFeatures obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ChannelFeatures_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKBolt11InvoiceFeatures a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKBolt11InvoiceFeatures b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = Bolt11InvoiceFeatures_eq(&a_conv, &b_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); + *ret_conv = ChannelFeatures_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKOfferFeatures a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKOfferFeatures b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = OfferFeatures_eq(&a_conv, &b_conv); - return ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKNodeFeatures obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = NodeFeatures_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKInvoiceRequestFeatures a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKInvoiceRequestFeatures b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = InvoiceRequestFeatures_eq(&a_conv, &b_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); + *ret_conv = NodeFeatures_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKBolt12InvoiceFeatures a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKBolt12InvoiceFeatures b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = Bolt12InvoiceFeatures_eq(&a_conv, &b_conv); - return ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKBolt11InvoiceFeatures obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = Bolt11InvoiceFeatures_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKBlindedHopFeatures a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKBlindedHopFeatures b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = BlindedHopFeatures_eq(&a_conv, &b_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ"); + *ret_conv = Bolt11InvoiceFeatures_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKChannelTypeFeatures a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKChannelTypeFeatures b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_eq(&a_conv, &b_conv); - return ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKBolt12InvoiceFeatures obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = Bolt12InvoiceFeatures_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -static inline uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg) { - LDKInitFeatures ret_var = InitFeatures_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ"); + *ret_conv = Bolt12InvoiceFeatures_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKInitFeatures arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = InitFeatures_clone_ptr(&arg_conv); - return ret_conv; + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKBlindedHopFeatures obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = BlindedHopFeatures_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKInitFeatures orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKInitFeatures ret_var = InitFeatures_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ"); + *ret_conv = BlindedHopFeatures_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -static inline uint64_t NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg) { - LDKNodeFeatures ret_var = NodeFeatures_clone(arg); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelTypeFeatures obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ChannelTypeFeatures_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); + *ret_conv = ChannelTypeFeatures_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKShutdownScript this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ShutdownScript_free(this_obj_conv); +} + +static inline uint64_t ShutdownScript_clone_ptr(LDKShutdownScript *NONNULL_PTR arg) { + LDKShutdownScript ret_var = ShutdownScript_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKNodeFeatures arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKShutdownScript arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = NodeFeatures_clone_ptr(&arg_conv); + int64_t ret_conv = ShutdownScript_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKNodeFeatures orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKShutdownScript orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKNodeFeatures ret_var = NodeFeatures_clone(&orig_conv); + LDKShutdownScript ret_var = ShutdownScript_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg) { - LDKChannelFeatures ret_var = ChannelFeatures_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelFeatures arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = ChannelFeatures_clone_ptr(&arg_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKShutdownScript a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKShutdownScript b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ShutdownScript_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelFeatures orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKChannelFeatures ret_var = ChannelFeatures_clone(&orig_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInvalidShutdownScript this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InvalidShutdownScript_free(this_obj_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1get_1script(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInvalidShutdownScript this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u8Z ret_var = InvalidShutdownScript_get_script(&this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1set_1script(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKInvalidShutdownScript this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u8Z val_ref; + val_ref.datalen = (*env)->GetArrayLength(env, val); + val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data); + InvalidShutdownScript_set_script(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1new(JNIEnv *env, jclass clz, int8_tArray script_arg) { + LDKCVec_u8Z script_arg_ref; + script_arg_ref.datalen = (*env)->GetArrayLength(env, script_arg); + script_arg_ref.data = MALLOC(script_arg_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, script_arg, 0, script_arg_ref.datalen, script_arg_ref.data); + LDKInvalidShutdownScript ret_var = InvalidShutdownScript_new(script_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t Bolt11InvoiceFeatures_clone_ptr(LDKBolt11InvoiceFeatures *NONNULL_PTR arg) { - LDKBolt11InvoiceFeatures ret_var = Bolt11InvoiceFeatures_clone(arg); +static inline uint64_t InvalidShutdownScript_clone_ptr(LDKInvalidShutdownScript *NONNULL_PTR arg) { + LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKBolt11InvoiceFeatures arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInvalidShutdownScript arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Bolt11InvoiceFeatures_clone_ptr(&arg_conv); + int64_t ret_conv = InvalidShutdownScript_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBolt11InvoiceFeatures orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKInvalidShutdownScript orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBolt11InvoiceFeatures ret_var = Bolt11InvoiceFeatures_clone(&orig_conv); + LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t OfferFeatures_clone_ptr(LDKOfferFeatures *NONNULL_PTR arg) { - LDKOfferFeatures ret_var = OfferFeatures_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKShutdownScript obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ShutdownScript_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKOfferFeatures arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = OfferFeatures_clone_ptr(&arg_conv); - return ret_conv; + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); + *ret_conv = ShutdownScript_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKOfferFeatures orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKOfferFeatures ret_var = OfferFeatures_clone(&orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1p2wpkh(JNIEnv *env, jclass clz, int8_tArray pubkey_hash) { + uint8_t pubkey_hash_arr[20]; + CHECK((*env)->GetArrayLength(env, pubkey_hash) == 20); + (*env)->GetByteArrayRegion(env, pubkey_hash, 0, 20, pubkey_hash_arr); + uint8_t (*pubkey_hash_ref)[20] = &pubkey_hash_arr; + LDKShutdownScript ret_var = ShutdownScript_new_p2wpkh(pubkey_hash_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t InvoiceRequestFeatures_clone_ptr(LDKInvoiceRequestFeatures *NONNULL_PTR arg) { - LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_clone(arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1p2wsh(JNIEnv *env, jclass clz, int8_tArray script_hash) { + uint8_t script_hash_arr[32]; + CHECK((*env)->GetArrayLength(env, script_hash) == 32); + (*env)->GetByteArrayRegion(env, script_hash, 0, 32, script_hash_arr); + uint8_t (*script_hash_ref)[32] = &script_hash_arr; + LDKShutdownScript ret_var = ShutdownScript_new_p2wsh(script_hash_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKInvoiceRequestFeatures arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = InvoiceRequestFeatures_clone_ptr(&arg_conv); + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1witness_1program(JNIEnv *env, jclass clz, int64_t witness_program) { + void* witness_program_ptr = untag_ptr(witness_program); + CHECK_ACCESS(witness_program_ptr); + LDKWitnessProgram witness_program_conv = *(LDKWitnessProgram*)(witness_program_ptr); + witness_program_conv = WitnessProgram_clone((LDKWitnessProgram*)untag_ptr(witness_program)); + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); + *ret_conv = ShutdownScript_new_witness_program(witness_program_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1into_1inner(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKShutdownScript this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = ShutdownScript_clone(&this_arg_conv); + LDKCVec_u8Z ret_var = ShutdownScript_into_inner(this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1as_1legacy_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKShutdownScript this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ShutdownScript_as_legacy_pubkey(&this_arg_conv).compressed_form); + return ret_arr; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1is_1compatible(JNIEnv *env, jclass clz, int64_t this_arg, int64_t features) { + LDKShutdownScript this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKInitFeatures features_conv; + features_conv.inner = untag_ptr(features); + features_conv.is_owned = ptr_is_owned(features); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); + features_conv.is_owned = false; + jboolean ret_conv = ShutdownScript_is_compatible(&this_arg_conv, &features_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKInvoiceRequestFeatures orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_clone(&orig_conv); +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1to_1str(JNIEnv *env, jclass clz, int64_t o) { + LDKShutdownScript o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = ShutdownScript_to_str(&o_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelId_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelId this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelId_free(this_obj_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelId_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelId this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelId_get_a(&this_ptr_conv)); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelId_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKChannelId this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + ChannelId_set_a(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1new(JNIEnv *env, jclass clz, int8_tArray a_arg) { + LDKThirtyTwoBytes a_arg_ref; + CHECK((*env)->GetArrayLength(env, a_arg) == 32); + (*env)->GetByteArrayRegion(env, a_arg, 0, 32, a_arg_ref.data); + LDKChannelId ret_var = ChannelId_new(a_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t Bolt12InvoiceFeatures_clone_ptr(LDKBolt12InvoiceFeatures *NONNULL_PTR arg) { - LDKBolt12InvoiceFeatures ret_var = Bolt12InvoiceFeatures_clone(arg); +static inline uint64_t ChannelId_clone_ptr(LDKChannelId *NONNULL_PTR arg) { + LDKChannelId ret_var = ChannelId_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKBolt12InvoiceFeatures arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelId arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Bolt12InvoiceFeatures_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelId_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBolt12InvoiceFeatures orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelId orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBolt12InvoiceFeatures ret_var = Bolt12InvoiceFeatures_clone(&orig_conv); + LDKChannelId ret_var = ChannelId_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t BlindedHopFeatures_clone_ptr(LDKBlindedHopFeatures *NONNULL_PTR arg) { - LDKBlindedHopFeatures ret_var = BlindedHopFeatures_clone(arg); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelId_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKChannelId a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKChannelId b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ChannelId_eq(&a_conv, &b_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKChannelId o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = ChannelId_hash(&o_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1v1_1from_1funding_1txid(JNIEnv *env, jclass clz, int8_tArray txid, int16_t output_index) { + uint8_t txid_arr[32]; + CHECK((*env)->GetArrayLength(env, txid) == 32); + (*env)->GetByteArrayRegion(env, txid, 0, 32, txid_arr); + uint8_t (*txid_ref)[32] = &txid_arr; + LDKChannelId ret_var = ChannelId_v1_from_funding_txid(txid_ref, output_index); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKBlindedHopFeatures arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = BlindedHopFeatures_clone_ptr(&arg_conv); - return ret_conv; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBlindedHopFeatures orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKBlindedHopFeatures ret_var = BlindedHopFeatures_clone(&orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1v1_1from_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t outpoint) { + LDKOutPoint outpoint_conv; + outpoint_conv.inner = untag_ptr(outpoint); + outpoint_conv.is_owned = ptr_is_owned(outpoint); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv); + outpoint_conv = OutPoint_clone(&outpoint_conv); + LDKChannelId ret_var = ChannelId_v1_from_funding_outpoint(outpoint_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg) { - LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1temporary_1from_1entropy_1source(JNIEnv *env, jclass clz, int64_t entropy_source) { + void* entropy_source_ptr = untag_ptr(entropy_source); + if (ptr_is_owned(entropy_source)) { CHECK_ACCESS(entropy_source_ptr); } + LDKEntropySource* entropy_source_conv = (LDKEntropySource*)entropy_source_ptr; + LDKChannelId ret_var = ChannelId_temporary_from_entropy_source(entropy_source_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelTypeFeatures arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = ChannelTypeFeatures_clone_ptr(&arg_conv); - return ret_conv; + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1from_1bytes(JNIEnv *env, jclass clz, int8_tArray data) { + LDKThirtyTwoBytes data_ref; + CHECK((*env)->GetArrayLength(env, data) == 32); + (*env)->GetByteArrayRegion(env, data, 0, 32, data_ref.data); + LDKChannelId ret_var = ChannelId_from_bytes(data_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelTypeFeatures orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(&orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1new_1zero(JNIEnv *env, jclass clz) { + LDKChannelId ret_var = ChannelId_new_zero(); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKInitFeatures o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = InitFeatures_hash(&o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelId_1is_1zero(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelId this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelId_is_zero(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKNodeFeatures o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = NodeFeatures_hash(&o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1v2_1from_1revocation_1basepoints(JNIEnv *env, jclass clz, int64_t ours, int64_t theirs) { + LDKRevocationBasepoint ours_conv; + ours_conv.inner = untag_ptr(ours); + ours_conv.is_owned = ptr_is_owned(ours); + CHECK_INNER_FIELD_ACCESS_OR_NULL(ours_conv); + ours_conv.is_owned = false; + LDKRevocationBasepoint theirs_conv; + theirs_conv.inner = untag_ptr(theirs); + theirs_conv.is_owned = ptr_is_owned(theirs); + CHECK_INNER_FIELD_ACCESS_OR_NULL(theirs_conv); + theirs_conv.is_owned = false; + LDKChannelId ret_var = ChannelId_v2_from_revocation_basepoints(&ours_conv, &theirs_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKChannelFeatures o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = ChannelFeatures_hash(&o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1temporary_1v2_1from_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t our_revocation_basepoint) { + LDKRevocationBasepoint our_revocation_basepoint_conv; + our_revocation_basepoint_conv.inner = untag_ptr(our_revocation_basepoint); + our_revocation_basepoint_conv.is_owned = ptr_is_owned(our_revocation_basepoint); + CHECK_INNER_FIELD_ACCESS_OR_NULL(our_revocation_basepoint_conv); + our_revocation_basepoint_conv.is_owned = false; + LDKChannelId ret_var = ChannelId_temporary_v2_from_revocation_basepoint(&our_revocation_basepoint_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKBolt11InvoiceFeatures o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = Bolt11InvoiceFeatures_hash(&o_conv); - return ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelId_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelId obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ChannelId_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKOfferFeatures o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = OfferFeatures_hash(&o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_ChannelIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdDecodeErrorZ), "LDKCResult_ChannelIdDecodeErrorZ"); + *ret_conv = ChannelId_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKInvoiceRequestFeatures o_conv; +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ChannelId_1to_1str(JNIEnv *env, jclass clz, int64_t o) { + LDKChannelId o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv.is_owned = false; - int64_t ret_conv = InvoiceRequestFeatures_hash(&o_conv); + LDKStr ret_str = ChannelId_to_str(&o_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKBolt12InvoiceFeatures o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = Bolt12InvoiceFeatures_hash(&o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice(JNIEnv *env, jclass clz, int64_t amt_msat, int64_t payment_hash, jstring description, int32_t invoice_expiry_delta_secs, int64_tArray phantom_route_hints, int64_t entropy_source, int64_t node_signer, int64_t logger, jclass network, int64_t min_final_cltv_expiry_delta, int64_t duration_since_epoch) { + void* amt_msat_ptr = untag_ptr(amt_msat); + CHECK_ACCESS(amt_msat_ptr); + LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); + amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); + void* payment_hash_ptr = untag_ptr(payment_hash); + CHECK_ACCESS(payment_hash_ptr); + LDKCOption_ThirtyTwoBytesZ payment_hash_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_ptr); + payment_hash_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash)); + LDKStr description_conv = java_to_owned_str(env, description); + LDKCVec_PhantomRouteHintsZ phantom_route_hints_constr; + phantom_route_hints_constr.datalen = (*env)->GetArrayLength(env, phantom_route_hints); + if (phantom_route_hints_constr.datalen > 0) + phantom_route_hints_constr.data = MALLOC(phantom_route_hints_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements"); + else + phantom_route_hints_constr.data = NULL; + int64_t* phantom_route_hints_vals = (*env)->GetLongArrayElements (env, phantom_route_hints, NULL); + for (size_t t = 0; t < phantom_route_hints_constr.datalen; t++) { + int64_t phantom_route_hints_conv_19 = phantom_route_hints_vals[t]; + LDKPhantomRouteHints phantom_route_hints_conv_19_conv; + phantom_route_hints_conv_19_conv.inner = untag_ptr(phantom_route_hints_conv_19); + phantom_route_hints_conv_19_conv.is_owned = ptr_is_owned(phantom_route_hints_conv_19); + CHECK_INNER_FIELD_ACCESS_OR_NULL(phantom_route_hints_conv_19_conv); + phantom_route_hints_conv_19_conv = PhantomRouteHints_clone(&phantom_route_hints_conv_19_conv); + phantom_route_hints_constr.data[t] = phantom_route_hints_conv_19_conv; + } + (*env)->ReleaseLongArrayElements(env, phantom_route_hints, phantom_route_hints_vals, 0); + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKCurrency network_conv = LDKCurrency_from_java(env, network); + void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); + CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); + LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); + min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = create_phantom_invoice(amt_msat_conv, payment_hash_conv, description_conv, invoice_expiry_delta_secs, phantom_route_hints_constr, entropy_source_conv, node_signer_conv, logger_conv, network_conv, min_final_cltv_expiry_delta_conv, duration_since_epoch); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKBlindedHopFeatures o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = BlindedHopFeatures_hash(&o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice_1with_1description_1hash(JNIEnv *env, jclass clz, int64_t amt_msat, int64_t payment_hash, int32_t invoice_expiry_delta_secs, int64_t description_hash, int64_tArray phantom_route_hints, int64_t entropy_source, int64_t node_signer, int64_t logger, jclass network, int64_t min_final_cltv_expiry_delta, int64_t duration_since_epoch) { + void* amt_msat_ptr = untag_ptr(amt_msat); + CHECK_ACCESS(amt_msat_ptr); + LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); + amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); + void* payment_hash_ptr = untag_ptr(payment_hash); + CHECK_ACCESS(payment_hash_ptr); + LDKCOption_ThirtyTwoBytesZ payment_hash_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_ptr); + payment_hash_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash)); + LDKSha256 description_hash_conv; + description_hash_conv.inner = untag_ptr(description_hash); + description_hash_conv.is_owned = ptr_is_owned(description_hash); + CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv); + description_hash_conv = Sha256_clone(&description_hash_conv); + LDKCVec_PhantomRouteHintsZ phantom_route_hints_constr; + phantom_route_hints_constr.datalen = (*env)->GetArrayLength(env, phantom_route_hints); + if (phantom_route_hints_constr.datalen > 0) + phantom_route_hints_constr.data = MALLOC(phantom_route_hints_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements"); + else + phantom_route_hints_constr.data = NULL; + int64_t* phantom_route_hints_vals = (*env)->GetLongArrayElements (env, phantom_route_hints, NULL); + for (size_t t = 0; t < phantom_route_hints_constr.datalen; t++) { + int64_t phantom_route_hints_conv_19 = phantom_route_hints_vals[t]; + LDKPhantomRouteHints phantom_route_hints_conv_19_conv; + phantom_route_hints_conv_19_conv.inner = untag_ptr(phantom_route_hints_conv_19); + phantom_route_hints_conv_19_conv.is_owned = ptr_is_owned(phantom_route_hints_conv_19); + CHECK_INNER_FIELD_ACCESS_OR_NULL(phantom_route_hints_conv_19_conv); + phantom_route_hints_conv_19_conv = PhantomRouteHints_clone(&phantom_route_hints_conv_19_conv); + phantom_route_hints_constr.data[t] = phantom_route_hints_conv_19_conv; + } + (*env)->ReleaseLongArrayElements(env, phantom_route_hints, phantom_route_hints_vals, 0); + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKCurrency network_conv = LDKCurrency_from_java(env, network); + void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); + CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); + LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); + min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = create_phantom_invoice_with_description_hash(amt_msat_conv, payment_hash_conv, invoice_expiry_delta_secs, description_hash_conv, phantom_route_hints_constr, entropy_source_conv, node_signer_conv, logger_conv, network_conv, min_final_cltv_expiry_delta_conv, duration_since_epoch); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKChannelTypeFeatures o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = ChannelTypeFeatures_hash(&o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t node_signer, int64_t logger, jclass network, int64_t amt_msat, jstring description, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { + LDKChannelManager channelmanager_conv; + channelmanager_conv.inner = untag_ptr(channelmanager); + channelmanager_conv.is_owned = ptr_is_owned(channelmanager); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); + channelmanager_conv.is_owned = false; + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKCurrency network_conv = LDKCurrency_from_java(env, network); + void* amt_msat_ptr = untag_ptr(amt_msat); + CHECK_ACCESS(amt_msat_ptr); + LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); + amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); + LDKStr description_conv = java_to_owned_str(env, description); + void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); + CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); + LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); + min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = create_invoice_from_channelmanager(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_conv, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKInitFeatures this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InitFeatures_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1with_1description_1hash(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t node_signer, int64_t logger, jclass network, int64_t amt_msat, int64_t description_hash, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { + LDKChannelManager channelmanager_conv; + channelmanager_conv.inner = untag_ptr(channelmanager); + channelmanager_conv.is_owned = ptr_is_owned(channelmanager); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); + channelmanager_conv.is_owned = false; + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKCurrency network_conv = LDKCurrency_from_java(env, network); + void* amt_msat_ptr = untag_ptr(amt_msat); + CHECK_ACCESS(amt_msat_ptr); + LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); + amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); + LDKSha256 description_hash_conv; + description_hash_conv.inner = untag_ptr(description_hash); + description_hash_conv.is_owned = ptr_is_owned(description_hash); + CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv); + description_hash_conv = Sha256_clone(&description_hash_conv); + void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); + CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); + LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); + min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = create_invoice_from_channelmanager_with_description_hash(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_hash_conv, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKNodeFeatures this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - NodeFeatures_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1with_1description_1hash_1and_1duration_1since_1epoch(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t node_signer, int64_t logger, jclass network, int64_t amt_msat, int64_t description_hash, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { + LDKChannelManager channelmanager_conv; + channelmanager_conv.inner = untag_ptr(channelmanager); + channelmanager_conv.is_owned = ptr_is_owned(channelmanager); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); + channelmanager_conv.is_owned = false; + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKCurrency network_conv = LDKCurrency_from_java(env, network); + void* amt_msat_ptr = untag_ptr(amt_msat); + CHECK_ACCESS(amt_msat_ptr); + LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); + amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); + LDKSha256 description_hash_conv; + description_hash_conv.inner = untag_ptr(description_hash); + description_hash_conv.is_owned = ptr_is_owned(description_hash); + CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv); + description_hash_conv = Sha256_clone(&description_hash_conv); + void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); + CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); + LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); + min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_hash_conv, duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelFeatures this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelFeatures_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1and_1duration_1since_1epoch(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t node_signer, int64_t logger, jclass network, int64_t amt_msat, jstring description, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { + LDKChannelManager channelmanager_conv; + channelmanager_conv.inner = untag_ptr(channelmanager); + channelmanager_conv.is_owned = ptr_is_owned(channelmanager); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); + channelmanager_conv.is_owned = false; + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKCurrency network_conv = LDKCurrency_from_java(env, network); + void* amt_msat_ptr = untag_ptr(amt_msat); + CHECK_ACCESS(amt_msat_ptr); + LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); + amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); + LDKStr description_conv = java_to_owned_str(env, description); + void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); + CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); + LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); + min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = create_invoice_from_channelmanager_and_duration_since_epoch(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_conv, duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKBolt11InvoiceFeatures this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Bolt11InvoiceFeatures_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1and_1duration_1since_1epoch_1with_1payment_1hash(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t node_signer, int64_t logger, jclass network, int64_t amt_msat, jstring description, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs, int8_tArray payment_hash, int64_t min_final_cltv_expiry_delta) { + LDKChannelManager channelmanager_conv; + channelmanager_conv.inner = untag_ptr(channelmanager); + channelmanager_conv.is_owned = ptr_is_owned(channelmanager); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); + channelmanager_conv.is_owned = false; + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKCurrency network_conv = LDKCurrency_from_java(env, network); + void* amt_msat_ptr = untag_ptr(amt_msat); + CHECK_ACCESS(amt_msat_ptr); + LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); + amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); + LDKStr description_conv = java_to_owned_str(env, description); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); + CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); + LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); + min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_conv, duration_since_epoch, invoice_expiry_delta_secs, payment_hash_ref, min_final_cltv_expiry_delta_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKOfferFeatures this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - OfferFeatures_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_payment_1parameters_1from_1zero_1amount_1invoice(JNIEnv *env, jclass clz, int64_t invoice, int64_t amount_msat) { + LDKBolt11Invoice invoice_conv; + invoice_conv.inner = untag_ptr(invoice); + invoice_conv.is_owned = ptr_is_owned(invoice); + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); + invoice_conv.is_owned = false; + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); + *ret_conv = payment_parameters_from_zero_amount_invoice(&invoice_conv, amount_msat); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKInvoiceRequestFeatures this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InvoiceRequestFeatures_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_payment_1parameters_1from_1invoice(JNIEnv *env, jclass clz, int64_t invoice) { + LDKBolt11Invoice invoice_conv; + invoice_conv.inner = untag_ptr(invoice); + invoice_conv.is_owned = ptr_is_owned(invoice); + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); + invoice_conv.is_owned = false; + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); + *ret_conv = payment_parameters_from_invoice(&invoice_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKBolt12InvoiceFeatures this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Bolt12InvoiceFeatures_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Retry_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKRetry this_ptr_conv = *(LDKRetry*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Retry_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKBlindedHopFeatures this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BlindedHopFeatures_free(this_obj_conv); +static inline uint64_t Retry_clone_ptr(LDKRetry *NONNULL_PTR arg) { + LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); + *ret_copy = Retry_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRetry* arg_conv = (LDKRetry*)untag_ptr(arg); + int64_t ret_conv = Retry_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelTypeFeatures this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelTypeFeatures_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKRetry* orig_conv = (LDKRetry*)untag_ptr(orig); + LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); + *ret_copy = Retry_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1empty(JNIEnv *env, jclass clz) { - LDKInitFeatures ret_var = InitFeatures_empty(); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1attempts(JNIEnv *env, jclass clz, int32_t a) { + LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); + *ret_copy = Retry_attempts(a); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKInitFeatures other_conv; - other_conv.inner = untag_ptr(other); - other_conv.is_owned = ptr_is_owned(other); - CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); - other_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1timeout(JNIEnv *env, jclass clz, int64_t a) { + LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); + *ret_copy = Retry_timeout(a); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Retry_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKRetry* a_conv = (LDKRetry*)untag_ptr(a); + LDKRetry* b_conv = (LDKRetry*)untag_ptr(b); + jboolean ret_conv = Retry_eq(a_conv, b_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_unknown_bits(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKRetry* o_conv = (LDKRetry*)untag_ptr(o); + int64_t ret_conv = Retry_hash(o_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1required_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = InitFeatures_set_required_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Retry_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKRetry* obj_conv = (LDKRetry*)untag_ptr(obj); + LDKCVec_u8Z ret_var = Retry_write(obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1optional_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = InitFeatures_set_optional_feature_bit(&this_arg_conv, bit); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_RetryDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RetryDecodeErrorZ), "LDKCResult_RetryDecodeErrorZ"); + *ret_conv = Retry_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1required_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = InitFeatures_set_required_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKRetryableSendFailure* orig_conv = (LDKRetryableSendFailure*)untag_ptr(orig); + jclass ret_conv = LDKRetryableSendFailure_to_java(env, RetryableSendFailure_clone(orig_conv)); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1optional_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = InitFeatures_set_optional_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1payment_1expired(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKRetryableSendFailure_to_java(env, RetryableSendFailure_payment_expired()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1empty(JNIEnv *env, jclass clz) { - LDKNodeFeatures ret_var = NodeFeatures_empty(); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1route_1not_1found(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKRetryableSendFailure_to_java(env, RetryableSendFailure_route_not_found()); + return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeFeatures other_conv; - other_conv.inner = untag_ptr(other); - other_conv.is_owned = ptr_is_owned(other); - CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); - other_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1duplicate_1payment(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKRetryableSendFailure_to_java(env, RetryableSendFailure_duplicate_payment()); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_unknown_bits(&this_arg_conv); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1onion_1packet_1size_1exceeded(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKRetryableSendFailure_to_java(env, RetryableSendFailure_onion_packet_size_exceeded()); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1required_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = NodeFeatures_set_required_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1optional_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = NodeFeatures_set_optional_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1required_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = NodeFeatures_set_required_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKRetryableSendFailure* a_conv = (LDKRetryableSendFailure*)untag_ptr(a); + LDKRetryableSendFailure* b_conv = (LDKRetryableSendFailure*)untag_ptr(b); + jboolean ret_conv = RetryableSendFailure_eq(a_conv, b_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1optional_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = NodeFeatures_set_optional_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + PaymentSendFailure_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1empty(JNIEnv *env, jclass clz) { - LDKChannelFeatures ret_var = ChannelFeatures_empty(); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +static inline uint64_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg) { + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1requires_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { - LDKChannelFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelFeatures other_conv; - other_conv.inner = untag_ptr(other); - other_conv.is_owned = ptr_is_owned(other); - CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); - other_conv.is_owned = false; - jboolean ret_conv = ChannelFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPaymentSendFailure* arg_conv = (LDKPaymentSendFailure*)untag_ptr(arg); + int64_t ret_conv = PaymentSendFailure_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelFeatures_requires_unknown_bits(&this_arg_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPaymentSendFailure* orig_conv = (LDKPaymentSendFailure*)untag_ptr(orig); + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1set_1required_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKChannelFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = ChannelFeatures_set_required_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1parameter_1error(JNIEnv *env, jclass clz, int64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKAPIError a_conv = *(LDKAPIError*)(a_ptr); + a_conv = APIError_clone((LDKAPIError*)untag_ptr(a)); + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_parameter_error(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1set_1optional_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKChannelFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = ChannelFeatures_set_optional_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1path_1parameter_1error(JNIEnv *env, jclass clz, int64_tArray a) { + LDKCVec_CResult_NoneAPIErrorZZ a_constr; + a_constr.datalen = (*env)->GetArrayLength(env, a); + if (a_constr.datalen > 0) + a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements"); + else + a_constr.data = NULL; + int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL); + for (size_t w = 0; w < a_constr.datalen; w++) { + int64_t a_conv_22 = a_vals[w]; + void* a_conv_22_ptr = untag_ptr(a_conv_22); + CHECK_ACCESS(a_conv_22_ptr); + LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(a_conv_22_ptr); + a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)untag_ptr(a_conv_22)); + a_constr.data[w] = a_conv_22_conv; + } + (*env)->ReleaseLongArrayElements(env, a, a_vals, 0); + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_path_parameter_error(a_constr); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1set_1required_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKChannelFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = ChannelFeatures_set_required_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1all_1failed_1resend_1safe(JNIEnv *env, jclass clz, int64_tArray a) { + LDKCVec_APIErrorZ a_constr; + a_constr.datalen = (*env)->GetArrayLength(env, a); + if (a_constr.datalen > 0) + a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements"); + else + a_constr.data = NULL; + int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL); + for (size_t k = 0; k < a_constr.datalen; k++) { + int64_t a_conv_10 = a_vals[k]; + void* a_conv_10_ptr = untag_ptr(a_conv_10); + CHECK_ACCESS(a_conv_10_ptr); + LDKAPIError a_conv_10_conv = *(LDKAPIError*)(a_conv_10_ptr); + a_conv_10_conv = APIError_clone((LDKAPIError*)untag_ptr(a_conv_10)); + a_constr.data[k] = a_conv_10_conv; + } + (*env)->ReleaseLongArrayElements(env, a, a_vals, 0); + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_all_failed_resend_safe(a_constr); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1set_1optional_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKChannelFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = ChannelFeatures_set_optional_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1duplicate_1payment(JNIEnv *env, jclass clz) { + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_duplicate_payment(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1empty(JNIEnv *env, jclass clz) { - LDKBolt11InvoiceFeatures ret_var = Bolt11InvoiceFeatures_empty(); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1partial_1failure(JNIEnv *env, jclass clz, int64_tArray results, int64_t failed_paths_retry, int8_tArray payment_id) { + LDKCVec_CResult_NoneAPIErrorZZ results_constr; + results_constr.datalen = (*env)->GetArrayLength(env, results); + if (results_constr.datalen > 0) + results_constr.data = MALLOC(results_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements"); + else + results_constr.data = NULL; + int64_t* results_vals = (*env)->GetLongArrayElements (env, results, NULL); + for (size_t w = 0; w < results_constr.datalen; w++) { + int64_t results_conv_22 = results_vals[w]; + void* results_conv_22_ptr = untag_ptr(results_conv_22); + CHECK_ACCESS(results_conv_22_ptr); + LDKCResult_NoneAPIErrorZ results_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(results_conv_22_ptr); + results_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)untag_ptr(results_conv_22)); + results_constr.data[w] = results_conv_22_conv; + } + (*env)->ReleaseLongArrayElements(env, results, results_vals, 0); + LDKRouteParameters failed_paths_retry_conv; + failed_paths_retry_conv.inner = untag_ptr(failed_paths_retry); + failed_paths_retry_conv.is_owned = ptr_is_owned(failed_paths_retry); + CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_conv); + failed_paths_retry_conv = RouteParameters_clone(&failed_paths_retry_conv); + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_partial_failure(results_constr, failed_paths_retry_conv, payment_id_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { - LDKBolt11InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKBolt11InvoiceFeatures other_conv; - other_conv.inner = untag_ptr(other); - other_conv.is_owned = ptr_is_owned(other); - CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); - other_conv.is_owned = false; - jboolean ret_conv = Bolt11InvoiceFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKPaymentSendFailure* a_conv = (LDKPaymentSendFailure*)untag_ptr(a); + LDKPaymentSendFailure* b_conv = (LDKPaymentSendFailure*)untag_ptr(b); + jboolean ret_conv = PaymentSendFailure_eq(a_conv, b_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = Bolt11InvoiceFeatures_requires_unknown_bits(&this_arg_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12PaymentError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKBolt12PaymentError this_ptr_conv = *(LDKBolt12PaymentError*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Bolt12PaymentError_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1required_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKBolt11InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = Bolt11InvoiceFeatures_set_required_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +static inline uint64_t Bolt12PaymentError_clone_ptr(LDKBolt12PaymentError *NONNULL_PTR arg) { + LDKBolt12PaymentError *ret_copy = MALLOC(sizeof(LDKBolt12PaymentError), "LDKBolt12PaymentError"); + *ret_copy = Bolt12PaymentError_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12PaymentError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBolt12PaymentError* arg_conv = (LDKBolt12PaymentError*)untag_ptr(arg); + int64_t ret_conv = Bolt12PaymentError_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1optional_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKBolt11InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = Bolt11InvoiceFeatures_set_optional_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12PaymentError_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBolt12PaymentError* orig_conv = (LDKBolt12PaymentError*)untag_ptr(orig); + LDKBolt12PaymentError *ret_copy = MALLOC(sizeof(LDKBolt12PaymentError), "LDKBolt12PaymentError"); + *ret_copy = Bolt12PaymentError_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1required_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKBolt11InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = Bolt11InvoiceFeatures_set_required_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12PaymentError_1unexpected_1invoice(JNIEnv *env, jclass clz) { + LDKBolt12PaymentError *ret_copy = MALLOC(sizeof(LDKBolt12PaymentError), "LDKBolt12PaymentError"); + *ret_copy = Bolt12PaymentError_unexpected_invoice(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1optional_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKBolt11InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = Bolt11InvoiceFeatures_set_optional_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12PaymentError_1duplicate_1invoice(JNIEnv *env, jclass clz) { + LDKBolt12PaymentError *ret_copy = MALLOC(sizeof(LDKBolt12PaymentError), "LDKBolt12PaymentError"); + *ret_copy = Bolt12PaymentError_duplicate_invoice(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1empty(JNIEnv *env, jclass clz) { - LDKOfferFeatures ret_var = OfferFeatures_empty(); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12PaymentError_1unknown_1required_1features(JNIEnv *env, jclass clz) { + LDKBolt12PaymentError *ret_copy = MALLOC(sizeof(LDKBolt12PaymentError), "LDKBolt12PaymentError"); + *ret_copy = Bolt12PaymentError_unknown_required_features(); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1requires_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { - LDKOfferFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOfferFeatures other_conv; - other_conv.inner = untag_ptr(other); - other_conv.is_owned = ptr_is_owned(other); - CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); - other_conv.is_owned = false; - jboolean ret_conv = OfferFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12PaymentError_1sending_1failed(JNIEnv *env, jclass clz, jclass a) { + LDKRetryableSendFailure a_conv = LDKRetryableSendFailure_from_java(env, a); + LDKBolt12PaymentError *ret_copy = MALLOC(sizeof(LDKBolt12PaymentError), "LDKBolt12PaymentError"); + *ret_copy = Bolt12PaymentError_sending_failed(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOfferFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = OfferFeatures_requires_unknown_bits(&this_arg_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12PaymentError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKBolt12PaymentError* a_conv = (LDKBolt12PaymentError*)untag_ptr(a); + LDKBolt12PaymentError* b_conv = (LDKBolt12PaymentError*)untag_ptr(b); + jboolean ret_conv = Bolt12PaymentError_eq(a_conv, b_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1set_1required_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKOfferFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = OfferFeatures_set_required_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKProbeSendFailure this_ptr_conv = *(LDKProbeSendFailure*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + ProbeSendFailure_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1set_1optional_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKOfferFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = OfferFeatures_set_optional_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +static inline uint64_t ProbeSendFailure_clone_ptr(LDKProbeSendFailure *NONNULL_PTR arg) { + LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); + *ret_copy = ProbeSendFailure_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1set_1required_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKOfferFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = OfferFeatures_set_required_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKProbeSendFailure* arg_conv = (LDKProbeSendFailure*)untag_ptr(arg); + int64_t ret_conv = ProbeSendFailure_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1set_1optional_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKOfferFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = OfferFeatures_set_optional_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKProbeSendFailure* orig_conv = (LDKProbeSendFailure*)untag_ptr(orig); + LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); + *ret_copy = ProbeSendFailure_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1empty(JNIEnv *env, jclass clz) { - LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_empty(); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1route_1not_1found(JNIEnv *env, jclass clz) { + LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); + *ret_copy = ProbeSendFailure_route_not_found(); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1requires_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { - LDKInvoiceRequestFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKInvoiceRequestFeatures other_conv; - other_conv.inner = untag_ptr(other); - other_conv.is_owned = ptr_is_owned(other); - CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); - other_conv.is_owned = false; - jboolean ret_conv = InvoiceRequestFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1sending_1failed(JNIEnv *env, jclass clz, int64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKPaymentSendFailure a_conv = *(LDKPaymentSendFailure*)(a_ptr); + a_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(a)); + LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); + *ret_copy = ProbeSendFailure_sending_failed(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequestFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InvoiceRequestFeatures_requires_unknown_bits(&this_arg_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKProbeSendFailure* a_conv = (LDKProbeSendFailure*)untag_ptr(a); + LDKProbeSendFailure* b_conv = (LDKProbeSendFailure*)untag_ptr(b); + jboolean ret_conv = ProbeSendFailure_eq(a_conv, b_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1set_1required_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKInvoiceRequestFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = InvoiceRequestFeatures_set_required_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKRecipientOnionFields this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + RecipientOnionFields_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1set_1optional_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKInvoiceRequestFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = InvoiceRequestFeatures_set_optional_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1get_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRecipientOnionFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); + *ret_copy = RecipientOnionFields_get_payment_secret(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1set_1required_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKInvoiceRequestFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = InvoiceRequestFeatures_set_required_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1set_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKRecipientOnionFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_ThirtyTwoBytesZ val_conv = *(LDKCOption_ThirtyTwoBytesZ*)(val_ptr); + val_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(val)); + RecipientOnionFields_set_payment_secret(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1set_1optional_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKInvoiceRequestFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = InvoiceRequestFeatures_set_optional_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1get_1payment_1metadata(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRecipientOnionFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = RecipientOnionFields_get_payment_metadata(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1empty(JNIEnv *env, jclass clz) { - LDKBolt12InvoiceFeatures ret_var = Bolt12InvoiceFeatures_empty(); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1set_1payment_1metadata(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKRecipientOnionFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_CVec_u8ZZ val_conv = *(LDKCOption_CVec_u8ZZ*)(val_ptr); + val_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(val)); + RecipientOnionFields_set_payment_metadata(&this_ptr_conv, val_conv); +} + +static inline uint64_t RecipientOnionFields_clone_ptr(LDKRecipientOnionFields *NONNULL_PTR arg) { + LDKRecipientOnionFields ret_var = RecipientOnionFields_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1requires_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { - LDKBolt12InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKBolt12InvoiceFeatures other_conv; - other_conv.inner = untag_ptr(other); - other_conv.is_owned = ptr_is_owned(other); - CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); - other_conv.is_owned = false; - jboolean ret_conv = Bolt12InvoiceFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRecipientOnionFields arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = RecipientOnionFields_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = Bolt12InvoiceFeatures_requires_unknown_bits(&this_arg_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKRecipientOnionFields orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKRecipientOnionFields ret_var = RecipientOnionFields_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1required_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKBolt12InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = Bolt12InvoiceFeatures_set_required_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKRecipientOnionFields a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKRecipientOnionFields b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = RecipientOnionFields_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1optional_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKBolt12InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = Bolt12InvoiceFeatures_set_optional_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKRecipientOnionFields obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = RecipientOnionFields_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1required_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKBolt12InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = Bolt12InvoiceFeatures_set_required_custom_bit(&this_arg_conv, bit); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_RecipientOnionFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsDecodeErrorZ), "LDKCResult_RecipientOnionFieldsDecodeErrorZ"); + *ret_conv = RecipientOnionFields_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1optional_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKBolt12InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = Bolt12InvoiceFeatures_set_optional_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1secret_1only(JNIEnv *env, jclass clz, int8_tArray payment_secret) { + LDKThirtyTwoBytes payment_secret_ref; + CHECK((*env)->GetArrayLength(env, payment_secret) == 32); + (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data); + LDKRecipientOnionFields ret_var = RecipientOnionFields_secret_only(payment_secret_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1empty(JNIEnv *env, jclass clz) { - LDKBlindedHopFeatures ret_var = BlindedHopFeatures_empty(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1spontaneous_1empty(JNIEnv *env, jclass clz) { + LDKRecipientOnionFields ret_var = RecipientOnionFields_spontaneous_empty(); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1requires_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { - LDKBlindedHopFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1with_1custom_1tlvs(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray custom_tlvs) { + LDKRecipientOnionFields this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKBlindedHopFeatures other_conv; - other_conv.inner = untag_ptr(other); - other_conv.is_owned = ptr_is_owned(other); - CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); - other_conv.is_owned = false; - jboolean ret_conv = BlindedHopFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); - return ret_conv; + this_arg_conv = RecipientOnionFields_clone(&this_arg_conv); + LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs_constr; + custom_tlvs_constr.datalen = (*env)->GetArrayLength(env, custom_tlvs); + if (custom_tlvs_constr.datalen > 0) + custom_tlvs_constr.data = MALLOC(custom_tlvs_constr.datalen * sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKCVec_C2Tuple_u64CVec_u8ZZZ Elements"); + else + custom_tlvs_constr.data = NULL; + int64_t* custom_tlvs_vals = (*env)->GetLongArrayElements (env, custom_tlvs, NULL); + for (size_t x = 0; x < custom_tlvs_constr.datalen; x++) { + int64_t custom_tlvs_conv_23 = custom_tlvs_vals[x]; + void* custom_tlvs_conv_23_ptr = untag_ptr(custom_tlvs_conv_23); + CHECK_ACCESS(custom_tlvs_conv_23_ptr); + LDKC2Tuple_u64CVec_u8ZZ custom_tlvs_conv_23_conv = *(LDKC2Tuple_u64CVec_u8ZZ*)(custom_tlvs_conv_23_ptr); + custom_tlvs_conv_23_conv = C2Tuple_u64CVec_u8ZZ_clone((LDKC2Tuple_u64CVec_u8ZZ*)untag_ptr(custom_tlvs_conv_23)); + custom_tlvs_constr.data[x] = custom_tlvs_conv_23_conv; + } + (*env)->ReleaseLongArrayElements(env, custom_tlvs, custom_tlvs_vals, 0); + LDKCResult_RecipientOnionFieldsNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsNoneZ), "LDKCResult_RecipientOnionFieldsNoneZ"); + *ret_conv = RecipientOnionFields_with_custom_tlvs(this_arg_conv, custom_tlvs_constr); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBlindedHopFeatures this_arg_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1custom_1tlvs(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKRecipientOnionFields this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = BlindedHopFeatures_requires_unknown_bits(&this_arg_conv); + LDKCVec_C2Tuple_u64CVec_u8ZZZ ret_var = RecipientOnionFields_custom_tlvs(&this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t x = 0; x < ret_var.datalen; x++) { + LDKC2Tuple_u64CVec_u8ZZ* ret_conv_23_conv = MALLOC(sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKC2Tuple_u64CVec_u8ZZ"); + *ret_conv_23_conv = ret_var.data[x]; + ret_arr_ptr[x] = tag_ptr(ret_conv_23_conv, true); + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomMessageReader_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKCustomMessageReader this_ptr_conv = *(LDKCustomMessageReader*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + CustomMessageReader_free(this_ptr_conv); +} + +static inline uint64_t Type_clone_ptr(LDKType *NONNULL_PTR arg) { + LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType"); + *ret_ret = Type_clone(arg); + return tag_ptr(ret_ret, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Type_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + void* arg_ptr = untag_ptr(arg); + if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); } + LDKType* arg_conv = (LDKType*)arg_ptr; + int64_t ret_conv = Type_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1set_1required_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKBlindedHopFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = BlindedHopFeatures_set_required_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Type_1clone(JNIEnv *env, jclass clz, int64_t orig) { + void* orig_ptr = untag_ptr(orig); + if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); } + LDKType* orig_conv = (LDKType*)orig_ptr; + LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType"); + *ret_ret = Type_clone(orig_conv); + return tag_ptr(ret_ret, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1set_1optional_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKBlindedHopFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = BlindedHopFeatures_set_optional_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Type_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKType this_ptr_conv = *(LDKType*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Type_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1set_1required_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKBlindedHopFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = BlindedHopFeatures_set_required_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferId_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKOfferId this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OfferId_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1set_1optional_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKBlindedHopFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = BlindedHopFeatures_set_optional_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OfferId_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOfferId this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OfferId_get_a(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1empty(JNIEnv *env, jclass clz) { - LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_empty(); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferId_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKOfferId this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + OfferId_set_a(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferId_1new(JNIEnv *env, jclass clz, int8_tArray a_arg) { + LDKThirtyTwoBytes a_arg_ref; + CHECK((*env)->GetArrayLength(env, a_arg) == 32); + (*env)->GetByteArrayRegion(env, a_arg, 0, 32, a_arg_ref.data); + LDKOfferId ret_var = OfferId_new(a_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { - LDKChannelTypeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelTypeFeatures other_conv; - other_conv.inner = untag_ptr(other); - other_conv.is_owned = ptr_is_owned(other); - CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); - other_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); - return ret_conv; +static inline uint64_t OfferId_clone_ptr(LDKOfferId *NONNULL_PTR arg) { + LDKOfferId ret_var = OfferId_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_requires_unknown_bits(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferId_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKOfferId arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = OfferId_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1required_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKChannelTypeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = ChannelTypeFeatures_set_required_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1optional_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKChannelTypeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = ChannelTypeFeatures_set_optional_feature_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1required_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKChannelTypeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = ChannelTypeFeatures_set_required_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferId_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKOfferId orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKOfferId ret_var = OfferId_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1optional_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { - LDKChannelTypeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = ChannelTypeFeatures_set_optional_custom_bit(&this_arg_conv, bit); - return tag_ptr(ret_conv, true); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferId_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKOfferId a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKOfferId b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = OfferId_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InitFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKInitFeatures obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OfferId_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKOfferId obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = InitFeatures_write(&obj_conv); + LDKCVec_u8Z ret_var = OfferId_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferId_1read(JNIEnv *env, jclass clz, int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); - *ret_conv = InitFeatures_read(ser_ref); + LDKCResult_OfferIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferIdDecodeErrorZ), "LDKCResult_OfferIdDecodeErrorZ"); + *ret_conv = OfferId_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelFeatures obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ChannelFeatures_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKOfferWithExplicitMetadataBuilder this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OfferWithExplicitMetadataBuilder_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); - *ret_conv = ChannelFeatures_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +static inline uint64_t OfferWithExplicitMetadataBuilder_clone_ptr(LDKOfferWithExplicitMetadataBuilder *NONNULL_PTR arg) { + LDKOfferWithExplicitMetadataBuilder ret_var = OfferWithExplicitMetadataBuilder_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKNodeFeatures obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = NodeFeatures_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKOfferWithExplicitMetadataBuilder arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = OfferWithExplicitMetadataBuilder_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); - *ret_conv = NodeFeatures_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKOfferWithExplicitMetadataBuilder orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKOfferWithExplicitMetadataBuilder ret_var = OfferWithExplicitMetadataBuilder_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKBolt11InvoiceFeatures obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = Bolt11InvoiceFeatures_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKOfferWithDerivedMetadataBuilder this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OfferWithDerivedMetadataBuilder_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ"); - *ret_conv = Bolt11InvoiceFeatures_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +static inline uint64_t OfferWithDerivedMetadataBuilder_clone_ptr(LDKOfferWithDerivedMetadataBuilder *NONNULL_PTR arg) { + LDKOfferWithDerivedMetadataBuilder ret_var = OfferWithDerivedMetadataBuilder_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKOfferWithDerivedMetadataBuilder arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = OfferWithDerivedMetadataBuilder_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKBolt12InvoiceFeatures obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = Bolt12InvoiceFeatures_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ"); - *ret_conv = Bolt12InvoiceFeatures_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKBlindedHopFeatures obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = BlindedHopFeatures_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ"); - *ret_conv = BlindedHopFeatures_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelTypeFeatures obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ChannelTypeFeatures_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKOfferWithDerivedMetadataBuilder orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKOfferWithDerivedMetadataBuilder ret_var = OfferWithDerivedMetadataBuilder_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); - *ret_conv = ChannelTypeFeatures_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1new(JNIEnv *env, jclass clz, int8_tArray signing_pubkey) { + LDKPublicKey signing_pubkey_ref; + CHECK((*env)->GetArrayLength(env, signing_pubkey) == 33); + (*env)->GetByteArrayRegion(env, signing_pubkey, 0, 33, signing_pubkey_ref.compressed_form); + LDKOfferWithExplicitMetadataBuilder ret_var = OfferWithExplicitMetadataBuilder_new(signing_pubkey_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1data_1loss_1protect_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1metadata(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray metadata) { + LDKOfferWithExplicitMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_data_loss_protect_optional(&this_arg_conv); + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + LDKCVec_u8Z metadata_ref; + metadata_ref.datalen = (*env)->GetArrayLength(env, metadata); + metadata_ref.data = MALLOC(metadata_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, metadata, 0, metadata_ref.datalen, metadata_ref.data); + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = OfferWithExplicitMetadataBuilder_metadata(this_arg_conv, metadata_ref); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1data_1loss_1protect_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1chain(JNIEnv *env, jclass clz, int64_t this_arg, jclass network) { + LDKOfferWithExplicitMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_data_loss_protect_required(&this_arg_conv); + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + LDKNetwork network_conv = LDKNetwork_from_java(env, network); + OfferWithExplicitMetadataBuilder_chain(this_arg_conv, network_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg, int64_t amount_msats) { + LDKOfferWithExplicitMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_data_loss_protect(&this_arg_conv); - return ret_conv; + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + OfferWithExplicitMetadataBuilder_amount_msats(this_arg_conv, amount_msats); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1data_1loss_1protect_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg, int64_t absolute_expiry) { + LDKOfferWithExplicitMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - NodeFeatures_set_data_loss_protect_optional(&this_arg_conv); + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + OfferWithExplicitMetadataBuilder_absolute_expiry(this_arg_conv, absolute_expiry); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1data_1loss_1protect_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1description(JNIEnv *env, jclass clz, int64_t this_arg, jstring description) { + LDKOfferWithExplicitMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - NodeFeatures_set_data_loss_protect_required(&this_arg_conv); + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + LDKStr description_conv = java_to_owned_str(env, description); + OfferWithExplicitMetadataBuilder_description(this_arg_conv, description_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1issuer(JNIEnv *env, jclass clz, int64_t this_arg, jstring issuer) { + LDKOfferWithExplicitMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_data_loss_protect(&this_arg_conv); - return ret_conv; + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + LDKStr issuer_conv = java_to_owned_str(env, issuer); + OfferWithExplicitMetadataBuilder_issuer(this_arg_conv, issuer_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1path(JNIEnv *env, jclass clz, int64_t this_arg, int64_t path) { + LDKOfferWithExplicitMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_data_loss_protect(&this_arg_conv); - return ret_conv; + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + LDKBlindedMessagePath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv = BlindedMessagePath_clone(&path_conv); + OfferWithExplicitMetadataBuilder_path(this_arg_conv, path_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1supported_1quantity(JNIEnv *env, jclass clz, int64_t this_arg, int64_t quantity) { + LDKOfferWithExplicitMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_data_loss_protect(&this_arg_conv); - return ret_conv; + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + void* quantity_ptr = untag_ptr(quantity); + CHECK_ACCESS(quantity_ptr); + LDKQuantity quantity_conv = *(LDKQuantity*)(quantity_ptr); + quantity_conv = Quantity_clone((LDKQuantity*)untag_ptr(quantity)); + OfferWithExplicitMetadataBuilder_supported_quantity(this_arg_conv, quantity_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1initial_1routing_1sync_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1build(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOfferWithExplicitMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_initial_routing_sync_optional(&this_arg_conv); + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + LDKCResult_OfferBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferBolt12SemanticErrorZ), "LDKCResult_OfferBolt12SemanticErrorZ"); + *ret_conv = OfferWithExplicitMetadataBuilder_build(this_arg_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1initial_1routing_1sync_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_initial_routing_sync_required(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1deriving_1signing_1pubkey(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t expanded_key, int64_t nonce) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKExpandedKey expanded_key_conv; + expanded_key_conv.inner = untag_ptr(expanded_key); + expanded_key_conv.is_owned = ptr_is_owned(expanded_key); + CHECK_INNER_FIELD_ACCESS_OR_NULL(expanded_key_conv); + expanded_key_conv.is_owned = false; + LDKNonce nonce_conv; + nonce_conv.inner = untag_ptr(nonce); + nonce_conv.is_owned = ptr_is_owned(nonce); + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_conv); + nonce_conv = Nonce_clone(&nonce_conv); + LDKOfferWithDerivedMetadataBuilder ret_var = OfferWithDerivedMetadataBuilder_deriving_signing_pubkey(node_id_ref, &expanded_key_conv, nonce_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1initial_1routing_1sync(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1chain(JNIEnv *env, jclass clz, int64_t this_arg, jclass network) { + LDKOfferWithDerivedMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_initial_routing_sync(&this_arg_conv); - return ret_conv; + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKNetwork network_conv = LDKNetwork_from_java(env, network); + OfferWithDerivedMetadataBuilder_chain(this_arg_conv, network_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1upfront_1shutdown_1script_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg, int64_t amount_msats) { + LDKOfferWithDerivedMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_upfront_shutdown_script_optional(&this_arg_conv); + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + OfferWithDerivedMetadataBuilder_amount_msats(this_arg_conv, amount_msats); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1upfront_1shutdown_1script_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg, int64_t absolute_expiry) { + LDKOfferWithDerivedMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_upfront_shutdown_script_required(&this_arg_conv); + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + OfferWithDerivedMetadataBuilder_absolute_expiry(this_arg_conv, absolute_expiry); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1description(JNIEnv *env, jclass clz, int64_t this_arg, jstring description) { + LDKOfferWithDerivedMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_upfront_shutdown_script(&this_arg_conv); - return ret_conv; + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKStr description_conv = java_to_owned_str(env, description); + OfferWithDerivedMetadataBuilder_description(this_arg_conv, description_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1upfront_1shutdown_1script_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1issuer(JNIEnv *env, jclass clz, int64_t this_arg, jstring issuer) { + LDKOfferWithDerivedMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - NodeFeatures_set_upfront_shutdown_script_optional(&this_arg_conv); + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKStr issuer_conv = java_to_owned_str(env, issuer); + OfferWithDerivedMetadataBuilder_issuer(this_arg_conv, issuer_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1upfront_1shutdown_1script_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1path(JNIEnv *env, jclass clz, int64_t this_arg, int64_t path) { + LDKOfferWithDerivedMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - NodeFeatures_set_upfront_shutdown_script_required(&this_arg_conv); + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKBlindedMessagePath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv = BlindedMessagePath_clone(&path_conv); + OfferWithDerivedMetadataBuilder_path(this_arg_conv, path_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1supported_1quantity(JNIEnv *env, jclass clz, int64_t this_arg, int64_t quantity) { + LDKOfferWithDerivedMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_upfront_shutdown_script(&this_arg_conv); - return ret_conv; + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + void* quantity_ptr = untag_ptr(quantity); + CHECK_ACCESS(quantity_ptr); + LDKQuantity quantity_conv = *(LDKQuantity*)(quantity_ptr); + quantity_conv = Quantity_clone((LDKQuantity*)untag_ptr(quantity)); + OfferWithDerivedMetadataBuilder_supported_quantity(this_arg_conv, quantity_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1build(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOfferWithDerivedMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_upfront_shutdown_script(&this_arg_conv); - return ret_conv; + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKCResult_OfferBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferBolt12SemanticErrorZ), "LDKCResult_OfferBolt12SemanticErrorZ"); + *ret_conv = OfferWithDerivedMetadataBuilder_build(this_arg_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_upfront_shutdown_script(&this_arg_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Offer_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKOffer this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Offer_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1gossip_1queries_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_gossip_queries_optional(&this_arg_conv); +static inline uint64_t Offer_clone_ptr(LDKOffer *NONNULL_PTR arg) { + LDKOffer ret_var = Offer_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKOffer arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = Offer_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1gossip_1queries_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_gossip_queries_required(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKOffer orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKOffer ret_var = Offer_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_Offer_1chains(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_gossip_queries(&this_arg_conv); - return ret_conv; + LDKCVec_ThirtyTwoBytesZ ret_var = Offer_chains(&this_arg_conv); + jobjectArray ret_arr = NULL; + ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); + ; + for (size_t i = 0; i < ret_var.datalen; i++) { + int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 32, ret_var.data[i].data); + (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); + } + + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1gossip_1queries_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_gossip_queries_optional(&this_arg_conv); + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = Offer_metadata(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1gossip_1queries_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1amount(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_gossip_queries_required(&this_arg_conv); + LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); + *ret_copy = Offer_amount(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1description(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_gossip_queries(&this_arg_conv); - return ret_conv; + LDKPrintableString ret_var = Offer_description(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1offer_1features(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_gossip_queries(&this_arg_conv); - return ret_conv; + LDKOfferFeatures ret_var = Offer_offer_features(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_gossip_queries(&this_arg_conv); - return ret_conv; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = Offer_absolute_expiry(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1variable_1length_1onion_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1issuer(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_variable_length_onion_optional(&this_arg_conv); + LDKPrintableString ret_var = Offer_issuer(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1variable_1length_1onion_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Offer_1paths(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_variable_length_onion_required(&this_arg_conv); + LDKCVec_BlindedMessagePathZ ret_var = Offer_paths(&this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t u = 0; u < ret_var.datalen; u++) { + LDKBlindedMessagePath ret_conv_20_var = ret_var.data[u]; + int64_t ret_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_20_var); + ret_conv_20_ref = tag_ptr(ret_conv_20_var.inner, ret_conv_20_var.is_owned); + ret_arr_ptr[u] = ret_conv_20_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1supported_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_variable_length_onion(&this_arg_conv); - return ret_conv; + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = Offer_supported_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1variable_1length_1onion_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Offer_1signing_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_variable_length_onion_optional(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Offer_signing_pubkey(&this_arg_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1variable_1length_1onion_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_variable_length_onion_required(&this_arg_conv); + LDKOfferId ret_var = Offer_id(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1supports_1chain(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray chain) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_variable_length_onion(&this_arg_conv); + LDKThirtyTwoBytes chain_ref; + CHECK((*env)->GetArrayLength(env, chain) == 32); + (*env)->GetByteArrayRegion(env, chain, 0, 32, chain_ref.data); + jboolean ret_conv = Offer_supports_chain(&this_arg_conv, chain_ref); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1variable_1length_1onion_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1is_1expired(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - Bolt11InvoiceFeatures_set_variable_length_onion_optional(&this_arg_conv); + jboolean ret_conv = Offer_is_expired(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1variable_1length_1onion_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1is_1expired_1no_1std(JNIEnv *env, jclass clz, int64_t this_arg, int64_t duration_since_epoch) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - Bolt11InvoiceFeatures_set_variable_length_onion_required(&this_arg_conv); + jboolean ret_conv = Offer_is_expired_no_std(&this_arg_conv, duration_since_epoch); + return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1supports_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1is_1valid_1quantity(JNIEnv *env, jclass clz, int64_t this_arg, int64_t quantity) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = Bolt11InvoiceFeatures_supports_variable_length_onion(&this_arg_conv); + jboolean ret_conv = Offer_is_valid_quantity(&this_arg_conv, quantity); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1expects_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_variable_length_onion(&this_arg_conv); + jboolean ret_conv = Offer_expects_quantity(&this_arg_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1request_1invoice_1deriving_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg, int64_t expanded_key, int64_t nonce, int8_tArray payment_id) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_variable_length_onion(&this_arg_conv); - return ret_conv; + LDKExpandedKey expanded_key_conv; + expanded_key_conv.inner = untag_ptr(expanded_key); + expanded_key_conv.is_owned = ptr_is_owned(expanded_key); + CHECK_INNER_FIELD_ACCESS_OR_NULL(expanded_key_conv); + expanded_key_conv.is_owned = false; + LDKNonce nonce_conv; + nonce_conv.inner = untag_ptr(nonce); + nonce_conv.is_owned = ptr_is_owned(nonce); + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_conv); + nonce_conv = Nonce_clone(&nonce_conv); + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ"); + *ret_conv = Offer_request_invoice_deriving_payer_id(&this_arg_conv, &expanded_key_conv, nonce_conv, payment_id_ref); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1request_1invoice_1deriving_1metadata(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payer_id, int64_t expanded_key, int64_t nonce, int8_tArray payment_id) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = Bolt11InvoiceFeatures_requires_variable_length_onion(&this_arg_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1static_1remote_1key_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_static_remote_key_optional(&this_arg_conv); + LDKPublicKey payer_id_ref; + CHECK((*env)->GetArrayLength(env, payer_id) == 33); + (*env)->GetByteArrayRegion(env, payer_id, 0, 33, payer_id_ref.compressed_form); + LDKExpandedKey expanded_key_conv; + expanded_key_conv.inner = untag_ptr(expanded_key); + expanded_key_conv.is_owned = ptr_is_owned(expanded_key); + CHECK_INNER_FIELD_ACCESS_OR_NULL(expanded_key_conv); + expanded_key_conv.is_owned = false; + LDKNonce nonce_conv; + nonce_conv.inner = untag_ptr(nonce); + nonce_conv.is_owned = ptr_is_owned(nonce); + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_conv); + nonce_conv = Nonce_clone(&nonce_conv); + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ"); + *ret_conv = Offer_request_invoice_deriving_metadata(&this_arg_conv, payer_id_ref, &expanded_key_conv, nonce_conv, payment_id_ref); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1static_1remote_1key_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1request_1invoice(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray metadata, int8_tArray payer_id) { + LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_static_remote_key_required(&this_arg_conv); + LDKCVec_u8Z metadata_ref; + metadata_ref.datalen = (*env)->GetArrayLength(env, metadata); + metadata_ref.data = MALLOC(metadata_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, metadata, 0, metadata_ref.datalen, metadata_ref.data); + LDKPublicKey payer_id_ref; + CHECK((*env)->GetArrayLength(env, payer_id) == 33); + (*env)->GetByteArrayRegion(env, payer_id, 0, 33, payer_id_ref.compressed_form); + LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ"); + *ret_conv = Offer_request_invoice(&this_arg_conv, metadata_ref, payer_id_ref); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_static_remote_key(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKOffer o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = Offer_hash(&o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1static_1remote_1key_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - NodeFeatures_set_static_remote_key_optional(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_OfferDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferDecodeErrorZ), "LDKCResult_OfferDecodeErrorZ"); + *ret_conv = Offer_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1static_1remote_1key_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - NodeFeatures_set_static_remote_key_required(&this_arg_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Offer_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKOffer obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = Offer_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_static_remote_key(&this_arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Amount_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKAmount this_ptr_conv = *(LDKAmount*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Amount_free(this_ptr_conv); +} + +static inline uint64_t Amount_clone_ptr(LDKAmount *NONNULL_PTR arg) { + LDKAmount *ret_copy = MALLOC(sizeof(LDKAmount), "LDKAmount"); + *ret_copy = Amount_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Amount_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKAmount* arg_conv = (LDKAmount*)untag_ptr(arg); + int64_t ret_conv = Amount_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1static_1remote_1key_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Amount_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKAmount* orig_conv = (LDKAmount*)untag_ptr(orig); + LDKAmount *ret_copy = MALLOC(sizeof(LDKAmount), "LDKAmount"); + *ret_copy = Amount_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Amount_1bitcoin(JNIEnv *env, jclass clz, int64_t amount_msats) { + LDKAmount *ret_copy = MALLOC(sizeof(LDKAmount), "LDKAmount"); + *ret_copy = Amount_bitcoin(amount_msats); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Amount_1currency(JNIEnv *env, jclass clz, int8_tArray iso4217_code, int64_t amount) { + LDKThreeBytes iso4217_code_ref; + CHECK((*env)->GetArrayLength(env, iso4217_code) == 3); + (*env)->GetByteArrayRegion(env, iso4217_code, 0, 3, iso4217_code_ref.data); + LDKAmount *ret_copy = MALLOC(sizeof(LDKAmount), "LDKAmount"); + *ret_copy = Amount_currency(iso4217_code_ref, amount); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Quantity_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKQuantity this_ptr_conv = *(LDKQuantity*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Quantity_free(this_ptr_conv); +} + +static inline uint64_t Quantity_clone_ptr(LDKQuantity *NONNULL_PTR arg) { + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = Quantity_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Quantity_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKQuantity* arg_conv = (LDKQuantity*)untag_ptr(arg); + int64_t ret_conv = Quantity_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Quantity_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKQuantity* orig_conv = (LDKQuantity*)untag_ptr(orig); + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = Quantity_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Quantity_1bounded(JNIEnv *env, jclass clz, int64_t a) { + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = Quantity_bounded(a); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Quantity_1unbounded(JNIEnv *env, jclass clz) { + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = Quantity_unbounded(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Quantity_1one(JNIEnv *env, jclass clz) { + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = Quantity_one(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1from_1str(JNIEnv *env, jclass clz, jstring s) { + LDKStr s_conv = java_to_owned_str(env, s); + LDKCResult_OfferBolt12ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferBolt12ParseErrorZ), "LDKCResult_OfferBolt12ParseErrorZ"); + *ret_conv = Offer_from_str(s_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Offer_1to_1str(JNIEnv *env, jclass clz, int64_t o) { + LDKOffer o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = Offer_to_str(&o_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInvoiceWithExplicitSigningPubkeyBuilder this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InvoiceWithExplicitSigningPubkeyBuilder_free(this_obj_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInvoiceWithDerivedSigningPubkeyBuilder this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InvoiceWithDerivedSigningPubkeyBuilder_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1build(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_static_remote_key_optional(&this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder + + LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ), "LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ"); + *ret_conv = InvoiceWithExplicitSigningPubkeyBuilder_build(this_arg_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1static_1remote_1key_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1relative_1expiry(JNIEnv *env, jclass clz, int64_t this_arg, int32_t relative_expiry_secs) { + LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_static_remote_key_required(&this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder + + InvoiceWithExplicitSigningPubkeyBuilder_relative_expiry(this_arg_conv, relative_expiry_secs); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1fallback_1v0_1p2wsh(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray script_hash) { + LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_supports_static_remote_key(&this_arg_conv); - return ret_conv; + // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder + + uint8_t script_hash_arr[32]; + CHECK((*env)->GetArrayLength(env, script_hash) == 32); + (*env)->GetByteArrayRegion(env, script_hash, 0, 32, script_hash_arr); + uint8_t (*script_hash_ref)[32] = &script_hash_arr; + InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wsh(this_arg_conv, script_hash_ref); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1fallback_1v0_1p2wpkh(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray pubkey_hash) { + LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_static_remote_key(&this_arg_conv); - return ret_conv; + // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder + + uint8_t pubkey_hash_arr[20]; + CHECK((*env)->GetArrayLength(env, pubkey_hash) == 20); + (*env)->GetByteArrayRegion(env, pubkey_hash, 0, 20, pubkey_hash_arr); + uint8_t (*pubkey_hash_ref)[20] = &pubkey_hash_arr; + InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wpkh(this_arg_conv, pubkey_hash_ref); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1fallback_1v1_1p2tr_1tweaked(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray utput_key) { + LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_static_remote_key(&this_arg_conv); - return ret_conv; + // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder + + LDKTweakedPublicKey utput_key_ref; + CHECK((*env)->GetArrayLength(env, utput_key) == 32); + (*env)->GetByteArrayRegion(env, utput_key, 0, 32, utput_key_ref.x_coordinate); + InvoiceWithExplicitSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(this_arg_conv, utput_key_ref); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1allow_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_requires_static_remote_key(&this_arg_conv); - return ret_conv; + // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder + + InvoiceWithExplicitSigningPubkeyBuilder_allow_mpp(this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1payment_1secret_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1build_1and_1sign(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_payment_secret_optional(&this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder + + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ), "LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ"); + *ret_conv = InvoiceWithDerivedSigningPubkeyBuilder_build_and_sign(this_arg_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1payment_1secret_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1relative_1expiry(JNIEnv *env, jclass clz, int64_t this_arg, int32_t relative_expiry_secs) { + LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_payment_secret_required(&this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder + + InvoiceWithDerivedSigningPubkeyBuilder_relative_expiry(this_arg_conv, relative_expiry_secs); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1fallback_1v0_1p2wsh(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray script_hash) { + LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_payment_secret(&this_arg_conv); - return ret_conv; + // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder + + uint8_t script_hash_arr[32]; + CHECK((*env)->GetArrayLength(env, script_hash) == 32); + (*env)->GetByteArrayRegion(env, script_hash, 0, 32, script_hash_arr); + uint8_t (*script_hash_ref)[32] = &script_hash_arr; + InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wsh(this_arg_conv, script_hash_ref); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1payment_1secret_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1fallback_1v0_1p2wpkh(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray pubkey_hash) { + LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - NodeFeatures_set_payment_secret_optional(&this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder + + uint8_t pubkey_hash_arr[20]; + CHECK((*env)->GetArrayLength(env, pubkey_hash) == 20); + (*env)->GetByteArrayRegion(env, pubkey_hash, 0, 20, pubkey_hash_arr); + uint8_t (*pubkey_hash_ref)[20] = &pubkey_hash_arr; + InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wpkh(this_arg_conv, pubkey_hash_ref); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1payment_1secret_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1fallback_1v1_1p2tr_1tweaked(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray utput_key) { + LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - NodeFeatures_set_payment_secret_required(&this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder + + LDKTweakedPublicKey utput_key_ref; + CHECK((*env)->GetArrayLength(env, utput_key) == 32); + (*env)->GetByteArrayRegion(env, utput_key, 0, 32, utput_key_ref.x_coordinate); + InvoiceWithDerivedSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(this_arg_conv, utput_key_ref); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1allow_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_payment_secret(&this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder + + InvoiceWithDerivedSigningPubkeyBuilder_allow_mpp(this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUnsignedBolt12Invoice this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + UnsignedBolt12Invoice_free(this_obj_conv); +} + +static inline uint64_t UnsignedBolt12Invoice_clone_ptr(LDKUnsignedBolt12Invoice *NONNULL_PTR arg) { + LDKUnsignedBolt12Invoice ret_var = UnsignedBolt12Invoice_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUnsignedBolt12Invoice arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = UnsignedBolt12Invoice_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1payment_1secret_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - Bolt11InvoiceFeatures_set_payment_secret_optional(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKUnsignedBolt12Invoice orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKUnsignedBolt12Invoice ret_var = UnsignedBolt12Invoice_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1payment_1secret_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - Bolt11InvoiceFeatures_set_payment_secret_required(&this_arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignBolt12InvoiceFn_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKSignBolt12InvoiceFn this_ptr_conv = *(LDKSignBolt12InvoiceFn*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + SignBolt12InvoiceFn_free(this_ptr_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1supports_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1tagged_1hash(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = Bolt11InvoiceFeatures_supports_payment_secret(&this_arg_conv); + LDKTaggedHash ret_var = UnsignedBolt12Invoice_tagged_hash(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBolt12Invoice this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Bolt12Invoice_free(this_obj_conv); +} + +static inline uint64_t Bolt12Invoice_clone_ptr(LDKBolt12Invoice *NONNULL_PTR arg) { + LDKBolt12Invoice ret_var = Bolt12Invoice_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBolt12Invoice arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = Bolt12Invoice_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBolt12Invoice orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKBolt12Invoice ret_var = Bolt12Invoice_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1created_1at(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_payment_secret(&this_arg_conv); + int64_t ret_conv = UnsignedBolt12Invoice_created_at(&this_arg_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1relative_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_payment_secret(&this_arg_conv); + int64_t ret_conv = UnsignedBolt12Invoice_relative_expiry(&this_arg_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1is_1expired(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = Bolt11InvoiceFeatures_requires_payment_secret(&this_arg_conv); + jboolean ret_conv = UnsignedBolt12Invoice_is_expired(&this_arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1basic_1mpp_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1fallbacks(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_basic_mpp_optional(&this_arg_conv); + LDKCVec_StrZ ret_var = UnsignedBolt12Invoice_fallbacks(&this_arg_conv); + jobjectArray ret_arr = NULL; + ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, String_clz, NULL); + ; + jstring *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t i = 0; i < ret_var.datalen; i++) { + LDKStr ret_conv_8_str = ret_var.data[i]; + jstring ret_conv_8_conv = str_ref_to_java(env, ret_conv_8_str.chars, ret_conv_8_str.len); + Str_free(ret_conv_8_str); + ret_arr_ptr[i] = ret_conv_8_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1basic_1mpp_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1invoice_1features(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_basic_mpp_required(&this_arg_conv); + LDKBolt12InvoiceFeatures ret_var = UnsignedBolt12Invoice_invoice_features(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1signing_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_basic_mpp(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedBolt12Invoice_signing_pubkey(&this_arg_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1basic_1mpp_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1offer_1chains(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_basic_mpp_optional(&this_arg_conv); + LDKCOption_CVec_ThirtyTwoBytesZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_ThirtyTwoBytesZZ), "LDKCOption_CVec_ThirtyTwoBytesZZ"); + *ret_copy = UnsignedBolt12Invoice_offer_chains(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1basic_1mpp_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1chain(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_basic_mpp_required(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, UnsignedBolt12Invoice_chain(&this_arg_conv).data); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_basic_mpp(&this_arg_conv); - return ret_conv; + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = UnsignedBolt12Invoice_metadata(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1basic_1mpp_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1amount(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - Bolt11InvoiceFeatures_set_basic_mpp_optional(&this_arg_conv); + LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); + *ret_copy = UnsignedBolt12Invoice_amount(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1basic_1mpp_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1offer_1features(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - Bolt11InvoiceFeatures_set_basic_mpp_required(&this_arg_conv); + LDKOfferFeatures ret_var = UnsignedBolt12Invoice_offer_features(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1supports_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1description(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = Bolt11InvoiceFeatures_supports_basic_mpp(&this_arg_conv); - return ret_conv; + LDKPrintableString ret_var = UnsignedBolt12Invoice_description(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1basic_1mpp_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12InvoiceFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - Bolt12InvoiceFeatures_set_basic_mpp_optional(&this_arg_conv); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = UnsignedBolt12Invoice_absolute_expiry(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1basic_1mpp_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12InvoiceFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1issuer(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - Bolt12InvoiceFeatures_set_basic_mpp_required(&this_arg_conv); + LDKPrintableString ret_var = UnsignedBolt12Invoice_issuer(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1supports_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12InvoiceFeatures this_arg_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1message_1paths(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = Bolt12InvoiceFeatures_supports_basic_mpp(&this_arg_conv); - return ret_conv; + LDKCVec_BlindedMessagePathZ ret_var = UnsignedBolt12Invoice_message_paths(&this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t u = 0; u < ret_var.datalen; u++) { + LDKBlindedMessagePath ret_conv_20_var = ret_var.data[u]; + int64_t ret_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_20_var); + ret_conv_20_ref = tag_ptr(ret_conv_20_var.inner, ret_conv_20_var.is_owned); + ret_arr_ptr[u] = ret_conv_20_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1supported_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_basic_mpp(&this_arg_conv); - return ret_conv; + LDKCOption_QuantityZ *ret_copy = MALLOC(sizeof(LDKCOption_QuantityZ), "LDKCOption_QuantityZ"); + *ret_copy = UnsignedBolt12Invoice_supported_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1payer_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_basic_mpp(&this_arg_conv); - return ret_conv; + LDKu8slice ret_var = UnsignedBolt12Invoice_payer_metadata(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1invoice_1request_1features(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = Bolt11InvoiceFeatures_requires_basic_mpp(&this_arg_conv); - return ret_conv; + LDKInvoiceRequestFeatures ret_var = UnsignedBolt12Invoice_invoice_request_features(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1requires_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12InvoiceFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = Bolt12InvoiceFeatures_requires_basic_mpp(&this_arg_conv); - return ret_conv; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = UnsignedBolt12Invoice_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1wumbo_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_wumbo_optional(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedBolt12Invoice_payer_id(&this_arg_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1wumbo_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_wumbo_required(&this_arg_conv); + LDKPrintableString ret_var = UnsignedBolt12Invoice_payer_note(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_wumbo(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, UnsignedBolt12Invoice_payment_hash(&this_arg_conv).data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1wumbo_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_wumbo_optional(&this_arg_conv); + int64_t ret_conv = UnsignedBolt12Invoice_amount_msats(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1wumbo_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1created_1at(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_wumbo_required(&this_arg_conv); + int64_t ret_conv = Bolt12Invoice_created_at(&this_arg_conv); + return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1relative_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_wumbo(&this_arg_conv); + int64_t ret_conv = Bolt12Invoice_relative_expiry(&this_arg_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1is_1expired(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_wumbo(&this_arg_conv); + jboolean ret_conv = Bolt12Invoice_is_expired(&this_arg_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1fallbacks(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_wumbo(&this_arg_conv); - return ret_conv; + LDKCVec_StrZ ret_var = Bolt12Invoice_fallbacks(&this_arg_conv); + jobjectArray ret_arr = NULL; + ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, String_clz, NULL); + ; + jstring *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t i = 0; i < ret_var.datalen; i++) { + LDKStr ret_conv_8_str = ret_var.data[i]; + jstring ret_conv_8_conv = str_ref_to_java(env, ret_conv_8_str.chars, ret_conv_8_str.len); + Str_free(ret_conv_8_str); + ret_arr_ptr[i] = ret_conv_8_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1anchors_1nonzero_1fee_1htlc_1tx_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1invoice_1features(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(&this_arg_conv); + LDKBolt12InvoiceFeatures ret_var = Bolt12Invoice_invoice_features(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1anchors_1nonzero_1fee_1htlc_1tx_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1signing_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Bolt12Invoice_signing_pubkey(&this_arg_conv).compressed_form); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1anchors_1nonzero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1offer_1chains(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_anchors_nonzero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + LDKCOption_CVec_ThirtyTwoBytesZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_ThirtyTwoBytesZZ), "LDKCOption_CVec_ThirtyTwoBytesZZ"); + *ret_copy = Bolt12Invoice_offer_chains(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1anchors_1nonzero_1fee_1htlc_1tx_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1chain(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, Bolt12Invoice_chain(&this_arg_conv).data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1anchors_1nonzero_1fee_1htlc_1tx_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(&this_arg_conv); + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = Bolt12Invoice_metadata(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1anchors_1nonzero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1amount(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); + *ret_copy = Bolt12Invoice_amount(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1anchors_1nonzero_1fee_1htlc_1tx_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1offer_1features(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(&this_arg_conv); + LDKOfferFeatures ret_var = Bolt12Invoice_offer_features(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1anchors_1nonzero_1fee_1htlc_1tx_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1description(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(&this_arg_conv); + LDKPrintableString ret_var = Bolt12Invoice_description(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1anchors_1nonzero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = Bolt12Invoice_absolute_expiry(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1anchors_1nonzero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1issuer(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_anchors_nonzero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + LDKPrintableString ret_var = Bolt12Invoice_issuer(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1anchors_1nonzero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1message_1paths(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + LDKCVec_BlindedMessagePathZ ret_var = Bolt12Invoice_message_paths(&this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t u = 0; u < ret_var.datalen; u++) { + LDKBlindedMessagePath ret_conv_20_var = ret_var.data[u]; + int64_t ret_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_20_var); + ret_conv_20_ref = tag_ptr(ret_conv_20_var.inner, ret_conv_20_var.is_owned); + ret_arr_ptr[u] = ret_conv_20_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1anchors_1nonzero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1supported_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + LDKCOption_QuantityZ *ret_copy = MALLOC(sizeof(LDKCOption_QuantityZ), "LDKCOption_QuantityZ"); + *ret_copy = Bolt12Invoice_supported_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1payer_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_anchors_zero_fee_htlc_tx_optional(&this_arg_conv); + LDKu8slice ret_var = Bolt12Invoice_payer_metadata(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1invoice_1request_1features(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_anchors_zero_fee_htlc_tx_required(&this_arg_conv); + LDKInvoiceRequestFeatures ret_var = Bolt12Invoice_invoice_request_features(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_anchors_zero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = Bolt12Invoice_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Bolt12Invoice_payer_id(&this_arg_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_anchors_zero_fee_htlc_tx_required(&this_arg_conv); + LDKPrintableString ret_var = Bolt12Invoice_payer_note(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_anchors_zero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, Bolt12Invoice_payment_hash(&this_arg_conv).data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(&this_arg_conv); + int64_t ret_conv = Bolt12Invoice_amount_msats(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1signature(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, Bolt12Invoice_signature(&this_arg_conv).compact_form); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1signable_1hash(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, Bolt12Invoice_signable_hash(&this_arg_conv).data); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1verify_1using_1metadata(JNIEnv *env, jclass clz, int64_t this_arg, int64_t key) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_anchors_zero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + LDKExpandedKey key_conv; + key_conv.inner = untag_ptr(key); + key_conv.is_owned = ptr_is_owned(key); + CHECK_INNER_FIELD_ACCESS_OR_NULL(key_conv); + key_conv.is_owned = false; + LDKCResult_ThirtyTwoBytesNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesNoneZ), "LDKCResult_ThirtyTwoBytesNoneZ"); + *ret_conv = Bolt12Invoice_verify_using_metadata(&this_arg_conv, &key_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1verify_1using_1payer_1data(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_id, int64_t nonce, int64_t key) { + LDKBolt12Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_anchors_zero_fee_htlc_tx(&this_arg_conv); - return ret_conv; + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + LDKNonce nonce_conv; + nonce_conv.inner = untag_ptr(nonce); + nonce_conv.is_owned = ptr_is_owned(nonce); + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_conv); + nonce_conv = Nonce_clone(&nonce_conv); + LDKExpandedKey key_conv; + key_conv.inner = untag_ptr(key); + key_conv.is_owned = ptr_is_owned(key); + CHECK_INNER_FIELD_ACCESS_OR_NULL(key_conv); + key_conv.is_owned = false; + LDKCResult_ThirtyTwoBytesNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesNoneZ), "LDKCResult_ThirtyTwoBytesNoneZ"); + *ret_conv = Bolt12Invoice_verify_using_payer_data(&this_arg_conv, payment_id_ref, nonce_conv, &key_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKBolt12Invoice o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = Bolt12Invoice_hash(&o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1route_1blinding_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_route_blinding_optional(&this_arg_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKUnsignedBolt12Invoice obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = UnsignedBolt12Invoice_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1route_1blinding_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_route_blinding_required(&this_arg_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKBolt12Invoice obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = Bolt12Invoice_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1route_1blinding(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_route_blinding(&this_arg_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_Bolt12InvoiceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceDecodeErrorZ), "LDKCResult_Bolt12InvoiceDecodeErrorZ"); + *ret_conv = Bolt12Invoice_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1route_1blinding_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - NodeFeatures_set_route_blinding_optional(&this_arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceError_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInvoiceError this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InvoiceError_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1route_1blinding_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - NodeFeatures_set_route_blinding_required(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceError_1get_1erroneous_1field(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInvoiceError this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKErroneousField ret_var = InvoiceError_get_erroneous_field(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1route_1blinding(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_route_blinding(&this_arg_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceError_1set_1erroneous_1field(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKInvoiceError this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKErroneousField val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ErroneousField_clone(&val_conv); + InvoiceError_set_erroneous_field(&this_ptr_conv, val_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1route_1blinding(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_route_blinding(&this_arg_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceError_1get_1message(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInvoiceError this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKUntrustedString ret_var = InvoiceError_get_message(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1route_1blinding(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_route_blinding(&this_arg_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceError_1set_1message(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKInvoiceError this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKUntrustedString val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = UntrustedString_clone(&val_conv); + InvoiceError_set_message(&this_ptr_conv, val_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1shutdown_1any_1segwit_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_shutdown_any_segwit_optional(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceError_1new(JNIEnv *env, jclass clz, int64_t erroneous_field_arg, int64_t message_arg) { + LDKErroneousField erroneous_field_arg_conv; + erroneous_field_arg_conv.inner = untag_ptr(erroneous_field_arg); + erroneous_field_arg_conv.is_owned = ptr_is_owned(erroneous_field_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(erroneous_field_arg_conv); + erroneous_field_arg_conv = ErroneousField_clone(&erroneous_field_arg_conv); + LDKUntrustedString message_arg_conv; + message_arg_conv.inner = untag_ptr(message_arg); + message_arg_conv.is_owned = ptr_is_owned(message_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_arg_conv); + message_arg_conv = UntrustedString_clone(&message_arg_conv); + LDKInvoiceError ret_var = InvoiceError_new(erroneous_field_arg_conv, message_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1shutdown_1any_1segwit_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_shutdown_any_segwit_required(&this_arg_conv); +static inline uint64_t InvoiceError_clone_ptr(LDKInvoiceError *NONNULL_PTR arg) { + LDKInvoiceError ret_var = InvoiceError_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_shutdown_anysegwit(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInvoiceError arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = InvoiceError_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1shutdown_1any_1segwit_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - NodeFeatures_set_shutdown_any_segwit_optional(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceError_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKInvoiceError orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKInvoiceError ret_var = InvoiceError_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1shutdown_1any_1segwit_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - NodeFeatures_set_shutdown_any_segwit_required(&this_arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErroneousField_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKErroneousField this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ErroneousField_free(this_obj_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_shutdown_anysegwit(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroneousField_1get_1tlv_1fieldnum(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKErroneousField this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ErroneousField_get_tlv_fieldnum(&this_ptr_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_shutdown_anysegwit(&this_arg_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErroneousField_1set_1tlv_1fieldnum(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKErroneousField this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ErroneousField_set_tlv_fieldnum(&this_ptr_conv, val); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_shutdown_anysegwit(&this_arg_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroneousField_1get_1suggested_1value(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKErroneousField this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = ErroneousField_get_suggested_value(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1taproot_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_taproot_optional(&this_arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErroneousField_1set_1suggested_1value(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKErroneousField this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_CVec_u8ZZ val_conv = *(LDKCOption_CVec_u8ZZ*)(val_ptr); + val_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(val)); + ErroneousField_set_suggested_value(&this_ptr_conv, val_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1taproot_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_taproot_required(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroneousField_1new(JNIEnv *env, jclass clz, int64_t tlv_fieldnum_arg, int64_t suggested_value_arg) { + void* suggested_value_arg_ptr = untag_ptr(suggested_value_arg); + CHECK_ACCESS(suggested_value_arg_ptr); + LDKCOption_CVec_u8ZZ suggested_value_arg_conv = *(LDKCOption_CVec_u8ZZ*)(suggested_value_arg_ptr); + suggested_value_arg_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(suggested_value_arg)); + LDKErroneousField ret_var = ErroneousField_new(tlv_fieldnum_arg, suggested_value_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1taproot(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_taproot(&this_arg_conv); +static inline uint64_t ErroneousField_clone_ptr(LDKErroneousField *NONNULL_PTR arg) { + LDKErroneousField ret_var = ErroneousField_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroneousField_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKErroneousField arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = ErroneousField_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1taproot_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - NodeFeatures_set_taproot_optional(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroneousField_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKErroneousField orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKErroneousField ret_var = ErroneousField_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1taproot_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - NodeFeatures_set_taproot_required(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceError_1from_1string(JNIEnv *env, jclass clz, jstring s) { + LDKStr s_conv = java_to_owned_str(env, s); + LDKInvoiceError ret_var = InvoiceError_from_string(s_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1taproot(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_taproot(&this_arg_conv); +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_InvoiceError_1to_1str(JNIEnv *env, jclass clz, int64_t o) { + LDKInvoiceError o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = InvoiceError_to_str(&o_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1taproot_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_taproot_optional(&this_arg_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceError_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKInvoiceError obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = InvoiceError_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1taproot_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_taproot_required(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceError_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); + *ret_conv = InvoiceError_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1taproot(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_supports_taproot(&this_arg_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInvoiceRequestWithExplicitPayerIdBuilder this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InvoiceRequestWithExplicitPayerIdBuilder_free(this_obj_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1taproot(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_taproot(&this_arg_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInvoiceRequestWithDerivedPayerIdBuilder this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InvoiceRequestWithDerivedPayerIdBuilder_free(this_obj_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1taproot(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1build(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_taproot(&this_arg_conv); - return ret_conv; + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithExplicitPayerIdBuilder + + LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ), "LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequestWithExplicitPayerIdBuilder_build(this_arg_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1taproot(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1chain(JNIEnv *env, jclass clz, int64_t this_arg, jclass network) { + LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_requires_taproot(&this_arg_conv); - return ret_conv; + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithExplicitPayerIdBuilder + + LDKNetwork network_conv = LDKNetwork_from_java(env, network); + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequestWithExplicitPayerIdBuilder_chain(this_arg_conv, network_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1onion_1messages_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg, int64_t amount_msats) { + LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_onion_messages_optional(&this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithExplicitPayerIdBuilder + + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequestWithExplicitPayerIdBuilder_amount_msats(this_arg_conv, amount_msats); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1onion_1messages_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1quantity(JNIEnv *env, jclass clz, int64_t this_arg, int64_t quantity) { + LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_onion_messages_required(&this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithExplicitPayerIdBuilder + + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequestWithExplicitPayerIdBuilder_quantity(this_arg_conv, quantity); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1onion_1messages(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg, jstring payer_note) { + LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_onion_messages(&this_arg_conv); - return ret_conv; + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithExplicitPayerIdBuilder + + LDKStr payer_note_conv = java_to_owned_str(env, payer_note); + InvoiceRequestWithExplicitPayerIdBuilder_payer_note(this_arg_conv, payer_note_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1onion_1messages_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1build_1and_1sign(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - NodeFeatures_set_onion_messages_optional(&this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerIdBuilder + + LDKCResult_InvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequestWithDerivedPayerIdBuilder_build_and_sign(this_arg_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1onion_1messages_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1chain(JNIEnv *env, jclass clz, int64_t this_arg, jclass network) { + LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - NodeFeatures_set_onion_messages_required(&this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerIdBuilder + + LDKNetwork network_conv = LDKNetwork_from_java(env, network); + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequestWithDerivedPayerIdBuilder_chain(this_arg_conv, network_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1onion_1messages(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg, int64_t amount_msats) { + LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_onion_messages(&this_arg_conv); - return ret_conv; + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerIdBuilder + + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequestWithDerivedPayerIdBuilder_amount_msats(this_arg_conv, amount_msats); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1onion_1messages(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1quantity(JNIEnv *env, jclass clz, int64_t this_arg, int64_t quantity) { + LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_onion_messages(&this_arg_conv); - return ret_conv; + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerIdBuilder + + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequestWithDerivedPayerIdBuilder_quantity(this_arg_conv, quantity); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1onion_1messages(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg, jstring payer_note) { + LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_onion_messages(&this_arg_conv); - return ret_conv; + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerIdBuilder + + LDKStr payer_note_conv = java_to_owned_str(env, payer_note); + InvoiceRequestWithDerivedPayerIdBuilder_payer_note(this_arg_conv, payer_note_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1channel_1type_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_channel_type_optional(&this_arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUnsignedInvoiceRequest this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + UnsignedInvoiceRequest_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1channel_1type_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - InitFeatures_set_channel_type_required(&this_arg_conv); +static inline uint64_t UnsignedInvoiceRequest_clone_ptr(LDKUnsignedInvoiceRequest *NONNULL_PTR arg) { + LDKUnsignedInvoiceRequest ret_var = UnsignedInvoiceRequest_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_channel_type(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUnsignedInvoiceRequest arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = UnsignedInvoiceRequest_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1channel_1type_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKUnsignedInvoiceRequest orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKUnsignedInvoiceRequest ret_var = UnsignedInvoiceRequest_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignInvoiceRequestFn_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKSignInvoiceRequestFn this_ptr_conv = *(LDKSignInvoiceRequestFn*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + SignInvoiceRequestFn_free(this_ptr_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1tagged_1hash(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_channel_type_optional(&this_arg_conv); + LDKTaggedHash ret_var = UnsignedInvoiceRequest_tagged_hash(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1channel_1type_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInvoiceRequest this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InvoiceRequest_free(this_obj_conv); +} + +static inline uint64_t InvoiceRequest_clone_ptr(LDKInvoiceRequest *NONNULL_PTR arg) { + LDKInvoiceRequest ret_var = InvoiceRequest_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInvoiceRequest arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = InvoiceRequest_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKInvoiceRequest orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKInvoiceRequest ret_var = InvoiceRequest_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKVerifiedInvoiceRequest this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + VerifiedInvoiceRequest_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1get_1offer_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKVerifiedInvoiceRequest this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKOfferId ret_var = VerifiedInvoiceRequest_get_offer_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1set_1offer_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKVerifiedInvoiceRequest this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKOfferId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = OfferId_clone(&val_conv); + VerifiedInvoiceRequest_set_offer_id(&this_ptr_conv, val_conv); +} + +static inline uint64_t VerifiedInvoiceRequest_clone_ptr(LDKVerifiedInvoiceRequest *NONNULL_PTR arg) { + LDKVerifiedInvoiceRequest ret_var = VerifiedInvoiceRequest_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKVerifiedInvoiceRequest arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = VerifiedInvoiceRequest_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKVerifiedInvoiceRequest orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKVerifiedInvoiceRequest ret_var = VerifiedInvoiceRequest_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1chains(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_channel_type_required(&this_arg_conv); + LDKCVec_ThirtyTwoBytesZ ret_var = UnsignedInvoiceRequest_chains(&this_arg_conv); + jobjectArray ret_arr = NULL; + ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); + ; + for (size_t i = 0; i < ret_var.datalen; i++) { + int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 32, ret_var.data[i].data); + (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); + } + + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_channel_type(&this_arg_conv); - return ret_conv; + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = UnsignedInvoiceRequest_metadata(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1amount(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_channel_type(&this_arg_conv); - return ret_conv; + LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); + *ret_copy = UnsignedInvoiceRequest_amount(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1description(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_channel_type(&this_arg_conv); - return ret_conv; + LDKPrintableString ret_var = UnsignedInvoiceRequest_description(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1scid_1privacy_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1offer_1features(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_scid_privacy_optional(&this_arg_conv); + LDKOfferFeatures ret_var = UnsignedInvoiceRequest_offer_features(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1scid_1privacy_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_scid_privacy_required(&this_arg_conv); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = UnsignedInvoiceRequest_absolute_expiry(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1issuer(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_scid_privacy(&this_arg_conv); - return ret_conv; + LDKPrintableString ret_var = UnsignedInvoiceRequest_issuer(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1scid_1privacy_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1paths(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_scid_privacy_optional(&this_arg_conv); + LDKCVec_BlindedMessagePathZ ret_var = UnsignedInvoiceRequest_paths(&this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t u = 0; u < ret_var.datalen; u++) { + LDKBlindedMessagePath ret_conv_20_var = ret_var.data[u]; + int64_t ret_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_20_var); + ret_conv_20_ref = tag_ptr(ret_conv_20_var.inner, ret_conv_20_var.is_owned); + ret_arr_ptr[u] = ret_conv_20_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1scid_1privacy_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1supported_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_scid_privacy_required(&this_arg_conv); + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = UnsignedInvoiceRequest_supported_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1signing_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_scid_privacy(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedInvoiceRequest_signing_pubkey(&this_arg_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1scid_1privacy_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1payer_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_scid_privacy_optional(&this_arg_conv); + LDKu8slice ret_var = UnsignedInvoiceRequest_payer_metadata(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1scid_1privacy_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1chain(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_scid_privacy_required(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, UnsignedInvoiceRequest_chain(&this_arg_conv).data); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_supports_scid_privacy(&this_arg_conv); - return ret_conv; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = UnsignedInvoiceRequest_amount_msats(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1invoice_1request_1features(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_scid_privacy(&this_arg_conv); - return ret_conv; + LDKInvoiceRequestFeatures ret_var = UnsignedInvoiceRequest_invoice_request_features(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_scid_privacy(&this_arg_conv); - return ret_conv; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = UnsignedInvoiceRequest_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_requires_scid_privacy(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedInvoiceRequest_payer_id(&this_arg_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1payment_1metadata_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - Bolt11InvoiceFeatures_set_payment_metadata_optional(&this_arg_conv); + LDKPrintableString ret_var = UnsignedInvoiceRequest_payer_note(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1payment_1metadata_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1chains(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - Bolt11InvoiceFeatures_set_payment_metadata_required(&this_arg_conv); + LDKCVec_ThirtyTwoBytesZ ret_var = InvoiceRequest_chains(&this_arg_conv); + jobjectArray ret_arr = NULL; + ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); + ; + for (size_t i = 0; i < ret_var.datalen; i++) { + int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 32, ret_var.data[i].data); + (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); + } + + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1supports_1payment_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = Bolt11InvoiceFeatures_supports_payment_metadata(&this_arg_conv); - return ret_conv; + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = InvoiceRequest_metadata(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1payment_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1amount(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = Bolt11InvoiceFeatures_requires_payment_metadata(&this_arg_conv); - return ret_conv; + LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); + *ret_copy = InvoiceRequest_amount(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1zero_1conf_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1description(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_zero_conf_optional(&this_arg_conv); + LDKPrintableString ret_var = InvoiceRequest_description(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1zero_1conf_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1offer_1features(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_zero_conf_required(&this_arg_conv); + LDKOfferFeatures ret_var = InvoiceRequest_offer_features(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_zero_conf(&this_arg_conv); - return ret_conv; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = InvoiceRequest_absolute_expiry(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1zero_1conf_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1issuer(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_zero_conf_optional(&this_arg_conv); + LDKPrintableString ret_var = InvoiceRequest_issuer(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1zero_1conf_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1paths(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_zero_conf_required(&this_arg_conv); + LDKCVec_BlindedMessagePathZ ret_var = InvoiceRequest_paths(&this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t u = 0; u < ret_var.datalen; u++) { + LDKBlindedMessagePath ret_conv_20_var = ret_var.data[u]; + int64_t ret_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_20_var); + ret_conv_20_ref = tag_ptr(ret_conv_20_var.inner, ret_conv_20_var.is_owned); + ret_arr_ptr[u] = ret_conv_20_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1supported_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_zero_conf(&this_arg_conv); - return ret_conv; + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = InvoiceRequest_supported_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1zero_1conf_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1signing_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_zero_conf_optional(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, InvoiceRequest_signing_pubkey(&this_arg_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1zero_1conf_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1payer_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelTypeFeatures_set_zero_conf_required(&this_arg_conv); + LDKu8slice ret_var = InvoiceRequest_payer_metadata(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1chain(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_supports_zero_conf(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, InvoiceRequest_chain(&this_arg_conv).data); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_zero_conf(&this_arg_conv); - return ret_conv; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = InvoiceRequest_amount_msats(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1invoice_1request_1features(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_zero_conf(&this_arg_conv); - return ret_conv; + LDKInvoiceRequestFeatures ret_var = InvoiceRequest_invoice_request_features(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelTypeFeatures_requires_zero_conf(&this_arg_conv); - return ret_conv; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = InvoiceRequest_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1keysend_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_keysend_optional(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, InvoiceRequest_payer_id(&this_arg_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1keysend_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_keysend_required(&this_arg_conv); + LDKPrintableString ret_var = InvoiceRequest_payer_note(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1keysend(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1respond_1with(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_keysend(&this_arg_conv); - return ret_conv; + LDKCVec_BlindedPaymentPathZ payment_paths_constr; + payment_paths_constr.datalen = (*env)->GetArrayLength(env, payment_paths); + if (payment_paths_constr.datalen > 0) + payment_paths_constr.data = MALLOC(payment_paths_constr.datalen * sizeof(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); + else + payment_paths_constr.data = NULL; + int64_t* payment_paths_vals = (*env)->GetLongArrayElements (env, payment_paths, NULL); + for (size_t u = 0; u < payment_paths_constr.datalen; u++) { + int64_t payment_paths_conv_20 = payment_paths_vals[u]; + LDKBlindedPaymentPath payment_paths_conv_20_conv; + payment_paths_conv_20_conv.inner = untag_ptr(payment_paths_conv_20); + payment_paths_conv_20_conv.is_owned = ptr_is_owned(payment_paths_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_paths_conv_20_conv); + payment_paths_conv_20_conv = BlindedPaymentPath_clone(&payment_paths_conv_20_conv); + payment_paths_constr.data[u] = payment_paths_conv_20_conv; + } + (*env)->ReleaseLongArrayElements(env, payment_paths, payment_paths_vals, 0); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequest_respond_with(&this_arg_conv, payment_paths_constr, payment_hash_ref); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1keysend(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1respond_1with_1no_1std(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash, int64_t created_at) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_keysend(&this_arg_conv); - return ret_conv; + LDKCVec_BlindedPaymentPathZ payment_paths_constr; + payment_paths_constr.datalen = (*env)->GetArrayLength(env, payment_paths); + if (payment_paths_constr.datalen > 0) + payment_paths_constr.data = MALLOC(payment_paths_constr.datalen * sizeof(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); + else + payment_paths_constr.data = NULL; + int64_t* payment_paths_vals = (*env)->GetLongArrayElements (env, payment_paths, NULL); + for (size_t u = 0; u < payment_paths_constr.datalen; u++) { + int64_t payment_paths_conv_20 = payment_paths_vals[u]; + LDKBlindedPaymentPath payment_paths_conv_20_conv; + payment_paths_conv_20_conv.inner = untag_ptr(payment_paths_conv_20); + payment_paths_conv_20_conv.is_owned = ptr_is_owned(payment_paths_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_paths_conv_20_conv); + payment_paths_conv_20_conv = BlindedPaymentPath_clone(&payment_paths_conv_20_conv); + payment_paths_constr.data[u] = payment_paths_conv_20_conv; + } + (*env)->ReleaseLongArrayElements(env, payment_paths, payment_paths_vals, 0); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequest_respond_with_no_std(&this_arg_conv, payment_paths_constr, payment_hash_ref, created_at); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1trampoline_1routing_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1verify_1using_1metadata(JNIEnv *env, jclass clz, int64_t this_arg, int64_t key) { + LDKInvoiceRequest this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = InvoiceRequest_clone(&this_arg_conv); + LDKExpandedKey key_conv; + key_conv.inner = untag_ptr(key); + key_conv.is_owned = ptr_is_owned(key); + CHECK_INNER_FIELD_ACCESS_OR_NULL(key_conv); + key_conv.is_owned = false; + LDKCResult_VerifiedInvoiceRequestNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_VerifiedInvoiceRequestNoneZ), "LDKCResult_VerifiedInvoiceRequestNoneZ"); + *ret_conv = InvoiceRequest_verify_using_metadata(this_arg_conv, &key_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1verify_1using_1recipient_1data(JNIEnv *env, jclass clz, int64_t this_arg, int64_t nonce, int64_t key) { + LDKInvoiceRequest this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = InvoiceRequest_clone(&this_arg_conv); + LDKNonce nonce_conv; + nonce_conv.inner = untag_ptr(nonce); + nonce_conv.is_owned = ptr_is_owned(nonce); + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_conv); + nonce_conv = Nonce_clone(&nonce_conv); + LDKExpandedKey key_conv; + key_conv.inner = untag_ptr(key); + key_conv.is_owned = ptr_is_owned(key); + CHECK_INNER_FIELD_ACCESS_OR_NULL(key_conv); + key_conv.is_owned = false; + LDKCResult_VerifiedInvoiceRequestNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_VerifiedInvoiceRequestNoneZ), "LDKCResult_VerifiedInvoiceRequestNoneZ"); + *ret_conv = InvoiceRequest_verify_using_recipient_data(this_arg_conv, nonce_conv, &key_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1signature(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_trampoline_routing_optional(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, InvoiceRequest_signature(&this_arg_conv).compact_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1trampoline_1routing_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1chains(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKVerifiedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_set_trampoline_routing_required(&this_arg_conv); + LDKCVec_ThirtyTwoBytesZ ret_var = VerifiedInvoiceRequest_chains(&this_arg_conv); + jobjectArray ret_arr = NULL; + ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); + ; + for (size_t i = 0; i < ret_var.datalen; i++) { + int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 32, ret_var.data[i].data); + (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); + } + + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1trampoline_1routing(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKVerifiedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_supports_trampoline_routing(&this_arg_conv); - return ret_conv; + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = VerifiedInvoiceRequest_metadata(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1trampoline_1routing_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1amount(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKVerifiedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_trampoline_routing_optional(&this_arg_conv); + LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); + *ret_copy = VerifiedInvoiceRequest_amount(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1trampoline_1routing_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1description(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKVerifiedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_set_trampoline_routing_required(&this_arg_conv); + LDKPrintableString ret_var = VerifiedInvoiceRequest_description(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1trampoline_1routing(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1offer_1features(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKVerifiedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_supports_trampoline_routing(&this_arg_conv); - return ret_conv; + LDKOfferFeatures ret_var = VerifiedInvoiceRequest_offer_features(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1trampoline_1routing_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKVerifiedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - Bolt11InvoiceFeatures_set_trampoline_routing_optional(&this_arg_conv); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = VerifiedInvoiceRequest_absolute_expiry(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1trampoline_1routing_1required(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1issuer(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKVerifiedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - Bolt11InvoiceFeatures_set_trampoline_routing_required(&this_arg_conv); + LDKPrintableString ret_var = VerifiedInvoiceRequest_issuer(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1supports_1trampoline_1routing(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1paths(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKVerifiedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = Bolt11InvoiceFeatures_supports_trampoline_routing(&this_arg_conv); - return ret_conv; + LDKCVec_BlindedMessagePathZ ret_var = VerifiedInvoiceRequest_paths(&this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t u = 0; u < ret_var.datalen; u++) { + LDKBlindedMessagePath ret_conv_20_var = ret_var.data[u]; + int64_t ret_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_20_var); + ret_conv_20_ref = tag_ptr(ret_conv_20_var.inner, ret_conv_20_var.is_owned); + ret_arr_ptr[u] = ret_conv_20_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1trampoline_1routing(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInitFeatures this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1supported_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKVerifiedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_trampoline_routing(&this_arg_conv); - return ret_conv; + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = VerifiedInvoiceRequest_supported_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1trampoline_1routing(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1signing_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKVerifiedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_trampoline_routing(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, VerifiedInvoiceRequest_signing_pubkey(&this_arg_conv).compressed_form); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1trampoline_1routing(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt11InvoiceFeatures this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1payer_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKVerifiedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = Bolt11InvoiceFeatures_requires_trampoline_routing(&this_arg_conv); - return ret_conv; + LDKu8slice ret_var = VerifiedInvoiceRequest_payer_metadata(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKShutdownScript this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ShutdownScript_free(this_obj_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1chain(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKVerifiedInvoiceRequest this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, VerifiedInvoiceRequest_chain(&this_arg_conv).data); + return ret_arr; } -static inline uint64_t ShutdownScript_clone_ptr(LDKShutdownScript *NONNULL_PTR arg) { - LDKShutdownScript ret_var = ShutdownScript_clone(arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKVerifiedInvoiceRequest this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = VerifiedInvoiceRequest_amount_msats(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1invoice_1request_1features(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKVerifiedInvoiceRequest this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKInvoiceRequestFeatures ret_var = VerifiedInvoiceRequest_invoice_request_features(&this_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKShutdownScript arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = ShutdownScript_clone_ptr(&arg_conv); - return ret_conv; + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKVerifiedInvoiceRequest this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = VerifiedInvoiceRequest_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKShutdownScript orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKShutdownScript ret_var = ShutdownScript_clone(&orig_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKVerifiedInvoiceRequest this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, VerifiedInvoiceRequest_payer_id(&this_arg_conv).compressed_form); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKVerifiedInvoiceRequest this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKPrintableString ret_var = VerifiedInvoiceRequest_payer_note(&this_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKShutdownScript a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKShutdownScript b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = ShutdownScript_eq(&a_conv, &b_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1respond_1with(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash) { + LDKVerifiedInvoiceRequest this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_BlindedPaymentPathZ payment_paths_constr; + payment_paths_constr.datalen = (*env)->GetArrayLength(env, payment_paths); + if (payment_paths_constr.datalen > 0) + payment_paths_constr.data = MALLOC(payment_paths_constr.datalen * sizeof(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); + else + payment_paths_constr.data = NULL; + int64_t* payment_paths_vals = (*env)->GetLongArrayElements (env, payment_paths, NULL); + for (size_t u = 0; u < payment_paths_constr.datalen; u++) { + int64_t payment_paths_conv_20 = payment_paths_vals[u]; + LDKBlindedPaymentPath payment_paths_conv_20_conv; + payment_paths_conv_20_conv.inner = untag_ptr(payment_paths_conv_20); + payment_paths_conv_20_conv.is_owned = ptr_is_owned(payment_paths_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_paths_conv_20_conv); + payment_paths_conv_20_conv = BlindedPaymentPath_clone(&payment_paths_conv_20_conv); + payment_paths_constr.data[u] = payment_paths_conv_20_conv; + } + (*env)->ReleaseLongArrayElements(env, payment_paths, payment_paths_vals, 0); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ"); + *ret_conv = VerifiedInvoiceRequest_respond_with(&this_arg_conv, payment_paths_constr, payment_hash_ref); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKInvalidShutdownScript this_obj_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1respond_1with_1no_1std(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash, int64_t created_at) { + LDKVerifiedInvoiceRequest this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_BlindedPaymentPathZ payment_paths_constr; + payment_paths_constr.datalen = (*env)->GetArrayLength(env, payment_paths); + if (payment_paths_constr.datalen > 0) + payment_paths_constr.data = MALLOC(payment_paths_constr.datalen * sizeof(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); + else + payment_paths_constr.data = NULL; + int64_t* payment_paths_vals = (*env)->GetLongArrayElements (env, payment_paths, NULL); + for (size_t u = 0; u < payment_paths_constr.datalen; u++) { + int64_t payment_paths_conv_20 = payment_paths_vals[u]; + LDKBlindedPaymentPath payment_paths_conv_20_conv; + payment_paths_conv_20_conv.inner = untag_ptr(payment_paths_conv_20); + payment_paths_conv_20_conv.is_owned = ptr_is_owned(payment_paths_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_paths_conv_20_conv); + payment_paths_conv_20_conv = BlindedPaymentPath_clone(&payment_paths_conv_20_conv); + payment_paths_constr.data[u] = payment_paths_conv_20_conv; + } + (*env)->ReleaseLongArrayElements(env, payment_paths, payment_paths_vals, 0); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ"); + *ret_conv = VerifiedInvoiceRequest_respond_with_no_std(&this_arg_conv, payment_paths_constr, payment_hash_ref, created_at); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1respond_1using_1derived_1keys(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash) { + LDKVerifiedInvoiceRequest this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_BlindedPaymentPathZ payment_paths_constr; + payment_paths_constr.datalen = (*env)->GetArrayLength(env, payment_paths); + if (payment_paths_constr.datalen > 0) + payment_paths_constr.data = MALLOC(payment_paths_constr.datalen * sizeof(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); + else + payment_paths_constr.data = NULL; + int64_t* payment_paths_vals = (*env)->GetLongArrayElements (env, payment_paths, NULL); + for (size_t u = 0; u < payment_paths_constr.datalen; u++) { + int64_t payment_paths_conv_20 = payment_paths_vals[u]; + LDKBlindedPaymentPath payment_paths_conv_20_conv; + payment_paths_conv_20_conv.inner = untag_ptr(payment_paths_conv_20); + payment_paths_conv_20_conv.is_owned = ptr_is_owned(payment_paths_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_paths_conv_20_conv); + payment_paths_conv_20_conv = BlindedPaymentPath_clone(&payment_paths_conv_20_conv); + payment_paths_constr.data[u] = payment_paths_conv_20_conv; + } + (*env)->ReleaseLongArrayElements(env, payment_paths, payment_paths_vals, 0); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ"); + *ret_conv = VerifiedInvoiceRequest_respond_using_derived_keys(&this_arg_conv, payment_paths_constr, payment_hash_ref); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1respond_1using_1derived_1keys_1no_1std(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash, int64_t created_at) { + LDKVerifiedInvoiceRequest this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_BlindedPaymentPathZ payment_paths_constr; + payment_paths_constr.datalen = (*env)->GetArrayLength(env, payment_paths); + if (payment_paths_constr.datalen > 0) + payment_paths_constr.data = MALLOC(payment_paths_constr.datalen * sizeof(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); + else + payment_paths_constr.data = NULL; + int64_t* payment_paths_vals = (*env)->GetLongArrayElements (env, payment_paths, NULL); + for (size_t u = 0; u < payment_paths_constr.datalen; u++) { + int64_t payment_paths_conv_20 = payment_paths_vals[u]; + LDKBlindedPaymentPath payment_paths_conv_20_conv; + payment_paths_conv_20_conv.inner = untag_ptr(payment_paths_conv_20); + payment_paths_conv_20_conv.is_owned = ptr_is_owned(payment_paths_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_paths_conv_20_conv); + payment_paths_conv_20_conv = BlindedPaymentPath_clone(&payment_paths_conv_20_conv); + payment_paths_constr.data[u] = payment_paths_conv_20_conv; + } + (*env)->ReleaseLongArrayElements(env, payment_paths, payment_paths_vals, 0); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ"); + *ret_conv = VerifiedInvoiceRequest_respond_using_derived_keys_no_std(&this_arg_conv, payment_paths_constr, payment_hash_ref, created_at); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKUnsignedInvoiceRequest obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = UnsignedInvoiceRequest_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKInvoiceRequest obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = InvoiceRequest_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInvoiceRequestFields this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InvalidShutdownScript_free(this_obj_conv); + InvoiceRequestFields_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1get_1script(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInvalidShutdownScript this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1get_1payer_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInvoiceRequestFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u8Z ret_var = InvalidShutdownScript_get_script(&this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, InvoiceRequestFields_get_payer_id(&this_ptr_conv).compressed_form); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1set_1script(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKInvalidShutdownScript this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1set_1payer_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKInvoiceRequestFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u8Z val_ref; - val_ref.datalen = (*env)->GetArrayLength(env, val); - val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data); - InvalidShutdownScript_set_script(&this_ptr_conv, val_ref); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + InvoiceRequestFields_set_payer_id(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1new(JNIEnv *env, jclass clz, int8_tArray script_arg) { - LDKCVec_u8Z script_arg_ref; - script_arg_ref.datalen = (*env)->GetArrayLength(env, script_arg); - script_arg_ref.data = MALLOC(script_arg_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, script_arg, 0, script_arg_ref.datalen, script_arg_ref.data); - LDKInvalidShutdownScript ret_var = InvalidShutdownScript_new(script_arg_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1get_1quantity(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInvoiceRequestFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = InvoiceRequestFields_get_quantity(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1set_1quantity(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKInvoiceRequestFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + InvoiceRequestFields_set_quantity(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1get_1payer_1note_1truncated(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInvoiceRequestFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKUntrustedString ret_var = InvoiceRequestFields_get_payer_note_truncated(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t InvalidShutdownScript_clone_ptr(LDKInvalidShutdownScript *NONNULL_PTR arg) { - LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(arg); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1set_1payer_1note_1truncated(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKInvoiceRequestFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKUntrustedString val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = UntrustedString_clone(&val_conv); + InvoiceRequestFields_set_payer_note_truncated(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1new(JNIEnv *env, jclass clz, int8_tArray payer_id_arg, int64_t quantity_arg, int64_t payer_note_truncated_arg) { + LDKPublicKey payer_id_arg_ref; + CHECK((*env)->GetArrayLength(env, payer_id_arg) == 33); + (*env)->GetByteArrayRegion(env, payer_id_arg, 0, 33, payer_id_arg_ref.compressed_form); + void* quantity_arg_ptr = untag_ptr(quantity_arg); + CHECK_ACCESS(quantity_arg_ptr); + LDKCOption_u64Z quantity_arg_conv = *(LDKCOption_u64Z*)(quantity_arg_ptr); + quantity_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(quantity_arg)); + LDKUntrustedString payer_note_truncated_arg_conv; + payer_note_truncated_arg_conv.inner = untag_ptr(payer_note_truncated_arg); + payer_note_truncated_arg_conv.is_owned = ptr_is_owned(payer_note_truncated_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payer_note_truncated_arg_conv); + payer_note_truncated_arg_conv = UntrustedString_clone(&payer_note_truncated_arg_conv); + LDKInvoiceRequestFields ret_var = InvoiceRequestFields_new(payer_id_arg_ref, quantity_arg_conv, payer_note_truncated_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKInvalidShutdownScript arg_conv; + +static inline uint64_t InvoiceRequestFields_clone_ptr(LDKInvoiceRequestFields *NONNULL_PTR arg) { + LDKInvoiceRequestFields ret_var = InvoiceRequestFields_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInvoiceRequestFields arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = InvalidShutdownScript_clone_ptr(&arg_conv); + int64_t ret_conv = InvoiceRequestFields_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKInvalidShutdownScript orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKInvoiceRequestFields orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(&orig_conv); + LDKInvoiceRequestFields ret_var = InvoiceRequestFields_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKShutdownScript obj_conv; - obj_conv.inner = untag_ptr(obj); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKInvoiceRequestFields a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKInvoiceRequestFields b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = InvoiceRequestFields_eq(&a_conv, &b_conv); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKInvoiceRequestFields obj_conv; + obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ShutdownScript_write(&obj_conv); + LDKCVec_u8Z ret_var = InvoiceRequestFields_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1read(JNIEnv *env, jclass clz, int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); - *ret_conv = ShutdownScript_read(ser_ref); + LDKCResult_InvoiceRequestFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestFieldsDecodeErrorZ), "LDKCResult_InvoiceRequestFieldsDecodeErrorZ"); + *ret_conv = InvoiceRequestFields_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1p2wpkh(JNIEnv *env, jclass clz, int8_tArray pubkey_hash) { - uint8_t pubkey_hash_arr[20]; - CHECK((*env)->GetArrayLength(env, pubkey_hash) == 20); - (*env)->GetByteArrayRegion(env, pubkey_hash, 0, 20, pubkey_hash_arr); - uint8_t (*pubkey_hash_ref)[20] = &pubkey_hash_arr; - LDKShutdownScript ret_var = ShutdownScript_new_p2wpkh(pubkey_hash_ref); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TaggedHash_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKTaggedHash this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + TaggedHash_free(this_obj_conv); +} + +static inline uint64_t TaggedHash_clone_ptr(LDKTaggedHash *NONNULL_PTR arg) { + LDKTaggedHash ret_var = TaggedHash_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TaggedHash_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKTaggedHash arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = TaggedHash_clone_ptr(&arg_conv); + return ret_conv; +} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1p2wsh(JNIEnv *env, jclass clz, int8_tArray script_hash) { - uint8_t script_hash_arr[32]; - CHECK((*env)->GetArrayLength(env, script_hash) == 32); - (*env)->GetByteArrayRegion(env, script_hash, 0, 32, script_hash_arr); - uint8_t (*script_hash_ref)[32] = &script_hash_arr; - LDKShutdownScript ret_var = ShutdownScript_new_p2wsh(script_hash_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TaggedHash_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKTaggedHash orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKTaggedHash ret_var = TaggedHash_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1witness_1program(JNIEnv *env, jclass clz, int64_t witness_program) { - void* witness_program_ptr = untag_ptr(witness_program); - CHECK_ACCESS(witness_program_ptr); - LDKWitnessProgram witness_program_conv = *(LDKWitnessProgram*)(witness_program_ptr); - witness_program_conv = WitnessProgram_clone((LDKWitnessProgram*)untag_ptr(witness_program)); - LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); - *ret_conv = ShutdownScript_new_witness_program(witness_program_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1into_1inner(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKShutdownScript this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TaggedHash_1as_1digest(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKTaggedHash this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = ShutdownScript_clone(&this_arg_conv); - LDKCVec_u8Z ret_var = ShutdownScript_into_inner(this_arg_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *TaggedHash_as_digest(&this_arg_conv)); return ret_arr; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1as_1legacy_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKShutdownScript this_arg_conv; +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_TaggedHash_1tag(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKTaggedHash this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ShutdownScript_as_legacy_pubkey(&this_arg_conv).compressed_form); - return ret_arr; + LDKStr ret_str = TaggedHash_tag(&this_arg_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1is_1compatible(JNIEnv *env, jclass clz, int64_t this_arg, int64_t features) { - LDKShutdownScript this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TaggedHash_1merkle_1root(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKTaggedHash this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKInitFeatures features_conv; - features_conv.inner = untag_ptr(features); - features_conv.is_owned = ptr_is_owned(features); - CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); - features_conv.is_owned = false; - jboolean ret_conv = ShutdownScript_is_compatible(&this_arg_conv, &features_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, TaggedHash_merkle_root(&this_arg_conv).data); + return ret_arr; } -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1to_1str(JNIEnv *env, jclass clz, int64_t o) { - LDKShutdownScript o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = ShutdownScript_to_str(&o_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKSignError this_ptr_conv = *(LDKSignError*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + SignError_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelId_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelId this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelId_free(this_obj_conv); +static inline uint64_t SignError_clone_ptr(LDKSignError *NONNULL_PTR arg) { + LDKSignError *ret_copy = MALLOC(sizeof(LDKSignError), "LDKSignError"); + *ret_copy = SignError_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKSignError* arg_conv = (LDKSignError*)untag_ptr(arg); + int64_t ret_conv = SignError_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelId_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelId this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelId_get_a(&this_ptr_conv)); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignError_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKSignError* orig_conv = (LDKSignError*)untag_ptr(orig); + LDKSignError *ret_copy = MALLOC(sizeof(LDKSignError), "LDKSignError"); + *ret_copy = SignError_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelId_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKChannelId this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - ChannelId_set_a(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignError_1signing(JNIEnv *env, jclass clz) { + LDKSignError *ret_copy = MALLOC(sizeof(LDKSignError), "LDKSignError"); + *ret_copy = SignError_signing(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1new(JNIEnv *env, jclass clz, int8_tArray a_arg) { - LDKThirtyTwoBytes a_arg_ref; - CHECK((*env)->GetArrayLength(env, a_arg) == 32); - (*env)->GetByteArrayRegion(env, a_arg, 0, 32, a_arg_ref.data); - LDKChannelId ret_var = ChannelId_new(a_arg_ref); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignError_1verification(JNIEnv *env, jclass clz, jclass a) { + LDKSecp256k1Error a_conv = LDKSecp256k1Error_from_java(env, a); + LDKSignError *ret_copy = MALLOC(sizeof(LDKSignError), "LDKSignError"); + *ret_copy = SignError_verification(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline uint64_t ChannelId_clone_ptr(LDKChannelId *NONNULL_PTR arg) { - LDKChannelId ret_var = ChannelId_clone(arg); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Nonce_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKNonce this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Nonce_free(this_obj_conv); +} + +static inline uint64_t Nonce_clone_ptr(LDKNonce *NONNULL_PTR arg) { + LDKNonce ret_var = Nonce_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelId arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Nonce_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNonce arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = ChannelId_clone_ptr(&arg_conv); + int64_t ret_conv = Nonce_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelId orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Nonce_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKNonce orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKChannelId ret_var = ChannelId_clone(&orig_conv); + LDKNonce ret_var = Nonce_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelId_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKChannelId a_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Nonce_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKNonce a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKChannelId b_conv; + LDKNonce b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = ChannelId_eq(&a_conv, &b_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKChannelId o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = ChannelId_hash(&o_conv); + jboolean ret_conv = Nonce_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1v1_1from_1funding_1txid(JNIEnv *env, jclass clz, int8_tArray txid, int16_t output_index) { - uint8_t txid_arr[32]; - CHECK((*env)->GetArrayLength(env, txid) == 32); - (*env)->GetByteArrayRegion(env, txid, 0, 32, txid_arr); - uint8_t (*txid_ref)[32] = &txid_arr; - LDKChannelId ret_var = ChannelId_v1_from_funding_txid(txid_ref, output_index); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1v1_1from_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t outpoint) { - LDKOutPoint outpoint_conv; - outpoint_conv.inner = untag_ptr(outpoint); - outpoint_conv.is_owned = ptr_is_owned(outpoint); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv); - outpoint_conv = OutPoint_clone(&outpoint_conv); - LDKChannelId ret_var = ChannelId_v1_from_funding_outpoint(outpoint_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1temporary_1from_1entropy_1source(JNIEnv *env, jclass clz, int64_t entropy_source) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Nonce_1from_1entropy_1source(JNIEnv *env, jclass clz, int64_t entropy_source) { void* entropy_source_ptr = untag_ptr(entropy_source); - if (ptr_is_owned(entropy_source)) { CHECK_ACCESS(entropy_source_ptr); } - LDKEntropySource* entropy_source_conv = (LDKEntropySource*)entropy_source_ptr; - LDKChannelId ret_var = ChannelId_temporary_from_entropy_source(entropy_source_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1from_1bytes(JNIEnv *env, jclass clz, int8_tArray data) { - LDKThirtyTwoBytes data_ref; - CHECK((*env)->GetArrayLength(env, data) == 32); - (*env)->GetByteArrayRegion(env, data, 0, 32, data_ref.data); - LDKChannelId ret_var = ChannelId_from_bytes(data_ref); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1new_1zero(JNIEnv *env, jclass clz) { - LDKChannelId ret_var = ChannelId_new_zero(); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + LDKNonce ret_var = Nonce_from_entropy_source(entropy_source_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelId_1is_1zero(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelId this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Nonce_1as_1slice(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNonce this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = ChannelId_is_zero(&this_arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1v2_1from_1revocation_1basepoints(JNIEnv *env, jclass clz, int64_t ours, int64_t theirs) { - LDKRevocationBasepoint ours_conv; - ours_conv.inner = untag_ptr(ours); - ours_conv.is_owned = ptr_is_owned(ours); - CHECK_INNER_FIELD_ACCESS_OR_NULL(ours_conv); - ours_conv.is_owned = false; - LDKRevocationBasepoint theirs_conv; - theirs_conv.inner = untag_ptr(theirs); - theirs_conv.is_owned = ptr_is_owned(theirs); - CHECK_INNER_FIELD_ACCESS_OR_NULL(theirs_conv); - theirs_conv.is_owned = false; - LDKChannelId ret_var = ChannelId_v2_from_revocation_basepoints(&ours_conv, &theirs_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1temporary_1v2_1from_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t our_revocation_basepoint) { - LDKRevocationBasepoint our_revocation_basepoint_conv; - our_revocation_basepoint_conv.inner = untag_ptr(our_revocation_basepoint); - our_revocation_basepoint_conv.is_owned = ptr_is_owned(our_revocation_basepoint); - CHECK_INNER_FIELD_ACCESS_OR_NULL(our_revocation_basepoint_conv); - our_revocation_basepoint_conv.is_owned = false; - LDKChannelId ret_var = ChannelId_temporary_v2_from_revocation_basepoint(&our_revocation_basepoint_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + LDKu8slice ret_var = Nonce_as_slice(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + return ret_arr; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelId_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelId obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Nonce_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKNonce obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ChannelId_write(&obj_conv); + LDKCVec_u8Z ret_var = Nonce_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Nonce_1read(JNIEnv *env, jclass clz, int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_ChannelIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdDecodeErrorZ), "LDKCResult_ChannelIdDecodeErrorZ"); - *ret_conv = ChannelId_read(ser_ref); + LDKCResult_NonceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonceDecodeErrorZ), "LDKCResult_NonceDecodeErrorZ"); + *ret_conv = Nonce_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ChannelId_1to_1str(JNIEnv *env, jclass clz, int64_t o) { - LDKChannelId o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = ChannelId_to_str(&o_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Retry_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKRetry this_ptr_conv = *(LDKRetry*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Retry_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12ParseError_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBolt12ParseError this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Bolt12ParseError_free(this_obj_conv); } -static inline uint64_t Retry_clone_ptr(LDKRetry *NONNULL_PTR arg) { - LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); - *ret_copy = Retry_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); +static inline uint64_t Bolt12ParseError_clone_ptr(LDKBolt12ParseError *NONNULL_PTR arg) { + LDKBolt12ParseError ret_var = Bolt12ParseError_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKRetry* arg_conv = (LDKRetry*)untag_ptr(arg); - int64_t ret_conv = Retry_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12ParseError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBolt12ParseError arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = Bolt12ParseError_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKRetry* orig_conv = (LDKRetry*)untag_ptr(orig); - LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); - *ret_copy = Retry_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12ParseError_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBolt12ParseError orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKBolt12ParseError ret_var = Bolt12ParseError_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1attempts(JNIEnv *env, jclass clz, int32_t a) { - LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); - *ret_copy = Retry_attempts(a); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBolt12SemanticError* orig_conv = (LDKBolt12SemanticError*)untag_ptr(orig); + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_clone(orig_conv)); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1timeout(JNIEnv *env, jclass clz, int64_t a) { - LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); - *ret_copy = Retry_timeout(a); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1already_1expired(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_already_expired()); + return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Retry_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKRetry* a_conv = (LDKRetry*)untag_ptr(a); - LDKRetry* b_conv = (LDKRetry*)untag_ptr(b); - jboolean ret_conv = Retry_eq(a_conv, b_conv); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unsupported_1chain(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unsupported_chain()); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKRetry* o_conv = (LDKRetry*)untag_ptr(o); - int64_t ret_conv = Retry_hash(o_conv); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1chain(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unexpected_chain()); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Retry_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKRetry* obj_conv = (LDKRetry*)untag_ptr(obj); - LDKCVec_u8Z ret_var = Retry_write(obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1amount(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_amount()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_RetryDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RetryDecodeErrorZ), "LDKCResult_RetryDecodeErrorZ"); - *ret_conv = Retry_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1invalid_1amount(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_invalid_amount()); + return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKRetryableSendFailure* orig_conv = (LDKRetryableSendFailure*)untag_ptr(orig); - jclass ret_conv = LDKRetryableSendFailure_to_java(env, RetryableSendFailure_clone(orig_conv)); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1insufficient_1amount(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_insufficient_amount()); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1payment_1expired(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKRetryableSendFailure_to_java(env, RetryableSendFailure_payment_expired()); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1amount(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unexpected_amount()); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1route_1not_1found(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKRetryableSendFailure_to_java(env, RetryableSendFailure_route_not_found()); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unsupported_1currency(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unsupported_currency()); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1duplicate_1payment(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKRetryableSendFailure_to_java(env, RetryableSendFailure_duplicate_payment()); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unknown_1required_1features(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unknown_required_features()); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKRetryableSendFailure* a_conv = (LDKRetryableSendFailure*)untag_ptr(a); - LDKRetryableSendFailure* b_conv = (LDKRetryableSendFailure*)untag_ptr(b); - jboolean ret_conv = RetryableSendFailure_eq(a_conv, b_conv); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1features(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unexpected_features()); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - PaymentSendFailure_free(this_ptr_conv); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1description(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_description()); + return ret_conv; } -static inline uint64_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg) { - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = PaymentSendFailure_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1signing_1pubkey(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_signing_pubkey()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKPaymentSendFailure* arg_conv = (LDKPaymentSendFailure*)untag_ptr(arg); - int64_t ret_conv = PaymentSendFailure_clone_ptr(arg_conv); + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1invalid_1signing_1pubkey(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_invalid_signing_pubkey()); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPaymentSendFailure* orig_conv = (LDKPaymentSendFailure*)untag_ptr(orig); - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = PaymentSendFailure_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1signing_1pubkey(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unexpected_signing_pubkey()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1parameter_1error(JNIEnv *env, jclass clz, int64_t a) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKAPIError a_conv = *(LDKAPIError*)(a_ptr); - a_conv = APIError_clone((LDKAPIError*)untag_ptr(a)); - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = PaymentSendFailure_parameter_error(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1quantity(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_quantity()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1path_1parameter_1error(JNIEnv *env, jclass clz, int64_tArray a) { - LDKCVec_CResult_NoneAPIErrorZZ a_constr; - a_constr.datalen = (*env)->GetArrayLength(env, a); - if (a_constr.datalen > 0) - a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements"); - else - a_constr.data = NULL; - int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL); - for (size_t w = 0; w < a_constr.datalen; w++) { - int64_t a_conv_22 = a_vals[w]; - void* a_conv_22_ptr = untag_ptr(a_conv_22); - CHECK_ACCESS(a_conv_22_ptr); - LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(a_conv_22_ptr); - a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)untag_ptr(a_conv_22)); - a_constr.data[w] = a_conv_22_conv; - } - (*env)->ReleaseLongArrayElements(env, a, a_vals, 0); - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = PaymentSendFailure_path_parameter_error(a_constr); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1invalid_1quantity(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_invalid_quantity()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1all_1failed_1resend_1safe(JNIEnv *env, jclass clz, int64_tArray a) { - LDKCVec_APIErrorZ a_constr; - a_constr.datalen = (*env)->GetArrayLength(env, a); - if (a_constr.datalen > 0) - a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements"); - else - a_constr.data = NULL; - int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL); - for (size_t k = 0; k < a_constr.datalen; k++) { - int64_t a_conv_10 = a_vals[k]; - void* a_conv_10_ptr = untag_ptr(a_conv_10); - CHECK_ACCESS(a_conv_10_ptr); - LDKAPIError a_conv_10_conv = *(LDKAPIError*)(a_conv_10_ptr); - a_conv_10_conv = APIError_clone((LDKAPIError*)untag_ptr(a_conv_10)); - a_constr.data[k] = a_conv_10_conv; - } - (*env)->ReleaseLongArrayElements(env, a, a_vals, 0); - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = PaymentSendFailure_all_failed_resend_safe(a_constr); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1duplicate_1payment(JNIEnv *env, jclass clz) { - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = PaymentSendFailure_duplicate_payment(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1quantity(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unexpected_quantity()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1partial_1failure(JNIEnv *env, jclass clz, int64_tArray results, int64_t failed_paths_retry, int8_tArray payment_id) { - LDKCVec_CResult_NoneAPIErrorZZ results_constr; - results_constr.datalen = (*env)->GetArrayLength(env, results); - if (results_constr.datalen > 0) - results_constr.data = MALLOC(results_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements"); - else - results_constr.data = NULL; - int64_t* results_vals = (*env)->GetLongArrayElements (env, results, NULL); - for (size_t w = 0; w < results_constr.datalen; w++) { - int64_t results_conv_22 = results_vals[w]; - void* results_conv_22_ptr = untag_ptr(results_conv_22); - CHECK_ACCESS(results_conv_22_ptr); - LDKCResult_NoneAPIErrorZ results_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(results_conv_22_ptr); - results_constr.data[w] = results_conv_22_conv; - } - (*env)->ReleaseLongArrayElements(env, results, results_vals, 0); - LDKRouteParameters failed_paths_retry_conv; - failed_paths_retry_conv.inner = untag_ptr(failed_paths_retry); - failed_paths_retry_conv.is_owned = ptr_is_owned(failed_paths_retry); - CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_conv); - failed_paths_retry_conv = RouteParameters_clone(&failed_paths_retry_conv); - LDKThirtyTwoBytes payment_id_ref; - CHECK((*env)->GetArrayLength(env, payment_id) == 32); - (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = PaymentSendFailure_partial_failure(results_constr, failed_paths_retry_conv, payment_id_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1invalid_1metadata(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_invalid_metadata()); + return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKPaymentSendFailure* a_conv = (LDKPaymentSendFailure*)untag_ptr(a); - LDKPaymentSendFailure* b_conv = (LDKPaymentSendFailure*)untag_ptr(b); - jboolean ret_conv = PaymentSendFailure_eq(a_conv, b_conv); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1metadata(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unexpected_metadata()); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKProbeSendFailure this_ptr_conv = *(LDKProbeSendFailure*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - ProbeSendFailure_free(this_ptr_conv); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1payer_1metadata(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_payer_metadata()); + return ret_conv; } -static inline uint64_t ProbeSendFailure_clone_ptr(LDKProbeSendFailure *NONNULL_PTR arg) { - LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); - *ret_copy = ProbeSendFailure_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKProbeSendFailure* arg_conv = (LDKProbeSendFailure*)untag_ptr(arg); - int64_t ret_conv = ProbeSendFailure_clone_ptr(arg_conv); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1payer_1id(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_payer_id()); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKProbeSendFailure* orig_conv = (LDKProbeSendFailure*)untag_ptr(orig); - LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); - *ret_copy = ProbeSendFailure_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1duplicate_1payment_1id(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_duplicate_payment_id()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1route_1not_1found(JNIEnv *env, jclass clz) { - LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); - *ret_copy = ProbeSendFailure_route_not_found(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1paths(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_paths()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1sending_1failed(JNIEnv *env, jclass clz, int64_t a) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKPaymentSendFailure a_conv = *(LDKPaymentSendFailure*)(a_ptr); - a_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(a)); - LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); - *ret_copy = ProbeSendFailure_sending_failed(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1paths(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unexpected_paths()); + return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKProbeSendFailure* a_conv = (LDKProbeSendFailure*)untag_ptr(a); - LDKProbeSendFailure* b_conv = (LDKProbeSendFailure*)untag_ptr(b); - jboolean ret_conv = ProbeSendFailure_eq(a_conv, b_conv); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1invalid_1pay_1info(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_invalid_pay_info()); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKRecipientOnionFields this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - RecipientOnionFields_free(this_obj_conv); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1creation_1time(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_creation_time()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1get_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRecipientOnionFields this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); - *ret_copy = RecipientOnionFields_get_payment_secret(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1payment_1hash(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_payment_hash()); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1set_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKRecipientOnionFields this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_ThirtyTwoBytesZ val_conv = *(LDKCOption_ThirtyTwoBytesZ*)(val_ptr); - val_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(val)); - RecipientOnionFields_set_payment_secret(&this_ptr_conv, val_conv); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1payment_1hash(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unexpected_payment_hash()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1get_1payment_1metadata(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRecipientOnionFields this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = RecipientOnionFields_get_payment_metadata(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1signature(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_signature()); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1set_1payment_1metadata(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKRecipientOnionFields this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_CVec_u8ZZ val_conv = *(LDKCOption_CVec_u8ZZ*)(val_ptr); - val_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(val)); - RecipientOnionFields_set_payment_metadata(&this_ptr_conv, val_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKRefundMaybeWithDerivedMetadataBuilder this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + RefundMaybeWithDerivedMetadataBuilder_free(this_obj_conv); } -static inline uint64_t RecipientOnionFields_clone_ptr(LDKRecipientOnionFields *NONNULL_PTR arg) { - LDKRecipientOnionFields ret_var = RecipientOnionFields_clone(arg); +static inline uint64_t RefundMaybeWithDerivedMetadataBuilder_clone_ptr(LDKRefundMaybeWithDerivedMetadataBuilder *NONNULL_PTR arg) { + LDKRefundMaybeWithDerivedMetadataBuilder ret_var = RefundMaybeWithDerivedMetadataBuilder_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKRecipientOnionFields arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRefundMaybeWithDerivedMetadataBuilder arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = RecipientOnionFields_clone_ptr(&arg_conv); + int64_t ret_conv = RefundMaybeWithDerivedMetadataBuilder_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKRecipientOnionFields orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKRefundMaybeWithDerivedMetadataBuilder orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKRecipientOnionFields ret_var = RecipientOnionFields_clone(&orig_conv); + LDKRefundMaybeWithDerivedMetadataBuilder ret_var = RefundMaybeWithDerivedMetadataBuilder_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKRecipientOnionFields a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKRecipientOnionFields b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = RecipientOnionFields_eq(&a_conv, &b_conv); - return ret_conv; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKRecipientOnionFields obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = RecipientOnionFields_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1new(JNIEnv *env, jclass clz, int8_tArray metadata, int8_tArray payer_id, int64_t amount_msats) { + LDKCVec_u8Z metadata_ref; + metadata_ref.datalen = (*env)->GetArrayLength(env, metadata); + metadata_ref.data = MALLOC(metadata_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, metadata, 0, metadata_ref.datalen, metadata_ref.data); + LDKPublicKey payer_id_ref; + CHECK((*env)->GetArrayLength(env, payer_id) == 33); + (*env)->GetByteArrayRegion(env, payer_id, 0, 33, payer_id_ref.compressed_form); + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ"); + *ret_conv = RefundMaybeWithDerivedMetadataBuilder_new(metadata_ref, payer_id_ref, amount_msats); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_RecipientOnionFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsDecodeErrorZ), "LDKCResult_RecipientOnionFieldsDecodeErrorZ"); - *ret_conv = RecipientOnionFields_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1deriving_1payer_1id(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t expanded_key, int64_t nonce, int64_t amount_msats, int8_tArray payment_id) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKExpandedKey expanded_key_conv; + expanded_key_conv.inner = untag_ptr(expanded_key); + expanded_key_conv.is_owned = ptr_is_owned(expanded_key); + CHECK_INNER_FIELD_ACCESS_OR_NULL(expanded_key_conv); + expanded_key_conv.is_owned = false; + LDKNonce nonce_conv; + nonce_conv.inner = untag_ptr(nonce); + nonce_conv.is_owned = ptr_is_owned(nonce); + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_conv); + nonce_conv = Nonce_clone(&nonce_conv); + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ"); + *ret_conv = RefundMaybeWithDerivedMetadataBuilder_deriving_payer_id(node_id_ref, &expanded_key_conv, nonce_conv, amount_msats, payment_id_ref); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1secret_1only(JNIEnv *env, jclass clz, int8_tArray payment_secret) { - LDKThirtyTwoBytes payment_secret_ref; - CHECK((*env)->GetArrayLength(env, payment_secret) == 32); - (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data); - LDKRecipientOnionFields ret_var = RecipientOnionFields_secret_only(payment_secret_ref); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1description(JNIEnv *env, jclass clz, int64_t this_arg, jstring description) { + LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKStr description_conv = java_to_owned_str(env, description); + RefundMaybeWithDerivedMetadataBuilder_description(this_arg_conv, description_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1spontaneous_1empty(JNIEnv *env, jclass clz) { - LDKRecipientOnionFields ret_var = RecipientOnionFields_spontaneous_empty(); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg, int64_t absolute_expiry) { + LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); + RefundMaybeWithDerivedMetadataBuilder_absolute_expiry(this_arg_conv, absolute_expiry); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1with_1custom_1tlvs(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray custom_tlvs) { - LDKRecipientOnionFields this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1issuer(JNIEnv *env, jclass clz, int64_t this_arg, jstring issuer) { + LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = RecipientOnionFields_clone(&this_arg_conv); - LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs_constr; - custom_tlvs_constr.datalen = (*env)->GetArrayLength(env, custom_tlvs); - if (custom_tlvs_constr.datalen > 0) - custom_tlvs_constr.data = MALLOC(custom_tlvs_constr.datalen * sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKCVec_C2Tuple_u64CVec_u8ZZZ Elements"); - else - custom_tlvs_constr.data = NULL; - int64_t* custom_tlvs_vals = (*env)->GetLongArrayElements (env, custom_tlvs, NULL); - for (size_t x = 0; x < custom_tlvs_constr.datalen; x++) { - int64_t custom_tlvs_conv_23 = custom_tlvs_vals[x]; - void* custom_tlvs_conv_23_ptr = untag_ptr(custom_tlvs_conv_23); - CHECK_ACCESS(custom_tlvs_conv_23_ptr); - LDKC2Tuple_u64CVec_u8ZZ custom_tlvs_conv_23_conv = *(LDKC2Tuple_u64CVec_u8ZZ*)(custom_tlvs_conv_23_ptr); - custom_tlvs_conv_23_conv = C2Tuple_u64CVec_u8ZZ_clone((LDKC2Tuple_u64CVec_u8ZZ*)untag_ptr(custom_tlvs_conv_23)); - custom_tlvs_constr.data[x] = custom_tlvs_conv_23_conv; - } - (*env)->ReleaseLongArrayElements(env, custom_tlvs, custom_tlvs_vals, 0); - LDKCResult_RecipientOnionFieldsNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsNoneZ), "LDKCResult_RecipientOnionFieldsNoneZ"); - *ret_conv = RecipientOnionFields_with_custom_tlvs(this_arg_conv, custom_tlvs_constr); - return tag_ptr(ret_conv, true); + this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKStr issuer_conv = java_to_owned_str(env, issuer); + RefundMaybeWithDerivedMetadataBuilder_issuer(this_arg_conv, issuer_conv); } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1custom_1tlvs(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKRecipientOnionFields this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1path(JNIEnv *env, jclass clz, int64_t this_arg, int64_t path) { + LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_C2Tuple_u64CVec_u8ZZZ ret_var = RecipientOnionFields_custom_tlvs(&this_arg_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t x = 0; x < ret_var.datalen; x++) { - LDKC2Tuple_u64CVec_u8ZZ* ret_conv_23_conv = MALLOC(sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKC2Tuple_u64CVec_u8ZZ"); - *ret_conv_23_conv = ret_var.data[x]; - ret_arr_ptr[x] = tag_ptr(ret_conv_23_conv, true); - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; + this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKBlindedMessagePath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv = BlindedMessagePath_clone(&path_conv); + RefundMaybeWithDerivedMetadataBuilder_path(this_arg_conv, path_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomMessageReader_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKCustomMessageReader this_ptr_conv = *(LDKCustomMessageReader*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - CustomMessageReader_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1chain(JNIEnv *env, jclass clz, int64_t this_arg, jclass network) { + LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKNetwork network_conv = LDKNetwork_from_java(env, network); + RefundMaybeWithDerivedMetadataBuilder_chain(this_arg_conv, network_conv); } -static inline uint64_t Type_clone_ptr(LDKType *NONNULL_PTR arg) { - LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType"); - *ret_ret = Type_clone(arg); - return tag_ptr(ret_ret, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Type_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - void* arg_ptr = untag_ptr(arg); - if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); } - LDKType* arg_conv = (LDKType*)arg_ptr; - int64_t ret_conv = Type_clone_ptr(arg_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1quantity(JNIEnv *env, jclass clz, int64_t this_arg, int64_t quantity) { + LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); + RefundMaybeWithDerivedMetadataBuilder_quantity(this_arg_conv, quantity); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Type_1clone(JNIEnv *env, jclass clz, int64_t orig) { - void* orig_ptr = untag_ptr(orig); - if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); } - LDKType* orig_conv = (LDKType*)orig_ptr; - LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType"); - *ret_ret = Type_clone(orig_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg, jstring payer_note) { + LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKStr payer_note_conv = java_to_owned_str(env, payer_note); + RefundMaybeWithDerivedMetadataBuilder_payer_note(this_arg_conv, payer_note_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Type_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKType this_ptr_conv = *(LDKType*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Type_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1build(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKCResult_RefundBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundBolt12SemanticErrorZ), "LDKCResult_RefundBolt12SemanticErrorZ"); + *ret_conv = RefundMaybeWithDerivedMetadataBuilder_build(this_arg_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferId_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKOfferId this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Refund_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKRefund this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - OfferId_free(this_obj_conv); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OfferId_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOfferId this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OfferId_get_a(&this_ptr_conv)); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferId_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKOfferId this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - OfferId_set_a(&this_ptr_conv, val_ref); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferId_1new(JNIEnv *env, jclass clz, int8_tArray a_arg) { - LDKThirtyTwoBytes a_arg_ref; - CHECK((*env)->GetArrayLength(env, a_arg) == 32); - (*env)->GetByteArrayRegion(env, a_arg, 0, 32, a_arg_ref.data); - LDKOfferId ret_var = OfferId_new(a_arg_ref); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + Refund_free(this_obj_conv); } -static inline uint64_t OfferId_clone_ptr(LDKOfferId *NONNULL_PTR arg) { - LDKOfferId ret_var = OfferId_clone(arg); +static inline uint64_t Refund_clone_ptr(LDKRefund *NONNULL_PTR arg) { + LDKRefund ret_var = Refund_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferId_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKOfferId arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRefund arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = OfferId_clone_ptr(&arg_conv); + int64_t ret_conv = Refund_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferId_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKOfferId orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKRefund orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKOfferId ret_var = OfferId_clone(&orig_conv); + LDKRefund ret_var = Refund_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferId_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKOfferId a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKOfferId b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = OfferId_eq(&a_conv, &b_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1description(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKRefund this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKPrintableString ret_var = Refund_description(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OfferId_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKOfferId obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = OfferId_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKRefund this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = Refund_absolute_expiry(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferId_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_OfferIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferIdDecodeErrorZ), "LDKCResult_OfferIdDecodeErrorZ"); - *ret_conv = OfferId_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKOfferWithExplicitMetadataBuilder this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - OfferWithExplicitMetadataBuilder_free(this_obj_conv); -} - -static inline uint64_t OfferWithExplicitMetadataBuilder_clone_ptr(LDKOfferWithExplicitMetadataBuilder *NONNULL_PTR arg) { - LDKOfferWithExplicitMetadataBuilder ret_var = OfferWithExplicitMetadataBuilder_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKOfferWithExplicitMetadataBuilder arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = OfferWithExplicitMetadataBuilder_clone_ptr(&arg_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Refund_1is_1expired(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKRefund this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Refund_is_expired(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKOfferWithExplicitMetadataBuilder orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKOfferWithExplicitMetadataBuilder ret_var = OfferWithExplicitMetadataBuilder_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKOfferWithDerivedMetadataBuilder this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - OfferWithDerivedMetadataBuilder_free(this_obj_conv); -} - -static inline uint64_t OfferWithDerivedMetadataBuilder_clone_ptr(LDKOfferWithDerivedMetadataBuilder *NONNULL_PTR arg) { - LDKOfferWithDerivedMetadataBuilder ret_var = OfferWithDerivedMetadataBuilder_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKOfferWithDerivedMetadataBuilder arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = OfferWithDerivedMetadataBuilder_clone_ptr(&arg_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Refund_1is_1expired_1no_1std(JNIEnv *env, jclass clz, int64_t this_arg, int64_t duration_since_epoch) { + LDKRefund this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Refund_is_expired_no_std(&this_arg_conv, duration_since_epoch); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKOfferWithDerivedMetadataBuilder orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKOfferWithDerivedMetadataBuilder ret_var = OfferWithDerivedMetadataBuilder_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1new(JNIEnv *env, jclass clz, int8_tArray signing_pubkey) { - LDKPublicKey signing_pubkey_ref; - CHECK((*env)->GetArrayLength(env, signing_pubkey) == 33); - (*env)->GetByteArrayRegion(env, signing_pubkey, 0, 33, signing_pubkey_ref.compressed_form); - LDKOfferWithExplicitMetadataBuilder ret_var = OfferWithExplicitMetadataBuilder_new(signing_pubkey_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1issuer(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKRefund this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKPrintableString ret_var = Refund_issuer(&this_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1metadata(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray metadata) { - LDKOfferWithExplicitMetadataBuilder this_arg_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Refund_1paths(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKRefund this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); - LDKCVec_u8Z metadata_ref; - metadata_ref.datalen = (*env)->GetArrayLength(env, metadata); - metadata_ref.data = MALLOC(metadata_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, metadata, 0, metadata_ref.datalen, metadata_ref.data); - LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); - *ret_conv = OfferWithExplicitMetadataBuilder_metadata(this_arg_conv, metadata_ref); - return tag_ptr(ret_conv, true); + this_arg_conv.is_owned = false; + LDKCVec_BlindedMessagePathZ ret_var = Refund_paths(&this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t u = 0; u < ret_var.datalen; u++) { + LDKBlindedMessagePath ret_conv_20_var = ret_var.data[u]; + int64_t ret_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_20_var); + ret_conv_20_ref = tag_ptr(ret_conv_20_var.inner, ret_conv_20_var.is_owned); + ret_arr_ptr[u] = ret_conv_20_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1chain(JNIEnv *env, jclass clz, int64_t this_arg, jclass network) { - LDKOfferWithExplicitMetadataBuilder this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Refund_1payer_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKRefund this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); - LDKNetwork network_conv = LDKNetwork_from_java(env, network); - OfferWithExplicitMetadataBuilder_chain(this_arg_conv, network_conv); + this_arg_conv.is_owned = false; + LDKu8slice ret_var = Refund_payer_metadata(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg, int64_t amount_msats) { - LDKOfferWithExplicitMetadataBuilder this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Refund_1chain(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKRefund this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); - OfferWithExplicitMetadataBuilder_amount_msats(this_arg_conv, amount_msats); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, Refund_chain(&this_arg_conv).data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg, int64_t absolute_expiry) { - LDKOfferWithExplicitMetadataBuilder this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKRefund this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); - OfferWithExplicitMetadataBuilder_absolute_expiry(this_arg_conv, absolute_expiry); + this_arg_conv.is_owned = false; + int64_t ret_conv = Refund_amount_msats(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1description(JNIEnv *env, jclass clz, int64_t this_arg, jstring description) { - LDKOfferWithExplicitMetadataBuilder this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1features(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKRefund this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); - LDKStr description_conv = java_to_owned_str(env, description); - OfferWithExplicitMetadataBuilder_description(this_arg_conv, description_conv); + this_arg_conv.is_owned = false; + LDKInvoiceRequestFeatures ret_var = Refund_features(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1issuer(JNIEnv *env, jclass clz, int64_t this_arg, jstring issuer) { - LDKOfferWithExplicitMetadataBuilder this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKRefund this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); - LDKStr issuer_conv = java_to_owned_str(env, issuer); - OfferWithExplicitMetadataBuilder_issuer(this_arg_conv, issuer_conv); + this_arg_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = Refund_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1path(JNIEnv *env, jclass clz, int64_t this_arg, int64_t path) { - LDKOfferWithExplicitMetadataBuilder this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Refund_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKRefund this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); - LDKBlindedPath path_conv; - path_conv.inner = untag_ptr(path); - path_conv.is_owned = ptr_is_owned(path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); - path_conv = BlindedPath_clone(&path_conv); - OfferWithExplicitMetadataBuilder_path(this_arg_conv, path_conv); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Refund_payer_id(&this_arg_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1supported_1quantity(JNIEnv *env, jclass clz, int64_t this_arg, int64_t quantity) { - LDKOfferWithExplicitMetadataBuilder this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKRefund this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); - void* quantity_ptr = untag_ptr(quantity); - CHECK_ACCESS(quantity_ptr); - LDKQuantity quantity_conv = *(LDKQuantity*)(quantity_ptr); - quantity_conv = Quantity_clone((LDKQuantity*)untag_ptr(quantity)); - OfferWithExplicitMetadataBuilder_supported_quantity(this_arg_conv, quantity_conv); + this_arg_conv.is_owned = false; + LDKPrintableString ret_var = Refund_payer_note(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1build(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOfferWithExplicitMetadataBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); - LDKCResult_OfferBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferBolt12SemanticErrorZ), "LDKCResult_OfferBolt12SemanticErrorZ"); - *ret_conv = OfferWithExplicitMetadataBuilder_build(this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKRefund o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = Refund_hash(&o_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_RefundDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundDecodeErrorZ), "LDKCResult_RefundDecodeErrorZ"); + *ret_conv = Refund_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1deriving_1signing_1pubkey(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t expanded_key, int64_t entropy_source) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKExpandedKey expanded_key_conv; - expanded_key_conv.inner = untag_ptr(expanded_key); - expanded_key_conv.is_owned = ptr_is_owned(expanded_key); - CHECK_INNER_FIELD_ACCESS_OR_NULL(expanded_key_conv); - expanded_key_conv.is_owned = false; - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - LDKOfferWithDerivedMetadataBuilder ret_var = OfferWithDerivedMetadataBuilder_deriving_signing_pubkey(node_id_ref, &expanded_key_conv, entropy_source_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Refund_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKRefund obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = Refund_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1chain(JNIEnv *env, jclass clz, int64_t this_arg, jclass network) { - LDKOfferWithDerivedMetadataBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); - LDKNetwork network_conv = LDKNetwork_from_java(env, network); - OfferWithDerivedMetadataBuilder_chain(this_arg_conv, network_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1from_1str(JNIEnv *env, jclass clz, jstring s) { + LDKStr s_conv = java_to_owned_str(env, s); + LDKCResult_RefundBolt12ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundBolt12ParseErrorZ), "LDKCResult_RefundBolt12ParseErrorZ"); + *ret_conv = Refund_from_str(s_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg, int64_t amount_msats) { - LDKOfferWithDerivedMetadataBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); - OfferWithDerivedMetadataBuilder_amount_msats(this_arg_conv, amount_msats); +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Refund_1to_1str(JNIEnv *env, jclass clz, int64_t o) { + LDKRefund o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = Refund_to_str(&o_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg, int64_t absolute_expiry) { - LDKOfferWithDerivedMetadataBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); - OfferWithDerivedMetadataBuilder_absolute_expiry(this_arg_conv, absolute_expiry); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_UtxoLookupError_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKUtxoLookupError* orig_conv = (LDKUtxoLookupError*)untag_ptr(orig); + jclass ret_conv = LDKUtxoLookupError_to_java(env, UtxoLookupError_clone(orig_conv)); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1description(JNIEnv *env, jclass clz, int64_t this_arg, jstring description) { - LDKOfferWithDerivedMetadataBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); - LDKStr description_conv = java_to_owned_str(env, description); - OfferWithDerivedMetadataBuilder_description(this_arg_conv, description_conv); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_UtxoLookupError_1unknown_1chain(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKUtxoLookupError_to_java(env, UtxoLookupError_unknown_chain()); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1issuer(JNIEnv *env, jclass clz, int64_t this_arg, jstring issuer) { - LDKOfferWithDerivedMetadataBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); - LDKStr issuer_conv = java_to_owned_str(env, issuer); - OfferWithDerivedMetadataBuilder_issuer(this_arg_conv, issuer_conv); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_UtxoLookupError_1unknown_1tx(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKUtxoLookupError_to_java(env, UtxoLookupError_unknown_tx()); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1path(JNIEnv *env, jclass clz, int64_t this_arg, int64_t path) { - LDKOfferWithDerivedMetadataBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); - LDKBlindedPath path_conv; - path_conv.inner = untag_ptr(path); - path_conv.is_owned = ptr_is_owned(path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); - path_conv = BlindedPath_clone(&path_conv); - OfferWithDerivedMetadataBuilder_path(this_arg_conv, path_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoResult_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKUtxoResult this_ptr_conv = *(LDKUtxoResult*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + UtxoResult_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1supported_1quantity(JNIEnv *env, jclass clz, int64_t this_arg, int64_t quantity) { - LDKOfferWithDerivedMetadataBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); - void* quantity_ptr = untag_ptr(quantity); - CHECK_ACCESS(quantity_ptr); - LDKQuantity quantity_conv = *(LDKQuantity*)(quantity_ptr); - quantity_conv = Quantity_clone((LDKQuantity*)untag_ptr(quantity)); - OfferWithDerivedMetadataBuilder_supported_quantity(this_arg_conv, quantity_conv); +static inline uint64_t UtxoResult_clone_ptr(LDKUtxoResult *NONNULL_PTR arg) { + LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult"); + *ret_copy = UtxoResult_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoResult_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUtxoResult* arg_conv = (LDKUtxoResult*)untag_ptr(arg); + int64_t ret_conv = UtxoResult_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1build(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOfferWithDerivedMetadataBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); - LDKCResult_OfferBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferBolt12SemanticErrorZ), "LDKCResult_OfferBolt12SemanticErrorZ"); - *ret_conv = OfferWithDerivedMetadataBuilder_build(this_arg_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoResult_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKUtxoResult* orig_conv = (LDKUtxoResult*)untag_ptr(orig); + LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult"); + *ret_copy = UtxoResult_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Offer_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKOffer this_obj_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoResult_1sync(JNIEnv *env, jclass clz, int64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKCResult_TxOutUtxoLookupErrorZ a_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(a_ptr); + a_conv = CResult_TxOutUtxoLookupErrorZ_clone((LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(a)); + LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult"); + *ret_copy = UtxoResult_sync(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoResult_1async(JNIEnv *env, jclass clz, int64_t a) { + LDKUtxoFuture a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = UtxoFuture_clone(&a_conv); + LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult"); + *ret_copy = UtxoResult_async(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoLookup_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKUtxoLookup this_ptr_conv = *(LDKUtxoLookup*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + UtxoLookup_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUtxoFuture this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Offer_free(this_obj_conv); + UtxoFuture_free(this_obj_conv); } -static inline uint64_t Offer_clone_ptr(LDKOffer *NONNULL_PTR arg) { - LDKOffer ret_var = Offer_clone(arg); +static inline uint64_t UtxoFuture_clone_ptr(LDKUtxoFuture *NONNULL_PTR arg) { + LDKUtxoFuture ret_var = UtxoFuture_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKOffer arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUtxoFuture arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Offer_clone_ptr(&arg_conv); + int64_t ret_conv = UtxoFuture_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKOffer orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKUtxoFuture orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKOffer ret_var = Offer_clone(&orig_conv); + LDKUtxoFuture ret_var = UtxoFuture_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_Offer_1chains(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOffer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_ThirtyTwoBytesZ ret_var = Offer_chains(&this_arg_conv); - jobjectArray ret_arr = NULL; - ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); - ; - for (size_t i = 0; i < ret_var.datalen; i++) { - int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 32, ret_var.data[i].data); - (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); - } - - FREE(ret_var.data); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1new(JNIEnv *env, jclass clz) { + LDKUtxoFuture ret_var = UtxoFuture_new(); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOffer this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1resolve_1without_1forwarding(JNIEnv *env, jclass clz, int64_t this_arg, int64_t graph, int64_t result) { + LDKUtxoFuture this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = Offer_metadata(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKNetworkGraph graph_conv; + graph_conv.inner = untag_ptr(graph); + graph_conv.is_owned = ptr_is_owned(graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(graph_conv); + graph_conv.is_owned = false; + void* result_ptr = untag_ptr(result); + CHECK_ACCESS(result_ptr); + LDKCResult_TxOutUtxoLookupErrorZ result_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(result_ptr); + result_conv = CResult_TxOutUtxoLookupErrorZ_clone((LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(result)); + UtxoFuture_resolve_without_forwarding(&this_arg_conv, &graph_conv, result_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1amount(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOffer this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1resolve(JNIEnv *env, jclass clz, int64_t this_arg, int64_t graph, int64_t gossip, int64_t result) { + LDKUtxoFuture this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); - *ret_copy = Offer_amount(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKNetworkGraph graph_conv; + graph_conv.inner = untag_ptr(graph); + graph_conv.is_owned = ptr_is_owned(graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(graph_conv); + graph_conv.is_owned = false; + LDKP2PGossipSync gossip_conv; + gossip_conv.inner = untag_ptr(gossip); + gossip_conv.is_owned = ptr_is_owned(gossip); + CHECK_INNER_FIELD_ACCESS_OR_NULL(gossip_conv); + gossip_conv.is_owned = false; + void* result_ptr = untag_ptr(result); + CHECK_ACCESS(result_ptr); + LDKCResult_TxOutUtxoLookupErrorZ result_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(result_ptr); + result_conv = CResult_TxOutUtxoLookupErrorZ_clone((LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(result)); + UtxoFuture_resolve(&this_arg_conv, &graph_conv, &gossip_conv, result_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1description(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOffer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = Offer_description(&this_arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeId_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKNodeId this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + NodeId_free(this_obj_conv); +} + +static inline uint64_t NodeId_clone_ptr(LDKNodeId *NONNULL_PTR arg) { + LDKNodeId ret_var = NodeId_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1offer_1features(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOffer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOfferFeatures ret_var = Offer_offer_features(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOffer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = Offer_absolute_expiry(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNodeId arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = NodeId_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1issuer(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOffer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = Offer_issuer(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKNodeId orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKNodeId ret_var = NodeId_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Offer_1paths(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOffer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_BlindedPathZ ret_var = Offer_paths(&this_arg_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t n = 0; n < ret_var.datalen; n++) { - LDKBlindedPath ret_conv_13_var = ret_var.data[n]; - int64_t ret_conv_13_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_13_var); - ret_conv_13_ref = tag_ptr(ret_conv_13_var.inner, ret_conv_13_var.is_owned); - ret_arr_ptr[n] = ret_conv_13_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1supported_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOffer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); - *ret_copy = Offer_supported_quantity(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Offer_1signing_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOffer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Offer_signing_pubkey(&this_arg_conv).compressed_form); - return ret_arr; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeId_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKNodeId a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKNodeId b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = NodeId_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOffer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOfferId ret_var = Offer_id(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1from_1pubkey(JNIEnv *env, jclass clz, int8_tArray pubkey) { + LDKPublicKey pubkey_ref; + CHECK((*env)->GetArrayLength(env, pubkey) == 33); + (*env)->GetByteArrayRegion(env, pubkey, 0, 33, pubkey_ref.compressed_form); + LDKNodeId ret_var = NodeId_from_pubkey(pubkey_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1supports_1chain(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray chain) { - LDKOffer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKThirtyTwoBytes chain_ref; - CHECK((*env)->GetArrayLength(env, chain) == 32); - (*env)->GetByteArrayRegion(env, chain, 0, 32, chain_ref.data); - jboolean ret_conv = Offer_supports_chain(&this_arg_conv, chain_ref); - return ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1is_1expired(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOffer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = Offer_is_expired(&this_arg_conv); - return ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1is_1expired_1no_1std(JNIEnv *env, jclass clz, int64_t this_arg, int64_t duration_since_epoch) { - LDKOffer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = Offer_is_expired_no_std(&this_arg_conv, duration_since_epoch); - return ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1is_1valid_1quantity(JNIEnv *env, jclass clz, int64_t this_arg, int64_t quantity) { - LDKOffer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = Offer_is_valid_quantity(&this_arg_conv, quantity); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1from_1slice(JNIEnv *env, jclass clz, int8_tArray bytes) { + LDKu8slice bytes_ref; + bytes_ref.datalen = (*env)->GetArrayLength(env, bytes); + bytes_ref.data = (*env)->GetByteArrayElements (env, bytes, NULL); + LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); + *ret_conv = NodeId_from_slice(bytes_ref); + (*env)->ReleaseByteArrayElements(env, bytes, (int8_t*)bytes_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1expects_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOffer this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeId_1as_1slice(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeId this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = Offer_expects_quantity(&this_arg_conv); - return ret_conv; + LDKu8slice ret_var = NodeId_as_slice(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1request_1invoice_1deriving_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg, int64_t expanded_key, int64_t entropy_source, int8_tArray payment_id) { - LDKOffer this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeId_1as_1array(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeId this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKExpandedKey expanded_key_conv; - expanded_key_conv.inner = untag_ptr(expanded_key); - expanded_key_conv.is_owned = ptr_is_owned(expanded_key); - CHECK_INNER_FIELD_ACCESS_OR_NULL(expanded_key_conv); - expanded_key_conv.is_owned = false; - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - LDKThirtyTwoBytes payment_id_ref; - CHECK((*env)->GetArrayLength(env, payment_id) == 32); - (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); - LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ"); - *ret_conv = Offer_request_invoice_deriving_payer_id(&this_arg_conv, &expanded_key_conv, entropy_source_conv, payment_id_ref); - return tag_ptr(ret_conv, true); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, *NodeId_as_array(&this_arg_conv)); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1request_1invoice_1deriving_1metadata(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payer_id, int64_t expanded_key, int64_t entropy_source, int8_tArray payment_id) { - LDKOffer this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1as_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeId this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKPublicKey payer_id_ref; - CHECK((*env)->GetArrayLength(env, payer_id) == 33); - (*env)->GetByteArrayRegion(env, payer_id, 0, 33, payer_id_ref.compressed_form); - LDKExpandedKey expanded_key_conv; - expanded_key_conv.inner = untag_ptr(expanded_key); - expanded_key_conv.is_owned = ptr_is_owned(expanded_key); - CHECK_INNER_FIELD_ACCESS_OR_NULL(expanded_key_conv); - expanded_key_conv.is_owned = false; - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - LDKThirtyTwoBytes payment_id_ref; - CHECK((*env)->GetArrayLength(env, payment_id) == 32); - (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); - LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ"); - *ret_conv = Offer_request_invoice_deriving_metadata(&this_arg_conv, payer_id_ref, &expanded_key_conv, entropy_source_conv, payment_id_ref); + LDKCResult_PublicKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecp256k1ErrorZ), "LDKCResult_PublicKeySecp256k1ErrorZ"); + *ret_conv = NodeId_as_pubkey(&this_arg_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1request_1invoice(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray metadata, int8_tArray payer_id) { - LDKOffer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_u8Z metadata_ref; - metadata_ref.datalen = (*env)->GetArrayLength(env, metadata); - metadata_ref.data = MALLOC(metadata_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, metadata, 0, metadata_ref.datalen, metadata_ref.data); - LDKPublicKey payer_id_ref; - CHECK((*env)->GetArrayLength(env, payer_id) == 33); - (*env)->GetByteArrayRegion(env, payer_id, 0, 33, payer_id_ref.compressed_form); - LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ"); - *ret_conv = Offer_request_invoice(&this_arg_conv, metadata_ref, payer_id_ref); - return tag_ptr(ret_conv, true); +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_NodeId_1to_1str(JNIEnv *env, jclass clz, int64_t o) { + LDKNodeId o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = NodeId_to_str(&o_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKOffer o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKNodeId o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv.is_owned = false; - int64_t ret_conv = Offer_hash(&o_conv); + int64_t ret_conv = NodeId_hash(&o_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Offer_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKOffer obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeId_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKNodeId obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = Offer_write(&obj_conv); + LDKCVec_u8Z ret_var = NodeId_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Amount_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKAmount this_ptr_conv = *(LDKAmount*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Amount_free(this_ptr_conv); -} - -static inline uint64_t Amount_clone_ptr(LDKAmount *NONNULL_PTR arg) { - LDKAmount *ret_copy = MALLOC(sizeof(LDKAmount), "LDKAmount"); - *ret_copy = Amount_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Amount_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKAmount* arg_conv = (LDKAmount*)untag_ptr(arg); - int64_t ret_conv = Amount_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Amount_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKAmount* orig_conv = (LDKAmount*)untag_ptr(orig); - LDKAmount *ret_copy = MALLOC(sizeof(LDKAmount), "LDKAmount"); - *ret_copy = Amount_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); + *ret_conv = NodeId_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Amount_1bitcoin(JNIEnv *env, jclass clz, int64_t amount_msats) { - LDKAmount *ret_copy = MALLOC(sizeof(LDKAmount), "LDKAmount"); - *ret_copy = Amount_bitcoin(amount_msats); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKNetworkGraph this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + NetworkGraph_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Amount_1currency(JNIEnv *env, jclass clz, int8_tArray iso4217_code, int64_t amount) { - LDKThreeBytes iso4217_code_ref; - CHECK((*env)->GetArrayLength(env, iso4217_code) == 3); - (*env)->GetByteArrayRegion(env, iso4217_code, 0, 3, iso4217_code_ref.data); - LDKAmount *ret_copy = MALLOC(sizeof(LDKAmount), "LDKAmount"); - *ret_copy = Amount_currency(iso4217_code_ref, amount); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKReadOnlyNetworkGraph this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ReadOnlyNetworkGraph_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Quantity_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); CHECK_ACCESS(this_ptr_ptr); - LDKQuantity this_ptr_conv = *(LDKQuantity*)(this_ptr_ptr); + LDKNetworkUpdate this_ptr_conv = *(LDKNetworkUpdate*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - Quantity_free(this_ptr_conv); + NetworkUpdate_free(this_ptr_conv); } -static inline uint64_t Quantity_clone_ptr(LDKQuantity *NONNULL_PTR arg) { - LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); - *ret_copy = Quantity_clone(arg); +static inline uint64_t NetworkUpdate_clone_ptr(LDKNetworkUpdate *NONNULL_PTR arg) { + LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); + *ret_copy = NetworkUpdate_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Quantity_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKQuantity* arg_conv = (LDKQuantity*)untag_ptr(arg); - int64_t ret_conv = Quantity_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNetworkUpdate* arg_conv = (LDKNetworkUpdate*)untag_ptr(arg); + int64_t ret_conv = NetworkUpdate_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Quantity_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKQuantity* orig_conv = (LDKQuantity*)untag_ptr(orig); - LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); - *ret_copy = Quantity_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKNetworkUpdate* orig_conv = (LDKNetworkUpdate*)untag_ptr(orig); + LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); + *ret_copy = NetworkUpdate_clone(orig_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Quantity_1bounded(JNIEnv *env, jclass clz, int64_t a) { - LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); - *ret_copy = Quantity_bounded(a); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1channel_1failure(JNIEnv *env, jclass clz, int64_t short_channel_id, jboolean is_permanent) { + LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); + *ret_copy = NetworkUpdate_channel_failure(short_channel_id, is_permanent); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Quantity_1unbounded(JNIEnv *env, jclass clz) { - LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); - *ret_copy = Quantity_unbounded(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1node_1failure(JNIEnv *env, jclass clz, int8_tArray node_id, jboolean is_permanent) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); + *ret_copy = NetworkUpdate_node_failure(node_id_ref, is_permanent); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Quantity_1one(JNIEnv *env, jclass clz) { - LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); - *ret_copy = Quantity_one(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKNetworkUpdate* a_conv = (LDKNetworkUpdate*)untag_ptr(a); + LDKNetworkUpdate* b_conv = (LDKNetworkUpdate*)untag_ptr(b); + jboolean ret_conv = NetworkUpdate_eq(a_conv, b_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1from_1str(JNIEnv *env, jclass clz, jstring s) { - LDKStr s_conv = java_to_owned_str(env, s); - LDKCResult_OfferBolt12ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferBolt12ParseErrorZ), "LDKCResult_OfferBolt12ParseErrorZ"); - *ret_conv = Offer_from_str(s_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKNetworkUpdate* obj_conv = (LDKNetworkUpdate*)untag_ptr(obj); + LDKCVec_u8Z ret_var = NetworkUpdate_write(obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Offer_1to_1str(JNIEnv *env, jclass clz, int64_t o) { - LDKOffer o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = Offer_to_str(&o_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = NetworkUpdate_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKInvoiceWithExplicitSigningPubkeyBuilder this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKP2PGossipSync this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InvoiceWithExplicitSigningPubkeyBuilder_free(this_obj_conv); + P2PGossipSync_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKInvoiceWithDerivedSigningPubkeyBuilder this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InvoiceWithDerivedSigningPubkeyBuilder_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1new(JNIEnv *env, jclass clz, int64_t network_graph, int64_t utxo_lookup, int64_t logger) { + LDKNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; + void* utxo_lookup_ptr = untag_ptr(utxo_lookup); + CHECK_ACCESS(utxo_lookup_ptr); + LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr); + // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ + if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) { + // Manually implement clone for Java trait instances + if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some); + } + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKP2PGossipSync ret_var = P2PGossipSync_new(&network_graph_conv, utxo_lookup_conv, logger_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1build(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1add_1utxo_1lookup(JNIEnv *env, jclass clz, int64_t this_arg, int64_t utxo_lookup) { + LDKP2PGossipSync this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder - - LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ), "LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ"); - *ret_conv = InvoiceWithExplicitSigningPubkeyBuilder_build(this_arg_conv); - return tag_ptr(ret_conv, true); + this_arg_conv.is_owned = false; + void* utxo_lookup_ptr = untag_ptr(utxo_lookup); + CHECK_ACCESS(utxo_lookup_ptr); + LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr); + // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ + if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) { + // Manually implement clone for Java trait instances + if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some); + } + } + P2PGossipSync_add_utxo_lookup(&this_arg_conv, utxo_lookup_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1relative_1expiry(JNIEnv *env, jclass clz, int64_t this_arg, int32_t relative_expiry_secs) { - LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1handle_1network_1update(JNIEnv *env, jclass clz, int64_t this_arg, int64_t network_update) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder - - InvoiceWithExplicitSigningPubkeyBuilder_relative_expiry(this_arg_conv, relative_expiry_secs); + this_arg_conv.is_owned = false; + LDKNetworkUpdate* network_update_conv = (LDKNetworkUpdate*)untag_ptr(network_update); + NetworkGraph_handle_network_update(&this_arg_conv, network_update_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1fallback_1v0_1p2wsh(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray script_hash) { - LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder - - uint8_t script_hash_arr[32]; - CHECK((*env)->GetArrayLength(env, script_hash) == 32); - (*env)->GetByteArrayRegion(env, script_hash, 0, 32, script_hash_arr); - uint8_t (*script_hash_ref)[32] = &script_hash_arr; - InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wsh(this_arg_conv, script_hash_ref); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, NetworkGraph_get_chain_hash(&this_arg_conv).data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1fallback_1v0_1p2wpkh(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray pubkey_hash) { - LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_verify_1node_1announcement(JNIEnv *env, jclass clz, int64_t msg) { + LDKNodeAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = verify_node_announcement(&msg_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_verify_1channel_1announcement(JNIEnv *env, jclass clz, int64_t msg) { + LDKChannelAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = verify_channel_announcement(&msg_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1as_1RoutingMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKP2PGossipSync this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder - - uint8_t pubkey_hash_arr[20]; - CHECK((*env)->GetArrayLength(env, pubkey_hash) == 20); - (*env)->GetByteArrayRegion(env, pubkey_hash, 0, 20, pubkey_hash_arr); - uint8_t (*pubkey_hash_ref)[20] = &pubkey_hash_arr; - InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wpkh(this_arg_conv, pubkey_hash_ref); + this_arg_conv.is_owned = false; + LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler"); + *ret_ret = P2PGossipSync_as_RoutingMessageHandler(&this_arg_conv); + return tag_ptr(ret_ret, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1fallback_1v1_1p2tr_1tweaked(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray utput_key) { - LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKP2PGossipSync this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder - - LDKTweakedPublicKey utput_key_ref; - CHECK((*env)->GetArrayLength(env, utput_key) == 32); - (*env)->GetByteArrayRegion(env, utput_key, 0, 32, utput_key_ref.x_coordinate); - InvoiceWithExplicitSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(this_arg_conv, utput_key_ref); + this_arg_conv.is_owned = false; + LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); + *ret_ret = P2PGossipSync_as_MessageSendEventsProvider(&this_arg_conv); + return tag_ptr(ret_ret, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1allow_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder - - InvoiceWithExplicitSigningPubkeyBuilder_allow_mpp(this_arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelUpdateInfo this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelUpdateInfo_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1build_1and_1sign(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder - - LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ), "LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ"); - *ret_conv = InvoiceWithDerivedSigningPubkeyBuilder_build_and_sign(this_arg_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ChannelUpdateInfo_get_htlc_minimum_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1relative_1expiry(JNIEnv *env, jclass clz, int64_t this_arg, int32_t relative_expiry_secs) { - LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder - - InvoiceWithDerivedSigningPubkeyBuilder_relative_expiry(this_arg_conv, relative_expiry_secs); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelUpdateInfo_set_htlc_minimum_msat(&this_ptr_conv, val); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1fallback_1v0_1p2wsh(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray script_hash) { - LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder - - uint8_t script_hash_arr[32]; - CHECK((*env)->GetArrayLength(env, script_hash) == 32); - (*env)->GetByteArrayRegion(env, script_hash, 0, 32, script_hash_arr); - uint8_t (*script_hash_ref)[32] = &script_hash_arr; - InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wsh(this_arg_conv, script_hash_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ChannelUpdateInfo_get_htlc_maximum_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1fallback_1v0_1p2wpkh(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray pubkey_hash) { - LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder - - uint8_t pubkey_hash_arr[20]; - CHECK((*env)->GetArrayLength(env, pubkey_hash) == 20); - (*env)->GetByteArrayRegion(env, pubkey_hash, 0, 20, pubkey_hash_arr); - uint8_t (*pubkey_hash_ref)[20] = &pubkey_hash_arr; - InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wpkh(this_arg_conv, pubkey_hash_ref); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelUpdateInfo_set_htlc_maximum_msat(&this_ptr_conv, val); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1fallback_1v1_1p2tr_1tweaked(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray utput_key) { - LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder - - LDKTweakedPublicKey utput_key_ref; - CHECK((*env)->GetArrayLength(env, utput_key) == 32); - (*env)->GetByteArrayRegion(env, utput_key, 0, 32, utput_key_ref.x_coordinate); - InvoiceWithDerivedSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(this_arg_conv, utput_key_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1fees(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKRoutingFees ret_var = ChannelUpdateInfo_get_fees(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1allow_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder - - InvoiceWithDerivedSigningPubkeyBuilder_allow_mpp(this_arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1fees(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKRoutingFees val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = RoutingFees_clone(&val_conv); + ChannelUpdateInfo_set_fees(&this_ptr_conv, val_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKUnsignedBolt12Invoice this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - UnsignedBolt12Invoice_free(this_obj_conv); +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1last_1update(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = ChannelUpdateInfo_get_last_update(&this_ptr_conv); + return ret_conv; } -static inline uint64_t UnsignedBolt12Invoice_clone_ptr(LDKUnsignedBolt12Invoice *NONNULL_PTR arg) { - LDKUnsignedBolt12Invoice ret_var = UnsignedBolt12Invoice_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1last_1update(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelUpdateInfo_set_last_update(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKUnsignedBolt12Invoice arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = UnsignedBolt12Invoice_clone_ptr(&arg_conv); + +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int16_t ret_conv = ChannelUpdateInfo_get_cltv_expiry_delta(&this_ptr_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKUnsignedBolt12Invoice orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKUnsignedBolt12Invoice ret_var = UnsignedBolt12Invoice_clone(&orig_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelUpdateInfo_set_cltv_expiry_delta(&this_ptr_conv, val); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1enabled(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + jboolean ret_conv = ChannelUpdateInfo_get_enabled(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1enabled(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelUpdateInfo_set_enabled(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1last_1update_1message(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelUpdate ret_var = ChannelUpdateInfo_get_last_update_message(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignBolt12InvoiceFn_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKSignBolt12InvoiceFn this_ptr_conv = *(LDKSignBolt12InvoiceFn*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - SignBolt12InvoiceFn_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1last_1update_1message(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelUpdateInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelUpdate val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelUpdate_clone(&val_conv); + ChannelUpdateInfo_set_last_update_message(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1tagged_1hash(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKTaggedHash ret_var = UnsignedBolt12Invoice_tagged_hash(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1new(JNIEnv *env, jclass clz, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg, int64_t fees_arg, int32_t last_update_arg, int16_t cltv_expiry_delta_arg, jboolean enabled_arg, int64_t last_update_message_arg) { + LDKRoutingFees fees_arg_conv; + fees_arg_conv.inner = untag_ptr(fees_arg); + fees_arg_conv.is_owned = ptr_is_owned(fees_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv); + fees_arg_conv = RoutingFees_clone(&fees_arg_conv); + LDKChannelUpdate last_update_message_arg_conv; + last_update_message_arg_conv.inner = untag_ptr(last_update_message_arg); + last_update_message_arg_conv.is_owned = ptr_is_owned(last_update_message_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(last_update_message_arg_conv); + last_update_message_arg_conv = ChannelUpdate_clone(&last_update_message_arg_conv); + LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_new(htlc_minimum_msat_arg, htlc_maximum_msat_arg, fees_arg_conv, last_update_arg, cltv_expiry_delta_arg, enabled_arg, last_update_message_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKBolt12Invoice this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Bolt12Invoice_free(this_obj_conv); -} - -static inline uint64_t Bolt12Invoice_clone_ptr(LDKBolt12Invoice *NONNULL_PTR arg) { - LDKBolt12Invoice ret_var = Bolt12Invoice_clone(arg); +static inline uint64_t ChannelUpdateInfo_clone_ptr(LDKChannelUpdateInfo *NONNULL_PTR arg) { + LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKBolt12Invoice arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelUpdateInfo arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Bolt12Invoice_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelUpdateInfo_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBolt12Invoice orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelUpdateInfo orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBolt12Invoice ret_var = Bolt12Invoice_clone(&orig_conv); + LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1offer_1chains(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_CVec_ThirtyTwoBytesZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_ThirtyTwoBytesZZ), "LDKCOption_CVec_ThirtyTwoBytesZZ"); - *ret_copy = UnsignedBolt12Invoice_offer_chains(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKChannelUpdateInfo a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKChannelUpdateInfo b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ChannelUpdateInfo_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1chain(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, UnsignedBolt12Invoice_chain(&this_arg_conv).data); +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1to_1str(JNIEnv *env, jclass clz, int64_t o) { + LDKChannelUpdateInfo o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = ChannelUpdateInfo_to_str(&o_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelUpdateInfo obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ChannelUpdateInfo_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = UnsignedBolt12Invoice_metadata(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ"); + *ret_conv = ChannelUpdateInfo_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1amount(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); - *ret_copy = UnsignedBolt12Invoice_amount(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelInfo this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelInfo_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1offer_1features(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOfferFeatures ret_var = UnsignedBolt12Invoice_offer_features(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelFeatures ret_var = ChannelInfo_get_features(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1description(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = UnsignedBolt12Invoice_description(&this_arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelFeatures val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelFeatures_clone(&val_conv); + ChannelInfo_set_features(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1one(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKNodeId ret_var = ChannelInfo_get_node_one(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = UnsignedBolt12Invoice_absolute_expiry(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1one(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKNodeId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = NodeId_clone(&val_conv); + ChannelInfo_set_node_one(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1issuer(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = UnsignedBolt12Invoice_issuer(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1two(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKNodeId ret_var = ChannelInfo_get_node_two(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1message_1paths(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_BlindedPathZ ret_var = UnsignedBolt12Invoice_message_paths(&this_arg_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t n = 0; n < ret_var.datalen; n++) { - LDKBlindedPath ret_conv_13_var = ret_var.data[n]; - int64_t ret_conv_13_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_13_var); - ret_conv_13_ref = tag_ptr(ret_conv_13_var.inner, ret_conv_13_var.is_owned); - ret_arr_ptr[n] = ret_conv_13_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1two(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKNodeId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = NodeId_clone(&val_conv); + ChannelInfo_set_node_two(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1supported_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_QuantityZ *ret_copy = MALLOC(sizeof(LDKCOption_QuantityZ), "LDKCOption_QuantityZ"); - *ret_copy = UnsignedBolt12Invoice_supported_quantity(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1capacity_1sats(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelInfo_get_capacity_sats(&this_ptr_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1payer_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKu8slice ret_var = UnsignedBolt12Invoice_payer_metadata(&this_arg_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - return ret_arr; -} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1capacity_1sats(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + ChannelInfo_set_capacity_sats(&this_ptr_conv, val_conv); +} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1invoice_1request_1features(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKInvoiceRequestFeatures ret_var = UnsignedBolt12Invoice_invoice_request_features(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1one_1to_1two(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelUpdateInfo ret_var = ChannelInfo_get_one_to_two(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = UnsignedBolt12Invoice_quantity(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1one_1to_1two(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelUpdateInfo val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelUpdateInfo_clone(&val_conv); + ChannelInfo_set_one_to_two(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1two_1to_1one(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelUpdateInfo ret_var = ChannelInfo_get_two_to_one(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedBolt12Invoice_payer_id(&this_arg_conv).compressed_form); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1two_1to_1one(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelUpdateInfo val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelUpdateInfo_clone(&val_conv); + ChannelInfo_set_two_to_one(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = UnsignedBolt12Invoice_payer_note(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1announcement_1message(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelAnnouncement ret_var = ChannelInfo_get_announcement_message(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1created_1at(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = UnsignedBolt12Invoice_created_at(&this_arg_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1announcement_1message(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelAnnouncement val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelAnnouncement_clone(&val_conv); + ChannelInfo_set_announcement_message(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1relative_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = UnsignedBolt12Invoice_relative_expiry(&this_arg_conv); - return ret_conv; +static inline uint64_t ChannelInfo_clone_ptr(LDKChannelInfo *NONNULL_PTR arg) { + LDKChannelInfo ret_var = ChannelInfo_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1is_1expired(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = UnsignedBolt12Invoice_is_expired(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelInfo arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = ChannelInfo_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, UnsignedBolt12Invoice_payment_hash(&this_arg_conv).data); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelInfo orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKChannelInfo ret_var = ChannelInfo_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = UnsignedBolt12Invoice_amount_msats(&this_arg_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKChannelInfo a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKChannelInfo b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ChannelInfo_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1invoice_1features(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1directional_1info(JNIEnv *env, jclass clz, int64_t this_arg, int8_t channel_flags) { + LDKChannelInfo this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKBolt12InvoiceFeatures ret_var = UnsignedBolt12Invoice_invoice_features(&this_arg_conv); + LDKChannelUpdateInfo ret_var = ChannelInfo_get_directional_info(&this_arg_conv, channel_flags); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1signing_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedBolt12Invoice_signing_pubkey(&this_arg_conv).compressed_form); - return ret_arr; +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1to_1str(JNIEnv *env, jclass clz, int64_t o) { + LDKChannelInfo o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = ChannelInfo_to_str(&o_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1offer_1chains(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_CVec_ThirtyTwoBytesZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_ThirtyTwoBytesZZ), "LDKCOption_CVec_ThirtyTwoBytesZZ"); - *ret_copy = Bolt12Invoice_offer_chains(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelInfo obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ChannelInfo_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1chain(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, Bolt12Invoice_chain(&this_arg_conv).data); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); + *ret_conv = ChannelInfo_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = Bolt12Invoice_metadata(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKDirectedChannelInfo this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + DirectedChannelInfo_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1amount(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); - *ret_copy = Bolt12Invoice_amount(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +static inline uint64_t DirectedChannelInfo_clone_ptr(LDKDirectedChannelInfo *NONNULL_PTR arg) { + LDKDirectedChannelInfo ret_var = DirectedChannelInfo_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKDirectedChannelInfo arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = DirectedChannelInfo_clone_ptr(&arg_conv); + return ret_conv; +} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1offer_1features(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOfferFeatures ret_var = Bolt12Invoice_offer_features(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKDirectedChannelInfo orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKDirectedChannelInfo ret_var = DirectedChannelInfo_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1description(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1channel(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKDirectedChannelInfo this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKPrintableString ret_var = Bolt12Invoice_description(&this_arg_conv); + LDKChannelInfo ret_var = DirectedChannelInfo_channel(&this_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1effective_1capacity(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKDirectedChannelInfo this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = Bolt12Invoice_absolute_expiry(&this_arg_conv); + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = DirectedChannelInfo_effective_capacity(&this_arg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1issuer(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1source(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKDirectedChannelInfo this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKPrintableString ret_var = Bolt12Invoice_issuer(&this_arg_conv); + LDKNodeId ret_var = DirectedChannelInfo_source(&this_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1message_1paths(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1target(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKDirectedChannelInfo this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_BlindedPathZ ret_var = Bolt12Invoice_message_paths(&this_arg_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t n = 0; n < ret_var.datalen; n++) { - LDKBlindedPath ret_conv_13_var = ret_var.data[n]; - int64_t ret_conv_13_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_13_var); - ret_conv_13_ref = tag_ptr(ret_conv_13_var.inner, ret_conv_13_var.is_owned); - ret_arr_ptr[n] = ret_conv_13_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; + LDKNodeId ret_var = DirectedChannelInfo_target(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1supported_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_QuantityZ *ret_copy = MALLOC(sizeof(LDKCOption_QuantityZ), "LDKCOption_QuantityZ"); - *ret_copy = Bolt12Invoice_supported_quantity(&this_arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKEffectiveCapacity this_ptr_conv = *(LDKEffectiveCapacity*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + EffectiveCapacity_free(this_ptr_conv); +} + +static inline uint64_t EffectiveCapacity_clone_ptr(LDKEffectiveCapacity *NONNULL_PTR arg) { + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKEffectiveCapacity* arg_conv = (LDKEffectiveCapacity*)untag_ptr(arg); + int64_t ret_conv = EffectiveCapacity_clone_ptr(arg_conv); + return ret_conv; +} -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1payer_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKu8slice ret_var = Bolt12Invoice_payer_metadata(&this_arg_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKEffectiveCapacity* orig_conv = (LDKEffectiveCapacity*)untag_ptr(orig); + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1invoice_1request_1features(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKInvoiceRequestFeatures ret_var = Bolt12Invoice_invoice_request_features(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1exact_1liquidity(JNIEnv *env, jclass clz, int64_t liquidity_msat) { + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_exact_liquidity(liquidity_msat); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = Bolt12Invoice_quantity(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1advertised_1max_1htlc(JNIEnv *env, jclass clz, int64_t amount_msat) { + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_advertised_max_htlc(amount_msat); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Bolt12Invoice_payer_id(&this_arg_conv).compressed_form); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1total(JNIEnv *env, jclass clz, int64_t capacity_msat, int64_t htlc_maximum_msat) { + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_total(capacity_msat, htlc_maximum_msat); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = Bolt12Invoice_payer_note(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1infinite(JNIEnv *env, jclass clz) { + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_infinite(); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1created_1at(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = Bolt12Invoice_created_at(&this_arg_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1hint_1max_1htlc(JNIEnv *env, jclass clz, int64_t amount_msat) { + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_hint_max_htlc(amount_msat); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1relative_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = Bolt12Invoice_relative_expiry(&this_arg_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1unknown(JNIEnv *env, jclass clz) { + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_unknown(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1is_1expired(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = Bolt12Invoice_is_expired(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1as_1msat(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKEffectiveCapacity* this_arg_conv = (LDKEffectiveCapacity*)untag_ptr(this_arg); + int64_t ret_conv = EffectiveCapacity_as_msat(this_arg_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, Bolt12Invoice_payment_hash(&this_arg_conv).data); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RoutingFees_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKRoutingFees obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = RoutingFees_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = Bolt12Invoice_amount_msats(&this_arg_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); + *ret_conv = RoutingFees_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1invoice_1features(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKBolt12InvoiceFeatures ret_var = Bolt12Invoice_invoice_features(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1signing_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Bolt12Invoice_signing_pubkey(&this_arg_conv).compressed_form); - return ret_arr; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1signature(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, Bolt12Invoice_signature(&this_arg_conv).compact_form); - return ret_arr; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1signable_1hash(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, Bolt12Invoice_signable_hash(&this_arg_conv).data); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1verify(JNIEnv *env, jclass clz, int64_t this_arg, int64_t key) { - LDKBolt12Invoice this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKExpandedKey key_conv; - key_conv.inner = untag_ptr(key); - key_conv.is_owned = ptr_is_owned(key); - CHECK_INNER_FIELD_ACCESS_OR_NULL(key_conv); - key_conv.is_owned = false; - LDKCResult_ThirtyTwoBytesNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesNoneZ), "LDKCResult_ThirtyTwoBytesNoneZ"); - *ret_conv = Bolt12Invoice_verify(&this_arg_conv, &key_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKBolt12Invoice o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = Bolt12Invoice_hash(&o_conv); - return ret_conv; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKUnsignedBolt12Invoice obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = UnsignedBolt12Invoice_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKBolt12Invoice obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = Bolt12Invoice_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKBlindedPayInfo this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKNodeAnnouncementDetails this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BlindedPayInfo_free(this_obj_conv); -} - -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBlindedPayInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int32_t ret_conv = BlindedPayInfo_get_fee_base_msat(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKBlindedPayInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - BlindedPayInfo_set_fee_base_msat(&this_ptr_conv, val); + NodeAnnouncementDetails_free(this_obj_conv); } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBlindedPayInfo this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int32_t ret_conv = BlindedPayInfo_get_fee_proportional_millionths(&this_ptr_conv); - return ret_conv; + LDKNodeFeatures ret_var = NodeAnnouncementDetails_get_features(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKBlindedPayInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - BlindedPayInfo_set_fee_proportional_millionths(&this_ptr_conv, val); + LDKNodeFeatures val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = NodeFeatures_clone(&val_conv); + NodeAnnouncementDetails_set_features(&this_ptr_conv, val_conv); } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBlindedPayInfo this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1get_1last_1update(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int16_t ret_conv = BlindedPayInfo_get_cltv_expiry_delta(&this_ptr_conv); + int32_t ret_conv = NodeAnnouncementDetails_get_last_update(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKBlindedPayInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1set_1last_1update(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - BlindedPayInfo_set_cltv_expiry_delta(&this_ptr_conv, val); + NodeAnnouncementDetails_set_last_update(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBlindedPayInfo this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1get_1rgb(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = BlindedPayInfo_get_htlc_minimum_msat(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 3); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 3, *NodeAnnouncementDetails_get_rgb(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKBlindedPayInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1set_1rgb(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - BlindedPayInfo_set_htlc_minimum_msat(&this_ptr_conv, val); + LDKThreeBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 3); + (*env)->GetByteArrayRegion(env, val, 0, 3, val_ref.data); + NodeAnnouncementDetails_set_rgb(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBlindedPayInfo this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1get_1alias(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = BlindedPayInfo_get_htlc_maximum_msat(&this_ptr_conv); - return ret_conv; + LDKNodeAlias ret_var = NodeAnnouncementDetails_get_alias(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKBlindedPayInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1set_1alias(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - BlindedPayInfo_set_htlc_maximum_msat(&this_ptr_conv, val); + LDKNodeAlias val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = NodeAlias_clone(&val_conv); + NodeAnnouncementDetails_set_alias(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBlindedPayInfo this_ptr_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1get_1addresses(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKBlindedHopFeatures ret_var = BlindedPayInfo_get_features(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + LDKCVec_SocketAddressZ ret_var = NodeAnnouncementDetails_get_addresses(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t p = 0; p < ret_var.datalen; p++) { + LDKSocketAddress *ret_conv_15_copy = MALLOC(sizeof(LDKSocketAddress), "LDKSocketAddress"); + *ret_conv_15_copy = ret_var.data[p]; + int64_t ret_conv_15_ref = tag_ptr(ret_conv_15_copy, true); + ret_arr_ptr[p] = ret_conv_15_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKBlindedPayInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1set_1addresses(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { + LDKNodeAnnouncementDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKBlindedHopFeatures val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = BlindedHopFeatures_clone(&val_conv); - BlindedPayInfo_set_features(&this_ptr_conv, val_conv); + LDKCVec_SocketAddressZ val_constr; + val_constr.datalen = (*env)->GetArrayLength(env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSocketAddress), "LDKCVec_SocketAddressZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); + for (size_t p = 0; p < val_constr.datalen; p++) { + int64_t val_conv_15 = val_vals[p]; + void* val_conv_15_ptr = untag_ptr(val_conv_15); + CHECK_ACCESS(val_conv_15_ptr); + LDKSocketAddress val_conv_15_conv = *(LDKSocketAddress*)(val_conv_15_ptr); + val_conv_15_conv = SocketAddress_clone((LDKSocketAddress*)untag_ptr(val_conv_15)); + val_constr.data[p] = val_conv_15_conv; + } + (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); + NodeAnnouncementDetails_set_addresses(&this_ptr_conv, val_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1new(JNIEnv *env, jclass clz, int32_t fee_base_msat_arg, int32_t fee_proportional_millionths_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg, int64_t features_arg) { - LDKBlindedHopFeatures features_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1new(JNIEnv *env, jclass clz, int64_t features_arg, int32_t last_update_arg, int8_tArray rgb_arg, int64_t alias_arg, int64_tArray addresses_arg) { + LDKNodeFeatures features_arg_conv; features_arg_conv.inner = untag_ptr(features_arg); features_arg_conv.is_owned = ptr_is_owned(features_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); - features_arg_conv = BlindedHopFeatures_clone(&features_arg_conv); - LDKBlindedPayInfo ret_var = BlindedPayInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, features_arg_conv); + features_arg_conv = NodeFeatures_clone(&features_arg_conv); + LDKThreeBytes rgb_arg_ref; + CHECK((*env)->GetArrayLength(env, rgb_arg) == 3); + (*env)->GetByteArrayRegion(env, rgb_arg, 0, 3, rgb_arg_ref.data); + LDKNodeAlias alias_arg_conv; + alias_arg_conv.inner = untag_ptr(alias_arg); + alias_arg_conv.is_owned = ptr_is_owned(alias_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(alias_arg_conv); + alias_arg_conv = NodeAlias_clone(&alias_arg_conv); + LDKCVec_SocketAddressZ addresses_arg_constr; + addresses_arg_constr.datalen = (*env)->GetArrayLength(env, addresses_arg); + if (addresses_arg_constr.datalen > 0) + addresses_arg_constr.data = MALLOC(addresses_arg_constr.datalen * sizeof(LDKSocketAddress), "LDKCVec_SocketAddressZ Elements"); + else + addresses_arg_constr.data = NULL; + int64_t* addresses_arg_vals = (*env)->GetLongArrayElements (env, addresses_arg, NULL); + for (size_t p = 0; p < addresses_arg_constr.datalen; p++) { + int64_t addresses_arg_conv_15 = addresses_arg_vals[p]; + void* addresses_arg_conv_15_ptr = untag_ptr(addresses_arg_conv_15); + CHECK_ACCESS(addresses_arg_conv_15_ptr); + LDKSocketAddress addresses_arg_conv_15_conv = *(LDKSocketAddress*)(addresses_arg_conv_15_ptr); + addresses_arg_conv_15_conv = SocketAddress_clone((LDKSocketAddress*)untag_ptr(addresses_arg_conv_15)); + addresses_arg_constr.data[p] = addresses_arg_conv_15_conv; + } + (*env)->ReleaseLongArrayElements(env, addresses_arg, addresses_arg_vals, 0); + LDKNodeAnnouncementDetails ret_var = NodeAnnouncementDetails_new(features_arg_conv, last_update_arg, rgb_arg_ref, alias_arg_conv, addresses_arg_constr); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t BlindedPayInfo_clone_ptr(LDKBlindedPayInfo *NONNULL_PTR arg) { - LDKBlindedPayInfo ret_var = BlindedPayInfo_clone(arg); +static inline uint64_t NodeAnnouncementDetails_clone_ptr(LDKNodeAnnouncementDetails *NONNULL_PTR arg) { + LDKNodeAnnouncementDetails ret_var = NodeAnnouncementDetails_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKBlindedPayInfo arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNodeAnnouncementDetails arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = BlindedPayInfo_clone_ptr(&arg_conv); + int64_t ret_conv = NodeAnnouncementDetails_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBlindedPayInfo orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKNodeAnnouncementDetails orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBlindedPayInfo ret_var = BlindedPayInfo_clone(&orig_conv); + LDKNodeAnnouncementDetails ret_var = NodeAnnouncementDetails_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKBlindedPayInfo o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = BlindedPayInfo_hash(&o_conv); - return ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKBlindedPayInfo a_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKNodeAnnouncementDetails a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKBlindedPayInfo b_conv; + LDKNodeAnnouncementDetails b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = BlindedPayInfo_eq(&a_conv, &b_conv); + jboolean ret_conv = NodeAnnouncementDetails_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKBlindedPayInfo obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = BlindedPayInfo_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKNodeAnnouncementInfo this_ptr_conv = *(LDKNodeAnnouncementInfo*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + NodeAnnouncementInfo_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); - *ret_conv = BlindedPayInfo_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +static inline uint64_t NodeAnnouncementInfo_clone_ptr(LDKNodeAnnouncementInfo *NONNULL_PTR arg) { + LDKNodeAnnouncementInfo *ret_copy = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo"); + *ret_copy = NodeAnnouncementInfo_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceError_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKInvoiceError this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InvoiceError_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNodeAnnouncementInfo* arg_conv = (LDKNodeAnnouncementInfo*)untag_ptr(arg); + int64_t ret_conv = NodeAnnouncementInfo_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceError_1get_1erroneous_1field(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInvoiceError this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKErroneousField ret_var = InvoiceError_get_erroneous_field(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKNodeAnnouncementInfo* orig_conv = (LDKNodeAnnouncementInfo*)untag_ptr(orig); + LDKNodeAnnouncementInfo *ret_copy = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo"); + *ret_copy = NodeAnnouncementInfo_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceError_1set_1erroneous_1field(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKInvoiceError this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKErroneousField val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ErroneousField_clone(&val_conv); - InvoiceError_set_erroneous_field(&this_ptr_conv, val_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1relayed(JNIEnv *env, jclass clz, int64_t a) { + LDKNodeAnnouncement a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = NodeAnnouncement_clone(&a_conv); + LDKNodeAnnouncementInfo *ret_copy = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo"); + *ret_copy = NodeAnnouncementInfo_relayed(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceError_1get_1message(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInvoiceError this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKUntrustedString ret_var = InvoiceError_get_message(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1local(JNIEnv *env, jclass clz, int64_t a) { + LDKNodeAnnouncementDetails a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = NodeAnnouncementDetails_clone(&a_conv); + LDKNodeAnnouncementInfo *ret_copy = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo"); + *ret_copy = NodeAnnouncementInfo_local(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceError_1set_1message(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKInvoiceError this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKUntrustedString val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = UntrustedString_clone(&val_conv); - InvoiceError_set_message(&this_ptr_conv, val_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKNodeAnnouncementInfo* a_conv = (LDKNodeAnnouncementInfo*)untag_ptr(a); + LDKNodeAnnouncementInfo* b_conv = (LDKNodeAnnouncementInfo*)untag_ptr(b); + jboolean ret_conv = NodeAnnouncementInfo_eq(a_conv, b_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceError_1new(JNIEnv *env, jclass clz, int64_t erroneous_field_arg, int64_t message_arg) { - LDKErroneousField erroneous_field_arg_conv; - erroneous_field_arg_conv.inner = untag_ptr(erroneous_field_arg); - erroneous_field_arg_conv.is_owned = ptr_is_owned(erroneous_field_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(erroneous_field_arg_conv); - erroneous_field_arg_conv = ErroneousField_clone(&erroneous_field_arg_conv); - LDKUntrustedString message_arg_conv; - message_arg_conv.inner = untag_ptr(message_arg); - message_arg_conv.is_owned = ptr_is_owned(message_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(message_arg_conv); - message_arg_conv = UntrustedString_clone(&message_arg_conv); - LDKInvoiceError ret_var = InvoiceError_new(erroneous_field_arg_conv, message_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1features(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeAnnouncementInfo* this_arg_conv = (LDKNodeAnnouncementInfo*)untag_ptr(this_arg); + LDKNodeFeatures ret_var = NodeAnnouncementInfo_features(this_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t InvoiceError_clone_ptr(LDKInvoiceError *NONNULL_PTR arg) { - LDKInvoiceError ret_var = InvoiceError_clone(arg); +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1last_1update(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeAnnouncementInfo* this_arg_conv = (LDKNodeAnnouncementInfo*)untag_ptr(this_arg); + int32_t ret_conv = NodeAnnouncementInfo_last_update(this_arg_conv); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1rgb(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeAnnouncementInfo* this_arg_conv = (LDKNodeAnnouncementInfo*)untag_ptr(this_arg); + int8_tArray ret_arr = (*env)->NewByteArray(env, 3); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 3, NodeAnnouncementInfo_rgb(this_arg_conv).data); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1alias(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeAnnouncementInfo* this_arg_conv = (LDKNodeAnnouncementInfo*)untag_ptr(this_arg); + LDKNodeAlias ret_var = NodeAnnouncementInfo_alias(this_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKInvoiceError arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = InvoiceError_clone_ptr(&arg_conv); - return ret_conv; + +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1addresses(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeAnnouncementInfo* this_arg_conv = (LDKNodeAnnouncementInfo*)untag_ptr(this_arg); + LDKCVec_SocketAddressZ ret_var = NodeAnnouncementInfo_addresses(this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t p = 0; p < ret_var.datalen; p++) { + LDKSocketAddress *ret_conv_15_copy = MALLOC(sizeof(LDKSocketAddress), "LDKSocketAddress"); + *ret_conv_15_copy = ret_var.data[p]; + int64_t ret_conv_15_ref = tag_ptr(ret_conv_15_copy, true); + ret_arr_ptr[p] = ret_conv_15_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceError_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKInvoiceError orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKInvoiceError ret_var = InvoiceError_clone(&orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1announcement_1message(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeAnnouncementInfo* this_arg_conv = (LDKNodeAnnouncementInfo*)untag_ptr(this_arg); + LDKNodeAnnouncement ret_var = NodeAnnouncementInfo_announcement_message(this_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErroneousField_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKErroneousField this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ErroneousField_free(this_obj_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKNodeAnnouncementInfo* obj_conv = (LDKNodeAnnouncementInfo*)untag_ptr(obj); + LDKCVec_u8Z ret_var = NodeAnnouncementInfo_write(obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroneousField_1get_1tlv_1fieldnum(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKErroneousField this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = ErroneousField_get_tlv_fieldnum(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); + *ret_conv = NodeAnnouncementInfo_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErroneousField_1set_1tlv_1fieldnum(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKErroneousField this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ErroneousField_set_tlv_fieldnum(&this_ptr_conv, val); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAlias_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKNodeAlias this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + NodeAlias_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroneousField_1get_1suggested_1value(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKErroneousField this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAlias_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKNodeAlias this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = ErroneousField_get_suggested_value(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *NodeAlias_get_a(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErroneousField_1set_1suggested_1value(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKErroneousField this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAlias_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKNodeAlias this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_CVec_u8ZZ val_conv = *(LDKCOption_CVec_u8ZZ*)(val_ptr); - val_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(val)); - ErroneousField_set_suggested_value(&this_ptr_conv, val_conv); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + NodeAlias_set_a(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroneousField_1new(JNIEnv *env, jclass clz, int64_t tlv_fieldnum_arg, int64_t suggested_value_arg) { - void* suggested_value_arg_ptr = untag_ptr(suggested_value_arg); - CHECK_ACCESS(suggested_value_arg_ptr); - LDKCOption_CVec_u8ZZ suggested_value_arg_conv = *(LDKCOption_CVec_u8ZZ*)(suggested_value_arg_ptr); - suggested_value_arg_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(suggested_value_arg)); - LDKErroneousField ret_var = ErroneousField_new(tlv_fieldnum_arg, suggested_value_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAlias_1new(JNIEnv *env, jclass clz, int8_tArray a_arg) { + LDKThirtyTwoBytes a_arg_ref; + CHECK((*env)->GetArrayLength(env, a_arg) == 32); + (*env)->GetByteArrayRegion(env, a_arg, 0, 32, a_arg_ref.data); + LDKNodeAlias ret_var = NodeAlias_new(a_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t ErroneousField_clone_ptr(LDKErroneousField *NONNULL_PTR arg) { - LDKErroneousField ret_var = ErroneousField_clone(arg); +static inline uint64_t NodeAlias_clone_ptr(LDKNodeAlias *NONNULL_PTR arg) { + LDKNodeAlias ret_var = NodeAlias_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroneousField_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKErroneousField arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAlias_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNodeAlias arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = ErroneousField_clone_ptr(&arg_conv); + int64_t ret_conv = NodeAlias_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroneousField_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKErroneousField orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAlias_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKNodeAlias orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKErroneousField ret_var = ErroneousField_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceError_1from_1string(JNIEnv *env, jclass clz, jstring s) { - LDKStr s_conv = java_to_owned_str(env, s); - LDKInvoiceError ret_var = InvoiceError_from_string(s_conv); + LDKNodeAlias ret_var = NodeAlias_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_InvoiceError_1to_1str(JNIEnv *env, jclass clz, int64_t o) { - LDKInvoiceError o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAlias_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKNodeAlias o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv.is_owned = false; - LDKStr ret_str = InvoiceError_to_str(&o_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); + int64_t ret_conv = NodeAlias_hash(&o_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceError_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKInvoiceError obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = InvoiceError_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeAlias_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKNodeAlias a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKNodeAlias b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = NodeAlias_eq(&a_conv, &b_conv); + return ret_conv; +} + +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_NodeAlias_1to_1str(JNIEnv *env, jclass clz, int64_t o) { + LDKNodeAlias o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = NodeAlias_to_str(&o_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAlias_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKNodeAlias obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = NodeAlias_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceError_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAlias_1read(JNIEnv *env, jclass clz, int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); - *ret_conv = InvoiceError_read(ser_ref); + LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ"); + *ret_conv = NodeAlias_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKInvoiceRequestWithExplicitPayerIdBuilder this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InvoiceRequestWithExplicitPayerIdBuilder_free(this_obj_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKInvoiceRequestWithDerivedPayerIdBuilder this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InvoiceRequestWithDerivedPayerIdBuilder_free(this_obj_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1build(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithExplicitPayerIdBuilder - - LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ), "LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ"); - *ret_conv = InvoiceRequestWithExplicitPayerIdBuilder_build(this_arg_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1chain(JNIEnv *env, jclass clz, int64_t this_arg, jclass network) { - LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithExplicitPayerIdBuilder - - LDKNetwork network_conv = LDKNetwork_from_java(env, network); - LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); - *ret_conv = InvoiceRequestWithExplicitPayerIdBuilder_chain(this_arg_conv, network_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg, int64_t amount_msats) { - LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithExplicitPayerIdBuilder - - LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); - *ret_conv = InvoiceRequestWithExplicitPayerIdBuilder_amount_msats(this_arg_conv, amount_msats); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1quantity(JNIEnv *env, jclass clz, int64_t this_arg, int64_t quantity) { - LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithExplicitPayerIdBuilder - - LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); - *ret_conv = InvoiceRequestWithExplicitPayerIdBuilder_quantity(this_arg_conv, quantity); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg, jstring payer_note) { - LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithExplicitPayerIdBuilder - - LDKStr payer_note_conv = java_to_owned_str(env, payer_note); - InvoiceRequestWithExplicitPayerIdBuilder_payer_note(this_arg_conv, payer_note_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1build_1and_1sign(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerIdBuilder - - LDKCResult_InvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestBolt12SemanticErrorZ"); - *ret_conv = InvoiceRequestWithDerivedPayerIdBuilder_build_and_sign(this_arg_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1chain(JNIEnv *env, jclass clz, int64_t this_arg, jclass network) { - LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerIdBuilder - - LDKNetwork network_conv = LDKNetwork_from_java(env, network); - LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); - *ret_conv = InvoiceRequestWithDerivedPayerIdBuilder_chain(this_arg_conv, network_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg, int64_t amount_msats) { - LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerIdBuilder - - LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); - *ret_conv = InvoiceRequestWithDerivedPayerIdBuilder_amount_msats(this_arg_conv, amount_msats); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1quantity(JNIEnv *env, jclass clz, int64_t this_arg, int64_t quantity) { - LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerIdBuilder - - LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); - *ret_conv = InvoiceRequestWithDerivedPayerIdBuilder_quantity(this_arg_conv, quantity); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg, jstring payer_note) { - LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerIdBuilder - - LDKStr payer_note_conv = java_to_owned_str(env, payer_note); - InvoiceRequestWithDerivedPayerIdBuilder_payer_note(this_arg_conv, payer_note_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKUnsignedInvoiceRequest this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - UnsignedInvoiceRequest_free(this_obj_conv); -} - -static inline uint64_t UnsignedInvoiceRequest_clone_ptr(LDKUnsignedInvoiceRequest *NONNULL_PTR arg) { - LDKUnsignedInvoiceRequest ret_var = UnsignedInvoiceRequest_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKUnsignedInvoiceRequest arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = UnsignedInvoiceRequest_clone_ptr(&arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKUnsignedInvoiceRequest orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKUnsignedInvoiceRequest ret_var = UnsignedInvoiceRequest_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignInvoiceRequestFn_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKSignInvoiceRequestFn this_ptr_conv = *(LDKSignInvoiceRequestFn*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - SignInvoiceRequestFn_free(this_ptr_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1tagged_1hash(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKTaggedHash ret_var = UnsignedInvoiceRequest_tagged_hash(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKInvoiceRequest this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InvoiceRequest_free(this_obj_conv); -} - -static inline uint64_t InvoiceRequest_clone_ptr(LDKInvoiceRequest *NONNULL_PTR arg) { - LDKInvoiceRequest ret_var = InvoiceRequest_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKInvoiceRequest arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = InvoiceRequest_clone_ptr(&arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKInvoiceRequest orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKInvoiceRequest ret_var = InvoiceRequest_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKVerifiedInvoiceRequest this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKNodeInfo this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - VerifiedInvoiceRequest_free(this_obj_conv); + NodeInfo_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1get_1offer_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKVerifiedInvoiceRequest this_ptr_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKOfferId ret_var = VerifiedInvoiceRequest_get_offer_id(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + LDKCVec_u64Z ret_var = NodeInfo_get_channels(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1set_1offer_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKVerifiedInvoiceRequest this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { + LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKOfferId val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = OfferId_clone(&val_conv); - VerifiedInvoiceRequest_set_offer_id(&this_ptr_conv, val_conv); + LDKCVec_u64Z val_constr; + val_constr.datalen = (*env)->GetArrayLength(env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); + for (size_t g = 0; g < val_constr.datalen; g++) { + int64_t val_conv_6 = val_vals[g]; + val_constr.data[g] = val_conv_6; + } + (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); + NodeInfo_set_channels(&this_ptr_conv, val_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1get_1keys(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKVerifiedInvoiceRequest this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1announcement_1info(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_SecretKeyZ *ret_copy = MALLOC(sizeof(LDKCOption_SecretKeyZ), "LDKCOption_SecretKeyZ"); - *ret_copy = VerifiedInvoiceRequest_get_keys(&this_ptr_conv); + LDKCOption_NodeAnnouncementInfoZ *ret_copy = MALLOC(sizeof(LDKCOption_NodeAnnouncementInfoZ), "LDKCOption_NodeAnnouncementInfoZ"); + *ret_copy = NodeInfo_get_announcement_info(&this_ptr_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1set_1keys(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKVerifiedInvoiceRequest this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1announcement_1info(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; void* val_ptr = untag_ptr(val); CHECK_ACCESS(val_ptr); - LDKCOption_SecretKeyZ val_conv = *(LDKCOption_SecretKeyZ*)(val_ptr); - val_conv = COption_SecretKeyZ_clone((LDKCOption_SecretKeyZ*)untag_ptr(val)); - VerifiedInvoiceRequest_set_keys(&this_ptr_conv, val_conv); + LDKCOption_NodeAnnouncementInfoZ val_conv = *(LDKCOption_NodeAnnouncementInfoZ*)(val_ptr); + val_conv = COption_NodeAnnouncementInfoZ_clone((LDKCOption_NodeAnnouncementInfoZ*)untag_ptr(val)); + NodeInfo_set_announcement_info(&this_ptr_conv, val_conv); } -static inline uint64_t VerifiedInvoiceRequest_clone_ptr(LDKVerifiedInvoiceRequest *NONNULL_PTR arg) { - LDKVerifiedInvoiceRequest ret_var = VerifiedInvoiceRequest_clone(arg); +static inline uint64_t NodeInfo_clone_ptr(LDKNodeInfo *NONNULL_PTR arg) { + LDKNodeInfo ret_var = NodeInfo_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKVerifiedInvoiceRequest arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNodeInfo arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = VerifiedInvoiceRequest_clone_ptr(&arg_conv); + int64_t ret_conv = NodeInfo_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKVerifiedInvoiceRequest orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKNodeInfo orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKVerifiedInvoiceRequest ret_var = VerifiedInvoiceRequest_clone(&orig_conv); + LDKNodeInfo ret_var = NodeInfo_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1chains(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKNodeInfo a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKNodeInfo b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = NodeInfo_eq(&a_conv, &b_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeInfo_1is_1tor_1only(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeInfo this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_ThirtyTwoBytesZ ret_var = UnsignedInvoiceRequest_chains(&this_arg_conv); - jobjectArray ret_arr = NULL; - ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); - ; - for (size_t i = 0; i < ret_var.datalen; i++) { - int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 32, ret_var.data[i].data); - (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); - } - - FREE(ret_var.data); + jboolean ret_conv = NodeInfo_is_tor_only(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_NodeInfo_1to_1str(JNIEnv *env, jclass clz, int64_t o) { + LDKNodeInfo o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = NodeInfo_to_str(&o_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeInfo_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKNodeInfo obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = NodeInfo_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = UnsignedInvoiceRequest_metadata(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); + *ret_conv = NodeInfo_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1amount(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); - *ret_copy = UnsignedInvoiceRequest_amount(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKNetworkGraph obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = NetworkGraph_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1description(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = UnsignedInvoiceRequest_description(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + void* arg_ptr = untag_ptr(arg); + CHECK_ACCESS(arg_ptr); + LDKLogger arg_conv = *(LDKLogger*)(arg_ptr); + if (arg_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&arg_conv); + } + LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); + *ret_conv = NetworkGraph_read(ser_ref, arg_conv); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1to_1str(JNIEnv *env, jclass clz, int64_t o) { + LDKNetworkGraph o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = NetworkGraph_to_str(&o_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1new(JNIEnv *env, jclass clz, jclass network, int64_t logger) { + LDKNetwork network_conv = LDKNetwork_from_java(env, network); + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKNetworkGraph ret_var = NetworkGraph_new(network_conv, logger_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1offer_1features(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read_1only(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKOfferFeatures ret_var = UnsignedInvoiceRequest_offer_features(&this_arg_conv); + LDKReadOnlyNetworkGraph ret_var = NetworkGraph_read_only(&this_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1get_1last_1rapid_1gossip_1sync_1timestamp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = UnsignedInvoiceRequest_absolute_expiry(&this_arg_conv); + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = NetworkGraph_get_last_rapid_gossip_sync_timestamp(&this_arg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1issuer(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1set_1last_1rapid_1gossip_1sync_1timestamp(JNIEnv *env, jclass clz, int64_t this_arg, int32_t last_rapid_gossip_sync_timestamp) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKPrintableString ret_var = UnsignedInvoiceRequest_issuer(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + NetworkGraph_set_last_rapid_gossip_sync_timestamp(&this_arg_conv, last_rapid_gossip_sync_timestamp); } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1paths(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_BlindedPathZ ret_var = UnsignedInvoiceRequest_paths(&this_arg_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t n = 0; n < ret_var.datalen; n++) { - LDKBlindedPath ret_conv_13_var = ret_var.data[n]; - int64_t ret_conv_13_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_13_var); - ret_conv_13_ref = tag_ptr(ret_conv_13_var.inner, ret_conv_13_var.is_owned); - ret_arr_ptr[n] = ret_conv_13_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1supported_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1node_1from_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); - *ret_copy = UnsignedInvoiceRequest_supported_quantity(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKNodeAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_node_from_announcement(&this_arg_conv, &msg_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1signing_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1node_1from_1unsigned_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedInvoiceRequest_signing_pubkey(&this_arg_conv).compressed_form); - return ret_arr; + LDKUnsignedNodeAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_node_from_unsigned_announcement(&this_arg_conv, &msg_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1payer_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel_1from_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg, int64_t utxo_lookup) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKu8slice ret_var = UnsignedInvoiceRequest_payer_metadata(&this_arg_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - return ret_arr; + LDKChannelAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + void* utxo_lookup_ptr = untag_ptr(utxo_lookup); + CHECK_ACCESS(utxo_lookup_ptr); + LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr); + // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ + if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) { + // Manually implement clone for Java trait instances + if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some); + } + } + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_channel_from_announcement(&this_arg_conv, &msg_conv, utxo_lookup_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1chain(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel_1from_1announcement_1no_1lookup(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, UnsignedInvoiceRequest_chain(&this_arg_conv).data); - return ret_arr; + LDKChannelAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_channel_from_announcement_no_lookup(&this_arg_conv, &msg_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel_1from_1unsigned_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg, int64_t utxo_lookup) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = UnsignedInvoiceRequest_amount_msats(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKUnsignedChannelAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + void* utxo_lookup_ptr = untag_ptr(utxo_lookup); + CHECK_ACCESS(utxo_lookup_ptr); + LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr); + // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ + if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) { + // Manually implement clone for Java trait instances + if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some); + } + } + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_channel_from_unsigned_announcement(&this_arg_conv, &msg_conv, utxo_lookup_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1invoice_1request_1features(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1add_1channel_1from_1partial_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t short_channel_id, int64_t timestamp, int64_t features, int8_tArray node_id_1, int8_tArray node_id_2) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKInvoiceRequestFeatures ret_var = UnsignedInvoiceRequest_invoice_request_features(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + LDKChannelFeatures features_conv; + features_conv.inner = untag_ptr(features); + features_conv.is_owned = ptr_is_owned(features); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); + features_conv = ChannelFeatures_clone(&features_conv); + LDKPublicKey node_id_1_ref; + CHECK((*env)->GetArrayLength(env, node_id_1) == 33); + (*env)->GetByteArrayRegion(env, node_id_1, 0, 33, node_id_1_ref.compressed_form); + LDKPublicKey node_id_2_ref; + CHECK((*env)->GetArrayLength(env, node_id_2) == 33); + (*env)->GetByteArrayRegion(env, node_id_2, 0, 33, node_id_2_ref.compressed_form); + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_add_channel_from_partial_announcement(&this_arg_conv, short_channel_id, timestamp, features_conv, node_id_1_ref, node_id_2_ref); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1channel_1failed_1permanent(JNIEnv *env, jclass clz, int64_t this_arg, int64_t short_channel_id) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = UnsignedInvoiceRequest_quantity(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + NetworkGraph_channel_failed_permanent(&this_arg_conv, short_channel_id); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1node_1failed_1permanent(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray node_id) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedInvoiceRequest_payer_id(&this_arg_conv).compressed_form); - return ret_arr; + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + NetworkGraph_node_failed_permanent(&this_arg_conv, node_id_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKUnsignedInvoiceRequest this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1remove_1stale_1channels_1and_1tracking(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKPrintableString ret_var = UnsignedInvoiceRequest_payer_note(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + NetworkGraph_remove_stale_channels_and_tracking(&this_arg_conv); } -JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1chains(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1remove_1stale_1channels_1and_1tracking_1with_1time(JNIEnv *env, jclass clz, int64_t this_arg, int64_t current_time_unix) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_ThirtyTwoBytesZ ret_var = InvoiceRequest_chains(&this_arg_conv); - jobjectArray ret_arr = NULL; - ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); - ; - for (size_t i = 0; i < ret_var.datalen; i++) { - int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 32, ret_var.data[i].data); - (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); - } - - FREE(ret_var.data); - return ret_arr; + NetworkGraph_remove_stale_channels_and_tracking_with_time(&this_arg_conv, current_time_unix); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = InvoiceRequest_metadata(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKChannelUpdate msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_channel(&this_arg_conv, &msg_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1amount(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel_1unsigned(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); - *ret_copy = InvoiceRequest_amount(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKUnsignedChannelUpdate msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_channel_unsigned(&this_arg_conv, &msg_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1description(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1verify_1channel_1update(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { + LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKPrintableString ret_var = InvoiceRequest_description(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + LDKChannelUpdate msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_verify_channel_update(&this_arg_conv, &msg_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1offer_1features(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t short_channel_id) { + LDKReadOnlyNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKOfferFeatures ret_var = InvoiceRequest_offer_features(&this_arg_conv); + LDKChannelInfo ret_var = ReadOnlyNetworkGraph_channel(&this_arg_conv, short_channel_id); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1list_1channels(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKReadOnlyNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = InvoiceRequest_absolute_expiry(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKCVec_u64Z ret_var = ReadOnlyNetworkGraph_list_channels(&this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1issuer(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1node(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_id) { + LDKReadOnlyNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKPrintableString ret_var = InvoiceRequest_issuer(&this_arg_conv); + LDKNodeId node_id_conv; + node_id_conv.inner = untag_ptr(node_id); + node_id_conv.is_owned = ptr_is_owned(node_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); + node_id_conv.is_owned = false; + LDKNodeInfo ret_var = ReadOnlyNetworkGraph_node(&this_arg_conv, &node_id_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1paths(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1list_1nodes(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKReadOnlyNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_BlindedPathZ ret_var = InvoiceRequest_paths(&this_arg_conv); + LDKCVec_NodeIdZ ret_var = ReadOnlyNetworkGraph_list_nodes(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t n = 0; n < ret_var.datalen; n++) { - LDKBlindedPath ret_conv_13_var = ret_var.data[n]; - int64_t ret_conv_13_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_13_var); - ret_conv_13_ref = tag_ptr(ret_conv_13_var.inner, ret_conv_13_var.is_owned); - ret_arr_ptr[n] = ret_conv_13_ref; + for (size_t i = 0; i < ret_var.datalen; i++) { + LDKNodeId ret_conv_8_var = ret_var.data[i]; + int64_t ret_conv_8_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_8_var); + ret_conv_8_ref = tag_ptr(ret_conv_8_var.inner, ret_conv_8_var.is_owned); + ret_arr_ptr[i] = ret_conv_8_ref; } (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); FREE(ret_var.data); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1supported_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1get_1addresses(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray pubkey) { + LDKReadOnlyNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); - *ret_copy = InvoiceRequest_supported_quantity(&this_arg_conv); + LDKPublicKey pubkey_ref; + CHECK((*env)->GetArrayLength(env, pubkey) == 33); + (*env)->GetByteArrayRegion(env, pubkey, 0, 33, pubkey_ref.compressed_form); + LDKCOption_CVec_SocketAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_SocketAddressZZ), "LDKCOption_CVec_SocketAddressZZ"); + *ret_copy = ReadOnlyNetworkGraph_get_addresses(&this_arg_conv, pubkey_ref); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1signing_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, InvoiceRequest_signing_pubkey(&this_arg_conv).compressed_form); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKDefaultRouter this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + DefaultRouter_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1payer_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKu8slice ret_var = InvoiceRequest_payer_metadata(&this_arg_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1new(JNIEnv *env, jclass clz, int64_t network_graph, int64_t logger, int64_t entropy_source, int64_t scorer, int64_t score_params) { + LDKNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + void* scorer_ptr = untag_ptr(scorer); + CHECK_ACCESS(scorer_ptr); + LDKLockableScore scorer_conv = *(LDKLockableScore*)(scorer_ptr); + if (scorer_conv.free == LDKLockableScore_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLockableScore_JCalls_cloned(&scorer_conv); + } + LDKProbabilisticScoringFeeParameters score_params_conv; + score_params_conv.inner = untag_ptr(score_params); + score_params_conv.is_owned = ptr_is_owned(score_params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(score_params_conv); + score_params_conv = ProbabilisticScoringFeeParameters_clone(&score_params_conv); + LDKDefaultRouter ret_var = DefaultRouter_new(&network_graph_conv, logger_conv, entropy_source_conv, scorer_conv, score_params_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1chain(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1as_1Router(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKDefaultRouter this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, InvoiceRequest_chain(&this_arg_conv).data); - return ret_arr; + LDKRouter* ret_ret = MALLOC(sizeof(LDKRouter), "LDKRouter"); + *ret_ret = DefaultRouter_as_Router(&this_arg_conv); + return tag_ptr(ret_ret, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1as_1MessageRouter(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKDefaultRouter this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = InvoiceRequest_amount_msats(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKMessageRouter* ret_ret = MALLOC(sizeof(LDKMessageRouter), "LDKMessageRouter"); + *ret_ret = DefaultRouter_as_MessageRouter(&this_arg_conv); + return tag_ptr(ret_ret, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1invoice_1request_1features(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKInvoiceRequestFeatures ret_var = InvoiceRequest_invoice_request_features(&this_arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Router_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKRouter this_ptr_conv = *(LDKRouter*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Router_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKScorerAccountingForInFlightHtlcs this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ScorerAccountingForInFlightHtlcs_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1new(JNIEnv *env, jclass clz, int64_t scorer, int64_t inflight_htlcs) { + void* scorer_ptr = untag_ptr(scorer); + CHECK_ACCESS(scorer_ptr); + LDKScoreLookUp scorer_conv = *(LDKScoreLookUp*)(scorer_ptr); + if (scorer_conv.free == LDKScoreLookUp_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKScoreLookUp_JCalls_cloned(&scorer_conv); + } + LDKInFlightHtlcs inflight_htlcs_conv; + inflight_htlcs_conv.inner = untag_ptr(inflight_htlcs); + inflight_htlcs_conv.is_owned = ptr_is_owned(inflight_htlcs); + CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_conv); + inflight_htlcs_conv.is_owned = false; + LDKScorerAccountingForInFlightHtlcs ret_var = ScorerAccountingForInFlightHtlcs_new(scorer_conv, &inflight_htlcs_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1as_1ScoreLookUp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKScorerAccountingForInFlightHtlcs this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = InvoiceRequest_quantity(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); + LDKScoreLookUp* ret_ret = MALLOC(sizeof(LDKScoreLookUp), "LDKScoreLookUp"); + *ret_ret = ScorerAccountingForInFlightHtlcs_as_ScoreLookUp(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInFlightHtlcs this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InFlightHtlcs_free(this_obj_conv); +} + +static inline uint64_t InFlightHtlcs_clone_ptr(LDKInFlightHtlcs *NONNULL_PTR arg) { + LDKInFlightHtlcs ret_var = InFlightHtlcs_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInFlightHtlcs arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = InFlightHtlcs_clone_ptr(&arg_conv); + return ret_conv; +} -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, InvoiceRequest_payer_id(&this_arg_conv).compressed_form); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKInFlightHtlcs orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKInFlightHtlcs ret_var = InFlightHtlcs_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = InvoiceRequest_payer_note(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1new(JNIEnv *env, jclass clz) { + LDKInFlightHtlcs ret_var = InFlightHtlcs_new(); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1respond_1with(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash) { - LDKInvoiceRequest this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1process_1path(JNIEnv *env, jclass clz, int64_t this_arg, int64_t path, int8_tArray payer_node_id) { + LDKInFlightHtlcs this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths_constr; - payment_paths_constr.datalen = (*env)->GetArrayLength(env, payment_paths); - if (payment_paths_constr.datalen > 0) - payment_paths_constr.data = MALLOC(payment_paths_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); - else - payment_paths_constr.data = NULL; - int64_t* payment_paths_vals = (*env)->GetLongArrayElements (env, payment_paths, NULL); - for (size_t l = 0; l < payment_paths_constr.datalen; l++) { - int64_t payment_paths_conv_37 = payment_paths_vals[l]; - void* payment_paths_conv_37_ptr = untag_ptr(payment_paths_conv_37); - CHECK_ACCESS(payment_paths_conv_37_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ payment_paths_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(payment_paths_conv_37_ptr); - payment_paths_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(payment_paths_conv_37)); - payment_paths_constr.data[l] = payment_paths_conv_37_conv; - } - (*env)->ReleaseLongArrayElements(env, payment_paths, payment_paths_vals, 0); - LDKThirtyTwoBytes payment_hash_ref; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ"); - *ret_conv = InvoiceRequest_respond_with(&this_arg_conv, payment_paths_constr, payment_hash_ref); - return tag_ptr(ret_conv, true); + LDKPath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv.is_owned = false; + LDKPublicKey payer_node_id_ref; + CHECK((*env)->GetArrayLength(env, payer_node_id) == 33); + (*env)->GetByteArrayRegion(env, payer_node_id, 0, 33, payer_node_id_ref.compressed_form); + InFlightHtlcs_process_path(&this_arg_conv, &path_conv, payer_node_id_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1respond_1with_1no_1std(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash, int64_t created_at) { - LDKInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths_constr; - payment_paths_constr.datalen = (*env)->GetArrayLength(env, payment_paths); - if (payment_paths_constr.datalen > 0) - payment_paths_constr.data = MALLOC(payment_paths_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); - else - payment_paths_constr.data = NULL; - int64_t* payment_paths_vals = (*env)->GetLongArrayElements (env, payment_paths, NULL); - for (size_t l = 0; l < payment_paths_constr.datalen; l++) { - int64_t payment_paths_conv_37 = payment_paths_vals[l]; - void* payment_paths_conv_37_ptr = untag_ptr(payment_paths_conv_37); - CHECK_ACCESS(payment_paths_conv_37_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ payment_paths_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(payment_paths_conv_37_ptr); - payment_paths_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(payment_paths_conv_37)); - payment_paths_constr.data[l] = payment_paths_conv_37_conv; - } - (*env)->ReleaseLongArrayElements(env, payment_paths, payment_paths_vals, 0); - LDKThirtyTwoBytes payment_hash_ref; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ"); - *ret_conv = InvoiceRequest_respond_with_no_std(&this_arg_conv, payment_paths_constr, payment_hash_ref, created_at); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1verify(JNIEnv *env, jclass clz, int64_t this_arg, int64_t key) { - LDKInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = InvoiceRequest_clone(&this_arg_conv); - LDKExpandedKey key_conv; - key_conv.inner = untag_ptr(key); - key_conv.is_owned = ptr_is_owned(key); - CHECK_INNER_FIELD_ACCESS_OR_NULL(key_conv); - key_conv.is_owned = false; - LDKCResult_VerifiedInvoiceRequestNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_VerifiedInvoiceRequestNoneZ), "LDKCResult_VerifiedInvoiceRequestNoneZ"); - *ret_conv = InvoiceRequest_verify(this_arg_conv, &key_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1signature(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, InvoiceRequest_signature(&this_arg_conv).compact_form); - return ret_arr; -} - -JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1chains(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_ThirtyTwoBytesZ ret_var = VerifiedInvoiceRequest_chains(&this_arg_conv); - jobjectArray ret_arr = NULL; - ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); - ; - for (size_t i = 0; i < ret_var.datalen; i++) { - int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 32, ret_var.data[i].data); - (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); - } - - FREE(ret_var.data); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = VerifiedInvoiceRequest_metadata(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1amount(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); - *ret_copy = VerifiedInvoiceRequest_amount(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1description(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = VerifiedInvoiceRequest_description(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1offer_1features(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOfferFeatures ret_var = VerifiedInvoiceRequest_offer_features(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = VerifiedInvoiceRequest_absolute_expiry(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1issuer(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = VerifiedInvoiceRequest_issuer(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1paths(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_BlindedPathZ ret_var = VerifiedInvoiceRequest_paths(&this_arg_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t n = 0; n < ret_var.datalen; n++) { - LDKBlindedPath ret_conv_13_var = ret_var.data[n]; - int64_t ret_conv_13_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_13_var); - ret_conv_13_ref = tag_ptr(ret_conv_13_var.inner, ret_conv_13_var.is_owned); - ret_arr_ptr[n] = ret_conv_13_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1supported_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); - *ret_copy = VerifiedInvoiceRequest_supported_quantity(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1signing_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, VerifiedInvoiceRequest_signing_pubkey(&this_arg_conv).compressed_form); - return ret_arr; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1payer_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKu8slice ret_var = VerifiedInvoiceRequest_payer_metadata(&this_arg_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - return ret_arr; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1chain(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, VerifiedInvoiceRequest_chain(&this_arg_conv).data); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = VerifiedInvoiceRequest_amount_msats(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1invoice_1request_1features(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKVerifiedInvoiceRequest this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1add_1inflight_1htlc(JNIEnv *env, jclass clz, int64_t this_arg, int64_t source, int64_t target, int64_t channel_scid, int64_t used_msat) { + LDKInFlightHtlcs this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKInvoiceRequestFeatures ret_var = VerifiedInvoiceRequest_invoice_request_features(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + LDKNodeId source_conv; + source_conv.inner = untag_ptr(source); + source_conv.is_owned = ptr_is_owned(source); + CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv); + source_conv.is_owned = false; + LDKNodeId target_conv; + target_conv.inner = untag_ptr(target); + target_conv.is_owned = ptr_is_owned(target); + CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); + target_conv.is_owned = false; + InFlightHtlcs_add_inflight_htlc(&this_arg_conv, &source_conv, &target_conv, channel_scid, used_msat); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKVerifiedInvoiceRequest this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1used_1liquidity_1msat(JNIEnv *env, jclass clz, int64_t this_arg, int64_t source, int64_t target, int64_t channel_scid) { + LDKInFlightHtlcs this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; + LDKNodeId source_conv; + source_conv.inner = untag_ptr(source); + source_conv.is_owned = ptr_is_owned(source); + CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv); + source_conv.is_owned = false; + LDKNodeId target_conv; + target_conv.inner = untag_ptr(target); + target_conv.is_owned = ptr_is_owned(target); + CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); + target_conv.is_owned = false; LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = VerifiedInvoiceRequest_quantity(&this_arg_conv); + *ret_copy = InFlightHtlcs_used_liquidity_msat(&this_arg_conv, &source_conv, &target_conv, channel_scid); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, VerifiedInvoiceRequest_payer_id(&this_arg_conv).compressed_form); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = VerifiedInvoiceRequest_payer_note(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1respond_1with(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths_constr; - payment_paths_constr.datalen = (*env)->GetArrayLength(env, payment_paths); - if (payment_paths_constr.datalen > 0) - payment_paths_constr.data = MALLOC(payment_paths_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); - else - payment_paths_constr.data = NULL; - int64_t* payment_paths_vals = (*env)->GetLongArrayElements (env, payment_paths, NULL); - for (size_t l = 0; l < payment_paths_constr.datalen; l++) { - int64_t payment_paths_conv_37 = payment_paths_vals[l]; - void* payment_paths_conv_37_ptr = untag_ptr(payment_paths_conv_37); - CHECK_ACCESS(payment_paths_conv_37_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ payment_paths_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(payment_paths_conv_37_ptr); - payment_paths_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(payment_paths_conv_37)); - payment_paths_constr.data[l] = payment_paths_conv_37_conv; - } - (*env)->ReleaseLongArrayElements(env, payment_paths, payment_paths_vals, 0); - LDKThirtyTwoBytes payment_hash_ref; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ"); - *ret_conv = VerifiedInvoiceRequest_respond_with(&this_arg_conv, payment_paths_constr, payment_hash_ref); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1respond_1with_1no_1std(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash, int64_t created_at) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths_constr; - payment_paths_constr.datalen = (*env)->GetArrayLength(env, payment_paths); - if (payment_paths_constr.datalen > 0) - payment_paths_constr.data = MALLOC(payment_paths_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); - else - payment_paths_constr.data = NULL; - int64_t* payment_paths_vals = (*env)->GetLongArrayElements (env, payment_paths, NULL); - for (size_t l = 0; l < payment_paths_constr.datalen; l++) { - int64_t payment_paths_conv_37 = payment_paths_vals[l]; - void* payment_paths_conv_37_ptr = untag_ptr(payment_paths_conv_37); - CHECK_ACCESS(payment_paths_conv_37_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ payment_paths_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(payment_paths_conv_37_ptr); - payment_paths_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(payment_paths_conv_37)); - payment_paths_constr.data[l] = payment_paths_conv_37_conv; - } - (*env)->ReleaseLongArrayElements(env, payment_paths, payment_paths_vals, 0); - LDKThirtyTwoBytes payment_hash_ref; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ"); - *ret_conv = VerifiedInvoiceRequest_respond_with_no_std(&this_arg_conv, payment_paths_constr, payment_hash_ref, created_at); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1respond_1using_1derived_1keys(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths_constr; - payment_paths_constr.datalen = (*env)->GetArrayLength(env, payment_paths); - if (payment_paths_constr.datalen > 0) - payment_paths_constr.data = MALLOC(payment_paths_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); - else - payment_paths_constr.data = NULL; - int64_t* payment_paths_vals = (*env)->GetLongArrayElements (env, payment_paths, NULL); - for (size_t l = 0; l < payment_paths_constr.datalen; l++) { - int64_t payment_paths_conv_37 = payment_paths_vals[l]; - void* payment_paths_conv_37_ptr = untag_ptr(payment_paths_conv_37); - CHECK_ACCESS(payment_paths_conv_37_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ payment_paths_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(payment_paths_conv_37_ptr); - payment_paths_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(payment_paths_conv_37)); - payment_paths_constr.data[l] = payment_paths_conv_37_conv; - } - (*env)->ReleaseLongArrayElements(env, payment_paths, payment_paths_vals, 0); - LDKThirtyTwoBytes payment_hash_ref; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ"); - *ret_conv = VerifiedInvoiceRequest_respond_using_derived_keys(&this_arg_conv, payment_paths_constr, payment_hash_ref); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1respond_1using_1derived_1keys_1no_1std(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash, int64_t created_at) { - LDKVerifiedInvoiceRequest this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths_constr; - payment_paths_constr.datalen = (*env)->GetArrayLength(env, payment_paths); - if (payment_paths_constr.datalen > 0) - payment_paths_constr.data = MALLOC(payment_paths_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); - else - payment_paths_constr.data = NULL; - int64_t* payment_paths_vals = (*env)->GetLongArrayElements (env, payment_paths, NULL); - for (size_t l = 0; l < payment_paths_constr.datalen; l++) { - int64_t payment_paths_conv_37 = payment_paths_vals[l]; - void* payment_paths_conv_37_ptr = untag_ptr(payment_paths_conv_37); - CHECK_ACCESS(payment_paths_conv_37_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ payment_paths_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(payment_paths_conv_37_ptr); - payment_paths_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(payment_paths_conv_37)); - payment_paths_constr.data[l] = payment_paths_conv_37_conv; - } - (*env)->ReleaseLongArrayElements(env, payment_paths, payment_paths_vals, 0); - LDKThirtyTwoBytes payment_hash_ref; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ"); - *ret_conv = VerifiedInvoiceRequest_respond_using_derived_keys_no_std(&this_arg_conv, payment_paths_constr, payment_hash_ref, created_at); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKUnsignedInvoiceRequest obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKInFlightHtlcs obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = UnsignedInvoiceRequest_write(&obj_conv); + LDKCVec_u8Z ret_var = InFlightHtlcs_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKInvoiceRequest obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = InvoiceRequest_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ"); + *ret_conv = InFlightHtlcs_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKInvoiceRequestFields this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKRouteHop this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InvoiceRequestFields_free(this_obj_conv); + RouteHop_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1get_1payer_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInvoiceRequestFields this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRouteHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, InvoiceRequestFields_get_payer_id(&this_ptr_conv).compressed_form); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RouteHop_get_pubkey(&this_ptr_conv).compressed_form); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1set_1payer_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKInvoiceRequestFields this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKRouteHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -74140,1273 +77371,2007 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1set_1pay LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - InvoiceRequestFields_set_payer_id(&this_ptr_conv, val_ref); + RouteHop_set_pubkey(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1get_1quantity(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInvoiceRequestFields this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1node_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRouteHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = InvoiceRequestFields_get_quantity(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); + LDKNodeFeatures ret_var = RouteHop_get_node_features(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1set_1quantity(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKInvoiceRequestFields this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1node_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKRouteHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - InvoiceRequestFields_set_quantity(&this_ptr_conv, val_conv); + LDKNodeFeatures val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = NodeFeatures_clone(&val_conv); + RouteHop_set_node_features(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1get_1payer_1note_1truncated(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInvoiceRequestFields this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRouteHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKUntrustedString ret_var = InvoiceRequestFields_get_payer_note_truncated(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + int64_t ret_conv = RouteHop_get_short_channel_id(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1set_1payer_1note_1truncated(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKInvoiceRequestFields this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKRouteHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKUntrustedString val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = UntrustedString_clone(&val_conv); - InvoiceRequestFields_set_payer_note_truncated(&this_ptr_conv, val_conv); + RouteHop_set_short_channel_id(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1new(JNIEnv *env, jclass clz, int8_tArray payer_id_arg, int64_t quantity_arg, int64_t payer_note_truncated_arg) { - LDKPublicKey payer_id_arg_ref; - CHECK((*env)->GetArrayLength(env, payer_id_arg) == 33); - (*env)->GetByteArrayRegion(env, payer_id_arg, 0, 33, payer_id_arg_ref.compressed_form); - void* quantity_arg_ptr = untag_ptr(quantity_arg); - CHECK_ACCESS(quantity_arg_ptr); - LDKCOption_u64Z quantity_arg_conv = *(LDKCOption_u64Z*)(quantity_arg_ptr); - quantity_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(quantity_arg)); - LDKUntrustedString payer_note_truncated_arg_conv; - payer_note_truncated_arg_conv.inner = untag_ptr(payer_note_truncated_arg); - payer_note_truncated_arg_conv.is_owned = ptr_is_owned(payer_note_truncated_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(payer_note_truncated_arg_conv); - payer_note_truncated_arg_conv = UntrustedString_clone(&payer_note_truncated_arg_conv); - LDKInvoiceRequestFields ret_var = InvoiceRequestFields_new(payer_id_arg_ref, quantity_arg_conv, payer_note_truncated_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1channel_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRouteHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelFeatures ret_var = RouteHop_get_channel_features(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t InvoiceRequestFields_clone_ptr(LDKInvoiceRequestFields *NONNULL_PTR arg) { - LDKInvoiceRequestFields ret_var = InvoiceRequestFields_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1channel_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKRouteHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelFeatures val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelFeatures_clone(&val_conv); + RouteHop_set_channel_features(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKInvoiceRequestFields arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = InvoiceRequestFields_clone_ptr(&arg_conv); + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1fee_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRouteHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = RouteHop_get_fee_msat(&this_ptr_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKInvoiceRequestFields orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1fee_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKRouteHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + RouteHop_set_fee_msat(&this_ptr_conv, val); +} + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRouteHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = RouteHop_get_cltv_expiry_delta(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKRouteHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + RouteHop_set_cltv_expiry_delta(&this_ptr_conv, val); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1maybe_1announced_1channel(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRouteHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + jboolean ret_conv = RouteHop_get_maybe_announced_channel(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1maybe_1announced_1channel(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKRouteHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + RouteHop_set_maybe_announced_channel(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1new(JNIEnv *env, jclass clz, int8_tArray pubkey_arg, int64_t node_features_arg, int64_t short_channel_id_arg, int64_t channel_features_arg, int64_t fee_msat_arg, int32_t cltv_expiry_delta_arg, jboolean maybe_announced_channel_arg) { + LDKPublicKey pubkey_arg_ref; + CHECK((*env)->GetArrayLength(env, pubkey_arg) == 33); + (*env)->GetByteArrayRegion(env, pubkey_arg, 0, 33, pubkey_arg_ref.compressed_form); + LDKNodeFeatures node_features_arg_conv; + node_features_arg_conv.inner = untag_ptr(node_features_arg); + node_features_arg_conv.is_owned = ptr_is_owned(node_features_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_features_arg_conv); + node_features_arg_conv = NodeFeatures_clone(&node_features_arg_conv); + LDKChannelFeatures channel_features_arg_conv; + channel_features_arg_conv.inner = untag_ptr(channel_features_arg); + channel_features_arg_conv.is_owned = ptr_is_owned(channel_features_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_features_arg_conv); + channel_features_arg_conv = ChannelFeatures_clone(&channel_features_arg_conv); + LDKRouteHop ret_var = RouteHop_new(pubkey_arg_ref, node_features_arg_conv, short_channel_id_arg, channel_features_arg_conv, fee_msat_arg, cltv_expiry_delta_arg, maybe_announced_channel_arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t RouteHop_clone_ptr(LDKRouteHop *NONNULL_PTR arg) { + LDKRouteHop ret_var = RouteHop_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRouteHop arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = RouteHop_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKRouteHop orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKInvoiceRequestFields ret_var = InvoiceRequestFields_clone(&orig_conv); + LDKRouteHop ret_var = RouteHop_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKInvoiceRequestFields a_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKRouteHop o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = RouteHop_hash(&o_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHop_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKRouteHop a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKInvoiceRequestFields b_conv; + LDKRouteHop b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = InvoiceRequestFields_eq(&a_conv, &b_conv); + jboolean ret_conv = RouteHop_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKInvoiceRequestFields obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHop_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKRouteHop obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = InvoiceRequestFields_write(&obj_conv); + LDKCVec_u8Z ret_var = RouteHop_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1read(JNIEnv *env, jclass clz, int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_InvoiceRequestFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestFieldsDecodeErrorZ), "LDKCResult_InvoiceRequestFieldsDecodeErrorZ"); - *ret_conv = InvoiceRequestFields_read(ser_ref); + LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); + *ret_conv = RouteHop_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TaggedHash_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKTaggedHash this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedTail_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBlindedTail this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - TaggedHash_free(this_obj_conv); + BlindedTail_free(this_obj_conv); } -static inline uint64_t TaggedHash_clone_ptr(LDKTaggedHash *NONNULL_PTR arg) { - LDKTaggedHash ret_var = TaggedHash_clone(arg); +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_BlindedTail_1get_1hops(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBlindedTail this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_BlindedHopZ ret_var = BlindedTail_get_hops(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t m = 0; m < ret_var.datalen; m++) { + LDKBlindedHop ret_conv_12_var = ret_var.data[m]; + int64_t ret_conv_12_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_var); + ret_conv_12_ref = tag_ptr(ret_conv_12_var.inner, ret_conv_12_var.is_owned); + ret_arr_ptr[m] = ret_conv_12_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedTail_1set_1hops(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { + LDKBlindedTail this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_BlindedHopZ val_constr; + val_constr.datalen = (*env)->GetArrayLength(env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKBlindedHop), "LDKCVec_BlindedHopZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); + for (size_t m = 0; m < val_constr.datalen; m++) { + int64_t val_conv_12 = val_vals[m]; + LDKBlindedHop val_conv_12_conv; + val_conv_12_conv.inner = untag_ptr(val_conv_12); + val_conv_12_conv.is_owned = ptr_is_owned(val_conv_12); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_12_conv); + val_conv_12_conv = BlindedHop_clone(&val_conv_12_conv); + val_constr.data[m] = val_conv_12_conv; + } + (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); + BlindedTail_set_hops(&this_ptr_conv, val_constr); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedTail_1get_1blinding_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBlindedTail this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, BlindedTail_get_blinding_point(&this_ptr_conv).compressed_form); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedTail_1set_1blinding_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKBlindedTail this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + BlindedTail_set_blinding_point(&this_ptr_conv, val_ref); +} + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_BlindedTail_1get_1excess_1final_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBlindedTail this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = BlindedTail_get_excess_final_cltv_expiry_delta(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedTail_1set_1excess_1final_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKBlindedTail this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + BlindedTail_set_excess_final_cltv_expiry_delta(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedTail_1get_1final_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBlindedTail this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = BlindedTail_get_final_value_msat(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedTail_1set_1final_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKBlindedTail this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + BlindedTail_set_final_value_msat(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedTail_1new(JNIEnv *env, jclass clz, int64_tArray hops_arg, int8_tArray blinding_point_arg, int32_t excess_final_cltv_expiry_delta_arg, int64_t final_value_msat_arg) { + LDKCVec_BlindedHopZ hops_arg_constr; + hops_arg_constr.datalen = (*env)->GetArrayLength(env, hops_arg); + if (hops_arg_constr.datalen > 0) + hops_arg_constr.data = MALLOC(hops_arg_constr.datalen * sizeof(LDKBlindedHop), "LDKCVec_BlindedHopZ Elements"); + else + hops_arg_constr.data = NULL; + int64_t* hops_arg_vals = (*env)->GetLongArrayElements (env, hops_arg, NULL); + for (size_t m = 0; m < hops_arg_constr.datalen; m++) { + int64_t hops_arg_conv_12 = hops_arg_vals[m]; + LDKBlindedHop hops_arg_conv_12_conv; + hops_arg_conv_12_conv.inner = untag_ptr(hops_arg_conv_12); + hops_arg_conv_12_conv.is_owned = ptr_is_owned(hops_arg_conv_12); + CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_arg_conv_12_conv); + hops_arg_conv_12_conv = BlindedHop_clone(&hops_arg_conv_12_conv); + hops_arg_constr.data[m] = hops_arg_conv_12_conv; + } + (*env)->ReleaseLongArrayElements(env, hops_arg, hops_arg_vals, 0); + LDKPublicKey blinding_point_arg_ref; + CHECK((*env)->GetArrayLength(env, blinding_point_arg) == 33); + (*env)->GetByteArrayRegion(env, blinding_point_arg, 0, 33, blinding_point_arg_ref.compressed_form); + LDKBlindedTail ret_var = BlindedTail_new(hops_arg_constr, blinding_point_arg_ref, excess_final_cltv_expiry_delta_arg, final_value_msat_arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TaggedHash_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKTaggedHash arg_conv; + +static inline uint64_t BlindedTail_clone_ptr(LDKBlindedTail *NONNULL_PTR arg) { + LDKBlindedTail ret_var = BlindedTail_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedTail_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBlindedTail arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = TaggedHash_clone_ptr(&arg_conv); + int64_t ret_conv = BlindedTail_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TaggedHash_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKTaggedHash orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedTail_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBlindedTail orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKTaggedHash ret_var = TaggedHash_clone(&orig_conv); + LDKBlindedTail ret_var = BlindedTail_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TaggedHash_1as_1digest(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKTaggedHash this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *TaggedHash_as_digest(&this_arg_conv)); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedTail_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKBlindedTail o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = BlindedTail_hash(&o_conv); + return ret_conv; } -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_TaggedHash_1tag(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKTaggedHash this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKStr ret_str = TaggedHash_tag(&this_arg_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedTail_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKBlindedTail a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKBlindedTail b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = BlindedTail_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TaggedHash_1merkle_1root(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKTaggedHash this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, TaggedHash_merkle_root(&this_arg_conv).data); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedTail_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKBlindedTail obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = BlindedTail_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKSignError this_ptr_conv = *(LDKSignError*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - SignError_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedTail_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_BlindedTailDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedTailDecodeErrorZ), "LDKCResult_BlindedTailDecodeErrorZ"); + *ret_conv = BlindedTail_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -static inline uint64_t SignError_clone_ptr(LDKSignError *NONNULL_PTR arg) { - LDKSignError *ret_copy = MALLOC(sizeof(LDKSignError), "LDKSignError"); - *ret_copy = SignError_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Path_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPath this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Path_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKSignError* arg_conv = (LDKSignError*)untag_ptr(arg); - int64_t ret_conv = SignError_clone_ptr(arg_conv); - return ret_conv; + +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Path_1get_1hops(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPath this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_RouteHopZ ret_var = Path_get_hops(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t k = 0; k < ret_var.datalen; k++) { + LDKRouteHop ret_conv_10_var = ret_var.data[k]; + int64_t ret_conv_10_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_10_var); + ret_conv_10_ref = tag_ptr(ret_conv_10_var.inner, ret_conv_10_var.is_owned); + ret_arr_ptr[k] = ret_conv_10_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignError_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKSignError* orig_conv = (LDKSignError*)untag_ptr(orig); - LDKSignError *ret_copy = MALLOC(sizeof(LDKSignError), "LDKSignError"); - *ret_copy = SignError_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Path_1set_1hops(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { + LDKPath this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_RouteHopZ val_constr; + val_constr.datalen = (*env)->GetArrayLength(env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); + for (size_t k = 0; k < val_constr.datalen; k++) { + int64_t val_conv_10 = val_vals[k]; + LDKRouteHop val_conv_10_conv; + val_conv_10_conv.inner = untag_ptr(val_conv_10); + val_conv_10_conv.is_owned = ptr_is_owned(val_conv_10); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_10_conv); + val_conv_10_conv = RouteHop_clone(&val_conv_10_conv); + val_constr.data[k] = val_conv_10_conv; + } + (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); + Path_set_hops(&this_ptr_conv, val_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignError_1signing(JNIEnv *env, jclass clz) { - LDKSignError *ret_copy = MALLOC(sizeof(LDKSignError), "LDKSignError"); - *ret_copy = SignError_signing(); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1get_1blinded_1tail(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPath this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBlindedTail ret_var = Path_get_blinded_tail(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignError_1verification(JNIEnv *env, jclass clz, jclass a) { - LDKSecp256k1Error a_conv = LDKSecp256k1Error_from_java(env, a); - LDKSignError *ret_copy = MALLOC(sizeof(LDKSignError), "LDKSignError"); - *ret_copy = SignError_verification(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Path_1set_1blinded_1tail(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKPath this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBlindedTail val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = BlindedTail_clone(&val_conv); + Path_set_blinded_tail(&this_ptr_conv, val_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12ParseError_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKBolt12ParseError this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Bolt12ParseError_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1new(JNIEnv *env, jclass clz, int64_tArray hops_arg, int64_t blinded_tail_arg) { + LDKCVec_RouteHopZ hops_arg_constr; + hops_arg_constr.datalen = (*env)->GetArrayLength(env, hops_arg); + if (hops_arg_constr.datalen > 0) + hops_arg_constr.data = MALLOC(hops_arg_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); + else + hops_arg_constr.data = NULL; + int64_t* hops_arg_vals = (*env)->GetLongArrayElements (env, hops_arg, NULL); + for (size_t k = 0; k < hops_arg_constr.datalen; k++) { + int64_t hops_arg_conv_10 = hops_arg_vals[k]; + LDKRouteHop hops_arg_conv_10_conv; + hops_arg_conv_10_conv.inner = untag_ptr(hops_arg_conv_10); + hops_arg_conv_10_conv.is_owned = ptr_is_owned(hops_arg_conv_10); + CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_arg_conv_10_conv); + hops_arg_conv_10_conv = RouteHop_clone(&hops_arg_conv_10_conv); + hops_arg_constr.data[k] = hops_arg_conv_10_conv; + } + (*env)->ReleaseLongArrayElements(env, hops_arg, hops_arg_vals, 0); + LDKBlindedTail blinded_tail_arg_conv; + blinded_tail_arg_conv.inner = untag_ptr(blinded_tail_arg); + blinded_tail_arg_conv.is_owned = ptr_is_owned(blinded_tail_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_tail_arg_conv); + blinded_tail_arg_conv = BlindedTail_clone(&blinded_tail_arg_conv); + LDKPath ret_var = Path_new(hops_arg_constr, blinded_tail_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -static inline uint64_t Bolt12ParseError_clone_ptr(LDKBolt12ParseError *NONNULL_PTR arg) { - LDKBolt12ParseError ret_var = Bolt12ParseError_clone(arg); +static inline uint64_t Path_clone_ptr(LDKPath *NONNULL_PTR arg) { + LDKPath ret_var = Path_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12ParseError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKBolt12ParseError arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPath arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Bolt12ParseError_clone_ptr(&arg_conv); + int64_t ret_conv = Path_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12ParseError_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBolt12ParseError orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPath orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBolt12ParseError ret_var = Bolt12ParseError_clone(&orig_conv); + LDKPath ret_var = Path_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBolt12SemanticError* orig_conv = (LDKBolt12SemanticError*)untag_ptr(orig); - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_clone(orig_conv)); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKPath o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = Path_hash(&o_conv); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1already_1expired(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_already_expired()); - return ret_conv; -} - -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unsupported_1chain(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unsupported_chain()); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Path_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKPath a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKPath b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = Path_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1chain(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unexpected_chain()); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1fee_1msat(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKPath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int64_t ret_conv = Path_fee_msat(&this_arg_conv); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1amount(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_amount()); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1final_1value_1msat(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKPath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int64_t ret_conv = Path_final_value_msat(&this_arg_conv); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1invalid_1amount(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_invalid_amount()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1final_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKPath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = Path_final_cltv_expiry_delta(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1insufficient_1amount(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_insufficient_amount()); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKRoute this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Route_free(this_obj_conv); } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1amount(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unexpected_amount()); - return ret_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Route_1get_1paths(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRoute this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_PathZ ret_var = Route_get_paths(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t g = 0; g < ret_var.datalen; g++) { + LDKPath ret_conv_6_var = ret_var.data[g]; + int64_t ret_conv_6_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_6_var); + ret_conv_6_ref = tag_ptr(ret_conv_6_var.inner, ret_conv_6_var.is_owned); + ret_arr_ptr[g] = ret_conv_6_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unsupported_1currency(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unsupported_currency()); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1paths(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { + LDKRoute this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_PathZ val_constr; + val_constr.datalen = (*env)->GetArrayLength(env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKPath), "LDKCVec_PathZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); + for (size_t g = 0; g < val_constr.datalen; g++) { + int64_t val_conv_6 = val_vals[g]; + LDKPath val_conv_6_conv; + val_conv_6_conv.inner = untag_ptr(val_conv_6); + val_conv_6_conv.is_owned = ptr_is_owned(val_conv_6); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_6_conv); + val_conv_6_conv = Path_clone(&val_conv_6_conv); + val_constr.data[g] = val_conv_6_conv; + } + (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); + Route_set_paths(&this_ptr_conv, val_constr); } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unknown_1required_1features(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unknown_required_features()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1route_1params(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRoute this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKRouteParameters ret_var = Route_get_route_params(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1features(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unexpected_features()); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1route_1params(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKRoute this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKRouteParameters val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = RouteParameters_clone(&val_conv); + Route_set_route_params(&this_ptr_conv, val_conv); } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1description(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_description()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1new(JNIEnv *env, jclass clz, int64_tArray paths_arg, int64_t route_params_arg) { + LDKCVec_PathZ paths_arg_constr; + paths_arg_constr.datalen = (*env)->GetArrayLength(env, paths_arg); + if (paths_arg_constr.datalen > 0) + paths_arg_constr.data = MALLOC(paths_arg_constr.datalen * sizeof(LDKPath), "LDKCVec_PathZ Elements"); + else + paths_arg_constr.data = NULL; + int64_t* paths_arg_vals = (*env)->GetLongArrayElements (env, paths_arg, NULL); + for (size_t g = 0; g < paths_arg_constr.datalen; g++) { + int64_t paths_arg_conv_6 = paths_arg_vals[g]; + LDKPath paths_arg_conv_6_conv; + paths_arg_conv_6_conv.inner = untag_ptr(paths_arg_conv_6); + paths_arg_conv_6_conv.is_owned = ptr_is_owned(paths_arg_conv_6); + CHECK_INNER_FIELD_ACCESS_OR_NULL(paths_arg_conv_6_conv); + paths_arg_conv_6_conv = Path_clone(&paths_arg_conv_6_conv); + paths_arg_constr.data[g] = paths_arg_conv_6_conv; + } + (*env)->ReleaseLongArrayElements(env, paths_arg, paths_arg_vals, 0); + LDKRouteParameters route_params_arg_conv; + route_params_arg_conv.inner = untag_ptr(route_params_arg); + route_params_arg_conv.is_owned = ptr_is_owned(route_params_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_arg_conv); + route_params_arg_conv = RouteParameters_clone(&route_params_arg_conv); + LDKRoute ret_var = Route_new(paths_arg_constr, route_params_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1signing_1pubkey(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_signing_pubkey()); - return ret_conv; +static inline uint64_t Route_clone_ptr(LDKRoute *NONNULL_PTR arg) { + LDKRoute ret_var = Route_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } - -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1invalid_1signing_1pubkey(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_invalid_signing_pubkey()); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRoute arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = Route_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1signing_1pubkey(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unexpected_signing_pubkey()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKRoute orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKRoute ret_var = Route_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1quantity(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_quantity()); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKRoute o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = Route_hash(&o_conv); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1invalid_1quantity(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_invalid_quantity()); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Route_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKRoute a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKRoute b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = Route_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1quantity(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unexpected_quantity()); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1total_1fees(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKRoute this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int64_t ret_conv = Route_get_total_fees(&this_arg_conv); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1invalid_1metadata(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_invalid_metadata()); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1total_1amount(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKRoute this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int64_t ret_conv = Route_get_total_amount(&this_arg_conv); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1metadata(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unexpected_metadata()); +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Route_1to_1str(JNIEnv *env, jclass clz, int64_t o) { + LDKRoute o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = Route_to_str(&o_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1payer_1metadata(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_payer_metadata()); - return ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Route_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKRoute obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = Route_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1payer_1id(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_payer_id()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); + *ret_conv = Route_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1duplicate_1payment_1id(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_duplicate_payment_id()); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKRouteParameters this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + RouteParameters_free(this_obj_conv); } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1paths(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_paths()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1payment_1params(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRouteParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPaymentParameters ret_var = RouteParameters_get_payment_params(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1paths(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unexpected_paths()); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1payment_1params(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKRouteParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPaymentParameters val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = PaymentParameters_clone(&val_conv); + RouteParameters_set_payment_params(&this_ptr_conv, val_conv); } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1invalid_1pay_1info(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_invalid_pay_info()); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1final_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRouteParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = RouteParameters_get_final_value_msat(&this_ptr_conv); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1creation_1time(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_creation_time()); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1final_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKRouteParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + RouteParameters_set_final_value_msat(&this_ptr_conv, val); } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1payment_1hash(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_payment_hash()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1max_1total_1routing_1fee_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRouteParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = RouteParameters_get_max_total_routing_fee_msat(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1signature(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_signature()); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1max_1total_1routing_1fee_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKRouteParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + RouteParameters_set_max_total_routing_fee_msat(&this_ptr_conv, val_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKRefundMaybeWithDerivedMetadataBuilder this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - RefundMaybeWithDerivedMetadataBuilder_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1new(JNIEnv *env, jclass clz, int64_t payment_params_arg, int64_t final_value_msat_arg, int64_t max_total_routing_fee_msat_arg) { + LDKPaymentParameters payment_params_arg_conv; + payment_params_arg_conv.inner = untag_ptr(payment_params_arg); + payment_params_arg_conv.is_owned = ptr_is_owned(payment_params_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_params_arg_conv); + payment_params_arg_conv = PaymentParameters_clone(&payment_params_arg_conv); + void* max_total_routing_fee_msat_arg_ptr = untag_ptr(max_total_routing_fee_msat_arg); + CHECK_ACCESS(max_total_routing_fee_msat_arg_ptr); + LDKCOption_u64Z max_total_routing_fee_msat_arg_conv = *(LDKCOption_u64Z*)(max_total_routing_fee_msat_arg_ptr); + max_total_routing_fee_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(max_total_routing_fee_msat_arg)); + LDKRouteParameters ret_var = RouteParameters_new(payment_params_arg_conv, final_value_msat_arg, max_total_routing_fee_msat_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -static inline uint64_t RefundMaybeWithDerivedMetadataBuilder_clone_ptr(LDKRefundMaybeWithDerivedMetadataBuilder *NONNULL_PTR arg) { - LDKRefundMaybeWithDerivedMetadataBuilder ret_var = RefundMaybeWithDerivedMetadataBuilder_clone(arg); +static inline uint64_t RouteParameters_clone_ptr(LDKRouteParameters *NONNULL_PTR arg) { + LDKRouteParameters ret_var = RouteParameters_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKRefundMaybeWithDerivedMetadataBuilder arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRouteParameters arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = RefundMaybeWithDerivedMetadataBuilder_clone_ptr(&arg_conv); + int64_t ret_conv = RouteParameters_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKRefundMaybeWithDerivedMetadataBuilder orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKRouteParameters orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKRefundMaybeWithDerivedMetadataBuilder ret_var = RefundMaybeWithDerivedMetadataBuilder_clone(&orig_conv); + LDKRouteParameters ret_var = RouteParameters_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1new(JNIEnv *env, jclass clz, int8_tArray metadata, int8_tArray payer_id, int64_t amount_msats) { - LDKCVec_u8Z metadata_ref; - metadata_ref.datalen = (*env)->GetArrayLength(env, metadata); - metadata_ref.data = MALLOC(metadata_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, metadata, 0, metadata_ref.datalen, metadata_ref.data); - LDKPublicKey payer_id_ref; - CHECK((*env)->GetArrayLength(env, payer_id) == 33); - (*env)->GetByteArrayRegion(env, payer_id, 0, 33, payer_id_ref.compressed_form); - LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ"); - *ret_conv = RefundMaybeWithDerivedMetadataBuilder_new(metadata_ref, payer_id_ref, amount_msats); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1deriving_1payer_1id(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t expanded_key, int64_t entropy_source, int64_t amount_msats, int8_tArray payment_id) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKExpandedKey expanded_key_conv; - expanded_key_conv.inner = untag_ptr(expanded_key); - expanded_key_conv.is_owned = ptr_is_owned(expanded_key); - CHECK_INNER_FIELD_ACCESS_OR_NULL(expanded_key_conv); - expanded_key_conv.is_owned = false; - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - LDKThirtyTwoBytes payment_id_ref; - CHECK((*env)->GetArrayLength(env, payment_id) == 32); - (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); - LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ"); - *ret_conv = RefundMaybeWithDerivedMetadataBuilder_deriving_payer_id(node_id_ref, &expanded_key_conv, entropy_source_conv, amount_msats, payment_id_ref); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKRouteParameters o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = RouteParameters_hash(&o_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1description(JNIEnv *env, jclass clz, int64_t this_arg, jstring description) { - LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); - LDKStr description_conv = java_to_owned_str(env, description); - RefundMaybeWithDerivedMetadataBuilder_description(this_arg_conv, description_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteParameters_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKRouteParameters a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKRouteParameters b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = RouteParameters_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg, int64_t absolute_expiry) { - LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); - RefundMaybeWithDerivedMetadataBuilder_absolute_expiry(this_arg_conv, absolute_expiry); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1from_1payment_1params_1and_1value(JNIEnv *env, jclass clz, int64_t payment_params, int64_t final_value_msat) { + LDKPaymentParameters payment_params_conv; + payment_params_conv.inner = untag_ptr(payment_params); + payment_params_conv.is_owned = ptr_is_owned(payment_params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_params_conv); + payment_params_conv = PaymentParameters_clone(&payment_params_conv); + LDKRouteParameters ret_var = RouteParameters_from_payment_params_and_value(payment_params_conv, final_value_msat); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1issuer(JNIEnv *env, jclass clz, int64_t this_arg, jstring issuer) { - LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1max_1path_1length(JNIEnv *env, jclass clz, int64_t this_arg, int64_t recipient_onion, jboolean is_keysend, int32_t best_block_height) { + LDKRouteParameters this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); - LDKStr issuer_conv = java_to_owned_str(env, issuer); - RefundMaybeWithDerivedMetadataBuilder_issuer(this_arg_conv, issuer_conv); + this_arg_conv.is_owned = false; + LDKRecipientOnionFields recipient_onion_conv; + recipient_onion_conv.inner = untag_ptr(recipient_onion); + recipient_onion_conv.is_owned = ptr_is_owned(recipient_onion); + CHECK_INNER_FIELD_ACCESS_OR_NULL(recipient_onion_conv); + recipient_onion_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = RouteParameters_set_max_path_length(&this_arg_conv, &recipient_onion_conv, is_keysend, best_block_height); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1path(JNIEnv *env, jclass clz, int64_t this_arg, int64_t path) { - LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); - LDKBlindedPath path_conv; - path_conv.inner = untag_ptr(path); - path_conv.is_owned = ptr_is_owned(path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); - path_conv = BlindedPath_clone(&path_conv); - RefundMaybeWithDerivedMetadataBuilder_path(this_arg_conv, path_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteParameters_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKRouteParameters obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = RouteParameters_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1chain(JNIEnv *env, jclass clz, int64_t this_arg, jclass network) { - LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); - LDKNetwork network_conv = LDKNetwork_from_java(env, network); - RefundMaybeWithDerivedMetadataBuilder_chain(this_arg_conv, network_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); + *ret_conv = RouteParameters_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1quantity(JNIEnv *env, jclass clz, int64_t this_arg, int64_t quantity) { - LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); - RefundMaybeWithDerivedMetadataBuilder_quantity(this_arg_conv, quantity); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPaymentParameters this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + PaymentParameters_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg, jstring payer_note) { - LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); - LDKStr payer_note_conv = java_to_owned_str(env, payer_note); - RefundMaybeWithDerivedMetadataBuilder_payer_note(this_arg_conv, payer_note_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1payee(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); + *ret_copy = PaymentParameters_get_payee(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1build(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); - LDKCResult_RefundBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundBolt12SemanticErrorZ), "LDKCResult_RefundBolt12SemanticErrorZ"); - *ret_conv = RefundMaybeWithDerivedMetadataBuilder_build(this_arg_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1payee(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKPayee val_conv = *(LDKPayee*)(val_ptr); + val_conv = Payee_clone((LDKPayee*)untag_ptr(val)); + PaymentParameters_set_payee(&this_ptr_conv, val_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Refund_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKRefund this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Refund_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1expiry_1time(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = PaymentParameters_get_expiry_time(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -static inline uint64_t Refund_clone_ptr(LDKRefund *NONNULL_PTR arg) { - LDKRefund ret_var = Refund_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1expiry_1time(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + PaymentParameters_set_expiry_time(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKRefund arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = Refund_clone_ptr(&arg_conv); + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1max_1total_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = PaymentParameters_get_max_total_cltv_expiry_delta(&this_ptr_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKRefund orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKRefund ret_var = Refund_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1max_1total_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + PaymentParameters_set_max_total_cltv_expiry_delta(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1description(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = Refund_description(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1max_1path_1count(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_t ret_conv = PaymentParameters_get_max_path_count(&this_ptr_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = Refund_absolute_expiry(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1max_1path_1count(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + PaymentParameters_set_max_path_count(&this_ptr_conv, val); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Refund_1is_1expired(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = Refund_is_expired(&this_arg_conv); +JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1max_1path_1length(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_t ret_conv = PaymentParameters_get_max_path_length(&this_ptr_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Refund_1is_1expired_1no_1std(JNIEnv *env, jclass clz, int64_t this_arg, int64_t duration_since_epoch) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = Refund_is_expired_no_std(&this_arg_conv, duration_since_epoch); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1max_1path_1length(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + PaymentParameters_set_max_path_length(&this_ptr_conv, val); +} + +JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1max_1channel_1saturation_1power_1of_1half(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_t ret_conv = PaymentParameters_get_max_channel_saturation_power_of_half(&this_ptr_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1issuer(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = Refund_issuer(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1max_1channel_1saturation_1power_1of_1half(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + PaymentParameters_set_max_channel_saturation_power_of_half(&this_ptr_conv, val); } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Refund_1paths(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_BlindedPathZ ret_var = Refund_paths(&this_arg_conv); +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1previously_1failed_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u64Z ret_var = PaymentParameters_get_previously_failed_channels(&this_ptr_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t n = 0; n < ret_var.datalen; n++) { - LDKBlindedPath ret_conv_13_var = ret_var.data[n]; - int64_t ret_conv_13_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_13_var); - ret_conv_13_ref = tag_ptr(ret_conv_13_var.inner, ret_conv_13_var.is_owned); - ret_arr_ptr[n] = ret_conv_13_ref; + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; } (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); FREE(ret_var.data); return ret_arr; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Refund_1payer_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKu8slice ret_var = Refund_payer_metadata(&this_arg_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1previously_1failed_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u64Z val_constr; + val_constr.datalen = (*env)->GetArrayLength(env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); + for (size_t g = 0; g < val_constr.datalen; g++) { + int64_t val_conv_6 = val_vals[g]; + val_constr.data[g] = val_conv_6; + } + (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); + PaymentParameters_set_previously_failed_channels(&this_ptr_conv, val_constr); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Refund_1chain(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, Refund_chain(&this_arg_conv).data); +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1previously_1failed_1blinded_1path_1idxs(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u64Z ret_var = PaymentParameters_get_previously_failed_blinded_path_idxs(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = Refund_amount_msats(&this_arg_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1previously_1failed_1blinded_1path_1idxs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u64Z val_constr; + val_constr.datalen = (*env)->GetArrayLength(env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); + for (size_t g = 0; g < val_constr.datalen; g++) { + int64_t val_conv_6 = val_vals[g]; + val_constr.data[g] = val_conv_6; + } + (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); + PaymentParameters_set_previously_failed_blinded_path_idxs(&this_ptr_conv, val_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1features(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKInvoiceRequestFeatures ret_var = Refund_features(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1new(JNIEnv *env, jclass clz, int64_t payee_arg, int64_t expiry_time_arg, int32_t max_total_cltv_expiry_delta_arg, int8_t max_path_count_arg, int8_t max_path_length_arg, int8_t max_channel_saturation_power_of_half_arg, int64_tArray previously_failed_channels_arg, int64_tArray previously_failed_blinded_path_idxs_arg) { + void* payee_arg_ptr = untag_ptr(payee_arg); + CHECK_ACCESS(payee_arg_ptr); + LDKPayee payee_arg_conv = *(LDKPayee*)(payee_arg_ptr); + payee_arg_conv = Payee_clone((LDKPayee*)untag_ptr(payee_arg)); + void* expiry_time_arg_ptr = untag_ptr(expiry_time_arg); + CHECK_ACCESS(expiry_time_arg_ptr); + LDKCOption_u64Z expiry_time_arg_conv = *(LDKCOption_u64Z*)(expiry_time_arg_ptr); + expiry_time_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(expiry_time_arg)); + LDKCVec_u64Z previously_failed_channels_arg_constr; + previously_failed_channels_arg_constr.datalen = (*env)->GetArrayLength(env, previously_failed_channels_arg); + if (previously_failed_channels_arg_constr.datalen > 0) + previously_failed_channels_arg_constr.data = MALLOC(previously_failed_channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + else + previously_failed_channels_arg_constr.data = NULL; + int64_t* previously_failed_channels_arg_vals = (*env)->GetLongArrayElements (env, previously_failed_channels_arg, NULL); + for (size_t g = 0; g < previously_failed_channels_arg_constr.datalen; g++) { + int64_t previously_failed_channels_arg_conv_6 = previously_failed_channels_arg_vals[g]; + previously_failed_channels_arg_constr.data[g] = previously_failed_channels_arg_conv_6; + } + (*env)->ReleaseLongArrayElements(env, previously_failed_channels_arg, previously_failed_channels_arg_vals, 0); + LDKCVec_u64Z previously_failed_blinded_path_idxs_arg_constr; + previously_failed_blinded_path_idxs_arg_constr.datalen = (*env)->GetArrayLength(env, previously_failed_blinded_path_idxs_arg); + if (previously_failed_blinded_path_idxs_arg_constr.datalen > 0) + previously_failed_blinded_path_idxs_arg_constr.data = MALLOC(previously_failed_blinded_path_idxs_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + else + previously_failed_blinded_path_idxs_arg_constr.data = NULL; + int64_t* previously_failed_blinded_path_idxs_arg_vals = (*env)->GetLongArrayElements (env, previously_failed_blinded_path_idxs_arg, NULL); + for (size_t g = 0; g < previously_failed_blinded_path_idxs_arg_constr.datalen; g++) { + int64_t previously_failed_blinded_path_idxs_arg_conv_6 = previously_failed_blinded_path_idxs_arg_vals[g]; + previously_failed_blinded_path_idxs_arg_constr.data[g] = previously_failed_blinded_path_idxs_arg_conv_6; + } + (*env)->ReleaseLongArrayElements(env, previously_failed_blinded_path_idxs_arg, previously_failed_blinded_path_idxs_arg_vals, 0); + LDKPaymentParameters ret_var = PaymentParameters_new(payee_arg_conv, expiry_time_arg_conv, max_total_cltv_expiry_delta_arg, max_path_count_arg, max_path_length_arg, max_channel_saturation_power_of_half_arg, previously_failed_channels_arg_constr, previously_failed_blinded_path_idxs_arg_constr); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = Refund_quantity(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +static inline uint64_t PaymentParameters_clone_ptr(LDKPaymentParameters *NONNULL_PTR arg) { + LDKPaymentParameters ret_var = PaymentParameters_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Refund_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Refund_payer_id(&this_arg_conv).compressed_form); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPaymentParameters arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = PaymentParameters_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKRefund this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPrintableString ret_var = Refund_payer_note(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPaymentParameters orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKPaymentParameters ret_var = PaymentParameters_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKRefund o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKPaymentParameters o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv.is_owned = false; - int64_t ret_conv = Refund_hash(&o_conv); + int64_t ret_conv = PaymentParameters_hash(&o_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Refund_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKRefund obj_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKPaymentParameters a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKPaymentParameters b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = PaymentParameters_eq(&a_conv, &b_conv); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKPaymentParameters obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = Refund_write(&obj_conv); + LDKCVec_u8Z ret_var = PaymentParameters_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1from_1str(JNIEnv *env, jclass clz, jstring s) { - LDKStr s_conv = java_to_owned_str(env, s); - LDKCResult_RefundBolt12ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundBolt12ParseErrorZ), "LDKCResult_RefundBolt12ParseErrorZ"); - *ret_conv = Refund_from_str(s_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1read(JNIEnv *env, jclass clz, int8_tArray ser, int32_t arg) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ"); + *ret_conv = PaymentParameters_read(ser_ref, arg); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Refund_1to_1str(JNIEnv *env, jclass clz, int64_t o) { - LDKRefund o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = Refund_to_str(&o_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1from_1node_1id(JNIEnv *env, jclass clz, int8_tArray payee_pubkey, int32_t final_cltv_expiry_delta) { + LDKPublicKey payee_pubkey_ref; + CHECK((*env)->GetArrayLength(env, payee_pubkey) == 33); + (*env)->GetByteArrayRegion(env, payee_pubkey, 0, 33, payee_pubkey_ref.compressed_form); + LDKPaymentParameters ret_var = PaymentParameters_from_node_id(payee_pubkey_ref, final_cltv_expiry_delta); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_UtxoLookupError_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKUtxoLookupError* orig_conv = (LDKUtxoLookupError*)untag_ptr(orig); - jclass ret_conv = LDKUtxoLookupError_to_java(env, UtxoLookupError_clone(orig_conv)); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1for_1keysend(JNIEnv *env, jclass clz, int8_tArray payee_pubkey, int32_t final_cltv_expiry_delta, jboolean allow_mpp) { + LDKPublicKey payee_pubkey_ref; + CHECK((*env)->GetArrayLength(env, payee_pubkey) == 33); + (*env)->GetByteArrayRegion(env, payee_pubkey, 0, 33, payee_pubkey_ref.compressed_form); + LDKPaymentParameters ret_var = PaymentParameters_for_keysend(payee_pubkey_ref, final_cltv_expiry_delta, allow_mpp); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_UtxoLookupError_1unknown_1chain(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKUtxoLookupError_to_java(env, UtxoLookupError_unknown_chain()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1from_1bolt12_1invoice(JNIEnv *env, jclass clz, int64_t invoice) { + LDKBolt12Invoice invoice_conv; + invoice_conv.inner = untag_ptr(invoice); + invoice_conv.is_owned = ptr_is_owned(invoice); + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); + invoice_conv.is_owned = false; + LDKPaymentParameters ret_var = PaymentParameters_from_bolt12_invoice(&invoice_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_UtxoLookupError_1unknown_1tx(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKUtxoLookupError_to_java(env, UtxoLookupError_unknown_tx()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1blinded(JNIEnv *env, jclass clz, int64_tArray blinded_route_hints) { + LDKCVec_BlindedPaymentPathZ blinded_route_hints_constr; + blinded_route_hints_constr.datalen = (*env)->GetArrayLength(env, blinded_route_hints); + if (blinded_route_hints_constr.datalen > 0) + blinded_route_hints_constr.data = MALLOC(blinded_route_hints_constr.datalen * sizeof(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); + else + blinded_route_hints_constr.data = NULL; + int64_t* blinded_route_hints_vals = (*env)->GetLongArrayElements (env, blinded_route_hints, NULL); + for (size_t u = 0; u < blinded_route_hints_constr.datalen; u++) { + int64_t blinded_route_hints_conv_20 = blinded_route_hints_vals[u]; + LDKBlindedPaymentPath blinded_route_hints_conv_20_conv; + blinded_route_hints_conv_20_conv.inner = untag_ptr(blinded_route_hints_conv_20); + blinded_route_hints_conv_20_conv.is_owned = ptr_is_owned(blinded_route_hints_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_route_hints_conv_20_conv); + blinded_route_hints_conv_20_conv = BlindedPaymentPath_clone(&blinded_route_hints_conv_20_conv); + blinded_route_hints_constr.data[u] = blinded_route_hints_conv_20_conv; + } + (*env)->ReleaseLongArrayElements(env, blinded_route_hints, blinded_route_hints_vals, 0); + LDKPaymentParameters ret_var = PaymentParameters_blinded(blinded_route_hints_constr); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoResult_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); CHECK_ACCESS(this_ptr_ptr); - LDKUtxoResult this_ptr_conv = *(LDKUtxoResult*)(this_ptr_ptr); + LDKPayee this_ptr_conv = *(LDKPayee*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - UtxoResult_free(this_ptr_conv); + Payee_free(this_ptr_conv); } -static inline uint64_t UtxoResult_clone_ptr(LDKUtxoResult *NONNULL_PTR arg) { - LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult"); - *ret_copy = UtxoResult_clone(arg); +static inline uint64_t Payee_clone_ptr(LDKPayee *NONNULL_PTR arg) { + LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); + *ret_copy = Payee_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoResult_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKUtxoResult* arg_conv = (LDKUtxoResult*)untag_ptr(arg); - int64_t ret_conv = UtxoResult_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPayee* arg_conv = (LDKPayee*)untag_ptr(arg); + int64_t ret_conv = Payee_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoResult_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKUtxoResult* orig_conv = (LDKUtxoResult*)untag_ptr(orig); - LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult"); - *ret_copy = UtxoResult_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPayee* orig_conv = (LDKPayee*)untag_ptr(orig); + LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); + *ret_copy = Payee_clone(orig_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoResult_1sync(JNIEnv *env, jclass clz, int64_t a) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKCResult_TxOutUtxoLookupErrorZ a_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(a_ptr); - a_conv = CResult_TxOutUtxoLookupErrorZ_clone((LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(a)); - LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult"); - *ret_copy = UtxoResult_sync(a_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1blinded(JNIEnv *env, jclass clz, int64_tArray route_hints, int64_t features) { + LDKCVec_BlindedPaymentPathZ route_hints_constr; + route_hints_constr.datalen = (*env)->GetArrayLength(env, route_hints); + if (route_hints_constr.datalen > 0) + route_hints_constr.data = MALLOC(route_hints_constr.datalen * sizeof(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ Elements"); + else + route_hints_constr.data = NULL; + int64_t* route_hints_vals = (*env)->GetLongArrayElements (env, route_hints, NULL); + for (size_t u = 0; u < route_hints_constr.datalen; u++) { + int64_t route_hints_conv_20 = route_hints_vals[u]; + LDKBlindedPaymentPath route_hints_conv_20_conv; + route_hints_conv_20_conv.inner = untag_ptr(route_hints_conv_20); + route_hints_conv_20_conv.is_owned = ptr_is_owned(route_hints_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_hints_conv_20_conv); + route_hints_conv_20_conv = BlindedPaymentPath_clone(&route_hints_conv_20_conv); + route_hints_constr.data[u] = route_hints_conv_20_conv; + } + (*env)->ReleaseLongArrayElements(env, route_hints, route_hints_vals, 0); + LDKBolt12InvoiceFeatures features_conv; + features_conv.inner = untag_ptr(features); + features_conv.is_owned = ptr_is_owned(features); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); + features_conv = Bolt12InvoiceFeatures_clone(&features_conv); + LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); + *ret_copy = Payee_blinded(route_hints_constr, features_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoResult_1async(JNIEnv *env, jclass clz, int64_t a) { - LDKUtxoFuture a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = UtxoFuture_clone(&a_conv); - LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult"); - *ret_copy = UtxoResult_async(a_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1clear(JNIEnv *env, jclass clz, int8_tArray node_id, int64_tArray route_hints, int64_t features, int32_t final_cltv_expiry_delta) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKCVec_RouteHintZ route_hints_constr; + route_hints_constr.datalen = (*env)->GetArrayLength(env, route_hints); + if (route_hints_constr.datalen > 0) + route_hints_constr.data = MALLOC(route_hints_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements"); + else + route_hints_constr.data = NULL; + int64_t* route_hints_vals = (*env)->GetLongArrayElements (env, route_hints, NULL); + for (size_t l = 0; l < route_hints_constr.datalen; l++) { + int64_t route_hints_conv_11 = route_hints_vals[l]; + LDKRouteHint route_hints_conv_11_conv; + route_hints_conv_11_conv.inner = untag_ptr(route_hints_conv_11); + route_hints_conv_11_conv.is_owned = ptr_is_owned(route_hints_conv_11); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_hints_conv_11_conv); + route_hints_conv_11_conv = RouteHint_clone(&route_hints_conv_11_conv); + route_hints_constr.data[l] = route_hints_conv_11_conv; + } + (*env)->ReleaseLongArrayElements(env, route_hints, route_hints_vals, 0); + LDKBolt11InvoiceFeatures features_conv; + features_conv.inner = untag_ptr(features); + features_conv.is_owned = ptr_is_owned(features); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); + features_conv = Bolt11InvoiceFeatures_clone(&features_conv); + LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); + *ret_copy = Payee_clear(node_id_ref, route_hints_constr, features_conv, final_cltv_expiry_delta); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoLookup_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKUtxoLookup this_ptr_conv = *(LDKUtxoLookup*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - UtxoLookup_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKPayee* o_conv = (LDKPayee*)untag_ptr(o); + int64_t ret_conv = Payee_hash(o_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKUtxoFuture this_obj_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Payee_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKPayee* a_conv = (LDKPayee*)untag_ptr(a); + LDKPayee* b_conv = (LDKPayee*)untag_ptr(b); + jboolean ret_conv = Payee_eq(a_conv, b_conv); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKRouteHint obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = RouteHint_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); + *ret_conv = RouteHint_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKRouteHintHop obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = RouteHintHop_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); + *ret_conv = RouteHintHop_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FirstHopCandidate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKFirstHopCandidate this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - UtxoFuture_free(this_obj_conv); + FirstHopCandidate_free(this_obj_conv); } -static inline uint64_t UtxoFuture_clone_ptr(LDKUtxoFuture *NONNULL_PTR arg) { - LDKUtxoFuture ret_var = UtxoFuture_clone(arg); +static inline uint64_t FirstHopCandidate_clone_ptr(LDKFirstHopCandidate *NONNULL_PTR arg) { + LDKFirstHopCandidate ret_var = FirstHopCandidate_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKUtxoFuture arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FirstHopCandidate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKFirstHopCandidate arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = UtxoFuture_clone_ptr(&arg_conv); + int64_t ret_conv = FirstHopCandidate_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKUtxoFuture orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FirstHopCandidate_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKFirstHopCandidate orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKUtxoFuture ret_var = UtxoFuture_clone(&orig_conv); + LDKFirstHopCandidate ret_var = FirstHopCandidate_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1new(JNIEnv *env, jclass clz) { - LDKUtxoFuture ret_var = UtxoFuture_new(); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PublicHopCandidate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPublicHopCandidate this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + PublicHopCandidate_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PublicHopCandidate_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPublicHopCandidate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = PublicHopCandidate_get_short_channel_id(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PublicHopCandidate_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKPublicHopCandidate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + PublicHopCandidate_set_short_channel_id(&this_ptr_conv, val); +} + +static inline uint64_t PublicHopCandidate_clone_ptr(LDKPublicHopCandidate *NONNULL_PTR arg) { + LDKPublicHopCandidate ret_var = PublicHopCandidate_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1resolve_1without_1forwarding(JNIEnv *env, jclass clz, int64_t this_arg, int64_t graph, int64_t result) { - LDKUtxoFuture this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNetworkGraph graph_conv; - graph_conv.inner = untag_ptr(graph); - graph_conv.is_owned = ptr_is_owned(graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(graph_conv); - graph_conv.is_owned = false; - void* result_ptr = untag_ptr(result); - CHECK_ACCESS(result_ptr); - LDKCResult_TxOutUtxoLookupErrorZ result_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(result_ptr); - UtxoFuture_resolve_without_forwarding(&this_arg_conv, &graph_conv, result_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PublicHopCandidate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPublicHopCandidate arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = PublicHopCandidate_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1resolve(JNIEnv *env, jclass clz, int64_t this_arg, int64_t graph, int64_t gossip, int64_t result) { - LDKUtxoFuture this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNetworkGraph graph_conv; - graph_conv.inner = untag_ptr(graph); - graph_conv.is_owned = ptr_is_owned(graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(graph_conv); - graph_conv.is_owned = false; - LDKP2PGossipSync gossip_conv; - gossip_conv.inner = untag_ptr(gossip); - gossip_conv.is_owned = ptr_is_owned(gossip); - CHECK_INNER_FIELD_ACCESS_OR_NULL(gossip_conv); - gossip_conv.is_owned = false; - void* result_ptr = untag_ptr(result); - CHECK_ACCESS(result_ptr); - LDKCResult_TxOutUtxoLookupErrorZ result_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(result_ptr); - UtxoFuture_resolve(&this_arg_conv, &graph_conv, &gossip_conv, result_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PublicHopCandidate_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPublicHopCandidate orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKPublicHopCandidate ret_var = PublicHopCandidate_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeId_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKNodeId this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PrivateHopCandidate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPrivateHopCandidate this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - NodeId_free(this_obj_conv); + PrivateHopCandidate_free(this_obj_conv); } -static inline uint64_t NodeId_clone_ptr(LDKNodeId *NONNULL_PTR arg) { - LDKNodeId ret_var = NodeId_clone(arg); +static inline uint64_t PrivateHopCandidate_clone_ptr(LDKPrivateHopCandidate *NONNULL_PTR arg) { + LDKPrivateHopCandidate ret_var = PrivateHopCandidate_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKNodeId arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateHopCandidate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPrivateHopCandidate arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = NodeId_clone_ptr(&arg_conv); + int64_t ret_conv = PrivateHopCandidate_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKNodeId orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateHopCandidate_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPrivateHopCandidate orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKNodeId ret_var = NodeId_clone(&orig_conv); + LDKPrivateHopCandidate ret_var = PrivateHopCandidate_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1from_1pubkey(JNIEnv *env, jclass clz, int8_tArray pubkey) { - LDKPublicKey pubkey_ref; - CHECK((*env)->GetArrayLength(env, pubkey) == 33); - (*env)->GetByteArrayRegion(env, pubkey, 0, 33, pubkey_ref.compressed_form); - LDKNodeId ret_var = NodeId_from_pubkey(pubkey_ref); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPathCandidate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBlindedPathCandidate this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + BlindedPathCandidate_free(this_obj_conv); +} + +static inline uint64_t BlindedPathCandidate_clone_ptr(LDKBlindedPathCandidate *NONNULL_PTR arg) { + LDKBlindedPathCandidate ret_var = BlindedPathCandidate_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1from_1slice(JNIEnv *env, jclass clz, int8_tArray bytes) { - LDKu8slice bytes_ref; - bytes_ref.datalen = (*env)->GetArrayLength(env, bytes); - bytes_ref.data = (*env)->GetByteArrayElements (env, bytes, NULL); - LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); - *ret_conv = NodeId_from_slice(bytes_ref); - (*env)->ReleaseByteArrayElements(env, bytes, (int8_t*)bytes_ref.data, 0); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeId_1as_1slice(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeId this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKu8slice ret_var = NodeId_as_slice(&this_arg_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - return ret_arr; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeId_1as_1array(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeId this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, *NodeId_as_array(&this_arg_conv)); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1as_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeId this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_PublicKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecp256k1ErrorZ), "LDKCResult_PublicKeySecp256k1ErrorZ"); - *ret_conv = NodeId_as_pubkey(&this_arg_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_NodeId_1to_1str(JNIEnv *env, jclass clz, int64_t o) { - LDKNodeId o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = NodeId_to_str(&o_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKNodeId o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = NodeId_hash(&o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPathCandidate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBlindedPathCandidate arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = BlindedPathCandidate_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeId_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKNodeId obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = NodeId_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); - *ret_conv = NodeId_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPathCandidate_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBlindedPathCandidate orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKBlindedPathCandidate ret_var = BlindedPathCandidate_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKNetworkGraph this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OneHopBlindedPathCandidate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKOneHopBlindedPathCandidate this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - NetworkGraph_free(this_obj_conv); + OneHopBlindedPathCandidate_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKReadOnlyNetworkGraph this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ReadOnlyNetworkGraph_free(this_obj_conv); +static inline uint64_t OneHopBlindedPathCandidate_clone_ptr(LDKOneHopBlindedPathCandidate *NONNULL_PTR arg) { + LDKOneHopBlindedPathCandidate ret_var = OneHopBlindedPathCandidate_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OneHopBlindedPathCandidate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKOneHopBlindedPathCandidate arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = OneHopBlindedPathCandidate_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OneHopBlindedPathCandidate_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKOneHopBlindedPathCandidate orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKOneHopBlindedPathCandidate ret_var = OneHopBlindedPathCandidate_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); CHECK_ACCESS(this_ptr_ptr); - LDKNetworkUpdate this_ptr_conv = *(LDKNetworkUpdate*)(this_ptr_ptr); + LDKCandidateRouteHop this_ptr_conv = *(LDKCandidateRouteHop*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - NetworkUpdate_free(this_ptr_conv); + CandidateRouteHop_free(this_ptr_conv); } -static inline uint64_t NetworkUpdate_clone_ptr(LDKNetworkUpdate *NONNULL_PTR arg) { - LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); - *ret_copy = NetworkUpdate_clone(arg); +static inline uint64_t CandidateRouteHop_clone_ptr(LDKCandidateRouteHop *NONNULL_PTR arg) { + LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); + *ret_copy = CandidateRouteHop_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKNetworkUpdate* arg_conv = (LDKNetworkUpdate*)untag_ptr(arg); - int64_t ret_conv = NetworkUpdate_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCandidateRouteHop* arg_conv = (LDKCandidateRouteHop*)untag_ptr(arg); + int64_t ret_conv = CandidateRouteHop_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKNetworkUpdate* orig_conv = (LDKNetworkUpdate*)untag_ptr(orig); - LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); - *ret_copy = NetworkUpdate_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCandidateRouteHop* orig_conv = (LDKCandidateRouteHop*)untag_ptr(orig); + LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); + *ret_copy = CandidateRouteHop_clone(orig_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1channel_1update_1message(JNIEnv *env, jclass clz, int64_t msg) { - LDKChannelUpdate msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ChannelUpdate_clone(&msg_conv); - LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); - *ret_copy = NetworkUpdate_channel_update_message(msg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1first_1hop(JNIEnv *env, jclass clz, int64_t a) { + LDKFirstHopCandidate a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = FirstHopCandidate_clone(&a_conv); + LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); + *ret_copy = CandidateRouteHop_first_hop(a_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1channel_1failure(JNIEnv *env, jclass clz, int64_t short_channel_id, jboolean is_permanent) { - LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); - *ret_copy = NetworkUpdate_channel_failure(short_channel_id, is_permanent); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1public_1hop(JNIEnv *env, jclass clz, int64_t a) { + LDKPublicHopCandidate a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = PublicHopCandidate_clone(&a_conv); + LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); + *ret_copy = CandidateRouteHop_public_hop(a_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1node_1failure(JNIEnv *env, jclass clz, int8_tArray node_id, jboolean is_permanent) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); - *ret_copy = NetworkUpdate_node_failure(node_id_ref, is_permanent); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1private_1hop(JNIEnv *env, jclass clz, int64_t a) { + LDKPrivateHopCandidate a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = PrivateHopCandidate_clone(&a_conv); + LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); + *ret_copy = CandidateRouteHop_private_hop(a_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKNetworkUpdate* a_conv = (LDKNetworkUpdate*)untag_ptr(a); - LDKNetworkUpdate* b_conv = (LDKNetworkUpdate*)untag_ptr(b); - jboolean ret_conv = NetworkUpdate_eq(a_conv, b_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1blinded(JNIEnv *env, jclass clz, int64_t a) { + LDKBlindedPathCandidate a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = BlindedPathCandidate_clone(&a_conv); + LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); + *ret_copy = CandidateRouteHop_blinded(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKNetworkUpdate* obj_conv = (LDKNetworkUpdate*)untag_ptr(obj); - LDKCVec_u8Z ret_var = NetworkUpdate_write(obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1one_1hop_1blinded(JNIEnv *env, jclass clz, int64_t a) { + LDKOneHopBlindedPathCandidate a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = OneHopBlindedPathCandidate_clone(&a_conv); + LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); + *ret_copy = CandidateRouteHop_one_hop_blinded(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); - *ret_conv = NetworkUpdate_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1globally_1unique_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = CandidateRouteHop_globally_unique_short_channel_id(this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKP2PGossipSync this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - P2PGossipSync_free(this_obj_conv); +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); + int32_t ret_conv = CandidateRouteHop_cltv_expiry_delta(this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1new(JNIEnv *env, jclass clz, int64_t network_graph, int64_t utxo_lookup, int64_t logger) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); + int64_t ret_conv = CandidateRouteHop_htlc_minimum_msat(this_arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1fees(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); + LDKRoutingFees ret_var = CandidateRouteHop_fees(this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1source(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); + LDKNodeId ret_var = CandidateRouteHop_source(this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1target(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); + LDKNodeId ret_var = CandidateRouteHop_target(this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_find_1route(JNIEnv *env, jclass clz, int8_tArray our_node_pubkey, int64_t route_params, int64_t network_graph, int64_tArray first_hops, int64_t logger, int64_t scorer, int64_t score_params, int8_tArray random_seed_bytes) { + LDKPublicKey our_node_pubkey_ref; + CHECK((*env)->GetArrayLength(env, our_node_pubkey) == 33); + (*env)->GetByteArrayRegion(env, our_node_pubkey, 0, 33, our_node_pubkey_ref.compressed_form); + LDKRouteParameters route_params_conv; + route_params_conv.inner = untag_ptr(route_params); + route_params_conv.is_owned = ptr_is_owned(route_params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); + route_params_conv.is_owned = false; LDKNetworkGraph network_graph_conv; network_graph_conv.inner = untag_ptr(network_graph); network_graph_conv.is_owned = ptr_is_owned(network_graph); CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); network_graph_conv.is_owned = false; - void* utxo_lookup_ptr = untag_ptr(utxo_lookup); - CHECK_ACCESS(utxo_lookup_ptr); - LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr); - // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ - if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) { - // Manually implement clone for Java trait instances - if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some); + LDKCVec_ChannelDetailsZ first_hops_constr; + LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL; + if (first_hops != NULL) { + first_hops_constr.datalen = (*env)->GetArrayLength(env, first_hops); + if (first_hops_constr.datalen > 0) + first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); + else + first_hops_constr.data = NULL; + int64_t* first_hops_vals = (*env)->GetLongArrayElements (env, first_hops, NULL); + for (size_t q = 0; q < first_hops_constr.datalen; q++) { + int64_t first_hops_conv_16 = first_hops_vals[q]; + LDKChannelDetails first_hops_conv_16_conv; + first_hops_conv_16_conv.inner = untag_ptr(first_hops_conv_16); + first_hops_conv_16_conv.is_owned = ptr_is_owned(first_hops_conv_16); + CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv); + first_hops_conv_16_conv.is_owned = false; + first_hops_constr.data[q] = first_hops_conv_16_conv; } + (*env)->ReleaseLongArrayElements(env, first_hops, first_hops_vals, 0); + first_hops_ptr = &first_hops_constr; } void* logger_ptr = untag_ptr(logger); CHECK_ACCESS(logger_ptr); @@ -75415,1206 +79380,1376 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1new(JNIEnv * // If this_arg is a JCalls struct, then we need to increment the refcnt in it. LDKLogger_JCalls_cloned(&logger_conv); } - LDKP2PGossipSync ret_var = P2PGossipSync_new(&network_graph_conv, utxo_lookup_conv, logger_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + void* scorer_ptr = untag_ptr(scorer); + if (ptr_is_owned(scorer)) { CHECK_ACCESS(scorer_ptr); } + LDKScoreLookUp* scorer_conv = (LDKScoreLookUp*)scorer_ptr; + LDKProbabilisticScoringFeeParameters score_params_conv; + score_params_conv.inner = untag_ptr(score_params); + score_params_conv.is_owned = ptr_is_owned(score_params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(score_params_conv); + score_params_conv.is_owned = false; + uint8_t random_seed_bytes_arr[32]; + CHECK((*env)->GetArrayLength(env, random_seed_bytes) == 32); + (*env)->GetByteArrayRegion(env, random_seed_bytes, 0, 32, random_seed_bytes_arr); + uint8_t (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr; + LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); + *ret_conv = find_route(our_node_pubkey_ref, &route_params_conv, &network_graph_conv, first_hops_ptr, logger_conv, scorer_conv, &score_params_conv, random_seed_bytes_ref); + if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); } + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1add_1utxo_1lookup(JNIEnv *env, jclass clz, int64_t this_arg, int64_t utxo_lookup) { - LDKP2PGossipSync this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - void* utxo_lookup_ptr = untag_ptr(utxo_lookup); - CHECK_ACCESS(utxo_lookup_ptr); - LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr); - // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ - if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) { - // Manually implement clone for Java trait instances - if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some); - } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_build_1route_1from_1hops(JNIEnv *env, jclass clz, int8_tArray our_node_pubkey, jobjectArray hops, int64_t route_params, int64_t network_graph, int64_t logger, int8_tArray random_seed_bytes) { + LDKPublicKey our_node_pubkey_ref; + CHECK((*env)->GetArrayLength(env, our_node_pubkey) == 33); + (*env)->GetByteArrayRegion(env, our_node_pubkey, 0, 33, our_node_pubkey_ref.compressed_form); + LDKCVec_PublicKeyZ hops_constr; + hops_constr.datalen = (*env)->GetArrayLength(env, hops); + if (hops_constr.datalen > 0) + hops_constr.data = MALLOC(hops_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); + else + hops_constr.data = NULL; + for (size_t i = 0; i < hops_constr.datalen; i++) { + int8_tArray hops_conv_8 = (*env)->GetObjectArrayElement(env, hops, i); + LDKPublicKey hops_conv_8_ref; + CHECK((*env)->GetArrayLength(env, hops_conv_8) == 33); + (*env)->GetByteArrayRegion(env, hops_conv_8, 0, 33, hops_conv_8_ref.compressed_form); + hops_constr.data[i] = hops_conv_8_ref; } - P2PGossipSync_add_utxo_lookup(&this_arg_conv, utxo_lookup_conv); + LDKRouteParameters route_params_conv; + route_params_conv.inner = untag_ptr(route_params); + route_params_conv.is_owned = ptr_is_owned(route_params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); + route_params_conv.is_owned = false; + LDKNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + uint8_t random_seed_bytes_arr[32]; + CHECK((*env)->GetArrayLength(env, random_seed_bytes) == 32); + (*env)->GetByteArrayRegion(env, random_seed_bytes, 0, 32, random_seed_bytes_arr); + uint8_t (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr; + LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); + *ret_conv = build_route_from_hops(our_node_pubkey_ref, hops_constr, &route_params_conv, &network_graph_conv, logger_conv, random_seed_bytes_ref); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1handle_1network_1update(JNIEnv *env, jclass clz, int64_t this_arg, int64_t network_update) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNetworkUpdate* network_update_conv = (LDKNetworkUpdate*)untag_ptr(network_update); - NetworkGraph_handle_network_update(&this_arg_conv, network_update_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoreLookUp_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKScoreLookUp this_ptr_conv = *(LDKScoreLookUp*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + ScoreLookUp_free(this_ptr_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, NetworkGraph_get_chain_hash(&this_arg_conv).data); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoreUpdate_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKScoreUpdate this_ptr_conv = *(LDKScoreUpdate*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + ScoreUpdate_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_verify_1node_1announcement(JNIEnv *env, jclass clz, int64_t msg) { - LDKNodeAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = verify_node_announcement(&msg_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKScore this_ptr_conv = *(LDKScore*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Score_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_verify_1channel_1announcement(JNIEnv *env, jclass clz, int64_t msg) { - LDKChannelAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = verify_channel_announcement(&msg_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockableScore_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKLockableScore this_ptr_conv = *(LDKLockableScore*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + LockableScore_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1as_1RoutingMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKP2PGossipSync this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WriteableScore_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKWriteableScore this_ptr_conv = *(LDKWriteableScore*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + WriteableScore_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKMultiThreadedLockableScore this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + MultiThreadedLockableScore_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1as_1LockableScore(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKMultiThreadedLockableScore this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler"); - *ret_ret = P2PGossipSync_as_RoutingMessageHandler(&this_arg_conv); + LDKLockableScore* ret_ret = MALLOC(sizeof(LDKLockableScore), "LDKLockableScore"); + *ret_ret = MultiThreadedLockableScore_as_LockableScore(&this_arg_conv); return tag_ptr(ret_ret, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKP2PGossipSync this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKMultiThreadedLockableScore obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = MultiThreadedLockableScore_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1as_1WriteableScore(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKMultiThreadedLockableScore this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); - *ret_ret = P2PGossipSync_as_MessageSendEventsProvider(&this_arg_conv); + LDKWriteableScore* ret_ret = MALLOC(sizeof(LDKWriteableScore), "LDKWriteableScore"); + *ret_ret = MultiThreadedLockableScore_as_WriteableScore(&this_arg_conv); return tag_ptr(ret_ret, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelUpdateInfo this_obj_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1new(JNIEnv *env, jclass clz, int64_t score) { + void* score_ptr = untag_ptr(score); + CHECK_ACCESS(score_ptr); + LDKScore score_conv = *(LDKScore*)(score_ptr); + if (score_conv.free == LDKScore_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKScore_JCalls_cloned(&score_conv); + } + LDKMultiThreadedLockableScore ret_var = MultiThreadedLockableScore_new(score_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLockRead_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKMultiThreadedScoreLockRead this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelUpdateInfo_free(this_obj_conv); -} - -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1last_1update(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelUpdateInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int32_t ret_conv = ChannelUpdateInfo_get_last_update(&this_ptr_conv); - return ret_conv; + MultiThreadedScoreLockRead_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1last_1update(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKChannelUpdateInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelUpdateInfo_set_last_update(&this_ptr_conv, val); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLockWrite_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKMultiThreadedScoreLockWrite this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + MultiThreadedScoreLockWrite_free(this_obj_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1enabled(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelUpdateInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - jboolean ret_conv = ChannelUpdateInfo_get_enabled(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLockRead_1as_1ScoreLookUp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKMultiThreadedScoreLockRead this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKScoreLookUp* ret_ret = MALLOC(sizeof(LDKScoreLookUp), "LDKScoreLookUp"); + *ret_ret = MultiThreadedScoreLockRead_as_ScoreLookUp(&this_arg_conv); + return tag_ptr(ret_ret, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1enabled(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKChannelUpdateInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelUpdateInfo_set_enabled(&this_ptr_conv, val); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLockWrite_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKMultiThreadedScoreLockWrite obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = MultiThreadedScoreLockWrite_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelUpdateInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int16_t ret_conv = ChannelUpdateInfo_get_cltv_expiry_delta(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLockWrite_1as_1ScoreUpdate(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKMultiThreadedScoreLockWrite this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKScoreUpdate* ret_ret = MALLOC(sizeof(LDKScoreUpdate), "LDKScoreUpdate"); + *ret_ret = MultiThreadedScoreLockWrite_as_ScoreUpdate(&this_arg_conv); + return tag_ptr(ret_ret, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKChannelUpdateInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelUpdateInfo_set_cltv_expiry_delta(&this_ptr_conv, val); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelUsage this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelUsage_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelUpdateInfo this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelUsage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelUpdateInfo_get_htlc_minimum_msat(&this_ptr_conv); + int64_t ret_conv = ChannelUsage_get_amount_msat(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelUpdateInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelUsage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelUpdateInfo_set_htlc_minimum_msat(&this_ptr_conv, val); + ChannelUsage_set_amount_msat(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelUpdateInfo this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1inflight_1htlc_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelUsage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelUpdateInfo_get_htlc_maximum_msat(&this_ptr_conv); + int64_t ret_conv = ChannelUsage_get_inflight_htlc_msat(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelUpdateInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelUpdateInfo_set_htlc_maximum_msat(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1fees(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelUpdateInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKRoutingFees ret_var = ChannelUpdateInfo_get_fees(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1fees(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelUpdateInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1inflight_1htlc_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelUsage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKRoutingFees val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = RoutingFees_clone(&val_conv); - ChannelUpdateInfo_set_fees(&this_ptr_conv, val_conv); + ChannelUsage_set_inflight_htlc_msat(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1last_1update_1message(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelUpdateInfo this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1effective_1capacity(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelUsage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelUpdate ret_var = ChannelUpdateInfo_get_last_update_message(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = ChannelUsage_get_effective_capacity(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1last_1update_1message(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelUpdateInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1effective_1capacity(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelUsage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelUpdate val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelUpdate_clone(&val_conv); - ChannelUpdateInfo_set_last_update_message(&this_ptr_conv, val_conv); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKEffectiveCapacity val_conv = *(LDKEffectiveCapacity*)(val_ptr); + val_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(val)); + ChannelUsage_set_effective_capacity(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1new(JNIEnv *env, jclass clz, int32_t last_update_arg, jboolean enabled_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg, int64_t fees_arg, int64_t last_update_message_arg) { - LDKRoutingFees fees_arg_conv; - fees_arg_conv.inner = untag_ptr(fees_arg); - fees_arg_conv.is_owned = ptr_is_owned(fees_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv); - fees_arg_conv = RoutingFees_clone(&fees_arg_conv); - LDKChannelUpdate last_update_message_arg_conv; - last_update_message_arg_conv.inner = untag_ptr(last_update_message_arg); - last_update_message_arg_conv.is_owned = ptr_is_owned(last_update_message_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(last_update_message_arg_conv); - last_update_message_arg_conv = ChannelUpdate_clone(&last_update_message_arg_conv); - LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_new(last_update_arg, enabled_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, fees_arg_conv, last_update_message_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1new(JNIEnv *env, jclass clz, int64_t amount_msat_arg, int64_t inflight_htlc_msat_arg, int64_t effective_capacity_arg) { + void* effective_capacity_arg_ptr = untag_ptr(effective_capacity_arg); + CHECK_ACCESS(effective_capacity_arg_ptr); + LDKEffectiveCapacity effective_capacity_arg_conv = *(LDKEffectiveCapacity*)(effective_capacity_arg_ptr); + effective_capacity_arg_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(effective_capacity_arg)); + LDKChannelUsage ret_var = ChannelUsage_new(amount_msat_arg, inflight_htlc_msat_arg, effective_capacity_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t ChannelUpdateInfo_clone_ptr(LDKChannelUpdateInfo *NONNULL_PTR arg) { - LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_clone(arg); +static inline uint64_t ChannelUsage_clone_ptr(LDKChannelUsage *NONNULL_PTR arg) { + LDKChannelUsage ret_var = ChannelUsage_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelUpdateInfo arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelUsage arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = ChannelUpdateInfo_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelUsage_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelUpdateInfo orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelUsage orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_clone(&orig_conv); + LDKChannelUsage ret_var = ChannelUsage_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKChannelUpdateInfo a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKChannelUpdateInfo b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = ChannelUpdateInfo_eq(&a_conv, &b_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKFixedPenaltyScorer this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + FixedPenaltyScorer_free(this_obj_conv); } -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1to_1str(JNIEnv *env, jclass clz, int64_t o) { - LDKChannelUpdateInfo o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = ChannelUpdateInfo_to_str(&o_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); +static inline uint64_t FixedPenaltyScorer_clone_ptr(LDKFixedPenaltyScorer *NONNULL_PTR arg) { + LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKFixedPenaltyScorer arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = FixedPenaltyScorer_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelUpdateInfo obj_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKFixedPenaltyScorer orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1with_1penalty(JNIEnv *env, jclass clz, int64_t penalty_msat) { + LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_with_penalty(penalty_msat); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1as_1ScoreLookUp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKFixedPenaltyScorer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKScoreLookUp* ret_ret = MALLOC(sizeof(LDKScoreLookUp), "LDKScoreLookUp"); + *ret_ret = FixedPenaltyScorer_as_ScoreLookUp(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1as_1ScoreUpdate(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKFixedPenaltyScorer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKScoreUpdate* ret_ret = MALLOC(sizeof(LDKScoreUpdate), "LDKScoreUpdate"); + *ret_ret = FixedPenaltyScorer_as_ScoreUpdate(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKFixedPenaltyScorer obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ChannelUpdateInfo_write(&obj_conv); + LDKCVec_u8Z ret_var = FixedPenaltyScorer_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ"); - *ret_conv = ChannelUpdateInfo_read(ser_ref); + LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); + *ret_conv = FixedPenaltyScorer_read(ser_ref, arg); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelInfo this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKProbabilisticScorer this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelInfo_free(this_obj_conv); + ProbabilisticScorer_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKProbabilisticScoringFeeParameters this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ProbabilisticScoringFeeParameters_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1base_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelFeatures ret_var = ChannelInfo_get_features(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + int64_t ret_conv = ProbabilisticScoringFeeParameters_get_base_penalty_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1base_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelFeatures val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelFeatures_clone(&val_conv); - ChannelInfo_set_features(&this_ptr_conv, val_conv); + ProbabilisticScoringFeeParameters_set_base_penalty_msat(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1one(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelInfo this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1base_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeId ret_var = ChannelInfo_get_node_one(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + int64_t ret_conv = ProbabilisticScoringFeeParameters_get_base_penalty_amount_multiplier_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1one(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1base_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeId val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = NodeId_clone(&val_conv); - ChannelInfo_set_node_one(&this_ptr_conv, val_conv); + ProbabilisticScoringFeeParameters_set_base_penalty_amount_multiplier_msat(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1one_1to_1two(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelInfo this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1liquidity_1penalty_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelUpdateInfo ret_var = ChannelInfo_get_one_to_two(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + int64_t ret_conv = ProbabilisticScoringFeeParameters_get_liquidity_penalty_multiplier_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1one_1to_1two(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1liquidity_1penalty_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelUpdateInfo val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelUpdateInfo_clone(&val_conv); - ChannelInfo_set_one_to_two(&this_ptr_conv, val_conv); + ProbabilisticScoringFeeParameters_set_liquidity_penalty_multiplier_msat(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1two(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelInfo this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1liquidity_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeId ret_var = ChannelInfo_get_node_two(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + int64_t ret_conv = ProbabilisticScoringFeeParameters_get_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1two(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1liquidity_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeId val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = NodeId_clone(&val_conv); - ChannelInfo_set_node_two(&this_ptr_conv, val_conv); + ProbabilisticScoringFeeParameters_set_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1two_1to_1one(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelInfo this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1historical_1liquidity_1penalty_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelUpdateInfo ret_var = ChannelInfo_get_two_to_one(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + int64_t ret_conv = ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_multiplier_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1two_1to_1one(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1historical_1liquidity_1penalty_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelUpdateInfo val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelUpdateInfo_clone(&val_conv); - ChannelInfo_set_two_to_one(&this_ptr_conv, val_conv); + ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_multiplier_msat(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1capacity_1sats(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelInfo this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1historical_1liquidity_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelInfo_get_capacity_sats(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + int64_t ret_conv = ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1capacity_1sats(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1historical_1liquidity_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - ChannelInfo_set_capacity_sats(&this_ptr_conv, val_conv); + ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1announcement_1message(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelInfo this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1anti_1probing_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelAnnouncement ret_var = ChannelInfo_get_announcement_message(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + int64_t ret_conv = ProbabilisticScoringFeeParameters_get_anti_probing_penalty_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1announcement_1message(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1anti_1probing_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelAnnouncement val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelAnnouncement_clone(&val_conv); - ChannelInfo_set_announcement_message(&this_ptr_conv, val_conv); -} - -static inline uint64_t ChannelInfo_clone_ptr(LDKChannelInfo *NONNULL_PTR arg) { - LDKChannelInfo ret_var = ChannelInfo_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelInfo arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = ChannelInfo_clone_ptr(&arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelInfo orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKChannelInfo ret_var = ChannelInfo_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + ProbabilisticScoringFeeParameters_set_anti_probing_penalty_msat(&this_ptr_conv, val); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKChannelInfo a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKChannelInfo b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = ChannelInfo_eq(&a_conv, &b_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1considered_1impossible_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ProbabilisticScoringFeeParameters_get_considered_impossible_penalty_msat(&this_ptr_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1directional_1info(JNIEnv *env, jclass clz, int64_t this_arg, int8_t channel_flags) { - LDKChannelInfo this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelUpdateInfo ret_var = ChannelInfo_get_directional_info(&this_arg_conv, channel_flags); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1considered_1impossible_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ProbabilisticScoringFeeParameters_set_considered_impossible_penalty_msat(&this_ptr_conv, val); } -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1to_1str(JNIEnv *env, jclass clz, int64_t o) { - LDKChannelInfo o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = ChannelInfo_to_str(&o_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1linear_1success_1probability(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + jboolean ret_conv = ProbabilisticScoringFeeParameters_get_linear_success_probability(&this_ptr_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelInfo obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ChannelInfo_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); - *ret_conv = ChannelInfo_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKDirectedChannelInfo this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - DirectedChannelInfo_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1linear_1success_1probability(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKProbabilisticScoringFeeParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ProbabilisticScoringFeeParameters_set_linear_success_probability(&this_ptr_conv, val); } -static inline uint64_t DirectedChannelInfo_clone_ptr(LDKDirectedChannelInfo *NONNULL_PTR arg) { - LDKDirectedChannelInfo ret_var = DirectedChannelInfo_clone(arg); +static inline uint64_t ProbabilisticScoringFeeParameters_clone_ptr(LDKProbabilisticScoringFeeParameters *NONNULL_PTR arg) { + LDKProbabilisticScoringFeeParameters ret_var = ProbabilisticScoringFeeParameters_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKDirectedChannelInfo arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKProbabilisticScoringFeeParameters arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = DirectedChannelInfo_clone_ptr(&arg_conv); + int64_t ret_conv = ProbabilisticScoringFeeParameters_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKDirectedChannelInfo orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKProbabilisticScoringFeeParameters orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKDirectedChannelInfo ret_var = DirectedChannelInfo_clone(&orig_conv); + LDKProbabilisticScoringFeeParameters ret_var = ProbabilisticScoringFeeParameters_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1channel(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKDirectedChannelInfo this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelInfo ret_var = DirectedChannelInfo_channel(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1default(JNIEnv *env, jclass clz) { + LDKProbabilisticScoringFeeParameters ret_var = ProbabilisticScoringFeeParameters_default(); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1effective_1capacity(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKDirectedChannelInfo this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1add_1banned(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_id) { + LDKProbabilisticScoringFeeParameters this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = DirectedChannelInfo_effective_capacity(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKNodeId node_id_conv; + node_id_conv.inner = untag_ptr(node_id); + node_id_conv.is_owned = ptr_is_owned(node_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); + node_id_conv.is_owned = false; + ProbabilisticScoringFeeParameters_add_banned(&this_arg_conv, &node_id_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1source(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKDirectedChannelInfo this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1add_1banned_1from_1list(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray node_ids) { + LDKProbabilisticScoringFeeParameters this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKNodeId ret_var = DirectedChannelInfo_source(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + LDKCVec_NodeIdZ node_ids_constr; + node_ids_constr.datalen = (*env)->GetArrayLength(env, node_ids); + if (node_ids_constr.datalen > 0) + node_ids_constr.data = MALLOC(node_ids_constr.datalen * sizeof(LDKNodeId), "LDKCVec_NodeIdZ Elements"); + else + node_ids_constr.data = NULL; + int64_t* node_ids_vals = (*env)->GetLongArrayElements (env, node_ids, NULL); + for (size_t i = 0; i < node_ids_constr.datalen; i++) { + int64_t node_ids_conv_8 = node_ids_vals[i]; + LDKNodeId node_ids_conv_8_conv; + node_ids_conv_8_conv.inner = untag_ptr(node_ids_conv_8); + node_ids_conv_8_conv.is_owned = ptr_is_owned(node_ids_conv_8); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_ids_conv_8_conv); + node_ids_conv_8_conv = NodeId_clone(&node_ids_conv_8_conv); + node_ids_constr.data[i] = node_ids_conv_8_conv; + } + (*env)->ReleaseLongArrayElements(env, node_ids, node_ids_vals, 0); + ProbabilisticScoringFeeParameters_add_banned_from_list(&this_arg_conv, node_ids_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1target(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKDirectedChannelInfo this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1remove_1banned(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_id) { + LDKProbabilisticScoringFeeParameters this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKNodeId ret_var = DirectedChannelInfo_target(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + LDKNodeId node_id_conv; + node_id_conv.inner = untag_ptr(node_id); + node_id_conv.is_owned = ptr_is_owned(node_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); + node_id_conv.is_owned = false; + ProbabilisticScoringFeeParameters_remove_banned(&this_arg_conv, &node_id_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKEffectiveCapacity this_ptr_conv = *(LDKEffectiveCapacity*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - EffectiveCapacity_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1manual_1penalty(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_id, int64_t penalty) { + LDKProbabilisticScoringFeeParameters this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeId node_id_conv; + node_id_conv.inner = untag_ptr(node_id); + node_id_conv.is_owned = ptr_is_owned(node_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); + node_id_conv.is_owned = false; + ProbabilisticScoringFeeParameters_set_manual_penalty(&this_arg_conv, &node_id_conv, penalty); } -static inline uint64_t EffectiveCapacity_clone_ptr(LDKEffectiveCapacity *NONNULL_PTR arg) { - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1remove_1manual_1penalty(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_id) { + LDKProbabilisticScoringFeeParameters this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeId node_id_conv; + node_id_conv.inner = untag_ptr(node_id); + node_id_conv.is_owned = ptr_is_owned(node_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); + node_id_conv.is_owned = false; + ProbabilisticScoringFeeParameters_remove_manual_penalty(&this_arg_conv, &node_id_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKEffectiveCapacity* arg_conv = (LDKEffectiveCapacity*)untag_ptr(arg); - int64_t ret_conv = EffectiveCapacity_clone_ptr(arg_conv); - return ret_conv; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1clear_1manual_1penalties(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKProbabilisticScoringFeeParameters this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ProbabilisticScoringFeeParameters_clear_manual_penalties(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKEffectiveCapacity* orig_conv = (LDKEffectiveCapacity*)untag_ptr(orig); - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1exact_1liquidity(JNIEnv *env, jclass clz, int64_t liquidity_msat) { - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_exact_liquidity(liquidity_msat); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1advertised_1max_1htlc(JNIEnv *env, jclass clz, int64_t amount_msat) { - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_advertised_max_htlc(amount_msat); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1total(JNIEnv *env, jclass clz, int64_t capacity_msat, int64_t htlc_maximum_msat) { - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_total(capacity_msat, htlc_maximum_msat); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1infinite(JNIEnv *env, jclass clz) { - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_infinite(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1hint_1max_1htlc(JNIEnv *env, jclass clz, int64_t amount_msat) { - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_hint_max_htlc(amount_msat); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1unknown(JNIEnv *env, jclass clz) { - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_unknown(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1as_1msat(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKEffectiveCapacity* this_arg_conv = (LDKEffectiveCapacity*)untag_ptr(this_arg); - int64_t ret_conv = EffectiveCapacity_as_msat(this_arg_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKRoutingFees this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKProbabilisticScoringDecayParameters this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - RoutingFees_free(this_obj_conv); + ProbabilisticScoringDecayParameters_free(this_obj_conv); } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRoutingFees this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1get_1historical_1no_1updates_1half_1life(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKProbabilisticScoringDecayParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int32_t ret_conv = RoutingFees_get_base_msat(&this_ptr_conv); + int64_t ret_conv = ProbabilisticScoringDecayParameters_get_historical_no_updates_half_life(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKRoutingFees this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1set_1historical_1no_1updates_1half_1life(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringDecayParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - RoutingFees_set_base_msat(&this_ptr_conv, val); + ProbabilisticScoringDecayParameters_set_historical_no_updates_half_life(&this_ptr_conv, val); } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRoutingFees this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1get_1liquidity_1offset_1half_1life(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKProbabilisticScoringDecayParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int32_t ret_conv = RoutingFees_get_proportional_millionths(&this_ptr_conv); + int64_t ret_conv = ProbabilisticScoringDecayParameters_get_liquidity_offset_half_life(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKRoutingFees this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1set_1liquidity_1offset_1half_1life(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKProbabilisticScoringDecayParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - RoutingFees_set_proportional_millionths(&this_ptr_conv, val); + ProbabilisticScoringDecayParameters_set_liquidity_offset_half_life(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1new(JNIEnv *env, jclass clz, int32_t base_msat_arg, int32_t proportional_millionths_arg) { - LDKRoutingFees ret_var = RoutingFees_new(base_msat_arg, proportional_millionths_arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1new(JNIEnv *env, jclass clz, int64_t historical_no_updates_half_life_arg, int64_t liquidity_offset_half_life_arg) { + LDKProbabilisticScoringDecayParameters ret_var = ProbabilisticScoringDecayParameters_new(historical_no_updates_half_life_arg, liquidity_offset_half_life_arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RoutingFees_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKRoutingFees a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKRoutingFees b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = RoutingFees_eq(&a_conv, &b_conv); - return ret_conv; -} - -static inline uint64_t RoutingFees_clone_ptr(LDKRoutingFees *NONNULL_PTR arg) { - LDKRoutingFees ret_var = RoutingFees_clone(arg); +static inline uint64_t ProbabilisticScoringDecayParameters_clone_ptr(LDKProbabilisticScoringDecayParameters *NONNULL_PTR arg) { + LDKProbabilisticScoringDecayParameters ret_var = ProbabilisticScoringDecayParameters_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKRoutingFees arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKProbabilisticScoringDecayParameters arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = RoutingFees_clone_ptr(&arg_conv); + int64_t ret_conv = ProbabilisticScoringDecayParameters_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKRoutingFees orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKProbabilisticScoringDecayParameters orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKRoutingFees ret_var = RoutingFees_clone(&orig_conv); + LDKProbabilisticScoringDecayParameters ret_var = ProbabilisticScoringDecayParameters_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKRoutingFees o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = RoutingFees_hash(&o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1default(JNIEnv *env, jclass clz) { + LDKProbabilisticScoringDecayParameters ret_var = ProbabilisticScoringDecayParameters_default(); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RoutingFees_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKRoutingFees obj_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1new(JNIEnv *env, jclass clz, int64_t decay_params, int64_t network_graph, int64_t logger) { + LDKProbabilisticScoringDecayParameters decay_params_conv; + decay_params_conv.inner = untag_ptr(decay_params); + decay_params_conv.is_owned = ptr_is_owned(decay_params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(decay_params_conv); + decay_params_conv = ProbabilisticScoringDecayParameters_clone(&decay_params_conv); + LDKNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKProbabilisticScorer ret_var = ProbabilisticScorer_new(decay_params_conv, &network_graph_conv, logger_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1debug_1log_1liquidity_1stats(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKProbabilisticScorer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ProbabilisticScorer_debug_log_liquidity_stats(&this_arg_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1estimated_1channel_1liquidity_1range(JNIEnv *env, jclass clz, int64_t this_arg, int64_t scid, int64_t target) { + LDKProbabilisticScorer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeId target_conv; + target_conv.inner = untag_ptr(target); + target_conv.is_owned = ptr_is_owned(target); + CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); + target_conv.is_owned = false; + LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ"); + *ret_copy = ProbabilisticScorer_estimated_channel_liquidity_range(&this_arg_conv, scid, &target_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1historical_1estimated_1channel_1liquidity_1probabilities(JNIEnv *env, jclass clz, int64_t this_arg, int64_t scid, int64_t target) { + LDKProbabilisticScorer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeId target_conv; + target_conv.inner = untag_ptr(target); + target_conv.is_owned = ptr_is_owned(target); + CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); + target_conv.is_owned = false; + LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ), "LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ"); + *ret_copy = ProbabilisticScorer_historical_estimated_channel_liquidity_probabilities(&this_arg_conv, scid, &target_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1historical_1estimated_1payment_1success_1probability(JNIEnv *env, jclass clz, int64_t this_arg, int64_t scid, int64_t target, int64_t amount_msat, int64_t params) { + LDKProbabilisticScorer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeId target_conv; + target_conv.inner = untag_ptr(target); + target_conv.is_owned = ptr_is_owned(target); + CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); + target_conv.is_owned = false; + LDKProbabilisticScoringFeeParameters params_conv; + params_conv.inner = untag_ptr(params); + params_conv.is_owned = ptr_is_owned(params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); + params_conv.is_owned = false; + LDKCOption_f64Z *ret_copy = MALLOC(sizeof(LDKCOption_f64Z), "LDKCOption_f64Z"); + *ret_copy = ProbabilisticScorer_historical_estimated_payment_success_probability(&this_arg_conv, scid, &target_conv, amount_msat, ¶ms_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1as_1ScoreLookUp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKProbabilisticScorer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKScoreLookUp* ret_ret = MALLOC(sizeof(LDKScoreLookUp), "LDKScoreLookUp"); + *ret_ret = ProbabilisticScorer_as_ScoreLookUp(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1as_1ScoreUpdate(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKProbabilisticScorer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKScoreUpdate* ret_ret = MALLOC(sizeof(LDKScoreUpdate), "LDKScoreUpdate"); + *ret_ret = ProbabilisticScorer_as_ScoreUpdate(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1as_1Score(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKProbabilisticScorer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore"); + *ret_ret = ProbabilisticScorer_as_Score(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKProbabilisticScorer obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = RoutingFees_write(&obj_conv); + LDKCVec_u8Z ret_var = ProbabilisticScorer_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg_a, int64_t arg_b, int64_t arg_c) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); - *ret_conv = RoutingFees_read(ser_ref); + LDKProbabilisticScoringDecayParameters arg_a_conv; + arg_a_conv.inner = untag_ptr(arg_a); + arg_a_conv.is_owned = ptr_is_owned(arg_a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_a_conv); + arg_a_conv = ProbabilisticScoringDecayParameters_clone(&arg_a_conv); + LDKNetworkGraph arg_b_conv; + arg_b_conv.inner = untag_ptr(arg_b); + arg_b_conv.is_owned = ptr_is_owned(arg_b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_b_conv); + arg_b_conv.is_owned = false; + void* arg_c_ptr = untag_ptr(arg_c); + CHECK_ACCESS(arg_c_ptr); + LDKLogger arg_c_conv = *(LDKLogger*)(arg_c_ptr); + if (arg_c_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&arg_c_conv); + } + LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ"); + *ret_conv = ProbabilisticScorer_read(ser_ref, arg_a_conv, &arg_b_conv, arg_c_conv); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKNodeAnnouncementInfo this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKDelayedPaymentOutputDescriptor this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - NodeAnnouncementInfo_free(this_obj_conv); + DelayedPaymentOutputDescriptor_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKNodeAnnouncementInfo this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeFeatures ret_var = NodeAnnouncementInfo_get_features(&this_ptr_conv); + LDKOutPoint ret_var = DelayedPaymentOutputDescriptor_get_outpoint(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKNodeAnnouncementInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeFeatures val_conv; + LDKOutPoint val_conv; val_conv.inner = untag_ptr(val); val_conv.is_owned = ptr_is_owned(val); CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = NodeFeatures_clone(&val_conv); - NodeAnnouncementInfo_set_features(&this_ptr_conv, val_conv); + val_conv = OutPoint_clone(&val_conv); + DelayedPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DelayedPaymentOutputDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + DelayedPaymentOutputDescriptor_set_per_commitment_point(&this_ptr_conv, val_ref); } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1last_1update(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKNodeAnnouncementInfo this_ptr_conv; +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int32_t ret_conv = NodeAnnouncementInfo_get_last_update(&this_ptr_conv); + int16_t ret_conv = DelayedPaymentOutputDescriptor_get_to_self_delay(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1last_1update(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKNodeAnnouncementInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - NodeAnnouncementInfo_set_last_update(&this_ptr_conv, val); + DelayedPaymentOutputDescriptor_set_to_self_delay(&this_ptr_conv, val); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1rgb(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKNodeAnnouncementInfo this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1output(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 3); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 3, *NodeAnnouncementInfo_get_rgb(&this_ptr_conv)); - return ret_arr; + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = DelayedPaymentOutputDescriptor_get_output(&this_ptr_conv); + return tag_ptr(ret_ref, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1rgb(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKNodeAnnouncementInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1output(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThreeBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 3); - (*env)->GetByteArrayRegion(env, val, 0, 3, val_ref.data); - NodeAnnouncementInfo_set_rgb(&this_ptr_conv, val_ref); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); + val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val)); + DelayedPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1alias(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKNodeAnnouncementInfo this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1revocation_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeAlias ret_var = NodeAnnouncementInfo_get_alias(&this_ptr_conv); + LDKRevocationKey ret_var = DelayedPaymentOutputDescriptor_get_revocation_pubkey(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1alias(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKNodeAnnouncementInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1revocation_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeAlias val_conv; + LDKRevocationKey val_conv; val_conv.inner = untag_ptr(val); val_conv.is_owned = ptr_is_owned(val); CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = NodeAlias_clone(&val_conv); - NodeAnnouncementInfo_set_alias(&this_ptr_conv, val_conv); + val_conv = RevocationKey_clone(&val_conv); + DelayedPaymentOutputDescriptor_set_revocation_pubkey(&this_ptr_conv, val_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *DelayedPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv)); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + DelayedPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = DelayedPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + DelayedPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1announcement_1message(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKNodeAnnouncementInfo this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1transaction_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeAnnouncement ret_var = NodeAnnouncementInfo_get_announcement_message(&this_ptr_conv); + LDKChannelTransactionParameters ret_var = DelayedPaymentOutputDescriptor_get_channel_transaction_parameters(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1announcement_1message(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKNodeAnnouncementInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1transaction_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeAnnouncement val_conv; + LDKChannelTransactionParameters val_conv; val_conv.inner = untag_ptr(val); val_conv.is_owned = ptr_is_owned(val); CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = NodeAnnouncement_clone(&val_conv); - NodeAnnouncementInfo_set_announcement_message(&this_ptr_conv, val_conv); + val_conv = ChannelTransactionParameters_clone(&val_conv); + DelayedPaymentOutputDescriptor_set_channel_transaction_parameters(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1new(JNIEnv *env, jclass clz, int64_t features_arg, int32_t last_update_arg, int8_tArray rgb_arg, int64_t alias_arg, int64_t announcement_message_arg) { - LDKNodeFeatures features_arg_conv; - features_arg_conv.inner = untag_ptr(features_arg); - features_arg_conv.is_owned = ptr_is_owned(features_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); - features_arg_conv = NodeFeatures_clone(&features_arg_conv); - LDKThreeBytes rgb_arg_ref; - CHECK((*env)->GetArrayLength(env, rgb_arg) == 3); - (*env)->GetByteArrayRegion(env, rgb_arg, 0, 3, rgb_arg_ref.data); - LDKNodeAlias alias_arg_conv; - alias_arg_conv.inner = untag_ptr(alias_arg); - alias_arg_conv.is_owned = ptr_is_owned(alias_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(alias_arg_conv); - alias_arg_conv = NodeAlias_clone(&alias_arg_conv); - LDKNodeAnnouncement announcement_message_arg_conv; - announcement_message_arg_conv.inner = untag_ptr(announcement_message_arg); - announcement_message_arg_conv.is_owned = ptr_is_owned(announcement_message_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_message_arg_conv); - announcement_message_arg_conv = NodeAnnouncement_clone(&announcement_message_arg_conv); - LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_new(features_arg_conv, last_update_arg, rgb_arg_ref, alias_arg_conv, announcement_message_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1new(JNIEnv *env, jclass clz, int64_t outpoint_arg, int8_tArray per_commitment_point_arg, int16_t to_self_delay_arg, int64_t output_arg, int64_t revocation_pubkey_arg, int8_tArray channel_keys_id_arg, int64_t channel_value_satoshis_arg, int64_t channel_transaction_parameters_arg) { + LDKOutPoint outpoint_arg_conv; + outpoint_arg_conv.inner = untag_ptr(outpoint_arg); + outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); + outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); + LDKPublicKey per_commitment_point_arg_ref; + CHECK((*env)->GetArrayLength(env, per_commitment_point_arg) == 33); + (*env)->GetByteArrayRegion(env, per_commitment_point_arg, 0, 33, per_commitment_point_arg_ref.compressed_form); + void* output_arg_ptr = untag_ptr(output_arg); + CHECK_ACCESS(output_arg_ptr); + LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr); + output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg)); + LDKRevocationKey revocation_pubkey_arg_conv; + revocation_pubkey_arg_conv.inner = untag_ptr(revocation_pubkey_arg); + revocation_pubkey_arg_conv.is_owned = ptr_is_owned(revocation_pubkey_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(revocation_pubkey_arg_conv); + revocation_pubkey_arg_conv = RevocationKey_clone(&revocation_pubkey_arg_conv); + LDKThirtyTwoBytes channel_keys_id_arg_ref; + CHECK((*env)->GetArrayLength(env, channel_keys_id_arg) == 32); + (*env)->GetByteArrayRegion(env, channel_keys_id_arg, 0, 32, channel_keys_id_arg_ref.data); + LDKChannelTransactionParameters channel_transaction_parameters_arg_conv; + channel_transaction_parameters_arg_conv.inner = untag_ptr(channel_transaction_parameters_arg); + channel_transaction_parameters_arg_conv.is_owned = ptr_is_owned(channel_transaction_parameters_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_transaction_parameters_arg_conv); + channel_transaction_parameters_arg_conv = ChannelTransactionParameters_clone(&channel_transaction_parameters_arg_conv); + LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_new(outpoint_arg_conv, per_commitment_point_arg_ref, to_self_delay_arg, output_arg_conv, revocation_pubkey_arg_conv, channel_keys_id_arg_ref, channel_value_satoshis_arg, channel_transaction_parameters_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t NodeAnnouncementInfo_clone_ptr(LDKNodeAnnouncementInfo *NONNULL_PTR arg) { - LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(arg); +static inline uint64_t DelayedPaymentOutputDescriptor_clone_ptr(LDKDelayedPaymentOutputDescriptor *NONNULL_PTR arg) { + LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKNodeAnnouncementInfo arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKDelayedPaymentOutputDescriptor arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = NodeAnnouncementInfo_clone_ptr(&arg_conv); + int64_t ret_conv = DelayedPaymentOutputDescriptor_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKNodeAnnouncementInfo orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKDelayedPaymentOutputDescriptor orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(&orig_conv); + LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKNodeAnnouncementInfo a_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKDelayedPaymentOutputDescriptor o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = DelayedPaymentOutputDescriptor_hash(&o_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKDelayedPaymentOutputDescriptor a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKNodeAnnouncementInfo b_conv; + LDKDelayedPaymentOutputDescriptor b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = NodeAnnouncementInfo_eq(&a_conv, &b_conv); + jboolean ret_conv = DelayedPaymentOutputDescriptor_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1addresses(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeAnnouncementInfo this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_SocketAddressZ ret_var = NodeAnnouncementInfo_addresses(&this_arg_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t p = 0; p < ret_var.datalen; p++) { - LDKSocketAddress *ret_conv_15_copy = MALLOC(sizeof(LDKSocketAddress), "LDKSocketAddress"); - *ret_conv_15_copy = ret_var.data[p]; - int64_t ret_conv_15_ref = tag_ptr(ret_conv_15_copy, true); - ret_arr_ptr[p] = ret_conv_15_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKNodeAnnouncementInfo obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKDelayedPaymentOutputDescriptor obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = NodeAnnouncementInfo_write(&obj_conv); + LDKCVec_u8Z ret_var = DelayedPaymentOutputDescriptor_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); - *ret_conv = NodeAnnouncementInfo_read(ser_ref); + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = DelayedPaymentOutputDescriptor_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAlias_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKNodeAlias this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKStaticPaymentOutputDescriptor this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - NodeAlias_free(this_obj_conv); + StaticPaymentOutputDescriptor_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAlias_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKNodeAlias this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *NodeAlias_get_a(&this_ptr_conv)); + LDKOutPoint ret_var = StaticPaymentOutputDescriptor_get_outpoint(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKOutPoint val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = OutPoint_clone(&val_conv); + StaticPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1output(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = StaticPaymentOutputDescriptor_get_output(&this_ptr_conv); + return tag_ptr(ret_ref, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1output(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); + val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val)); + StaticPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *StaticPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAlias_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKNodeAlias this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -76622,11943 +80757,13267 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAlias_1set_1a(JNIEnv *env, LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - NodeAlias_set_a(&this_ptr_conv, val_ref); + StaticPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAlias_1new(JNIEnv *env, jclass clz, int8_tArray a_arg) { - LDKThirtyTwoBytes a_arg_ref; - CHECK((*env)->GetArrayLength(env, a_arg) == 32); - (*env)->GetByteArrayRegion(env, a_arg, 0, 32, a_arg_ref.data); - LDKNodeAlias ret_var = NodeAlias_new(a_arg_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = StaticPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + StaticPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1transaction_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelTransactionParameters ret_var = StaticPaymentOutputDescriptor_get_channel_transaction_parameters(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t NodeAlias_clone_ptr(LDKNodeAlias *NONNULL_PTR arg) { - LDKNodeAlias ret_var = NodeAlias_clone(arg); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1transaction_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelTransactionParameters val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelTransactionParameters_clone(&val_conv); + StaticPaymentOutputDescriptor_set_channel_transaction_parameters(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1new(JNIEnv *env, jclass clz, int64_t outpoint_arg, int64_t output_arg, int8_tArray channel_keys_id_arg, int64_t channel_value_satoshis_arg, int64_t channel_transaction_parameters_arg) { + LDKOutPoint outpoint_arg_conv; + outpoint_arg_conv.inner = untag_ptr(outpoint_arg); + outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); + outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); + void* output_arg_ptr = untag_ptr(output_arg); + CHECK_ACCESS(output_arg_ptr); + LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr); + output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg)); + LDKThirtyTwoBytes channel_keys_id_arg_ref; + CHECK((*env)->GetArrayLength(env, channel_keys_id_arg) == 32); + (*env)->GetByteArrayRegion(env, channel_keys_id_arg, 0, 32, channel_keys_id_arg_ref.data); + LDKChannelTransactionParameters channel_transaction_parameters_arg_conv; + channel_transaction_parameters_arg_conv.inner = untag_ptr(channel_transaction_parameters_arg); + channel_transaction_parameters_arg_conv.is_owned = ptr_is_owned(channel_transaction_parameters_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_transaction_parameters_arg_conv); + channel_transaction_parameters_arg_conv = ChannelTransactionParameters_clone(&channel_transaction_parameters_arg_conv); + LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_new(outpoint_arg_conv, output_arg_conv, channel_keys_id_arg_ref, channel_value_satoshis_arg, channel_transaction_parameters_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAlias_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKNodeAlias arg_conv; + +static inline uint64_t StaticPaymentOutputDescriptor_clone_ptr(LDKStaticPaymentOutputDescriptor *NONNULL_PTR arg) { + LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKStaticPaymentOutputDescriptor arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = NodeAlias_clone_ptr(&arg_conv); + int64_t ret_conv = StaticPaymentOutputDescriptor_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAlias_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKNodeAlias orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKStaticPaymentOutputDescriptor orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKNodeAlias ret_var = NodeAlias_clone(&orig_conv); + LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAlias_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKNodeAlias o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKStaticPaymentOutputDescriptor o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv.is_owned = false; - int64_t ret_conv = NodeAlias_hash(&o_conv); + int64_t ret_conv = StaticPaymentOutputDescriptor_hash(&o_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeAlias_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKNodeAlias a_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKStaticPaymentOutputDescriptor a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKNodeAlias b_conv; + LDKStaticPaymentOutputDescriptor b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = NodeAlias_eq(&a_conv, &b_conv); + jboolean ret_conv = StaticPaymentOutputDescriptor_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_NodeAlias_1to_1str(JNIEnv *env, jclass clz, int64_t o) { - LDKNodeAlias o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = NodeAlias_to_str(&o_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1witness_1script(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKStaticPaymentOutputDescriptor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = StaticPaymentOutputDescriptor_witness_script(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1max_1witness_1length(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKStaticPaymentOutputDescriptor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int64_t ret_conv = StaticPaymentOutputDescriptor_max_witness_length(&this_arg_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAlias_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKNodeAlias obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKStaticPaymentOutputDescriptor obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = NodeAlias_write(&obj_conv); + LDKCVec_u8Z ret_var = StaticPaymentOutputDescriptor_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAlias_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ"); - *ret_conv = NodeAlias_read(ser_ref); + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = StaticPaymentOutputDescriptor_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKNodeInfo this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + SpendableOutputDescriptor_free(this_ptr_conv); +} + +static inline uint64_t SpendableOutputDescriptor_clone_ptr(LDKSpendableOutputDescriptor *NONNULL_PTR arg) { + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = SpendableOutputDescriptor_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKSpendableOutputDescriptor* arg_conv = (LDKSpendableOutputDescriptor*)untag_ptr(arg); + int64_t ret_conv = SpendableOutputDescriptor_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKSpendableOutputDescriptor* orig_conv = (LDKSpendableOutputDescriptor*)untag_ptr(orig); + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = SpendableOutputDescriptor_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1static_1output(JNIEnv *env, jclass clz, int64_t outpoint, int64_t output, int8_tArray channel_keys_id) { + LDKOutPoint outpoint_conv; + outpoint_conv.inner = untag_ptr(outpoint); + outpoint_conv.is_owned = ptr_is_owned(outpoint); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv); + outpoint_conv = OutPoint_clone(&outpoint_conv); + void* output_ptr = untag_ptr(output); + CHECK_ACCESS(output_ptr); + LDKTxOut output_conv = *(LDKTxOut*)(output_ptr); + output_conv = TxOut_clone((LDKTxOut*)untag_ptr(output)); + LDKThirtyTwoBytes channel_keys_id_ref; + CHECK((*env)->GetArrayLength(env, channel_keys_id) == 32); + (*env)->GetByteArrayRegion(env, channel_keys_id, 0, 32, channel_keys_id_ref.data); + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = SpendableOutputDescriptor_static_output(outpoint_conv, output_conv, channel_keys_id_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1delayed_1payment_1output(JNIEnv *env, jclass clz, int64_t a) { + LDKDelayedPaymentOutputDescriptor a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = DelayedPaymentOutputDescriptor_clone(&a_conv); + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = SpendableOutputDescriptor_delayed_payment_output(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1static_1payment_1output(JNIEnv *env, jclass clz, int64_t a) { + LDKStaticPaymentOutputDescriptor a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = StaticPaymentOutputDescriptor_clone(&a_conv); + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = SpendableOutputDescriptor_static_payment_output(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKSpendableOutputDescriptor* o_conv = (LDKSpendableOutputDescriptor*)untag_ptr(o); + int64_t ret_conv = SpendableOutputDescriptor_hash(o_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKSpendableOutputDescriptor* a_conv = (LDKSpendableOutputDescriptor*)untag_ptr(a); + LDKSpendableOutputDescriptor* b_conv = (LDKSpendableOutputDescriptor*)untag_ptr(b); + jboolean ret_conv = SpendableOutputDescriptor_eq(a_conv, b_conv); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKSpendableOutputDescriptor* obj_conv = (LDKSpendableOutputDescriptor*)untag_ptr(obj); + LDKCVec_u8Z ret_var = SpendableOutputDescriptor_write(obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); + *ret_conv = SpendableOutputDescriptor_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1create_1spendable_1outputs_1psbt(JNIEnv *env, jclass clz, int64_tArray descriptors, int64_tArray outputs, int8_tArray change_destination_script, int32_t feerate_sat_per_1000_weight, int64_t locktime) { + LDKCVec_SpendableOutputDescriptorZ descriptors_constr; + descriptors_constr.datalen = (*env)->GetArrayLength(env, descriptors); + if (descriptors_constr.datalen > 0) + descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); + else + descriptors_constr.data = NULL; + int64_t* descriptors_vals = (*env)->GetLongArrayElements (env, descriptors, NULL); + for (size_t b = 0; b < descriptors_constr.datalen; b++) { + int64_t descriptors_conv_27 = descriptors_vals[b]; + void* descriptors_conv_27_ptr = untag_ptr(descriptors_conv_27); + CHECK_ACCESS(descriptors_conv_27_ptr); + LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr); + descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(descriptors_conv_27)); + descriptors_constr.data[b] = descriptors_conv_27_conv; + } + (*env)->ReleaseLongArrayElements(env, descriptors, descriptors_vals, 0); + LDKCVec_TxOutZ outputs_constr; + outputs_constr.datalen = (*env)->GetArrayLength(env, outputs); + if (outputs_constr.datalen > 0) + outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements"); + else + outputs_constr.data = NULL; + int64_t* outputs_vals = (*env)->GetLongArrayElements (env, outputs, NULL); + for (size_t h = 0; h < outputs_constr.datalen; h++) { + int64_t outputs_conv_7 = outputs_vals[h]; + void* outputs_conv_7_ptr = untag_ptr(outputs_conv_7); + CHECK_ACCESS(outputs_conv_7_ptr); + LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr); + outputs_conv_7_conv = TxOut_clone((LDKTxOut*)untag_ptr(outputs_conv_7)); + outputs_constr.data[h] = outputs_conv_7_conv; + } + (*env)->ReleaseLongArrayElements(env, outputs, outputs_vals, 0); + LDKCVec_u8Z change_destination_script_ref; + change_destination_script_ref.datalen = (*env)->GetArrayLength(env, change_destination_script); + change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, change_destination_script, 0, change_destination_script_ref.datalen, change_destination_script_ref.data); + void* locktime_ptr = untag_ptr(locktime); + CHECK_ACCESS(locktime_ptr); + LDKCOption_u32Z locktime_conv = *(LDKCOption_u32Z*)(locktime_ptr); + locktime_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(locktime)); + LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ), "LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ"); + *ret_conv = SpendableOutputDescriptor_create_spendable_outputs_psbt(descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight, locktime_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelDerivationParameters this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - NodeInfo_free(this_obj_conv); + ChannelDerivationParameters_free(this_obj_conv); } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKNodeInfo this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1get_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDerivationParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u64Z ret_var = NodeInfo_get_channels(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t g = 0; g < ret_var.datalen; g++) { - int64_t ret_conv_6_conv = ret_var.data[g]; - ret_arr_ptr[g] = ret_conv_6_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); + int64_t ret_conv = ChannelDerivationParameters_get_value_satoshis(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1set_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDerivationParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelDerivationParameters_set_value_satoshis(&this_ptr_conv, val); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1get_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDerivationParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelDerivationParameters_get_keys_id(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { - LDKNodeInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1set_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKChannelDerivationParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u64Z val_constr; - val_constr.datalen = (*env)->GetArrayLength(env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); - for (size_t g = 0; g < val_constr.datalen; g++) { - int64_t val_conv_6 = val_vals[g]; - val_constr.data[g] = val_conv_6; - } - (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); - NodeInfo_set_channels(&this_ptr_conv, val_constr); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + ChannelDerivationParameters_set_keys_id(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1announcement_1info(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKNodeInfo this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1get_1transaction_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDerivationParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeAnnouncementInfo ret_var = NodeInfo_get_announcement_info(&this_ptr_conv); + LDKChannelTransactionParameters ret_var = ChannelDerivationParameters_get_transaction_parameters(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1announcement_1info(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKNodeInfo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1set_1transaction_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDerivationParameters this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeAnnouncementInfo val_conv; + LDKChannelTransactionParameters val_conv; val_conv.inner = untag_ptr(val); val_conv.is_owned = ptr_is_owned(val); CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = NodeAnnouncementInfo_clone(&val_conv); - NodeInfo_set_announcement_info(&this_ptr_conv, val_conv); + val_conv = ChannelTransactionParameters_clone(&val_conv); + ChannelDerivationParameters_set_transaction_parameters(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1new(JNIEnv *env, jclass clz, int64_tArray channels_arg, int64_t announcement_info_arg) { - LDKCVec_u64Z channels_arg_constr; - channels_arg_constr.datalen = (*env)->GetArrayLength(env, channels_arg); - if (channels_arg_constr.datalen > 0) - channels_arg_constr.data = MALLOC(channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); - else - channels_arg_constr.data = NULL; - int64_t* channels_arg_vals = (*env)->GetLongArrayElements (env, channels_arg, NULL); - for (size_t g = 0; g < channels_arg_constr.datalen; g++) { - int64_t channels_arg_conv_6 = channels_arg_vals[g]; - channels_arg_constr.data[g] = channels_arg_conv_6; - } - (*env)->ReleaseLongArrayElements(env, channels_arg, channels_arg_vals, 0); - LDKNodeAnnouncementInfo announcement_info_arg_conv; - announcement_info_arg_conv.inner = untag_ptr(announcement_info_arg); - announcement_info_arg_conv.is_owned = ptr_is_owned(announcement_info_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_info_arg_conv); - announcement_info_arg_conv = NodeAnnouncementInfo_clone(&announcement_info_arg_conv); - LDKNodeInfo ret_var = NodeInfo_new(channels_arg_constr, announcement_info_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1new(JNIEnv *env, jclass clz, int64_t value_satoshis_arg, int8_tArray keys_id_arg, int64_t transaction_parameters_arg) { + LDKThirtyTwoBytes keys_id_arg_ref; + CHECK((*env)->GetArrayLength(env, keys_id_arg) == 32); + (*env)->GetByteArrayRegion(env, keys_id_arg, 0, 32, keys_id_arg_ref.data); + LDKChannelTransactionParameters transaction_parameters_arg_conv; + transaction_parameters_arg_conv.inner = untag_ptr(transaction_parameters_arg); + transaction_parameters_arg_conv.is_owned = ptr_is_owned(transaction_parameters_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(transaction_parameters_arg_conv); + transaction_parameters_arg_conv = ChannelTransactionParameters_clone(&transaction_parameters_arg_conv); + LDKChannelDerivationParameters ret_var = ChannelDerivationParameters_new(value_satoshis_arg, keys_id_arg_ref, transaction_parameters_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t NodeInfo_clone_ptr(LDKNodeInfo *NONNULL_PTR arg) { - LDKNodeInfo ret_var = NodeInfo_clone(arg); +static inline uint64_t ChannelDerivationParameters_clone_ptr(LDKChannelDerivationParameters *NONNULL_PTR arg) { + LDKChannelDerivationParameters ret_var = ChannelDerivationParameters_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKNodeInfo arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelDerivationParameters arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = NodeInfo_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelDerivationParameters_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKNodeInfo orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelDerivationParameters orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKNodeInfo ret_var = NodeInfo_clone(&orig_conv); + LDKChannelDerivationParameters ret_var = ChannelDerivationParameters_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKNodeInfo a_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKChannelDerivationParameters a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKNodeInfo b_conv; + LDKChannelDerivationParameters b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = NodeInfo_eq(&a_conv, &b_conv); - return ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeInfo_1is_1tor_1only(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNodeInfo this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - jboolean ret_conv = NodeInfo_is_tor_only(&this_arg_conv); - return ret_conv; -} - -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_NodeInfo_1to_1str(JNIEnv *env, jclass clz, int64_t o) { - LDKNodeInfo o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = NodeInfo_to_str(&o_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); + jboolean ret_conv = ChannelDerivationParameters_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeInfo_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKNodeInfo obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelDerivationParameters obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = NodeInfo_write(&obj_conv); + LDKCVec_u8Z ret_var = ChannelDerivationParameters_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1read(JNIEnv *env, jclass clz, int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); - *ret_conv = NodeInfo_read(ser_ref); + LDKCResult_ChannelDerivationParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDerivationParametersDecodeErrorZ), "LDKCResult_ChannelDerivationParametersDecodeErrorZ"); + *ret_conv = ChannelDerivationParameters_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKNetworkGraph obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = NetworkGraph_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; -} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKHTLCDescriptor this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + HTLCDescriptor_free(this_obj_conv); +} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - void* arg_ptr = untag_ptr(arg); - CHECK_ACCESS(arg_ptr); - LDKLogger arg_conv = *(LDKLogger*)(arg_ptr); - if (arg_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&arg_conv); - } - LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); - *ret_conv = NetworkGraph_read(ser_ref, arg_conv); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1channel_1derivation_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKHTLCDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelDerivationParameters ret_var = HTLCDescriptor_get_channel_derivation_parameters(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1to_1str(JNIEnv *env, jclass clz, int64_t o) { - LDKNetworkGraph o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = NetworkGraph_to_str(&o_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1channel_1derivation_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKHTLCDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelDerivationParameters val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelDerivationParameters_clone(&val_conv); + HTLCDescriptor_set_channel_derivation_parameters(&this_ptr_conv, val_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1commitment_1txid(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKHTLCDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *HTLCDescriptor_get_commitment_txid(&this_ptr_conv)); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1commitment_1txid(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKHTLCDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + HTLCDescriptor_set_commitment_txid(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1per_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKHTLCDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = HTLCDescriptor_get_per_commitment_number(&this_ptr_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1new(JNIEnv *env, jclass clz, jclass network, int64_t logger) { - LDKNetwork network_conv = LDKNetwork_from_java(env, network); - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKNetworkGraph ret_var = NetworkGraph_new(network_conv, logger_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1per_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKHTLCDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + HTLCDescriptor_set_per_commitment_number(&this_ptr_conv, val); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKHTLCDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, HTLCDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKHTLCDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + HTLCDescriptor_set_per_commitment_point(&this_ptr_conv, val_ref); +} + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKHTLCDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = HTLCDescriptor_get_feerate_per_kw(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKHTLCDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + HTLCDescriptor_set_feerate_per_kw(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1htlc(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKHTLCDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKHTLCOutputInCommitment ret_var = HTLCDescriptor_get_htlc(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read_1only(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKReadOnlyNetworkGraph ret_var = NetworkGraph_read_only(&this_arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1htlc(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKHTLCDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKHTLCOutputInCommitment val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = HTLCOutputInCommitment_clone(&val_conv); + HTLCDescriptor_set_htlc(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1preimage(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKHTLCDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); + *ret_copy = HTLCDescriptor_get_preimage(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1preimage(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKHTLCDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_ThirtyTwoBytesZ val_conv = *(LDKCOption_ThirtyTwoBytesZ*)(val_ptr); + val_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(val)); + HTLCDescriptor_set_preimage(&this_ptr_conv, val_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1counterparty_1sig(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKHTLCDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, HTLCDescriptor_get_counterparty_sig(&this_ptr_conv).compact_form); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1counterparty_1sig(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKHTLCDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKECDSASignature val_ref; + CHECK((*env)->GetArrayLength(env, val) == 64); + (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); + HTLCDescriptor_set_counterparty_sig(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1new(JNIEnv *env, jclass clz, int64_t channel_derivation_parameters_arg, int8_tArray commitment_txid_arg, int64_t per_commitment_number_arg, int8_tArray per_commitment_point_arg, int32_t feerate_per_kw_arg, int64_t htlc_arg, int64_t preimage_arg, int8_tArray counterparty_sig_arg) { + LDKChannelDerivationParameters channel_derivation_parameters_arg_conv; + channel_derivation_parameters_arg_conv.inner = untag_ptr(channel_derivation_parameters_arg); + channel_derivation_parameters_arg_conv.is_owned = ptr_is_owned(channel_derivation_parameters_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_derivation_parameters_arg_conv); + channel_derivation_parameters_arg_conv = ChannelDerivationParameters_clone(&channel_derivation_parameters_arg_conv); + LDKThirtyTwoBytes commitment_txid_arg_ref; + CHECK((*env)->GetArrayLength(env, commitment_txid_arg) == 32); + (*env)->GetByteArrayRegion(env, commitment_txid_arg, 0, 32, commitment_txid_arg_ref.data); + LDKPublicKey per_commitment_point_arg_ref; + CHECK((*env)->GetArrayLength(env, per_commitment_point_arg) == 33); + (*env)->GetByteArrayRegion(env, per_commitment_point_arg, 0, 33, per_commitment_point_arg_ref.compressed_form); + LDKHTLCOutputInCommitment htlc_arg_conv; + htlc_arg_conv.inner = untag_ptr(htlc_arg); + htlc_arg_conv.is_owned = ptr_is_owned(htlc_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_arg_conv); + htlc_arg_conv = HTLCOutputInCommitment_clone(&htlc_arg_conv); + void* preimage_arg_ptr = untag_ptr(preimage_arg); + CHECK_ACCESS(preimage_arg_ptr); + LDKCOption_ThirtyTwoBytesZ preimage_arg_conv = *(LDKCOption_ThirtyTwoBytesZ*)(preimage_arg_ptr); + preimage_arg_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(preimage_arg)); + LDKECDSASignature counterparty_sig_arg_ref; + CHECK((*env)->GetArrayLength(env, counterparty_sig_arg) == 64); + (*env)->GetByteArrayRegion(env, counterparty_sig_arg, 0, 64, counterparty_sig_arg_ref.compact_form); + LDKHTLCDescriptor ret_var = HTLCDescriptor_new(channel_derivation_parameters_arg_conv, commitment_txid_arg_ref, per_commitment_number_arg, per_commitment_point_arg_ref, feerate_per_kw_arg, htlc_arg_conv, preimage_arg_conv, counterparty_sig_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1get_1last_1rapid_1gossip_1sync_1timestamp(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); - *ret_copy = NetworkGraph_get_last_rapid_gossip_sync_timestamp(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +static inline uint64_t HTLCDescriptor_clone_ptr(LDKHTLCDescriptor *NONNULL_PTR arg) { + LDKHTLCDescriptor ret_var = HTLCDescriptor_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKHTLCDescriptor arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = HTLCDescriptor_clone_ptr(&arg_conv); + return ret_conv; +} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1set_1last_1rapid_1gossip_1sync_1timestamp(JNIEnv *env, jclass clz, int64_t this_arg, int32_t last_rapid_gossip_sync_timestamp) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - NetworkGraph_set_last_rapid_gossip_sync_timestamp(&this_arg_conv, last_rapid_gossip_sync_timestamp); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKHTLCDescriptor orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKHTLCDescriptor ret_var = HTLCDescriptor_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1node_1from_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_update_node_from_announcement(&this_arg_conv, &msg_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKHTLCDescriptor a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKHTLCDescriptor b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = HTLCDescriptor_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1node_1from_1unsigned_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKUnsignedNodeAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_update_node_from_unsigned_announcement(&this_arg_conv, &msg_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKHTLCDescriptor obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = HTLCDescriptor_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel_1from_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg, int64_t utxo_lookup) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - void* utxo_lookup_ptr = untag_ptr(utxo_lookup); - CHECK_ACCESS(utxo_lookup_ptr); - LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr); - // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ - if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) { - // Manually implement clone for Java trait instances - if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some); - } - } - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_update_channel_from_announcement(&this_arg_conv, &msg_conv, utxo_lookup_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_HTLCDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCDescriptorDecodeErrorZ), "LDKCResult_HTLCDescriptorDecodeErrorZ"); + *ret_conv = HTLCDescriptor_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel_1from_1announcement_1no_1lookup(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { - LDKNetworkGraph this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1outpoint(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKHTLCDescriptor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKChannelAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_update_channel_from_announcement_no_lookup(&this_arg_conv, &msg_conv); - return tag_ptr(ret_conv, true); + LDKOutPoint ret_var = HTLCDescriptor_outpoint(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel_1from_1unsigned_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg, int64_t utxo_lookup) { - LDKNetworkGraph this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1previous_1utxo(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKHTLCDescriptor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKUnsignedChannelAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - void* utxo_lookup_ptr = untag_ptr(utxo_lookup); - CHECK_ACCESS(utxo_lookup_ptr); - LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr); - // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ - if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) { - // Manually implement clone for Java trait instances - if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some); - } - } - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_update_channel_from_unsigned_announcement(&this_arg_conv, &msg_conv, utxo_lookup_conv); - return tag_ptr(ret_conv, true); + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = HTLCDescriptor_previous_utxo(&this_arg_conv); + return tag_ptr(ret_ref, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1add_1channel_1from_1partial_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t short_channel_id, int64_t timestamp, int64_t features, int8_tArray node_id_1, int8_tArray node_id_2) { - LDKNetworkGraph this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1unsigned_1tx_1input(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKHTLCDescriptor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKChannelFeatures features_conv; - features_conv.inner = untag_ptr(features); - features_conv.is_owned = ptr_is_owned(features); - CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); - features_conv = ChannelFeatures_clone(&features_conv); - LDKPublicKey node_id_1_ref; - CHECK((*env)->GetArrayLength(env, node_id_1) == 33); - (*env)->GetByteArrayRegion(env, node_id_1, 0, 33, node_id_1_ref.compressed_form); - LDKPublicKey node_id_2_ref; - CHECK((*env)->GetArrayLength(env, node_id_2) == 33); - (*env)->GetByteArrayRegion(env, node_id_2, 0, 33, node_id_2_ref.compressed_form); - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_add_channel_from_partial_announcement(&this_arg_conv, short_channel_id, timestamp, features_conv, node_id_1_ref, node_id_2_ref); - return tag_ptr(ret_conv, true); + LDKTxIn* ret_ref = MALLOC(sizeof(LDKTxIn), "LDKTxIn"); + *ret_ref = HTLCDescriptor_unsigned_tx_input(&this_arg_conv); + return tag_ptr(ret_ref, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1channel_1failed_1permanent(JNIEnv *env, jclass clz, int64_t this_arg, int64_t short_channel_id) { - LDKNetworkGraph this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1tx_1output(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKHTLCDescriptor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NetworkGraph_channel_failed_permanent(&this_arg_conv, short_channel_id); + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = HTLCDescriptor_tx_output(&this_arg_conv); + return tag_ptr(ret_ref, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1node_1failed_1permanent(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray node_id) { - LDKNetworkGraph this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1witness_1script(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKHTLCDescriptor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - NetworkGraph_node_failed_permanent(&this_arg_conv, node_id_ref); + LDKCVec_u8Z ret_var = HTLCDescriptor_witness_script(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1remove_1stale_1channels_1and_1tracking(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNetworkGraph this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1tx_1input_1witness(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray signature, int8_tArray witness_script) { + LDKHTLCDescriptor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NetworkGraph_remove_stale_channels_and_tracking(&this_arg_conv); + LDKECDSASignature signature_ref; + CHECK((*env)->GetArrayLength(env, signature) == 64); + (*env)->GetByteArrayRegion(env, signature, 0, 64, signature_ref.compact_form); + LDKu8slice witness_script_ref; + witness_script_ref.datalen = (*env)->GetArrayLength(env, witness_script); + witness_script_ref.data = (*env)->GetByteArrayElements (env, witness_script, NULL); + LDKWitness ret_var = HTLCDescriptor_tx_input_witness(&this_arg_conv, signature_ref, witness_script_ref); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + Witness_free(ret_var); + (*env)->ReleaseByteArrayElements(env, witness_script, (int8_t*)witness_script_ref.data, 0); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1remove_1stale_1channels_1and_1tracking_1with_1time(JNIEnv *env, jclass clz, int64_t this_arg, int64_t current_time_unix) { - LDKNetworkGraph this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1derive_1channel_1signer(JNIEnv *env, jclass clz, int64_t this_arg, int64_t signer_provider) { + LDKHTLCDescriptor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NetworkGraph_remove_stale_channels_and_tracking_with_time(&this_arg_conv, current_time_unix); + void* signer_provider_ptr = untag_ptr(signer_provider); + if (ptr_is_owned(signer_provider)) { CHECK_ACCESS(signer_provider_ptr); } + LDKSignerProvider* signer_provider_conv = (LDKSignerProvider*)signer_provider_ptr; + LDKEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner"); + *ret_ret = HTLCDescriptor_derive_channel_signer(&this_arg_conv, signer_provider_conv); + return tag_ptr(ret_ret, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelUpdate msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_update_channel(&this_arg_conv, &msg_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelSigner_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKChannelSigner this_ptr_conv = *(LDKChannelSigner*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + ChannelSigner_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel_1unsigned(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKUnsignedChannelUpdate msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_update_channel_unsigned(&this_arg_conv, &msg_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1verify_1channel_1update(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { - LDKNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelUpdate msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_verify_channel_update(&this_arg_conv, &msg_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t short_channel_id) { - LDKReadOnlyNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelInfo ret_var = ReadOnlyNetworkGraph_channel(&this_arg_conv, short_channel_id); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1list_1channels(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKReadOnlyNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_u64Z ret_var = ReadOnlyNetworkGraph_list_channels(&this_arg_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t g = 0; g < ret_var.datalen; g++) { - int64_t ret_conv_6_conv = ret_var.data[g]; - ret_arr_ptr[g] = ret_conv_6_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1node(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_id) { - LDKReadOnlyNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId node_id_conv; - node_id_conv.inner = untag_ptr(node_id); - node_id_conv.is_owned = ptr_is_owned(node_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); - node_id_conv.is_owned = false; - LDKNodeInfo ret_var = ReadOnlyNetworkGraph_node(&this_arg_conv, &node_id_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1list_1nodes(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKReadOnlyNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_NodeIdZ ret_var = ReadOnlyNetworkGraph_list_nodes(&this_arg_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t i = 0; i < ret_var.datalen; i++) { - LDKNodeId ret_conv_8_var = ret_var.data[i]; - int64_t ret_conv_8_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_8_var); - ret_conv_8_ref = tag_ptr(ret_conv_8_var.inner, ret_conv_8_var.is_owned); - ret_arr_ptr[i] = ret_conv_8_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1get_1addresses(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray pubkey) { - LDKReadOnlyNetworkGraph this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPublicKey pubkey_ref; - CHECK((*env)->GetArrayLength(env, pubkey) == 33); - (*env)->GetByteArrayRegion(env, pubkey, 0, 33, pubkey_ref.compressed_form); - LDKCOption_CVec_SocketAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_SocketAddressZZ), "LDKCOption_CVec_SocketAddressZZ"); - *ret_copy = ReadOnlyNetworkGraph_get_addresses(&this_arg_conv, pubkey_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKDefaultRouter this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - DefaultRouter_free(this_obj_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1new(JNIEnv *env, jclass clz, int64_t network_graph, int64_t logger, int64_t entropy_source, int64_t scorer, int64_t score_params) { - LDKNetworkGraph network_graph_conv; - network_graph_conv.inner = untag_ptr(network_graph); - network_graph_conv.is_owned = ptr_is_owned(network_graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - network_graph_conv.is_owned = false; - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - void* scorer_ptr = untag_ptr(scorer); - CHECK_ACCESS(scorer_ptr); - LDKLockableScore scorer_conv = *(LDKLockableScore*)(scorer_ptr); - if (scorer_conv.free == LDKLockableScore_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLockableScore_JCalls_cloned(&scorer_conv); - } - LDKProbabilisticScoringFeeParameters score_params_conv; - score_params_conv.inner = untag_ptr(score_params); - score_params_conv.is_owned = ptr_is_owned(score_params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(score_params_conv); - score_params_conv = ProbabilisticScoringFeeParameters_clone(&score_params_conv); - LDKDefaultRouter ret_var = DefaultRouter_new(&network_graph_conv, logger_conv, entropy_source_conv, scorer_conv, score_params_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Recipient_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKRecipient* orig_conv = (LDKRecipient*)untag_ptr(orig); + jclass ret_conv = LDKRecipient_to_java(env, Recipient_clone(orig_conv)); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1as_1Router(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKDefaultRouter this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKRouter* ret_ret = MALLOC(sizeof(LDKRouter), "LDKRouter"); - *ret_ret = DefaultRouter_as_Router(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Recipient_1node(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKRecipient_to_java(env, Recipient_node()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1as_1MessageRouter(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKDefaultRouter this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKMessageRouter* ret_ret = MALLOC(sizeof(LDKMessageRouter), "LDKMessageRouter"); - *ret_ret = DefaultRouter_as_MessageRouter(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Recipient_1phantom_1node(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKRecipient_to_java(env, Recipient_phantom_node()); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Router_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EntropySource_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); CHECK_ACCESS(this_ptr_ptr); - LDKRouter this_ptr_conv = *(LDKRouter*)(this_ptr_ptr); + LDKEntropySource this_ptr_conv = *(LDKEntropySource*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - Router_free(this_ptr_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKScorerAccountingForInFlightHtlcs this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ScorerAccountingForInFlightHtlcs_free(this_obj_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1new(JNIEnv *env, jclass clz, int64_t scorer, int64_t inflight_htlcs) { - void* scorer_ptr = untag_ptr(scorer); - CHECK_ACCESS(scorer_ptr); - LDKScoreLookUp scorer_conv = *(LDKScoreLookUp*)(scorer_ptr); - if (scorer_conv.free == LDKScoreLookUp_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKScoreLookUp_JCalls_cloned(&scorer_conv); - } - LDKInFlightHtlcs inflight_htlcs_conv; - inflight_htlcs_conv.inner = untag_ptr(inflight_htlcs); - inflight_htlcs_conv.is_owned = ptr_is_owned(inflight_htlcs); - CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_conv); - inflight_htlcs_conv.is_owned = false; - LDKScorerAccountingForInFlightHtlcs ret_var = ScorerAccountingForInFlightHtlcs_new(scorer_conv, &inflight_htlcs_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1as_1ScoreLookUp(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKScorerAccountingForInFlightHtlcs this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKScoreLookUp* ret_ret = MALLOC(sizeof(LDKScoreLookUp), "LDKScoreLookUp"); - *ret_ret = ScorerAccountingForInFlightHtlcs_as_ScoreLookUp(&this_arg_conv); - return tag_ptr(ret_ret, true); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKInFlightHtlcs this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InFlightHtlcs_free(this_obj_conv); -} - -static inline uint64_t InFlightHtlcs_clone_ptr(LDKInFlightHtlcs *NONNULL_PTR arg) { - LDKInFlightHtlcs ret_var = InFlightHtlcs_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKInFlightHtlcs arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = InFlightHtlcs_clone_ptr(&arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKInFlightHtlcs orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKInFlightHtlcs ret_var = InFlightHtlcs_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1new(JNIEnv *env, jclass clz) { - LDKInFlightHtlcs ret_var = InFlightHtlcs_new(); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1process_1path(JNIEnv *env, jclass clz, int64_t this_arg, int64_t path, int8_tArray payer_node_id) { - LDKInFlightHtlcs this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPath path_conv; - path_conv.inner = untag_ptr(path); - path_conv.is_owned = ptr_is_owned(path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); - path_conv.is_owned = false; - LDKPublicKey payer_node_id_ref; - CHECK((*env)->GetArrayLength(env, payer_node_id) == 33); - (*env)->GetByteArrayRegion(env, payer_node_id, 0, 33, payer_node_id_ref.compressed_form); - InFlightHtlcs_process_path(&this_arg_conv, &path_conv, payer_node_id_ref); + EntropySource_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1add_1inflight_1htlc(JNIEnv *env, jclass clz, int64_t this_arg, int64_t source, int64_t target, int64_t channel_scid, int64_t used_msat) { - LDKInFlightHtlcs this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId source_conv; - source_conv.inner = untag_ptr(source); - source_conv.is_owned = ptr_is_owned(source); - CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv); - source_conv.is_owned = false; - LDKNodeId target_conv; - target_conv.inner = untag_ptr(target); - target_conv.is_owned = ptr_is_owned(target); - CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); - target_conv.is_owned = false; - InFlightHtlcs_add_inflight_htlc(&this_arg_conv, &source_conv, &target_conv, channel_scid, used_msat); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeSigner_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKNodeSigner this_ptr_conv = *(LDKNodeSigner*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + NodeSigner_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1used_1liquidity_1msat(JNIEnv *env, jclass clz, int64_t this_arg, int64_t source, int64_t target, int64_t channel_scid) { - LDKInFlightHtlcs this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId source_conv; - source_conv.inner = untag_ptr(source); - source_conv.is_owned = ptr_is_owned(source); - CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv); - source_conv.is_owned = false; - LDKNodeId target_conv; - target_conv.inner = untag_ptr(target); - target_conv.is_owned = ptr_is_owned(target); - CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); - target_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = InFlightHtlcs_used_liquidity_msat(&this_arg_conv, &source_conv, &target_conv, channel_scid); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutputSpender_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKOutputSpender this_ptr_conv = *(LDKOutputSpender*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + OutputSpender_free(this_ptr_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKInFlightHtlcs obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = InFlightHtlcs_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignerProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKSignerProvider this_ptr_conv = *(LDKSignerProvider*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + SignerProvider_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ"); - *ret_conv = InFlightHtlcs_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChangeDestinationSource_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKChangeDestinationSource this_ptr_conv = *(LDKChangeDestinationSource*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + ChangeDestinationSource_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKRouteHop this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInMemorySigner this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - RouteHop_free(this_obj_conv); + InMemorySigner_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRouteHop this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1funding_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RouteHop_get_pubkey(&this_ptr_conv).compressed_form); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_funding_key(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKRouteHop this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1funding_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - RouteHop_set_pubkey(&this_ptr_conv, val_ref); + LDKSecretKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); + InMemorySigner_set_funding_key(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1node_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRouteHop this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1revocation_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeFeatures ret_var = RouteHop_get_node_features(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_revocation_base_key(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1node_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKRouteHop this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1revocation_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNodeFeatures val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = NodeFeatures_clone(&val_conv); - RouteHop_set_node_features(&this_ptr_conv, val_conv); + LDKSecretKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); + InMemorySigner_set_revocation_base_key(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRouteHop this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = RouteHop_get_short_channel_id(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_payment_key(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKRouteHop this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - RouteHop_set_short_channel_id(&this_ptr_conv, val); + LDKSecretKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); + InMemorySigner_set_payment_key(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1channel_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRouteHop this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1delayed_1payment_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelFeatures ret_var = RouteHop_get_channel_features(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_delayed_payment_base_key(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1channel_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKRouteHop this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1delayed_1payment_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelFeatures val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelFeatures_clone(&val_conv); - RouteHop_set_channel_features(&this_ptr_conv, val_conv); + LDKSecretKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); + InMemorySigner_set_delayed_payment_base_key(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1fee_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRouteHop this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1htlc_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = RouteHop_get_fee_msat(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_htlc_base_key(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1fee_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKRouteHop this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1htlc_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - RouteHop_set_fee_msat(&this_ptr_conv, val); + LDKSecretKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); + InMemorySigner_set_htlc_base_key(&this_ptr_conv, val_ref); } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRouteHop this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1commitment_1seed(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int32_t ret_conv = RouteHop_get_cltv_expiry_delta(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_commitment_seed(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKRouteHop this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1commitment_1seed(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - RouteHop_set_cltv_expiry_delta(&this_ptr_conv, val); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + InMemorySigner_set_commitment_seed(&this_ptr_conv, val_ref); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1maybe_1announced_1channel(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRouteHop this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - jboolean ret_conv = RouteHop_get_maybe_announced_channel(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1maybe_1announced_1channel(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKRouteHop this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - RouteHop_set_maybe_announced_channel(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1new(JNIEnv *env, jclass clz, int8_tArray pubkey_arg, int64_t node_features_arg, int64_t short_channel_id_arg, int64_t channel_features_arg, int64_t fee_msat_arg, int32_t cltv_expiry_delta_arg, jboolean maybe_announced_channel_arg) { - LDKPublicKey pubkey_arg_ref; - CHECK((*env)->GetArrayLength(env, pubkey_arg) == 33); - (*env)->GetByteArrayRegion(env, pubkey_arg, 0, 33, pubkey_arg_ref.compressed_form); - LDKNodeFeatures node_features_arg_conv; - node_features_arg_conv.inner = untag_ptr(node_features_arg); - node_features_arg_conv.is_owned = ptr_is_owned(node_features_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(node_features_arg_conv); - node_features_arg_conv = NodeFeatures_clone(&node_features_arg_conv); - LDKChannelFeatures channel_features_arg_conv; - channel_features_arg_conv.inner = untag_ptr(channel_features_arg); - channel_features_arg_conv.is_owned = ptr_is_owned(channel_features_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_features_arg_conv); - channel_features_arg_conv = ChannelFeatures_clone(&channel_features_arg_conv); - LDKRouteHop ret_var = RouteHop_new(pubkey_arg_ref, node_features_arg_conv, short_channel_id_arg, channel_features_arg_conv, fee_msat_arg, cltv_expiry_delta_arg, maybe_announced_channel_arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline uint64_t RouteHop_clone_ptr(LDKRouteHop *NONNULL_PTR arg) { - LDKRouteHop ret_var = RouteHop_clone(arg); +static inline uint64_t InMemorySigner_clone_ptr(LDKInMemorySigner *NONNULL_PTR arg) { + LDKInMemorySigner ret_var = InMemorySigner_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKRouteHop arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInMemorySigner arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = RouteHop_clone_ptr(&arg_conv); + int64_t ret_conv = InMemorySigner_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKRouteHop orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKInMemorySigner orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKRouteHop ret_var = RouteHop_clone(&orig_conv); + LDKInMemorySigner ret_var = InMemorySigner_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKRouteHop o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = RouteHop_hash(&o_conv); - return ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHop_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKRouteHop a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKRouteHop b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = RouteHop_eq(&a_conv, &b_conv); - return ret_conv; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHop_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKRouteHop obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = RouteHop_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); - *ret_conv = RouteHop_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedTail_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKBlindedTail this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BlindedTail_free(this_obj_conv); -} - -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_BlindedTail_1get_1hops(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBlindedTail this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_BlindedHopZ ret_var = BlindedTail_get_hops(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t m = 0; m < ret_var.datalen; m++) { - LDKBlindedHop ret_conv_12_var = ret_var.data[m]; - int64_t ret_conv_12_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_var); - ret_conv_12_ref = tag_ptr(ret_conv_12_var.inner, ret_conv_12_var.is_owned); - ret_arr_ptr[m] = ret_conv_12_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedTail_1set_1hops(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { - LDKBlindedTail this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_BlindedHopZ val_constr; - val_constr.datalen = (*env)->GetArrayLength(env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKBlindedHop), "LDKCVec_BlindedHopZ Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); - for (size_t m = 0; m < val_constr.datalen; m++) { - int64_t val_conv_12 = val_vals[m]; - LDKBlindedHop val_conv_12_conv; - val_conv_12_conv.inner = untag_ptr(val_conv_12); - val_conv_12_conv.is_owned = ptr_is_owned(val_conv_12); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_12_conv); - val_conv_12_conv = BlindedHop_clone(&val_conv_12_conv); - val_constr.data[m] = val_conv_12_conv; - } - (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); - BlindedTail_set_hops(&this_ptr_conv, val_constr); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedTail_1get_1blinding_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBlindedTail this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, BlindedTail_get_blinding_point(&this_ptr_conv).compressed_form); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedTail_1set_1blinding_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKBlindedTail this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - BlindedTail_set_blinding_point(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1new(JNIEnv *env, jclass clz, int8_tArray funding_key, int8_tArray revocation_base_key, int8_tArray payment_key, int8_tArray delayed_payment_base_key, int8_tArray htlc_base_key, int8_tArray commitment_seed, int64_t channel_value_satoshis, int8_tArray channel_keys_id, int8_tArray rand_bytes_unique_start) { + LDKSecretKey funding_key_ref; + CHECK((*env)->GetArrayLength(env, funding_key) == 32); + (*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_ref.bytes); + LDKSecretKey revocation_base_key_ref; + CHECK((*env)->GetArrayLength(env, revocation_base_key) == 32); + (*env)->GetByteArrayRegion(env, revocation_base_key, 0, 32, revocation_base_key_ref.bytes); + LDKSecretKey payment_key_ref; + CHECK((*env)->GetArrayLength(env, payment_key) == 32); + (*env)->GetByteArrayRegion(env, payment_key, 0, 32, payment_key_ref.bytes); + LDKSecretKey delayed_payment_base_key_ref; + CHECK((*env)->GetArrayLength(env, delayed_payment_base_key) == 32); + (*env)->GetByteArrayRegion(env, delayed_payment_base_key, 0, 32, delayed_payment_base_key_ref.bytes); + LDKSecretKey htlc_base_key_ref; + CHECK((*env)->GetArrayLength(env, htlc_base_key) == 32); + (*env)->GetByteArrayRegion(env, htlc_base_key, 0, 32, htlc_base_key_ref.bytes); + LDKThirtyTwoBytes commitment_seed_ref; + CHECK((*env)->GetArrayLength(env, commitment_seed) == 32); + (*env)->GetByteArrayRegion(env, commitment_seed, 0, 32, commitment_seed_ref.data); + LDKThirtyTwoBytes channel_keys_id_ref; + CHECK((*env)->GetArrayLength(env, channel_keys_id) == 32); + (*env)->GetByteArrayRegion(env, channel_keys_id, 0, 32, channel_keys_id_ref.data); + LDKThirtyTwoBytes rand_bytes_unique_start_ref; + CHECK((*env)->GetArrayLength(env, rand_bytes_unique_start) == 32); + (*env)->GetByteArrayRegion(env, rand_bytes_unique_start, 0, 32, rand_bytes_unique_start_ref.data); + LDKInMemorySigner ret_var = InMemorySigner_new(funding_key_ref, revocation_base_key_ref, payment_key_ref, delayed_payment_base_key_ref, htlc_base_key_ref, commitment_seed_ref, channel_value_satoshis, channel_keys_id_ref, rand_bytes_unique_start_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_BlindedTail_1get_1excess_1final_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBlindedTail this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int32_t ret_conv = BlindedTail_get_excess_final_cltv_expiry_delta(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterparty_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelPublicKeys ret_var = InMemorySigner_counterparty_pubkeys(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedTail_1set_1excess_1final_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKBlindedTail this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - BlindedTail_set_excess_final_cltv_expiry_delta(&this_ptr_conv, val); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterparty_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); + *ret_copy = InMemorySigner_counterparty_selected_contest_delay(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedTail_1get_1final_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBlindedTail this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = BlindedTail_get_final_value_msat(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1holder_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); + *ret_copy = InMemorySigner_holder_selected_contest_delay(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedTail_1set_1final_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKBlindedTail this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - BlindedTail_set_final_value_msat(&this_ptr_conv, val); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCOption_boolZ *ret_copy = MALLOC(sizeof(LDKCOption_boolZ), "LDKCOption_boolZ"); + *ret_copy = InMemorySigner_is_outbound(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedTail_1new(JNIEnv *env, jclass clz, int64_tArray hops_arg, int8_tArray blinding_point_arg, int32_t excess_final_cltv_expiry_delta_arg, int64_t final_value_msat_arg) { - LDKCVec_BlindedHopZ hops_arg_constr; - hops_arg_constr.datalen = (*env)->GetArrayLength(env, hops_arg); - if (hops_arg_constr.datalen > 0) - hops_arg_constr.data = MALLOC(hops_arg_constr.datalen * sizeof(LDKBlindedHop), "LDKCVec_BlindedHopZ Elements"); - else - hops_arg_constr.data = NULL; - int64_t* hops_arg_vals = (*env)->GetLongArrayElements (env, hops_arg, NULL); - for (size_t m = 0; m < hops_arg_constr.datalen; m++) { - int64_t hops_arg_conv_12 = hops_arg_vals[m]; - LDKBlindedHop hops_arg_conv_12_conv; - hops_arg_conv_12_conv.inner = untag_ptr(hops_arg_conv_12); - hops_arg_conv_12_conv.is_owned = ptr_is_owned(hops_arg_conv_12); - CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_arg_conv_12_conv); - hops_arg_conv_12_conv = BlindedHop_clone(&hops_arg_conv_12_conv); - hops_arg_constr.data[m] = hops_arg_conv_12_conv; - } - (*env)->ReleaseLongArrayElements(env, hops_arg, hops_arg_vals, 0); - LDKPublicKey blinding_point_arg_ref; - CHECK((*env)->GetArrayLength(env, blinding_point_arg) == 33); - (*env)->GetByteArrayRegion(env, blinding_point_arg, 0, 33, blinding_point_arg_ref.compressed_form); - LDKBlindedTail ret_var = BlindedTail_new(hops_arg_constr, blinding_point_arg_ref, excess_final_cltv_expiry_delta_arg, final_value_msat_arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKOutPoint ret_var = InMemorySigner_funding_outpoint(&this_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t BlindedTail_clone_ptr(LDKBlindedTail *NONNULL_PTR arg) { - LDKBlindedTail ret_var = BlindedTail_clone(arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1channel_1parameters(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelTransactionParameters ret_var = InMemorySigner_get_channel_parameters(&this_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedTail_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKBlindedTail arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = BlindedTail_clone_ptr(&arg_conv); - return ret_conv; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedTail_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBlindedTail orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKBlindedTail ret_var = BlindedTail_clone(&orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1channel_1type_1features(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelTypeFeatures ret_var = InMemorySigner_channel_type_features(&this_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedTail_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKBlindedTail o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = BlindedTail_hash(&o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1counterparty_1payment_1input(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray spend_tx, int64_t input_idx, int64_t descriptor) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKTransaction spend_tx_ref; + spend_tx_ref.datalen = (*env)->GetArrayLength(env, spend_tx); + spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); + (*env)->GetByteArrayRegion(env, spend_tx, 0, spend_tx_ref.datalen, spend_tx_ref.data); + spend_tx_ref.data_is_owned = true; + LDKStaticPaymentOutputDescriptor descriptor_conv; + descriptor_conv.inner = untag_ptr(descriptor); + descriptor_conv.is_owned = ptr_is_owned(descriptor); + CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); + descriptor_conv.is_owned = false; + LDKCResult_WitnessNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_WitnessNoneZ), "LDKCResult_WitnessNoneZ"); + *ret_conv = InMemorySigner_sign_counterparty_payment_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedTail_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKBlindedTail a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKBlindedTail b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = BlindedTail_eq(&a_conv, &b_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1dynamic_1p2wsh_1input(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray spend_tx, int64_t input_idx, int64_t descriptor) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKTransaction spend_tx_ref; + spend_tx_ref.datalen = (*env)->GetArrayLength(env, spend_tx); + spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); + (*env)->GetByteArrayRegion(env, spend_tx, 0, spend_tx_ref.datalen, spend_tx_ref.data); + spend_tx_ref.data_is_owned = true; + LDKDelayedPaymentOutputDescriptor descriptor_conv; + descriptor_conv.inner = untag_ptr(descriptor); + descriptor_conv.is_owned = ptr_is_owned(descriptor); + CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); + descriptor_conv.is_owned = false; + LDKCResult_WitnessNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_WitnessNoneZ), "LDKCResult_WitnessNoneZ"); + *ret_conv = InMemorySigner_sign_dynamic_p2wsh_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedTail_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKBlindedTail obj_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1EntropySource(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource"); + *ret_ret = InMemorySigner_as_EntropySource(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1ChannelSigner(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelSigner* ret_ret = MALLOC(sizeof(LDKChannelSigner), "LDKChannelSigner"); + *ret_ret = InMemorySigner_as_ChannelSigner(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1EcdsaChannelSigner(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner"); + *ret_ret = InMemorySigner_as_EcdsaChannelSigner(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKInMemorySigner obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = BlindedTail_write(&obj_conv); + LDKCVec_u8Z ret_var = InMemorySigner_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedTail_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_BlindedTailDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedTailDecodeErrorZ), "LDKCResult_BlindedTailDecodeErrorZ"); - *ret_conv = BlindedTail_read(ser_ref); + void* arg_ptr = untag_ptr(arg); + CHECK_ACCESS(arg_ptr); + LDKEntropySource arg_conv = *(LDKEntropySource*)(arg_ptr); + if (arg_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&arg_conv); + } + LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); + *ret_conv = InMemorySigner_read(ser_ref, arg_conv); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Path_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKPath this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKKeysManager this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Path_free(this_obj_conv); + KeysManager_free(this_obj_conv); } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Path_1get_1hops(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_RouteHopZ ret_var = Path_get_hops(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t k = 0; k < ret_var.datalen; k++) { - LDKRouteHop ret_conv_10_var = ret_var.data[k]; - int64_t ret_conv_10_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_10_var); - ret_conv_10_ref = tag_ptr(ret_conv_10_var.inner, ret_conv_10_var.is_owned); - ret_arr_ptr[k] = ret_conv_10_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1new(JNIEnv *env, jclass clz, int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos) { + uint8_t seed_arr[32]; + CHECK((*env)->GetArrayLength(env, seed) == 32); + (*env)->GetByteArrayRegion(env, seed, 0, 32, seed_arr); + uint8_t (*seed_ref)[32] = &seed_arr; + LDKKeysManager ret_var = KeysManager_new(seed_ref, starting_time_secs, starting_time_nanos); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_KeysManager_1get_1node_1secret_1key(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKKeysManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, KeysManager_get_node_secret_key(&this_arg_conv).bytes); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Path_1set_1hops(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { - LDKPath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_RouteHopZ val_constr; - val_constr.datalen = (*env)->GetArrayLength(env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); - for (size_t k = 0; k < val_constr.datalen; k++) { - int64_t val_conv_10 = val_vals[k]; - LDKRouteHop val_conv_10_conv; - val_conv_10_conv.inner = untag_ptr(val_conv_10); - val_conv_10_conv.is_owned = ptr_is_owned(val_conv_10); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_10_conv); - val_conv_10_conv = RouteHop_clone(&val_conv_10_conv); - val_constr.data[k] = val_conv_10_conv; - } - (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); - Path_set_hops(&this_ptr_conv, val_constr); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1get_1blinded_1tail(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKBlindedTail ret_var = Path_get_blinded_tail(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1derive_1channel_1keys(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_value_satoshis, int8_tArray params) { + LDKKeysManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + uint8_t params_arr[32]; + CHECK((*env)->GetArrayLength(env, params) == 32); + (*env)->GetByteArrayRegion(env, params, 0, 32, params_arr); + uint8_t (*params_ref)[32] = ¶ms_arr; + LDKInMemorySigner ret_var = KeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Path_1set_1blinded_1tail(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKPath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKBlindedTail val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = BlindedTail_clone(&val_conv); - Path_set_blinded_tail(&this_ptr_conv, val_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1new(JNIEnv *env, jclass clz, int64_tArray hops_arg, int64_t blinded_tail_arg) { - LDKCVec_RouteHopZ hops_arg_constr; - hops_arg_constr.datalen = (*env)->GetArrayLength(env, hops_arg); - if (hops_arg_constr.datalen > 0) - hops_arg_constr.data = MALLOC(hops_arg_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1sign_1spendable_1outputs_1psbt(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray descriptors, int8_tArray psbt) { + LDKKeysManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_SpendableOutputDescriptorZ descriptors_constr; + descriptors_constr.datalen = (*env)->GetArrayLength(env, descriptors); + if (descriptors_constr.datalen > 0) + descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); else - hops_arg_constr.data = NULL; - int64_t* hops_arg_vals = (*env)->GetLongArrayElements (env, hops_arg, NULL); - for (size_t k = 0; k < hops_arg_constr.datalen; k++) { - int64_t hops_arg_conv_10 = hops_arg_vals[k]; - LDKRouteHop hops_arg_conv_10_conv; - hops_arg_conv_10_conv.inner = untag_ptr(hops_arg_conv_10); - hops_arg_conv_10_conv.is_owned = ptr_is_owned(hops_arg_conv_10); - CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_arg_conv_10_conv); - hops_arg_conv_10_conv = RouteHop_clone(&hops_arg_conv_10_conv); - hops_arg_constr.data[k] = hops_arg_conv_10_conv; + descriptors_constr.data = NULL; + int64_t* descriptors_vals = (*env)->GetLongArrayElements (env, descriptors, NULL); + for (size_t b = 0; b < descriptors_constr.datalen; b++) { + int64_t descriptors_conv_27 = descriptors_vals[b]; + void* descriptors_conv_27_ptr = untag_ptr(descriptors_conv_27); + CHECK_ACCESS(descriptors_conv_27_ptr); + LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr); + descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(descriptors_conv_27)); + descriptors_constr.data[b] = descriptors_conv_27_conv; } - (*env)->ReleaseLongArrayElements(env, hops_arg, hops_arg_vals, 0); - LDKBlindedTail blinded_tail_arg_conv; - blinded_tail_arg_conv.inner = untag_ptr(blinded_tail_arg); - blinded_tail_arg_conv.is_owned = ptr_is_owned(blinded_tail_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_tail_arg_conv); - blinded_tail_arg_conv = BlindedTail_clone(&blinded_tail_arg_conv); - LDKPath ret_var = Path_new(hops_arg_constr, blinded_tail_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + (*env)->ReleaseLongArrayElements(env, descriptors, descriptors_vals, 0); + LDKCVec_u8Z psbt_ref; + psbt_ref.datalen = (*env)->GetArrayLength(env, psbt); + psbt_ref.data = MALLOC(psbt_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, psbt, 0, psbt_ref.datalen, psbt_ref.data); + LDKCResult_CVec_u8ZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZNoneZ), "LDKCResult_CVec_u8ZNoneZ"); + *ret_conv = KeysManager_sign_spendable_outputs_psbt(&this_arg_conv, descriptors_constr, psbt_ref); + return tag_ptr(ret_conv, true); } -static inline uint64_t Path_clone_ptr(LDKPath *NONNULL_PTR arg) { - LDKPath ret_var = Path_clone(arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1EntropySource(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKKeysManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource"); + *ret_ret = KeysManager_as_EntropySource(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1NodeSigner(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKKeysManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeSigner* ret_ret = MALLOC(sizeof(LDKNodeSigner), "LDKNodeSigner"); + *ret_ret = KeysManager_as_NodeSigner(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1OutputSpender(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKKeysManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKOutputSpender* ret_ret = MALLOC(sizeof(LDKOutputSpender), "LDKOutputSpender"); + *ret_ret = KeysManager_as_OutputSpender(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1SignerProvider(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKKeysManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKSignerProvider* ret_ret = MALLOC(sizeof(LDKSignerProvider), "LDKSignerProvider"); + *ret_ret = KeysManager_as_SignerProvider(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPhantomKeysManager this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + PhantomKeysManager_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1as_1EntropySource(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKPhantomKeysManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource"); + *ret_ret = PhantomKeysManager_as_EntropySource(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1as_1NodeSigner(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKPhantomKeysManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeSigner* ret_ret = MALLOC(sizeof(LDKNodeSigner), "LDKNodeSigner"); + *ret_ret = PhantomKeysManager_as_NodeSigner(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1as_1OutputSpender(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKPhantomKeysManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKOutputSpender* ret_ret = MALLOC(sizeof(LDKOutputSpender), "LDKOutputSpender"); + *ret_ret = PhantomKeysManager_as_OutputSpender(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1as_1SignerProvider(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKPhantomKeysManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKSignerProvider* ret_ret = MALLOC(sizeof(LDKSignerProvider), "LDKSignerProvider"); + *ret_ret = PhantomKeysManager_as_SignerProvider(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1new(JNIEnv *env, jclass clz, int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos, int8_tArray cross_node_seed) { + uint8_t seed_arr[32]; + CHECK((*env)->GetArrayLength(env, seed) == 32); + (*env)->GetByteArrayRegion(env, seed, 0, 32, seed_arr); + uint8_t (*seed_ref)[32] = &seed_arr; + uint8_t cross_node_seed_arr[32]; + CHECK((*env)->GetArrayLength(env, cross_node_seed) == 32); + (*env)->GetByteArrayRegion(env, cross_node_seed, 0, 32, cross_node_seed_arr); + uint8_t (*cross_node_seed_ref)[32] = &cross_node_seed_arr; + LDKPhantomKeysManager ret_var = PhantomKeysManager_new(seed_ref, starting_time_secs, starting_time_nanos, cross_node_seed_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKPath arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = Path_clone_ptr(&arg_conv); - return ret_conv; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPath orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKPath ret_var = Path_clone(&orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1derive_1channel_1keys(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_value_satoshis, int8_tArray params) { + LDKPhantomKeysManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + uint8_t params_arr[32]; + CHECK((*env)->GetArrayLength(env, params) == 32); + (*env)->GetByteArrayRegion(env, params, 0, 32, params_arr); + uint8_t (*params_ref)[32] = ¶ms_arr; + LDKInMemorySigner ret_var = PhantomKeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKPath o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = Path_hash(&o_conv); - return ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Path_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKPath a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKPath b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = Path_eq(&a_conv, &b_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1fee_1msat(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKPath this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1get_1node_1secret_1key(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKPhantomKeysManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - int64_t ret_conv = Path_fee_msat(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, PhantomKeysManager_get_node_secret_key(&this_arg_conv).bytes); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1final_1value_1msat(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKPath this_arg_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1get_1phantom_1node_1secret_1key(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKPhantomKeysManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - int64_t ret_conv = Path_final_value_msat(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, PhantomKeysManager_get_phantom_node_secret_key(&this_arg_conv).bytes); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1final_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKPath this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RandomBytes_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKRandomBytes this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + RandomBytes_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RandomBytes_1new(JNIEnv *env, jclass clz, int8_tArray seed) { + LDKThirtyTwoBytes seed_ref; + CHECK((*env)->GetArrayLength(env, seed) == 32); + (*env)->GetByteArrayRegion(env, seed, 0, 32, seed_ref.data); + LDKRandomBytes ret_var = RandomBytes_new(seed_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RandomBytes_1as_1EntropySource(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKRandomBytes this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); - *ret_copy = Path_final_cltv_expiry_delta(&this_arg_conv); + LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource"); + *ret_ret = RandomBytes_as_EntropySource(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +static inline uint64_t EcdsaChannelSigner_clone_ptr(LDKEcdsaChannelSigner *NONNULL_PTR arg) { + LDKEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner"); + *ret_ret = EcdsaChannelSigner_clone(arg); + return tag_ptr(ret_ret, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EcdsaChannelSigner_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + void* arg_ptr = untag_ptr(arg); + if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); } + LDKEcdsaChannelSigner* arg_conv = (LDKEcdsaChannelSigner*)arg_ptr; + int64_t ret_conv = EcdsaChannelSigner_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EcdsaChannelSigner_1clone(JNIEnv *env, jclass clz, int64_t orig) { + void* orig_ptr = untag_ptr(orig); + if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); } + LDKEcdsaChannelSigner* orig_conv = (LDKEcdsaChannelSigner*)orig_ptr; + LDKEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner"); + *ret_ret = EcdsaChannelSigner_clone(orig_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EcdsaChannelSigner_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKEcdsaChannelSigner this_ptr_conv = *(LDKEcdsaChannelSigner*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + EcdsaChannelSigner_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKAsyncPaymentsMessageHandler this_ptr_conv = *(LDKAsyncPaymentsMessageHandler*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + AsyncPaymentsMessageHandler_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessage_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKAsyncPaymentsMessage this_ptr_conv = *(LDKAsyncPaymentsMessage*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + AsyncPaymentsMessage_free(this_ptr_conv); +} + +static inline uint64_t AsyncPaymentsMessage_clone_ptr(LDKAsyncPaymentsMessage *NONNULL_PTR arg) { + LDKAsyncPaymentsMessage *ret_copy = MALLOC(sizeof(LDKAsyncPaymentsMessage), "LDKAsyncPaymentsMessage"); + *ret_copy = AsyncPaymentsMessage_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKAsyncPaymentsMessage* arg_conv = (LDKAsyncPaymentsMessage*)untag_ptr(arg); + int64_t ret_conv = AsyncPaymentsMessage_clone_ptr(arg_conv); + return ret_conv; +} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKRoute this_obj_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessage_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKAsyncPaymentsMessage* orig_conv = (LDKAsyncPaymentsMessage*)untag_ptr(orig); + LDKAsyncPaymentsMessage *ret_copy = MALLOC(sizeof(LDKAsyncPaymentsMessage), "LDKAsyncPaymentsMessage"); + *ret_copy = AsyncPaymentsMessage_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessage_1held_1htlc_1available(JNIEnv *env, jclass clz, int64_t a) { + LDKHeldHtlcAvailable a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = HeldHtlcAvailable_clone(&a_conv); + LDKAsyncPaymentsMessage *ret_copy = MALLOC(sizeof(LDKAsyncPaymentsMessage), "LDKAsyncPaymentsMessage"); + *ret_copy = AsyncPaymentsMessage_held_htlc_available(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessage_1release_1held_1htlc(JNIEnv *env, jclass clz, int64_t a) { + LDKReleaseHeldHtlc a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = ReleaseHeldHtlc_clone(&a_conv); + LDKAsyncPaymentsMessage *ret_copy = MALLOC(sizeof(LDKAsyncPaymentsMessage), "LDKAsyncPaymentsMessage"); + *ret_copy = AsyncPaymentsMessage_release_held_htlc(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HeldHtlcAvailable_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKHeldHtlcAvailable this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Route_free(this_obj_conv); + HeldHtlcAvailable_free(this_obj_conv); } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Route_1get_1paths(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRoute this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HeldHtlcAvailable_1get_1payment_1release_1secret(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKHeldHtlcAvailable this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_PathZ ret_var = Route_get_paths(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t g = 0; g < ret_var.datalen; g++) { - LDKPath ret_conv_6_var = ret_var.data[g]; - int64_t ret_conv_6_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_6_var); - ret_conv_6_ref = tag_ptr(ret_conv_6_var.inner, ret_conv_6_var.is_owned); - ret_arr_ptr[g] = ret_conv_6_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *HeldHtlcAvailable_get_payment_release_secret(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1paths(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { - LDKRoute this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HeldHtlcAvailable_1set_1payment_1release_1secret(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKHeldHtlcAvailable this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_PathZ val_constr; - val_constr.datalen = (*env)->GetArrayLength(env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKPath), "LDKCVec_PathZ Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); - for (size_t g = 0; g < val_constr.datalen; g++) { - int64_t val_conv_6 = val_vals[g]; - LDKPath val_conv_6_conv; - val_conv_6_conv.inner = untag_ptr(val_conv_6); - val_conv_6_conv.is_owned = ptr_is_owned(val_conv_6); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_6_conv); - val_conv_6_conv = Path_clone(&val_conv_6_conv); - val_constr.data[g] = val_conv_6_conv; - } - (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); - Route_set_paths(&this_ptr_conv, val_constr); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + HeldHtlcAvailable_set_payment_release_secret(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1route_1params(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRoute this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKRouteParameters ret_var = Route_get_route_params(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HeldHtlcAvailable_1new(JNIEnv *env, jclass clz, int8_tArray payment_release_secret_arg) { + LDKThirtyTwoBytes payment_release_secret_arg_ref; + CHECK((*env)->GetArrayLength(env, payment_release_secret_arg) == 32); + (*env)->GetByteArrayRegion(env, payment_release_secret_arg, 0, 32, payment_release_secret_arg_ref.data); + LDKHeldHtlcAvailable ret_var = HeldHtlcAvailable_new(payment_release_secret_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1route_1params(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKRoute this_ptr_conv; +static inline uint64_t HeldHtlcAvailable_clone_ptr(LDKHeldHtlcAvailable *NONNULL_PTR arg) { + LDKHeldHtlcAvailable ret_var = HeldHtlcAvailable_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HeldHtlcAvailable_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKHeldHtlcAvailable arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = HeldHtlcAvailable_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HeldHtlcAvailable_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKHeldHtlcAvailable orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKHeldHtlcAvailable ret_var = HeldHtlcAvailable_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReleaseHeldHtlc_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKReleaseHeldHtlc this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ReleaseHeldHtlc_free(this_obj_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReleaseHeldHtlc_1get_1payment_1release_1secret(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKReleaseHeldHtlc this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKRouteParameters val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = RouteParameters_clone(&val_conv); - Route_set_route_params(&this_ptr_conv, val_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ReleaseHeldHtlc_get_payment_release_secret(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1new(JNIEnv *env, jclass clz, int64_tArray paths_arg, int64_t route_params_arg) { - LDKCVec_PathZ paths_arg_constr; - paths_arg_constr.datalen = (*env)->GetArrayLength(env, paths_arg); - if (paths_arg_constr.datalen > 0) - paths_arg_constr.data = MALLOC(paths_arg_constr.datalen * sizeof(LDKPath), "LDKCVec_PathZ Elements"); - else - paths_arg_constr.data = NULL; - int64_t* paths_arg_vals = (*env)->GetLongArrayElements (env, paths_arg, NULL); - for (size_t g = 0; g < paths_arg_constr.datalen; g++) { - int64_t paths_arg_conv_6 = paths_arg_vals[g]; - LDKPath paths_arg_conv_6_conv; - paths_arg_conv_6_conv.inner = untag_ptr(paths_arg_conv_6); - paths_arg_conv_6_conv.is_owned = ptr_is_owned(paths_arg_conv_6); - CHECK_INNER_FIELD_ACCESS_OR_NULL(paths_arg_conv_6_conv); - paths_arg_conv_6_conv = Path_clone(&paths_arg_conv_6_conv); - paths_arg_constr.data[g] = paths_arg_conv_6_conv; - } - (*env)->ReleaseLongArrayElements(env, paths_arg, paths_arg_vals, 0); - LDKRouteParameters route_params_arg_conv; - route_params_arg_conv.inner = untag_ptr(route_params_arg); - route_params_arg_conv.is_owned = ptr_is_owned(route_params_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_arg_conv); - route_params_arg_conv = RouteParameters_clone(&route_params_arg_conv); - LDKRoute ret_var = Route_new(paths_arg_constr, route_params_arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReleaseHeldHtlc_1set_1payment_1release_1secret(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKReleaseHeldHtlc this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + ReleaseHeldHtlc_set_payment_release_secret(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReleaseHeldHtlc_1new(JNIEnv *env, jclass clz, int8_tArray payment_release_secret_arg) { + LDKThirtyTwoBytes payment_release_secret_arg_ref; + CHECK((*env)->GetArrayLength(env, payment_release_secret_arg) == 32); + (*env)->GetByteArrayRegion(env, payment_release_secret_arg, 0, 32, payment_release_secret_arg_ref.data); + LDKReleaseHeldHtlc ret_var = ReleaseHeldHtlc_new(payment_release_secret_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t Route_clone_ptr(LDKRoute *NONNULL_PTR arg) { - LDKRoute ret_var = Route_clone(arg); +static inline uint64_t ReleaseHeldHtlc_clone_ptr(LDKReleaseHeldHtlc *NONNULL_PTR arg) { + LDKReleaseHeldHtlc ret_var = ReleaseHeldHtlc_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKRoute arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReleaseHeldHtlc_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKReleaseHeldHtlc arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Route_clone_ptr(&arg_conv); + int64_t ret_conv = ReleaseHeldHtlc_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKRoute orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReleaseHeldHtlc_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKReleaseHeldHtlc orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKRoute ret_var = Route_clone(&orig_conv); + LDKReleaseHeldHtlc ret_var = ReleaseHeldHtlc_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKRoute o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = Route_hash(&o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReleaseHeldHtlc_1as_1OnionMessageContents(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKReleaseHeldHtlc this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *ret_ret = ReleaseHeldHtlc_as_OnionMessageContents(&this_arg_conv); + return tag_ptr(ret_ret, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Route_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKRoute a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKRoute b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = Route_eq(&a_conv, &b_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1total_1fees(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKRoute this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = Route_get_total_fees(&this_arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1total_1amount(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKRoute this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = Route_get_total_amount(&this_arg_conv); - return ret_conv; -} - -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Route_1to_1str(JNIEnv *env, jclass clz, int64_t o) { - LDKRoute o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - LDKStr ret_str = Route_to_str(&o_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Route_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKRoute obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HeldHtlcAvailable_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKHeldHtlcAvailable obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = Route_write(&obj_conv); + LDKCVec_u8Z ret_var = HeldHtlcAvailable_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HeldHtlcAvailable_1read(JNIEnv *env, jclass clz, int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); - *ret_conv = Route_read(ser_ref); + LDKCResult_HeldHtlcAvailableDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HeldHtlcAvailableDecodeErrorZ), "LDKCResult_HeldHtlcAvailableDecodeErrorZ"); + *ret_conv = HeldHtlcAvailable_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKRouteParameters this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - RouteParameters_free(this_obj_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReleaseHeldHtlc_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKReleaseHeldHtlc obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ReleaseHeldHtlc_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1payment_1params(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRouteParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPaymentParameters ret_var = RouteParameters_get_payment_params(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReleaseHeldHtlc_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_ReleaseHeldHtlcDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReleaseHeldHtlcDecodeErrorZ), "LDKCResult_ReleaseHeldHtlcDecodeErrorZ"); + *ret_conv = ReleaseHeldHtlc_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1payment_1params(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKRouteParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPaymentParameters val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = PaymentParameters_clone(&val_conv); - RouteParameters_set_payment_params(&this_ptr_conv, val_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessage_1is_1known_1type(JNIEnv *env, jclass clz, int64_t tlv_type) { + jboolean ret_conv = AsyncPaymentsMessage_is_known_type(tlv_type); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1final_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRouteParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = RouteParameters_get_final_value_msat(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessage_1as_1OnionMessageContents(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKAsyncPaymentsMessage* this_arg_conv = (LDKAsyncPaymentsMessage*)untag_ptr(this_arg); + LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *ret_ret = AsyncPaymentsMessage_as_OnionMessageContents(this_arg_conv); + return tag_ptr(ret_ret, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1final_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKRouteParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - RouteParameters_set_final_value_msat(&this_ptr_conv, val); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessage_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKAsyncPaymentsMessage* obj_conv = (LDKAsyncPaymentsMessage*)untag_ptr(obj); + LDKCVec_u8Z ret_var = AsyncPaymentsMessage_write(obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1max_1total_1routing_1fee_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRouteParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = RouteParameters_get_max_total_routing_fee_msat(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessage_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_AsyncPaymentsMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AsyncPaymentsMessageDecodeErrorZ), "LDKCResult_AsyncPaymentsMessageDecodeErrorZ"); + *ret_conv = AsyncPaymentsMessage_read(ser_ref, arg); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1max_1total_1routing_1fee_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKRouteParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - RouteParameters_set_max_total_routing_fee_msat(&this_ptr_conv, val_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKOnionMessenger this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OnionMessenger_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1new(JNIEnv *env, jclass clz, int64_t payment_params_arg, int64_t final_value_msat_arg, int64_t max_total_routing_fee_msat_arg) { - LDKPaymentParameters payment_params_arg_conv; - payment_params_arg_conv.inner = untag_ptr(payment_params_arg); - payment_params_arg_conv.is_owned = ptr_is_owned(payment_params_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_params_arg_conv); - payment_params_arg_conv = PaymentParameters_clone(&payment_params_arg_conv); - void* max_total_routing_fee_msat_arg_ptr = untag_ptr(max_total_routing_fee_msat_arg); - CHECK_ACCESS(max_total_routing_fee_msat_arg_ptr); - LDKCOption_u64Z max_total_routing_fee_msat_arg_conv = *(LDKCOption_u64Z*)(max_total_routing_fee_msat_arg_ptr); - max_total_routing_fee_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(max_total_routing_fee_msat_arg)); - LDKRouteParameters ret_var = RouteParameters_new(payment_params_arg_conv, final_value_msat_arg, max_total_routing_fee_msat_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Responder_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKResponder this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Responder_free(this_obj_conv); } -static inline uint64_t RouteParameters_clone_ptr(LDKRouteParameters *NONNULL_PTR arg) { - LDKRouteParameters ret_var = RouteParameters_clone(arg); +static inline uint64_t Responder_clone_ptr(LDKResponder *NONNULL_PTR arg) { + LDKResponder ret_var = Responder_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKRouteParameters arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Responder_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKResponder arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = RouteParameters_clone_ptr(&arg_conv); + int64_t ret_conv = Responder_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKRouteParameters orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Responder_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKResponder orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKRouteParameters ret_var = RouteParameters_clone(&orig_conv); + LDKResponder ret_var = Responder_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKRouteParameters o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = RouteParameters_hash(&o_conv); - return ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteParameters_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKRouteParameters a_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Responder_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKResponder a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKRouteParameters b_conv; + LDKResponder b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = RouteParameters_eq(&a_conv, &b_conv); + jboolean ret_conv = Responder_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1from_1payment_1params_1and_1value(JNIEnv *env, jclass clz, int64_t payment_params, int64_t final_value_msat) { - LDKPaymentParameters payment_params_conv; - payment_params_conv.inner = untag_ptr(payment_params); - payment_params_conv.is_owned = ptr_is_owned(payment_params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_params_conv); - payment_params_conv = PaymentParameters_clone(&payment_params_conv); - LDKRouteParameters ret_var = RouteParameters_from_payment_params_and_value(payment_params_conv, final_value_msat); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteParameters_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKRouteParameters obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Responder_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKResponder obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = RouteParameters_write(&obj_conv); + LDKCVec_u8Z ret_var = Responder_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Responder_1read(JNIEnv *env, jclass clz, int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); - *ret_conv = RouteParameters_read(ser_ref); + LDKCResult_ResponderDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ResponderDecodeErrorZ), "LDKCResult_ResponderDecodeErrorZ"); + *ret_conv = Responder_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKPaymentParameters this_obj_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Responder_1respond(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKResponder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = Responder_clone(&this_arg_conv); + LDKResponseInstruction ret_var = Responder_respond(this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Responder_1respond_1with_1reply_1path(JNIEnv *env, jclass clz, int64_t this_arg, int64_t context) { + LDKResponder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = Responder_clone(&this_arg_conv); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKMessageContext context_conv = *(LDKMessageContext*)(context_ptr); + context_conv = MessageContext_clone((LDKMessageContext*)untag_ptr(context)); + LDKResponseInstruction ret_var = Responder_respond_with_reply_path(this_arg_conv, context_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ResponseInstruction_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKResponseInstruction this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PaymentParameters_free(this_obj_conv); + ResponseInstruction_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1payee(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); - *ret_copy = PaymentParameters_get_payee(&this_ptr_conv); +static inline uint64_t ResponseInstruction_clone_ptr(LDKResponseInstruction *NONNULL_PTR arg) { + LDKResponseInstruction ret_var = ResponseInstruction_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ResponseInstruction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKResponseInstruction arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = ResponseInstruction_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ResponseInstruction_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKResponseInstruction orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKResponseInstruction ret_var = ResponseInstruction_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendInstructions_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKMessageSendInstructions this_ptr_conv = *(LDKMessageSendInstructions*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + MessageSendInstructions_free(this_ptr_conv); +} + +static inline uint64_t MessageSendInstructions_clone_ptr(LDKMessageSendInstructions *NONNULL_PTR arg) { + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = MessageSendInstructions_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendInstructions_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKMessageSendInstructions* arg_conv = (LDKMessageSendInstructions*)untag_ptr(arg); + int64_t ret_conv = MessageSendInstructions_clone_ptr(arg_conv); + return ret_conv; +} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1payee(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKPayee val_conv = *(LDKPayee*)(val_ptr); - val_conv = Payee_clone((LDKPayee*)untag_ptr(val)); - PaymentParameters_set_payee(&this_ptr_conv, val_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendInstructions_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKMessageSendInstructions* orig_conv = (LDKMessageSendInstructions*)untag_ptr(orig); + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = MessageSendInstructions_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1expiry_1time(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = PaymentParameters_get_expiry_time(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendInstructions_1with_1specified_1reply_1path(JNIEnv *env, jclass clz, int64_t destination, int64_t reply_path) { + void* destination_ptr = untag_ptr(destination); + CHECK_ACCESS(destination_ptr); + LDKDestination destination_conv = *(LDKDestination*)(destination_ptr); + destination_conv = Destination_clone((LDKDestination*)untag_ptr(destination)); + LDKBlindedMessagePath reply_path_conv; + reply_path_conv.inner = untag_ptr(reply_path); + reply_path_conv.is_owned = ptr_is_owned(reply_path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(reply_path_conv); + reply_path_conv = BlindedMessagePath_clone(&reply_path_conv); + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = MessageSendInstructions_with_specified_reply_path(destination_conv, reply_path_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1expiry_1time(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - PaymentParameters_set_expiry_time(&this_ptr_conv, val_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendInstructions_1with_1reply_1path(JNIEnv *env, jclass clz, int64_t destination, int64_t context) { + void* destination_ptr = untag_ptr(destination); + CHECK_ACCESS(destination_ptr); + LDKDestination destination_conv = *(LDKDestination*)(destination_ptr); + destination_conv = Destination_clone((LDKDestination*)untag_ptr(destination)); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKMessageContext context_conv = *(LDKMessageContext*)(context_ptr); + context_conv = MessageContext_clone((LDKMessageContext*)untag_ptr(context)); + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = MessageSendInstructions_with_reply_path(destination_conv, context_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1max_1total_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int32_t ret_conv = PaymentParameters_get_max_total_cltv_expiry_delta(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendInstructions_1without_1reply_1path(JNIEnv *env, jclass clz, int64_t destination) { + void* destination_ptr = untag_ptr(destination); + CHECK_ACCESS(destination_ptr); + LDKDestination destination_conv = *(LDKDestination*)(destination_ptr); + destination_conv = Destination_clone((LDKDestination*)untag_ptr(destination)); + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = MessageSendInstructions_without_reply_path(destination_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1max_1total_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - PaymentParameters_set_max_total_cltv_expiry_delta(&this_ptr_conv, val); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendInstructions_1for_1reply(JNIEnv *env, jclass clz, int64_t instructions) { + LDKResponseInstruction instructions_conv; + instructions_conv.inner = untag_ptr(instructions); + instructions_conv.is_owned = ptr_is_owned(instructions); + CHECK_INNER_FIELD_ACCESS_OR_NULL(instructions_conv); + instructions_conv = ResponseInstruction_clone(&instructions_conv); + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = MessageSendInstructions_for_reply(instructions_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1max_1path_1count(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_t ret_conv = PaymentParameters_get_max_path_count(&this_ptr_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageRouter_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKMessageRouter this_ptr_conv = *(LDKMessageRouter*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + MessageRouter_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1max_1path_1count(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - PaymentParameters_set_max_path_count(&this_ptr_conv, val); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DefaultMessageRouter_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKDefaultMessageRouter this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + DefaultMessageRouter_free(this_obj_conv); } -JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1max_1channel_1saturation_1power_1of_1half(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_t ret_conv = PaymentParameters_get_max_channel_saturation_power_of_half(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultMessageRouter_1new(JNIEnv *env, jclass clz, int64_t network_graph, int64_t entropy_source) { + LDKNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + LDKDefaultMessageRouter ret_var = DefaultMessageRouter_new(&network_graph_conv, entropy_source_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1max_1channel_1saturation_1power_1of_1half(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) { - LDKPaymentParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - PaymentParameters_set_max_channel_saturation_power_of_half(&this_ptr_conv, val); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultMessageRouter_1as_1MessageRouter(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKDefaultMessageRouter this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKMessageRouter* ret_ret = MALLOC(sizeof(LDKMessageRouter), "LDKMessageRouter"); + *ret_ret = DefaultMessageRouter_as_MessageRouter(&this_arg_conv); + return tag_ptr(ret_ret, true); } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1previously_1failed_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPaymentParameters this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKOnionMessagePath this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OnionMessagePath_free(this_obj_conv); +} + +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1get_1intermediate_1nodes(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOnionMessagePath this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u64Z ret_var = PaymentParameters_get_previously_failed_channels(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t g = 0; g < ret_var.datalen; g++) { - int64_t ret_conv_6_conv = ret_var.data[g]; - ret_arr_ptr[g] = ret_conv_6_conv; + LDKCVec_PublicKeyZ ret_var = OnionMessagePath_get_intermediate_nodes(&this_ptr_conv); + jobjectArray ret_arr = NULL; + ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); + ; + for (size_t i = 0; i < ret_var.datalen; i++) { + int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 33, ret_var.data[i].compressed_form); + (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1previously_1failed_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { - LDKPaymentParameters this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1set_1intermediate_1nodes(JNIEnv *env, jclass clz, int64_t this_ptr, jobjectArray val) { + LDKOnionMessagePath this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u64Z val_constr; + LDKCVec_PublicKeyZ val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); else val_constr.data = NULL; - int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); - for (size_t g = 0; g < val_constr.datalen; g++) { - int64_t val_conv_6 = val_vals[g]; - val_constr.data[g] = val_conv_6; + for (size_t i = 0; i < val_constr.datalen; i++) { + int8_tArray val_conv_8 = (*env)->GetObjectArrayElement(env, val, i); + LDKPublicKey val_conv_8_ref; + CHECK((*env)->GetArrayLength(env, val_conv_8) == 33); + (*env)->GetByteArrayRegion(env, val_conv_8, 0, 33, val_conv_8_ref.compressed_form); + val_constr.data[i] = val_conv_8_ref; } - (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); - PaymentParameters_set_previously_failed_channels(&this_ptr_conv, val_constr); + OnionMessagePath_set_intermediate_nodes(&this_ptr_conv, val_constr); } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1previously_1failed_1blinded_1path_1idxs(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPaymentParameters this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1get_1destination(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOnionMessagePath this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u64Z ret_var = PaymentParameters_get_previously_failed_blinded_path_idxs(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t g = 0; g < ret_var.datalen; g++) { - int64_t ret_conv_6_conv = ret_var.data[g]; - ret_arr_ptr[g] = ret_conv_6_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; + LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); + *ret_copy = OnionMessagePath_get_destination(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1previously_1failed_1blinded_1path_1idxs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { - LDKPaymentParameters this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1set_1destination(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKOnionMessagePath this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u64Z val_constr; - val_constr.datalen = (*env)->GetArrayLength(env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); - for (size_t g = 0; g < val_constr.datalen; g++) { - int64_t val_conv_6 = val_vals[g]; - val_constr.data[g] = val_conv_6; - } - (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); - PaymentParameters_set_previously_failed_blinded_path_idxs(&this_ptr_conv, val_constr); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKDestination val_conv = *(LDKDestination*)(val_ptr); + val_conv = Destination_clone((LDKDestination*)untag_ptr(val)); + OnionMessagePath_set_destination(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1new(JNIEnv *env, jclass clz, int64_t payee_arg, int64_t expiry_time_arg, int32_t max_total_cltv_expiry_delta_arg, int8_t max_path_count_arg, int8_t max_channel_saturation_power_of_half_arg, int64_tArray previously_failed_channels_arg, int64_tArray previously_failed_blinded_path_idxs_arg) { - void* payee_arg_ptr = untag_ptr(payee_arg); - CHECK_ACCESS(payee_arg_ptr); - LDKPayee payee_arg_conv = *(LDKPayee*)(payee_arg_ptr); - payee_arg_conv = Payee_clone((LDKPayee*)untag_ptr(payee_arg)); - void* expiry_time_arg_ptr = untag_ptr(expiry_time_arg); - CHECK_ACCESS(expiry_time_arg_ptr); - LDKCOption_u64Z expiry_time_arg_conv = *(LDKCOption_u64Z*)(expiry_time_arg_ptr); - expiry_time_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(expiry_time_arg)); - LDKCVec_u64Z previously_failed_channels_arg_constr; - previously_failed_channels_arg_constr.datalen = (*env)->GetArrayLength(env, previously_failed_channels_arg); - if (previously_failed_channels_arg_constr.datalen > 0) - previously_failed_channels_arg_constr.data = MALLOC(previously_failed_channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); - else - previously_failed_channels_arg_constr.data = NULL; - int64_t* previously_failed_channels_arg_vals = (*env)->GetLongArrayElements (env, previously_failed_channels_arg, NULL); - for (size_t g = 0; g < previously_failed_channels_arg_constr.datalen; g++) { - int64_t previously_failed_channels_arg_conv_6 = previously_failed_channels_arg_vals[g]; - previously_failed_channels_arg_constr.data[g] = previously_failed_channels_arg_conv_6; - } - (*env)->ReleaseLongArrayElements(env, previously_failed_channels_arg, previously_failed_channels_arg_vals, 0); - LDKCVec_u64Z previously_failed_blinded_path_idxs_arg_constr; - previously_failed_blinded_path_idxs_arg_constr.datalen = (*env)->GetArrayLength(env, previously_failed_blinded_path_idxs_arg); - if (previously_failed_blinded_path_idxs_arg_constr.datalen > 0) - previously_failed_blinded_path_idxs_arg_constr.data = MALLOC(previously_failed_blinded_path_idxs_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); - else - previously_failed_blinded_path_idxs_arg_constr.data = NULL; - int64_t* previously_failed_blinded_path_idxs_arg_vals = (*env)->GetLongArrayElements (env, previously_failed_blinded_path_idxs_arg, NULL); - for (size_t g = 0; g < previously_failed_blinded_path_idxs_arg_constr.datalen; g++) { - int64_t previously_failed_blinded_path_idxs_arg_conv_6 = previously_failed_blinded_path_idxs_arg_vals[g]; - previously_failed_blinded_path_idxs_arg_constr.data[g] = previously_failed_blinded_path_idxs_arg_conv_6; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1get_1first_1node_1addresses(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOnionMessagePath this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_CVec_SocketAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_SocketAddressZZ), "LDKCOption_CVec_SocketAddressZZ"); + *ret_copy = OnionMessagePath_get_first_node_addresses(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1set_1first_1node_1addresses(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKOnionMessagePath this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_CVec_SocketAddressZZ val_conv = *(LDKCOption_CVec_SocketAddressZZ*)(val_ptr); + val_conv = COption_CVec_SocketAddressZZ_clone((LDKCOption_CVec_SocketAddressZZ*)untag_ptr(val)); + OnionMessagePath_set_first_node_addresses(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1new(JNIEnv *env, jclass clz, jobjectArray intermediate_nodes_arg, int64_t destination_arg, int64_t first_node_addresses_arg) { + LDKCVec_PublicKeyZ intermediate_nodes_arg_constr; + intermediate_nodes_arg_constr.datalen = (*env)->GetArrayLength(env, intermediate_nodes_arg); + if (intermediate_nodes_arg_constr.datalen > 0) + intermediate_nodes_arg_constr.data = MALLOC(intermediate_nodes_arg_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); + else + intermediate_nodes_arg_constr.data = NULL; + for (size_t i = 0; i < intermediate_nodes_arg_constr.datalen; i++) { + int8_tArray intermediate_nodes_arg_conv_8 = (*env)->GetObjectArrayElement(env, intermediate_nodes_arg, i); + LDKPublicKey intermediate_nodes_arg_conv_8_ref; + CHECK((*env)->GetArrayLength(env, intermediate_nodes_arg_conv_8) == 33); + (*env)->GetByteArrayRegion(env, intermediate_nodes_arg_conv_8, 0, 33, intermediate_nodes_arg_conv_8_ref.compressed_form); + intermediate_nodes_arg_constr.data[i] = intermediate_nodes_arg_conv_8_ref; } - (*env)->ReleaseLongArrayElements(env, previously_failed_blinded_path_idxs_arg, previously_failed_blinded_path_idxs_arg_vals, 0); - LDKPaymentParameters ret_var = PaymentParameters_new(payee_arg_conv, expiry_time_arg_conv, max_total_cltv_expiry_delta_arg, max_path_count_arg, max_channel_saturation_power_of_half_arg, previously_failed_channels_arg_constr, previously_failed_blinded_path_idxs_arg_constr); + void* destination_arg_ptr = untag_ptr(destination_arg); + CHECK_ACCESS(destination_arg_ptr); + LDKDestination destination_arg_conv = *(LDKDestination*)(destination_arg_ptr); + destination_arg_conv = Destination_clone((LDKDestination*)untag_ptr(destination_arg)); + void* first_node_addresses_arg_ptr = untag_ptr(first_node_addresses_arg); + CHECK_ACCESS(first_node_addresses_arg_ptr); + LDKCOption_CVec_SocketAddressZZ first_node_addresses_arg_conv = *(LDKCOption_CVec_SocketAddressZZ*)(first_node_addresses_arg_ptr); + first_node_addresses_arg_conv = COption_CVec_SocketAddressZZ_clone((LDKCOption_CVec_SocketAddressZZ*)untag_ptr(first_node_addresses_arg)); + LDKOnionMessagePath ret_var = OnionMessagePath_new(intermediate_nodes_arg_constr, destination_arg_conv, first_node_addresses_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t PaymentParameters_clone_ptr(LDKPaymentParameters *NONNULL_PTR arg) { - LDKPaymentParameters ret_var = PaymentParameters_clone(arg); +static inline uint64_t OnionMessagePath_clone_ptr(LDKOnionMessagePath *NONNULL_PTR arg) { + LDKOnionMessagePath ret_var = OnionMessagePath_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKPaymentParameters arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKOnionMessagePath arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = PaymentParameters_clone_ptr(&arg_conv); + int64_t ret_conv = OnionMessagePath_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPaymentParameters orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKOnionMessagePath orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKPaymentParameters ret_var = PaymentParameters_clone(&orig_conv); + LDKOnionMessagePath ret_var = OnionMessagePath_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKPaymentParameters o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = PaymentParameters_hash(&o_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1first_1node(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOnionMessagePath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OnionMessagePath_first_node(&this_arg_conv).compressed_form); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Destination_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKDestination this_ptr_conv = *(LDKDestination*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Destination_free(this_ptr_conv); +} + +static inline uint64_t Destination_clone_ptr(LDKDestination *NONNULL_PTR arg) { + LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); + *ret_copy = Destination_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKDestination* arg_conv = (LDKDestination*)untag_ptr(arg); + int64_t ret_conv = Destination_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKPaymentParameters a_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKDestination* orig_conv = (LDKDestination*)untag_ptr(orig); + LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); + *ret_copy = Destination_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1node(JNIEnv *env, jclass clz, int8_tArray a) { + LDKPublicKey a_ref; + CHECK((*env)->GetArrayLength(env, a) == 33); + (*env)->GetByteArrayRegion(env, a, 0, 33, a_ref.compressed_form); + LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); + *ret_copy = Destination_node(a_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1blinded_1path(JNIEnv *env, jclass clz, int64_t a) { + LDKBlindedMessagePath a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKPaymentParameters b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = PaymentParameters_eq(&a_conv, &b_conv); + a_conv = BlindedMessagePath_clone(&a_conv); + LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); + *ret_copy = Destination_blinded_path(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKDestination* o_conv = (LDKDestination*)untag_ptr(o); + int64_t ret_conv = Destination_hash(o_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKPaymentParameters obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = PaymentParameters_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Destination_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKDestination* a_conv = (LDKDestination*)untag_ptr(a); + LDKDestination* b_conv = (LDKDestination*)untag_ptr(b); + jboolean ret_conv = Destination_eq(a_conv, b_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1read(JNIEnv *env, jclass clz, int8_tArray ser, int32_t arg) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ"); - *ret_conv = PaymentParameters_read(ser_ref, arg); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Destination_1resolve(JNIEnv *env, jclass clz, int64_t this_arg, int64_t network_graph) { + LDKDestination* this_arg_conv = (LDKDestination*)untag_ptr(this_arg); + LDKReadOnlyNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; + Destination_resolve(this_arg_conv, &network_graph_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1from_1node_1id(JNIEnv *env, jclass clz, int8_tArray payee_pubkey, int32_t final_cltv_expiry_delta) { - LDKPublicKey payee_pubkey_ref; - CHECK((*env)->GetArrayLength(env, payee_pubkey) == 33); - (*env)->GetByteArrayRegion(env, payee_pubkey, 0, 33, payee_pubkey_ref.compressed_form); - LDKPaymentParameters ret_var = PaymentParameters_from_node_id(payee_pubkey_ref, final_cltv_expiry_delta); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SendSuccess_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKSendSuccess this_ptr_conv = *(LDKSendSuccess*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + SendSuccess_free(this_ptr_conv); +} + +static inline uint64_t SendSuccess_clone_ptr(LDKSendSuccess *NONNULL_PTR arg) { + LDKSendSuccess *ret_copy = MALLOC(sizeof(LDKSendSuccess), "LDKSendSuccess"); + *ret_copy = SendSuccess_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendSuccess_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKSendSuccess* arg_conv = (LDKSendSuccess*)untag_ptr(arg); + int64_t ret_conv = SendSuccess_clone_ptr(arg_conv); + return ret_conv; +} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1for_1keysend(JNIEnv *env, jclass clz, int8_tArray payee_pubkey, int32_t final_cltv_expiry_delta, jboolean allow_mpp) { - LDKPublicKey payee_pubkey_ref; - CHECK((*env)->GetArrayLength(env, payee_pubkey) == 33); - (*env)->GetByteArrayRegion(env, payee_pubkey, 0, 33, payee_pubkey_ref.compressed_form); - LDKPaymentParameters ret_var = PaymentParameters_for_keysend(payee_pubkey_ref, final_cltv_expiry_delta, allow_mpp); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendSuccess_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKSendSuccess* orig_conv = (LDKSendSuccess*)untag_ptr(orig); + LDKSendSuccess *ret_copy = MALLOC(sizeof(LDKSendSuccess), "LDKSendSuccess"); + *ret_copy = SendSuccess_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1from_1bolt12_1invoice(JNIEnv *env, jclass clz, int64_t invoice) { - LDKBolt12Invoice invoice_conv; - invoice_conv.inner = untag_ptr(invoice); - invoice_conv.is_owned = ptr_is_owned(invoice); - CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); - invoice_conv.is_owned = false; - LDKPaymentParameters ret_var = PaymentParameters_from_bolt12_invoice(&invoice_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendSuccess_1buffered(JNIEnv *env, jclass clz) { + LDKSendSuccess *ret_copy = MALLOC(sizeof(LDKSendSuccess), "LDKSendSuccess"); + *ret_copy = SendSuccess_buffered(); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1blinded(JNIEnv *env, jclass clz, int64_tArray blinded_route_hints) { - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ blinded_route_hints_constr; - blinded_route_hints_constr.datalen = (*env)->GetArrayLength(env, blinded_route_hints); - if (blinded_route_hints_constr.datalen > 0) - blinded_route_hints_constr.data = MALLOC(blinded_route_hints_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); - else - blinded_route_hints_constr.data = NULL; - int64_t* blinded_route_hints_vals = (*env)->GetLongArrayElements (env, blinded_route_hints, NULL); - for (size_t l = 0; l < blinded_route_hints_constr.datalen; l++) { - int64_t blinded_route_hints_conv_37 = blinded_route_hints_vals[l]; - void* blinded_route_hints_conv_37_ptr = untag_ptr(blinded_route_hints_conv_37); - CHECK_ACCESS(blinded_route_hints_conv_37_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ blinded_route_hints_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(blinded_route_hints_conv_37_ptr); - blinded_route_hints_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(blinded_route_hints_conv_37)); - blinded_route_hints_constr.data[l] = blinded_route_hints_conv_37_conv; - } - (*env)->ReleaseLongArrayElements(env, blinded_route_hints, blinded_route_hints_vals, 0); - LDKPaymentParameters ret_var = PaymentParameters_blinded(blinded_route_hints_constr); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendSuccess_1buffered_1awaiting_1connection(JNIEnv *env, jclass clz, int8_tArray a) { + LDKPublicKey a_ref; + CHECK((*env)->GetArrayLength(env, a) == 33); + (*env)->GetByteArrayRegion(env, a, 0, 33, a_ref.compressed_form); + LDKSendSuccess *ret_copy = MALLOC(sizeof(LDKSendSuccess), "LDKSendSuccess"); + *ret_copy = SendSuccess_buffered_awaiting_connection(a_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendSuccess_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKSendSuccess* o_conv = (LDKSendSuccess*)untag_ptr(o); + int64_t ret_conv = SendSuccess_hash(o_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SendSuccess_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKSendSuccess* a_conv = (LDKSendSuccess*)untag_ptr(a); + LDKSendSuccess* b_conv = (LDKSendSuccess*)untag_ptr(b); + jboolean ret_conv = SendSuccess_eq(a_conv, b_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SendError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); CHECK_ACCESS(this_ptr_ptr); - LDKPayee this_ptr_conv = *(LDKPayee*)(this_ptr_ptr); + LDKSendError this_ptr_conv = *(LDKSendError*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - Payee_free(this_ptr_conv); + SendError_free(this_ptr_conv); } -static inline uint64_t Payee_clone_ptr(LDKPayee *NONNULL_PTR arg) { - LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); - *ret_copy = Payee_clone(arg); +static inline uint64_t SendError_clone_ptr(LDKSendError *NONNULL_PTR arg) { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKPayee* arg_conv = (LDKPayee*)untag_ptr(arg); - int64_t ret_conv = Payee_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKSendError* arg_conv = (LDKSendError*)untag_ptr(arg); + int64_t ret_conv = SendError_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPayee* orig_conv = (LDKPayee*)untag_ptr(orig); - LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); - *ret_copy = Payee_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKSendError* orig_conv = (LDKSendError*)untag_ptr(orig); + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_clone(orig_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1blinded(JNIEnv *env, jclass clz, int64_tArray route_hints, int64_t features) { - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ route_hints_constr; - route_hints_constr.datalen = (*env)->GetArrayLength(env, route_hints); - if (route_hints_constr.datalen > 0) - route_hints_constr.data = MALLOC(route_hints_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); - else - route_hints_constr.data = NULL; - int64_t* route_hints_vals = (*env)->GetLongArrayElements (env, route_hints, NULL); - for (size_t l = 0; l < route_hints_constr.datalen; l++) { - int64_t route_hints_conv_37 = route_hints_vals[l]; - void* route_hints_conv_37_ptr = untag_ptr(route_hints_conv_37); - CHECK_ACCESS(route_hints_conv_37_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ route_hints_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(route_hints_conv_37_ptr); - route_hints_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(route_hints_conv_37)); - route_hints_constr.data[l] = route_hints_conv_37_conv; - } - (*env)->ReleaseLongArrayElements(env, route_hints, route_hints_vals, 0); - LDKBolt12InvoiceFeatures features_conv; - features_conv.inner = untag_ptr(features); - features_conv.is_owned = ptr_is_owned(features); - CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); - features_conv = Bolt12InvoiceFeatures_clone(&features_conv); - LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); - *ret_copy = Payee_blinded(route_hints_constr, features_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1secp256k1(JNIEnv *env, jclass clz, jclass a) { + LDKSecp256k1Error a_conv = LDKSecp256k1Error_from_java(env, a); + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_secp256k1(a_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1clear(JNIEnv *env, jclass clz, int8_tArray node_id, int64_tArray route_hints, int64_t features, int32_t final_cltv_expiry_delta) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKCVec_RouteHintZ route_hints_constr; - route_hints_constr.datalen = (*env)->GetArrayLength(env, route_hints); - if (route_hints_constr.datalen > 0) - route_hints_constr.data = MALLOC(route_hints_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements"); - else - route_hints_constr.data = NULL; - int64_t* route_hints_vals = (*env)->GetLongArrayElements (env, route_hints, NULL); - for (size_t l = 0; l < route_hints_constr.datalen; l++) { - int64_t route_hints_conv_11 = route_hints_vals[l]; - LDKRouteHint route_hints_conv_11_conv; - route_hints_conv_11_conv.inner = untag_ptr(route_hints_conv_11); - route_hints_conv_11_conv.is_owned = ptr_is_owned(route_hints_conv_11); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_hints_conv_11_conv); - route_hints_conv_11_conv = RouteHint_clone(&route_hints_conv_11_conv); - route_hints_constr.data[l] = route_hints_conv_11_conv; - } - (*env)->ReleaseLongArrayElements(env, route_hints, route_hints_vals, 0); - LDKBolt11InvoiceFeatures features_conv; - features_conv.inner = untag_ptr(features); - features_conv.is_owned = ptr_is_owned(features); - CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); - features_conv = Bolt11InvoiceFeatures_clone(&features_conv); - LDKPayee *ret_copy = MALLOC(sizeof(LDKPayee), "LDKPayee"); - *ret_copy = Payee_clear(node_id_ref, route_hints_constr, features_conv, final_cltv_expiry_delta); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1too_1big_1packet(JNIEnv *env, jclass clz) { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_too_big_packet(); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKPayee* o_conv = (LDKPayee*)untag_ptr(o); - int64_t ret_conv = Payee_hash(o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1too_1few_1blinded_1hops(JNIEnv *env, jclass clz) { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_too_few_blinded_hops(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Payee_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKPayee* a_conv = (LDKPayee*)untag_ptr(a); - LDKPayee* b_conv = (LDKPayee*)untag_ptr(b); - jboolean ret_conv = Payee_eq(a_conv, b_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1invalid_1first_1hop(JNIEnv *env, jclass clz, int8_tArray a) { + LDKPublicKey a_ref; + CHECK((*env)->GetArrayLength(env, a) == 33); + (*env)->GetByteArrayRegion(env, a, 0, 33, a_ref.compressed_form); + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_invalid_first_hop(a_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKRouteHint this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - RouteHint_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1path_1not_1found(JNIEnv *env, jclass clz) { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_path_not_found(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRouteHint this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_RouteHintHopZ ret_var = RouteHint_get_a(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t o = 0; o < ret_var.datalen; o++) { - LDKRouteHintHop ret_conv_14_var = ret_var.data[o]; - int64_t ret_conv_14_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var); - ret_conv_14_ref = tag_ptr(ret_conv_14_var.inner, ret_conv_14_var.is_owned); - ret_arr_ptr[o] = ret_conv_14_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1invalid_1message(JNIEnv *env, jclass clz) { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_invalid_message(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { - LDKRouteHint this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_RouteHintHopZ val_constr; - val_constr.datalen = (*env)->GetArrayLength(env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); - for (size_t o = 0; o < val_constr.datalen; o++) { - int64_t val_conv_14 = val_vals[o]; - LDKRouteHintHop val_conv_14_conv; - val_conv_14_conv.inner = untag_ptr(val_conv_14); - val_conv_14_conv.is_owned = ptr_is_owned(val_conv_14); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_14_conv); - val_conv_14_conv = RouteHintHop_clone(&val_conv_14_conv); - val_constr.data[o] = val_conv_14_conv; - } - (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); - RouteHint_set_a(&this_ptr_conv, val_constr); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1buffer_1full(JNIEnv *env, jclass clz) { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_buffer_full(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1new(JNIEnv *env, jclass clz, int64_tArray a_arg) { - LDKCVec_RouteHintHopZ a_arg_constr; - a_arg_constr.datalen = (*env)->GetArrayLength(env, a_arg); - if (a_arg_constr.datalen > 0) - a_arg_constr.data = MALLOC(a_arg_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements"); - else - a_arg_constr.data = NULL; - int64_t* a_arg_vals = (*env)->GetLongArrayElements (env, a_arg, NULL); - for (size_t o = 0; o < a_arg_constr.datalen; o++) { - int64_t a_arg_conv_14 = a_arg_vals[o]; - LDKRouteHintHop a_arg_conv_14_conv; - a_arg_conv_14_conv.inner = untag_ptr(a_arg_conv_14); - a_arg_conv_14_conv.is_owned = ptr_is_owned(a_arg_conv_14); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_arg_conv_14_conv); - a_arg_conv_14_conv = RouteHintHop_clone(&a_arg_conv_14_conv); - a_arg_constr.data[o] = a_arg_conv_14_conv; - } - (*env)->ReleaseLongArrayElements(env, a_arg, a_arg_vals, 0); - LDKRouteHint ret_var = RouteHint_new(a_arg_constr); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1get_1node_1id_1failed(JNIEnv *env, jclass clz) { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_get_node_id_failed(); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline uint64_t RouteHint_clone_ptr(LDKRouteHint *NONNULL_PTR arg) { - LDKRouteHint ret_var = RouteHint_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1unresolved_1introduction_1node(JNIEnv *env, jclass clz) { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_unresolved_introduction_node(); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKRouteHint arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = RouteHint_clone_ptr(&arg_conv); - return ret_conv; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKRouteHint orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKRouteHint ret_var = RouteHint_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1blinded_1path_1advance_1failed(JNIEnv *env, jclass clz) { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_blinded_path_advance_failed(); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKRouteHint o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = RouteHint_hash(&o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKSendError* o_conv = (LDKSendError*)untag_ptr(o); + int64_t ret_conv = SendError_hash(o_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHint_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKRouteHint a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKRouteHint b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = RouteHint_eq(&a_conv, &b_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SendError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKSendError* a_conv = (LDKSendError*)untag_ptr(a); + LDKSendError* b_conv = (LDKSendError*)untag_ptr(b); + jboolean ret_conv = SendError_eq(a_conv, b_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKRouteHint obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = RouteHint_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKCustomOnionMessageHandler this_ptr_conv = *(LDKCustomOnionMessageHandler*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + CustomOnionMessageHandler_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeeledOnion_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKPeeledOnion this_ptr_conv = *(LDKPeeledOnion*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + PeeledOnion_free(this_ptr_conv); +} + +static inline uint64_t PeeledOnion_clone_ptr(LDKPeeledOnion *NONNULL_PTR arg) { + LDKPeeledOnion *ret_copy = MALLOC(sizeof(LDKPeeledOnion), "LDKPeeledOnion"); + *ret_copy = PeeledOnion_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeeledOnion_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPeeledOnion* arg_conv = (LDKPeeledOnion*)untag_ptr(arg); + int64_t ret_conv = PeeledOnion_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeeledOnion_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPeeledOnion* orig_conv = (LDKPeeledOnion*)untag_ptr(orig); + LDKPeeledOnion *ret_copy = MALLOC(sizeof(LDKPeeledOnion), "LDKPeeledOnion"); + *ret_copy = PeeledOnion_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeeledOnion_1forward(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKNextMessageHop a_conv = *(LDKNextMessageHop*)(a_ptr); + a_conv = NextMessageHop_clone((LDKNextMessageHop*)untag_ptr(a)); + LDKOnionMessage b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv = OnionMessage_clone(&b_conv); + LDKPeeledOnion *ret_copy = MALLOC(sizeof(LDKPeeledOnion), "LDKPeeledOnion"); + *ret_copy = PeeledOnion_forward(a_conv, b_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeeledOnion_1receive(JNIEnv *env, jclass clz, int64_t a, int64_t b, int64_t c) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKParsedOnionMessageContents a_conv = *(LDKParsedOnionMessageContents*)(a_ptr); + a_conv = ParsedOnionMessageContents_clone((LDKParsedOnionMessageContents*)untag_ptr(a)); + void* b_ptr = untag_ptr(b); + CHECK_ACCESS(b_ptr); + LDKCOption_MessageContextZ b_conv = *(LDKCOption_MessageContextZ*)(b_ptr); + b_conv = COption_MessageContextZ_clone((LDKCOption_MessageContextZ*)untag_ptr(b)); + LDKBlindedMessagePath c_conv; + c_conv.inner = untag_ptr(c); + c_conv.is_owned = ptr_is_owned(c); + CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv); + c_conv = BlindedMessagePath_clone(&c_conv); + LDKPeeledOnion *ret_copy = MALLOC(sizeof(LDKPeeledOnion), "LDKPeeledOnion"); + *ret_copy = PeeledOnion_receive(a_conv, b_conv, c_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1onion_1message_1resolving_1destination(JNIEnv *env, jclass clz, int64_t entropy_source, int64_t node_signer, int64_t node_id_lookup, int64_t network_graph, int64_t path, int64_t contents, int64_t reply_path) { + void* entropy_source_ptr = untag_ptr(entropy_source); + if (ptr_is_owned(entropy_source)) { CHECK_ACCESS(entropy_source_ptr); } + LDKEntropySource* entropy_source_conv = (LDKEntropySource*)entropy_source_ptr; + void* node_signer_ptr = untag_ptr(node_signer); + if (ptr_is_owned(node_signer)) { CHECK_ACCESS(node_signer_ptr); } + LDKNodeSigner* node_signer_conv = (LDKNodeSigner*)node_signer_ptr; + void* node_id_lookup_ptr = untag_ptr(node_id_lookup); + if (ptr_is_owned(node_id_lookup)) { CHECK_ACCESS(node_id_lookup_ptr); } + LDKNodeIdLookUp* node_id_lookup_conv = (LDKNodeIdLookUp*)node_id_lookup_ptr; + LDKReadOnlyNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; + LDKOnionMessagePath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv = OnionMessagePath_clone(&path_conv); + void* contents_ptr = untag_ptr(contents); + CHECK_ACCESS(contents_ptr); + LDKOnionMessageContents contents_conv = *(LDKOnionMessageContents*)(contents_ptr); + if (contents_conv.free == LDKOnionMessageContents_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOnionMessageContents_JCalls_cloned(&contents_conv); + } + LDKBlindedMessagePath reply_path_conv; + reply_path_conv.inner = untag_ptr(reply_path); + reply_path_conv.is_owned = ptr_is_owned(reply_path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(reply_path_conv); + reply_path_conv = BlindedMessagePath_clone(&reply_path_conv); + LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ), "LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ"); + *ret_conv = create_onion_message_resolving_destination(entropy_source_conv, node_signer_conv, node_id_lookup_conv, &network_graph_conv, path_conv, contents_conv, reply_path_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1onion_1message(JNIEnv *env, jclass clz, int64_t entropy_source, int64_t node_signer, int64_t node_id_lookup, int64_t path, int64_t contents, int64_t reply_path) { + void* entropy_source_ptr = untag_ptr(entropy_source); + if (ptr_is_owned(entropy_source)) { CHECK_ACCESS(entropy_source_ptr); } + LDKEntropySource* entropy_source_conv = (LDKEntropySource*)entropy_source_ptr; + void* node_signer_ptr = untag_ptr(node_signer); + if (ptr_is_owned(node_signer)) { CHECK_ACCESS(node_signer_ptr); } + LDKNodeSigner* node_signer_conv = (LDKNodeSigner*)node_signer_ptr; + void* node_id_lookup_ptr = untag_ptr(node_id_lookup); + if (ptr_is_owned(node_id_lookup)) { CHECK_ACCESS(node_id_lookup_ptr); } + LDKNodeIdLookUp* node_id_lookup_conv = (LDKNodeIdLookUp*)node_id_lookup_ptr; + LDKOnionMessagePath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv = OnionMessagePath_clone(&path_conv); + void* contents_ptr = untag_ptr(contents); + CHECK_ACCESS(contents_ptr); + LDKOnionMessageContents contents_conv = *(LDKOnionMessageContents*)(contents_ptr); + if (contents_conv.free == LDKOnionMessageContents_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOnionMessageContents_JCalls_cloned(&contents_conv); + } + LDKBlindedMessagePath reply_path_conv; + reply_path_conv.inner = untag_ptr(reply_path); + reply_path_conv.is_owned = ptr_is_owned(reply_path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(reply_path_conv); + reply_path_conv = BlindedMessagePath_clone(&reply_path_conv); + LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ), "LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ"); + *ret_conv = create_onion_message(entropy_source_conv, node_signer_conv, node_id_lookup_conv, path_conv, contents_conv, reply_path_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_peel_1onion_1message(JNIEnv *env, jclass clz, int64_t msg, int64_t node_signer, int64_t logger, int64_t custom_handler) { + LDKOnionMessage msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + void* custom_handler_ptr = untag_ptr(custom_handler); + CHECK_ACCESS(custom_handler_ptr); + LDKCustomOnionMessageHandler custom_handler_conv = *(LDKCustomOnionMessageHandler*)(custom_handler_ptr); + if (custom_handler_conv.free == LDKCustomOnionMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKCustomOnionMessageHandler_JCalls_cloned(&custom_handler_conv); + } + LDKCResult_PeeledOnionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PeeledOnionNoneZ), "LDKCResult_PeeledOnionNoneZ"); + *ret_conv = peel_onion_message(&msg_conv, node_signer_conv, logger_conv, custom_handler_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1new(JNIEnv *env, jclass clz, int64_t entropy_source, int64_t node_signer, int64_t logger, int64_t node_id_lookup, int64_t message_router, int64_t offers_handler, int64_t async_payments_handler, int64_t custom_handler) { + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + void* node_id_lookup_ptr = untag_ptr(node_id_lookup); + CHECK_ACCESS(node_id_lookup_ptr); + LDKNodeIdLookUp node_id_lookup_conv = *(LDKNodeIdLookUp*)(node_id_lookup_ptr); + if (node_id_lookup_conv.free == LDKNodeIdLookUp_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeIdLookUp_JCalls_cloned(&node_id_lookup_conv); + } + void* message_router_ptr = untag_ptr(message_router); + CHECK_ACCESS(message_router_ptr); + LDKMessageRouter message_router_conv = *(LDKMessageRouter*)(message_router_ptr); + if (message_router_conv.free == LDKMessageRouter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKMessageRouter_JCalls_cloned(&message_router_conv); + } + void* offers_handler_ptr = untag_ptr(offers_handler); + CHECK_ACCESS(offers_handler_ptr); + LDKOffersMessageHandler offers_handler_conv = *(LDKOffersMessageHandler*)(offers_handler_ptr); + if (offers_handler_conv.free == LDKOffersMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOffersMessageHandler_JCalls_cloned(&offers_handler_conv); + } + void* async_payments_handler_ptr = untag_ptr(async_payments_handler); + CHECK_ACCESS(async_payments_handler_ptr); + LDKAsyncPaymentsMessageHandler async_payments_handler_conv = *(LDKAsyncPaymentsMessageHandler*)(async_payments_handler_ptr); + if (async_payments_handler_conv.free == LDKAsyncPaymentsMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKAsyncPaymentsMessageHandler_JCalls_cloned(&async_payments_handler_conv); + } + void* custom_handler_ptr = untag_ptr(custom_handler); + CHECK_ACCESS(custom_handler_ptr); + LDKCustomOnionMessageHandler custom_handler_conv = *(LDKCustomOnionMessageHandler*)(custom_handler_ptr); + if (custom_handler_conv.free == LDKCustomOnionMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKCustomOnionMessageHandler_JCalls_cloned(&custom_handler_conv); + } + LDKOnionMessenger ret_var = OnionMessenger_new(entropy_source_conv, node_signer_conv, logger_conv, node_id_lookup_conv, message_router_conv, offers_handler_conv, async_payments_handler_conv, custom_handler_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1new_1with_1offline_1peer_1interception(JNIEnv *env, jclass clz, int64_t entropy_source, int64_t node_signer, int64_t logger, int64_t node_id_lookup, int64_t message_router, int64_t offers_handler, int64_t async_payments_handler, int64_t custom_handler) { + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + void* node_id_lookup_ptr = untag_ptr(node_id_lookup); + CHECK_ACCESS(node_id_lookup_ptr); + LDKNodeIdLookUp node_id_lookup_conv = *(LDKNodeIdLookUp*)(node_id_lookup_ptr); + if (node_id_lookup_conv.free == LDKNodeIdLookUp_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeIdLookUp_JCalls_cloned(&node_id_lookup_conv); + } + void* message_router_ptr = untag_ptr(message_router); + CHECK_ACCESS(message_router_ptr); + LDKMessageRouter message_router_conv = *(LDKMessageRouter*)(message_router_ptr); + if (message_router_conv.free == LDKMessageRouter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKMessageRouter_JCalls_cloned(&message_router_conv); + } + void* offers_handler_ptr = untag_ptr(offers_handler); + CHECK_ACCESS(offers_handler_ptr); + LDKOffersMessageHandler offers_handler_conv = *(LDKOffersMessageHandler*)(offers_handler_ptr); + if (offers_handler_conv.free == LDKOffersMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOffersMessageHandler_JCalls_cloned(&offers_handler_conv); + } + void* async_payments_handler_ptr = untag_ptr(async_payments_handler); + CHECK_ACCESS(async_payments_handler_ptr); + LDKAsyncPaymentsMessageHandler async_payments_handler_conv = *(LDKAsyncPaymentsMessageHandler*)(async_payments_handler_ptr); + if (async_payments_handler_conv.free == LDKAsyncPaymentsMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKAsyncPaymentsMessageHandler_JCalls_cloned(&async_payments_handler_conv); + } + void* custom_handler_ptr = untag_ptr(custom_handler); + CHECK_ACCESS(custom_handler_ptr); + LDKCustomOnionMessageHandler custom_handler_conv = *(LDKCustomOnionMessageHandler*)(custom_handler_ptr); + if (custom_handler_conv.free == LDKCustomOnionMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKCustomOnionMessageHandler_JCalls_cloned(&custom_handler_conv); + } + LDKOnionMessenger ret_var = OnionMessenger_new_with_offline_peer_interception(entropy_source_conv, node_signer_conv, logger_conv, node_id_lookup_conv, message_router_conv, offers_handler_conv, async_payments_handler_conv, custom_handler_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1send_1onion_1message(JNIEnv *env, jclass clz, int64_t this_arg, int64_t contents, int64_t instructions) { + LDKOnionMessenger this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + void* contents_ptr = untag_ptr(contents); + CHECK_ACCESS(contents_ptr); + LDKOnionMessageContents contents_conv = *(LDKOnionMessageContents*)(contents_ptr); + if (contents_conv.free == LDKOnionMessageContents_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOnionMessageContents_JCalls_cloned(&contents_conv); + } + void* instructions_ptr = untag_ptr(instructions); + CHECK_ACCESS(instructions_ptr); + LDKMessageSendInstructions instructions_conv = *(LDKMessageSendInstructions*)(instructions_ptr); + instructions_conv = MessageSendInstructions_clone((LDKMessageSendInstructions*)untag_ptr(instructions)); + LDKCResult_SendSuccessSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SendSuccessSendErrorZ), "LDKCResult_SendSuccessSendErrorZ"); + *ret_conv = OnionMessenger_send_onion_message(&this_arg_conv, contents_conv, instructions_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1forward_1onion_1message(JNIEnv *env, jclass clz, int64_t this_arg, int64_t message, int8_tArray peer_node_id) { + LDKOnionMessenger this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKOnionMessage message_conv; + message_conv.inner = untag_ptr(message); + message_conv.is_owned = ptr_is_owned(message); + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_conv); + message_conv = OnionMessage_clone(&message_conv); + LDKPublicKey peer_node_id_ref; + CHECK((*env)->GetArrayLength(env, peer_node_id) == 33); + (*env)->GetByteArrayRegion(env, peer_node_id, 0, 33, peer_node_id_ref.compressed_form); + LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ"); + *ret_conv = OnionMessenger_forward_onion_message(&this_arg_conv, message_conv, peer_node_id_ref); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1handle_1onion_1message_1response(JNIEnv *env, jclass clz, int64_t this_arg, int64_t response, int64_t instructions) { + LDKOnionMessenger this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + void* response_ptr = untag_ptr(response); + CHECK_ACCESS(response_ptr); + LDKOnionMessageContents response_conv = *(LDKOnionMessageContents*)(response_ptr); + if (response_conv.free == LDKOnionMessageContents_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOnionMessageContents_JCalls_cloned(&response_conv); + } + LDKResponseInstruction instructions_conv; + instructions_conv.inner = untag_ptr(instructions); + instructions_conv.is_owned = ptr_is_owned(instructions); + CHECK_INNER_FIELD_ACCESS_OR_NULL(instructions_conv); + instructions_conv = ResponseInstruction_clone(&instructions_conv); + LDKCResult_SendSuccessSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SendSuccessSendErrorZ), "LDKCResult_SendSuccessSendErrorZ"); + *ret_conv = OnionMessenger_handle_onion_message_response(&this_arg_conv, response_conv, instructions_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1get_1update_1future(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOnionMessenger this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKFuture ret_var = OnionMessenger_get_update_future(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1as_1EventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOnionMessenger this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); + *ret_ret = OnionMessenger_as_EventsProvider(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1as_1OnionMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOnionMessenger this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKOnionMessageHandler* ret_ret = MALLOC(sizeof(LDKOnionMessageHandler), "LDKOnionMessageHandler"); + *ret_ret = OnionMessenger_as_OnionMessageHandler(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OffersMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKOffersMessageHandler this_ptr_conv = *(LDKOffersMessageHandler*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + OffersMessageHandler_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OffersMessage_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKOffersMessage this_ptr_conv = *(LDKOffersMessage*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + OffersMessage_free(this_ptr_conv); +} + +static inline uint64_t OffersMessage_clone_ptr(LDKOffersMessage *NONNULL_PTR arg) { + LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); + *ret_copy = OffersMessage_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKOffersMessage* arg_conv = (LDKOffersMessage*)untag_ptr(arg); + int64_t ret_conv = OffersMessage_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessage_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKOffersMessage* orig_conv = (LDKOffersMessage*)untag_ptr(orig); + LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); + *ret_copy = OffersMessage_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessage_1invoice_1request(JNIEnv *env, jclass clz, int64_t a) { + LDKInvoiceRequest a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = InvoiceRequest_clone(&a_conv); + LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); + *ret_copy = OffersMessage_invoice_request(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessage_1invoice(JNIEnv *env, jclass clz, int64_t a) { + LDKBolt12Invoice a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = Bolt12Invoice_clone(&a_conv); + LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); + *ret_copy = OffersMessage_invoice(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessage_1invoice_1error(JNIEnv *env, jclass clz, int64_t a) { + LDKInvoiceError a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = InvoiceError_clone(&a_conv); + LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); + *ret_copy = OffersMessage_invoice_error(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OffersMessage_1is_1known_1type(JNIEnv *env, jclass clz, int64_t tlv_type) { + jboolean ret_conv = OffersMessage_is_known_type(tlv_type); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessage_1as_1OnionMessageContents(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOffersMessage* this_arg_conv = (LDKOffersMessage*)untag_ptr(this_arg); + LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *ret_ret = OffersMessage_as_OnionMessageContents(this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OffersMessage_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKOffersMessage* obj_conv = (LDKOffersMessage*)untag_ptr(obj); + LDKCVec_u8Z ret_var = OffersMessage_write(obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessage_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg_a, int64_t arg_b) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); - *ret_conv = RouteHint_read(ser_ref); + void* arg_b_ptr = untag_ptr(arg_b); + if (ptr_is_owned(arg_b)) { CHECK_ACCESS(arg_b_ptr); } + LDKLogger* arg_b_conv = (LDKLogger*)arg_b_ptr; + LDKCResult_OffersMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersMessageDecodeErrorZ), "LDKCResult_OffersMessageDecodeErrorZ"); + *ret_conv = OffersMessage_read(ser_ref, arg_a, arg_b_conv); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKRouteHintHop this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Packet_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPacket this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - RouteHintHop_free(this_obj_conv); + Packet_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1src_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRouteHintHop this_ptr_conv; +JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_Packet_1get_1version(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPacket this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RouteHintHop_get_src_node_id(&this_ptr_conv).compressed_form); - return ret_arr; + int8_t ret_conv = Packet_get_version(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1src_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKRouteHintHop this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Packet_1set_1version(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) { + LDKPacket this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - RouteHintHop_set_src_node_id(&this_ptr_conv, val_ref); + Packet_set_version(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRouteHintHop this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Packet_1get_1public_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPacket this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = RouteHintHop_get_short_channel_id(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Packet_get_public_key(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKRouteHintHop this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Packet_1set_1public_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKPacket this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - RouteHintHop_set_short_channel_id(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + Packet_set_public_key(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1fees(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRouteHintHop this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Packet_1get_1hop_1data(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPacket this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKRoutingFees ret_var = RouteHintHop_get_fees(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + LDKCVec_u8Z ret_var = Packet_get_hop_data(&this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1fees(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKRouteHintHop this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Packet_1set_1hop_1data(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKPacket this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKRoutingFees val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = RoutingFees_clone(&val_conv); - RouteHintHop_set_fees(&this_ptr_conv, val_conv); -} - -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRouteHintHop this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int16_t ret_conv = RouteHintHop_get_cltv_expiry_delta(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKRouteHintHop this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - RouteHintHop_set_cltv_expiry_delta(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRouteHintHop this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = RouteHintHop_get_htlc_minimum_msat(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKRouteHintHop this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - RouteHintHop_set_htlc_minimum_msat(&this_ptr_conv, val_conv); + LDKCVec_u8Z val_ref; + val_ref.datalen = (*env)->GetArrayLength(env, val); + val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data); + Packet_set_hop_data(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRouteHintHop this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Packet_1get_1hmac(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPacket this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = RouteHintHop_get_htlc_maximum_msat(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *Packet_get_hmac(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKRouteHintHop this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Packet_1set_1hmac(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKPacket this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - RouteHintHop_set_htlc_maximum_msat(&this_ptr_conv, val_conv); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + Packet_set_hmac(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1new(JNIEnv *env, jclass clz, int8_tArray src_node_id_arg, int64_t short_channel_id_arg, int64_t fees_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg) { - LDKPublicKey src_node_id_arg_ref; - CHECK((*env)->GetArrayLength(env, src_node_id_arg) == 33); - (*env)->GetByteArrayRegion(env, src_node_id_arg, 0, 33, src_node_id_arg_ref.compressed_form); - LDKRoutingFees fees_arg_conv; - fees_arg_conv.inner = untag_ptr(fees_arg); - fees_arg_conv.is_owned = ptr_is_owned(fees_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv); - fees_arg_conv = RoutingFees_clone(&fees_arg_conv); - void* htlc_minimum_msat_arg_ptr = untag_ptr(htlc_minimum_msat_arg); - CHECK_ACCESS(htlc_minimum_msat_arg_ptr); - LDKCOption_u64Z htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_minimum_msat_arg_ptr); - htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_minimum_msat_arg)); - void* htlc_maximum_msat_arg_ptr = untag_ptr(htlc_maximum_msat_arg); - CHECK_ACCESS(htlc_maximum_msat_arg_ptr); - LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_arg_ptr); - htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_maximum_msat_arg)); - LDKRouteHintHop ret_var = RouteHintHop_new(src_node_id_arg_ref, short_channel_id_arg, fees_arg_conv, cltv_expiry_delta_arg, htlc_minimum_msat_arg_conv, htlc_maximum_msat_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Packet_1new(JNIEnv *env, jclass clz, int8_t version_arg, int8_tArray public_key_arg, int8_tArray hop_data_arg, int8_tArray hmac_arg) { + LDKPublicKey public_key_arg_ref; + CHECK((*env)->GetArrayLength(env, public_key_arg) == 33); + (*env)->GetByteArrayRegion(env, public_key_arg, 0, 33, public_key_arg_ref.compressed_form); + LDKCVec_u8Z hop_data_arg_ref; + hop_data_arg_ref.datalen = (*env)->GetArrayLength(env, hop_data_arg); + hop_data_arg_ref.data = MALLOC(hop_data_arg_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, hop_data_arg, 0, hop_data_arg_ref.datalen, hop_data_arg_ref.data); + LDKThirtyTwoBytes hmac_arg_ref; + CHECK((*env)->GetArrayLength(env, hmac_arg) == 32); + (*env)->GetByteArrayRegion(env, hmac_arg, 0, 32, hmac_arg_ref.data); + LDKPacket ret_var = Packet_new(version_arg, public_key_arg_ref, hop_data_arg_ref, hmac_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t RouteHintHop_clone_ptr(LDKRouteHintHop *NONNULL_PTR arg) { - LDKRouteHintHop ret_var = RouteHintHop_clone(arg); +static inline uint64_t Packet_clone_ptr(LDKPacket *NONNULL_PTR arg) { + LDKPacket ret_var = Packet_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKRouteHintHop arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Packet_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPacket arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = RouteHintHop_clone_ptr(&arg_conv); + int64_t ret_conv = Packet_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKRouteHintHop orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Packet_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPacket orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKRouteHintHop ret_var = RouteHintHop_clone(&orig_conv); + LDKPacket ret_var = Packet_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKRouteHintHop o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Packet_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKPacket o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv.is_owned = false; - int64_t ret_conv = RouteHintHop_hash(&o_conv); + int64_t ret_conv = Packet_hash(&o_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKRouteHintHop a_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Packet_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKPacket a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKRouteHintHop b_conv; + LDKPacket b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = RouteHintHop_eq(&a_conv, &b_conv); + jboolean ret_conv = Packet_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKRouteHintHop obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Packet_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKPacket obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = RouteHintHop_write(&obj_conv); + LDKCVec_u8Z ret_var = Packet_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); - *ret_conv = RouteHintHop_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKParsedOnionMessageContents this_ptr_conv = *(LDKParsedOnionMessageContents*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + ParsedOnionMessageContents_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FirstHopCandidate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKFirstHopCandidate this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - FirstHopCandidate_free(this_obj_conv); +static inline uint64_t ParsedOnionMessageContents_clone_ptr(LDKParsedOnionMessageContents *NONNULL_PTR arg) { + LDKParsedOnionMessageContents *ret_copy = MALLOC(sizeof(LDKParsedOnionMessageContents), "LDKParsedOnionMessageContents"); + *ret_copy = ParsedOnionMessageContents_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKParsedOnionMessageContents* arg_conv = (LDKParsedOnionMessageContents*)untag_ptr(arg); + int64_t ret_conv = ParsedOnionMessageContents_clone_ptr(arg_conv); + return ret_conv; } -static inline uint64_t FirstHopCandidate_clone_ptr(LDKFirstHopCandidate *NONNULL_PTR arg) { - LDKFirstHopCandidate ret_var = FirstHopCandidate_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKParsedOnionMessageContents* orig_conv = (LDKParsedOnionMessageContents*)untag_ptr(orig); + LDKParsedOnionMessageContents *ret_copy = MALLOC(sizeof(LDKParsedOnionMessageContents), "LDKParsedOnionMessageContents"); + *ret_copy = ParsedOnionMessageContents_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FirstHopCandidate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKFirstHopCandidate arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = FirstHopCandidate_clone_ptr(&arg_conv); + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1offers(JNIEnv *env, jclass clz, int64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKOffersMessage a_conv = *(LDKOffersMessage*)(a_ptr); + a_conv = OffersMessage_clone((LDKOffersMessage*)untag_ptr(a)); + LDKParsedOnionMessageContents *ret_copy = MALLOC(sizeof(LDKParsedOnionMessageContents), "LDKParsedOnionMessageContents"); + *ret_copy = ParsedOnionMessageContents_offers(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1custom(JNIEnv *env, jclass clz, int64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKOnionMessageContents a_conv = *(LDKOnionMessageContents*)(a_ptr); + if (a_conv.free == LDKOnionMessageContents_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOnionMessageContents_JCalls_cloned(&a_conv); + } + LDKParsedOnionMessageContents *ret_copy = MALLOC(sizeof(LDKParsedOnionMessageContents), "LDKParsedOnionMessageContents"); + *ret_copy = ParsedOnionMessageContents_custom(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1as_1OnionMessageContents(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKParsedOnionMessageContents* this_arg_conv = (LDKParsedOnionMessageContents*)untag_ptr(this_arg); + LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *ret_ret = ParsedOnionMessageContents_as_OnionMessageContents(this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKParsedOnionMessageContents* obj_conv = (LDKParsedOnionMessageContents*)untag_ptr(obj); + LDKCVec_u8Z ret_var = ParsedOnionMessageContents_write(obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +static inline uint64_t OnionMessageContents_clone_ptr(LDKOnionMessageContents *NONNULL_PTR arg) { + LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *ret_ret = OnionMessageContents_clone(arg); + return tag_ptr(ret_ret, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + void* arg_ptr = untag_ptr(arg); + if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); } + LDKOnionMessageContents* arg_conv = (LDKOnionMessageContents*)arg_ptr; + int64_t ret_conv = OnionMessageContents_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FirstHopCandidate_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKFirstHopCandidate orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKFirstHopCandidate ret_var = FirstHopCandidate_clone(&orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1clone(JNIEnv *env, jclass clz, int64_t orig) { + void* orig_ptr = untag_ptr(orig); + if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); } + LDKOnionMessageContents* orig_conv = (LDKOnionMessageContents*)orig_ptr; + LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *ret_ret = OnionMessageContents_clone(orig_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKOnionMessageContents this_ptr_conv = *(LDKOnionMessageContents*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + OnionMessageContents_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKIntroductionNode this_ptr_conv = *(LDKIntroductionNode*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + IntroductionNode_free(this_ptr_conv); +} + +static inline uint64_t IntroductionNode_clone_ptr(LDKIntroductionNode *NONNULL_PTR arg) { + LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); + *ret_copy = IntroductionNode_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKIntroductionNode* arg_conv = (LDKIntroductionNode*)untag_ptr(arg); + int64_t ret_conv = IntroductionNode_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKIntroductionNode* orig_conv = (LDKIntroductionNode*)untag_ptr(orig); + LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); + *ret_copy = IntroductionNode_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1node_1id(JNIEnv *env, jclass clz, int8_tArray a) { + LDKPublicKey a_ref; + CHECK((*env)->GetArrayLength(env, a) == 33); + (*env)->GetByteArrayRegion(env, a, 0, 33, a_ref.compressed_form); + LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); + *ret_copy = IntroductionNode_node_id(a_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1directed_1short_1channel_1id(JNIEnv *env, jclass clz, jclass a, int64_t b) { + LDKDirection a_conv = LDKDirection_from_java(env, a); + LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); + *ret_copy = IntroductionNode_directed_short_channel_id(a_conv, b); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKIntroductionNode* o_conv = (LDKIntroductionNode*)untag_ptr(o); + int64_t ret_conv = IntroductionNode_hash(o_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKIntroductionNode* a_conv = (LDKIntroductionNode*)untag_ptr(a); + LDKIntroductionNode* b_conv = (LDKIntroductionNode*)untag_ptr(b); + jboolean ret_conv = IntroductionNode_eq(a_conv, b_conv); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Direction_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKDirection* orig_conv = (LDKDirection*)untag_ptr(orig); + jclass ret_conv = LDKDirection_to_java(env, Direction_clone(orig_conv)); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Direction_1node_1one(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKDirection_to_java(env, Direction_node_one()); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Direction_1node_1two(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKDirection_to_java(env, Direction_node_two()); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Direction_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKDirection* o_conv = (LDKDirection*)untag_ptr(o); + int64_t ret_conv = Direction_hash(o_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Direction_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKDirection* a_conv = (LDKDirection*)untag_ptr(a); + LDKDirection* b_conv = (LDKDirection*)untag_ptr(b); + jboolean ret_conv = Direction_eq(a_conv, b_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeIdLookUp_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKNodeIdLookUp this_ptr_conv = *(LDKNodeIdLookUp*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + NodeIdLookUp_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EmptyNodeIdLookUp_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKEmptyNodeIdLookUp this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + EmptyNodeIdLookUp_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EmptyNodeIdLookUp_1new(JNIEnv *env, jclass clz) { + LDKEmptyNodeIdLookUp ret_var = EmptyNodeIdLookUp_new(); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PublicHopCandidate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKPublicHopCandidate this_obj_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EmptyNodeIdLookUp_1as_1NodeIdLookUp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKEmptyNodeIdLookUp this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeIdLookUp* ret_ret = MALLOC(sizeof(LDKNodeIdLookUp), "LDKNodeIdLookUp"); + *ret_ret = EmptyNodeIdLookUp_as_NodeIdLookUp(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedHop_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBlindedHop this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PublicHopCandidate_free(this_obj_conv); + BlindedHop_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PublicHopCandidate_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPublicHopCandidate this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedHop_1get_1blinded_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBlindedHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = PublicHopCandidate_get_short_channel_id(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, BlindedHop_get_blinded_node_id(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PublicHopCandidate_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKPublicHopCandidate this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedHop_1set_1blinded_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKBlindedHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - PublicHopCandidate_set_short_channel_id(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + BlindedHop_set_blinded_node_id(&this_ptr_conv, val_ref); } -static inline uint64_t PublicHopCandidate_clone_ptr(LDKPublicHopCandidate *NONNULL_PTR arg) { - LDKPublicHopCandidate ret_var = PublicHopCandidate_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedHop_1get_1encrypted_1payload(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBlindedHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u8Z ret_var = BlindedHop_get_encrypted_payload(&this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PublicHopCandidate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKPublicHopCandidate arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = PublicHopCandidate_clone_ptr(&arg_conv); - return ret_conv; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedHop_1set_1encrypted_1payload(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKBlindedHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u8Z val_ref; + val_ref.datalen = (*env)->GetArrayLength(env, val); + val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data); + BlindedHop_set_encrypted_payload(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PublicHopCandidate_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPublicHopCandidate orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKPublicHopCandidate ret_var = PublicHopCandidate_clone(&orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHop_1new(JNIEnv *env, jclass clz, int8_tArray blinded_node_id_arg, int8_tArray encrypted_payload_arg) { + LDKPublicKey blinded_node_id_arg_ref; + CHECK((*env)->GetArrayLength(env, blinded_node_id_arg) == 33); + (*env)->GetByteArrayRegion(env, blinded_node_id_arg, 0, 33, blinded_node_id_arg_ref.compressed_form); + LDKCVec_u8Z encrypted_payload_arg_ref; + encrypted_payload_arg_ref.datalen = (*env)->GetArrayLength(env, encrypted_payload_arg); + encrypted_payload_arg_ref.data = MALLOC(encrypted_payload_arg_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, encrypted_payload_arg, 0, encrypted_payload_arg_ref.datalen, encrypted_payload_arg_ref.data); + LDKBlindedHop ret_var = BlindedHop_new(blinded_node_id_arg_ref, encrypted_payload_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PrivateHopCandidate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKPrivateHopCandidate this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PrivateHopCandidate_free(this_obj_conv); -} - -static inline uint64_t PrivateHopCandidate_clone_ptr(LDKPrivateHopCandidate *NONNULL_PTR arg) { - LDKPrivateHopCandidate ret_var = PrivateHopCandidate_clone(arg); +static inline uint64_t BlindedHop_clone_ptr(LDKBlindedHop *NONNULL_PTR arg) { + LDKBlindedHop ret_var = BlindedHop_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateHopCandidate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKPrivateHopCandidate arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBlindedHop arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = PrivateHopCandidate_clone_ptr(&arg_conv); + int64_t ret_conv = BlindedHop_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateHopCandidate_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPrivateHopCandidate orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHop_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBlindedHop orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKPrivateHopCandidate ret_var = PrivateHopCandidate_clone(&orig_conv); + LDKBlindedHop ret_var = BlindedHop_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPathCandidate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKBlindedPathCandidate this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BlindedPathCandidate_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHop_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKBlindedHop o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = BlindedHop_hash(&o_conv); + return ret_conv; } -static inline uint64_t BlindedPathCandidate_clone_ptr(LDKBlindedPathCandidate *NONNULL_PTR arg) { - LDKBlindedPathCandidate ret_var = BlindedPathCandidate_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPathCandidate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKBlindedPathCandidate arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedHop_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKBlindedHop a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKBlindedHop b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = BlindedHop_eq(&a_conv, &b_conv); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedHop_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKBlindedHop obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = BlindedHop_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHop_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); + *ret_conv = BlindedHop_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBlindedPayInfo this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + BlindedPayInfo_free(this_obj_conv); +} + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = BlindedPayInfo_get_fee_base_msat(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + BlindedPayInfo_set_fee_base_msat(&this_ptr_conv, val); +} + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = BlindedPayInfo_get_fee_proportional_millionths(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + BlindedPayInfo_set_fee_proportional_millionths(&this_ptr_conv, val); +} + +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int16_t ret_conv = BlindedPayInfo_get_cltv_expiry_delta(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + BlindedPayInfo_set_cltv_expiry_delta(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = BlindedPayInfo_get_htlc_minimum_msat(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + BlindedPayInfo_set_htlc_minimum_msat(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = BlindedPayInfo_get_htlc_maximum_msat(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + BlindedPayInfo_set_htlc_maximum_msat(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBlindedHopFeatures ret_var = BlindedPayInfo_get_features(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKBlindedPayInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBlindedHopFeatures val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = BlindedHopFeatures_clone(&val_conv); + BlindedPayInfo_set_features(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1new(JNIEnv *env, jclass clz, int32_t fee_base_msat_arg, int32_t fee_proportional_millionths_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg, int64_t features_arg) { + LDKBlindedHopFeatures features_arg_conv; + features_arg_conv.inner = untag_ptr(features_arg); + features_arg_conv.is_owned = ptr_is_owned(features_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); + features_arg_conv = BlindedHopFeatures_clone(&features_arg_conv); + LDKBlindedPayInfo ret_var = BlindedPayInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, features_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t BlindedPayInfo_clone_ptr(LDKBlindedPayInfo *NONNULL_PTR arg) { + LDKBlindedPayInfo ret_var = BlindedPayInfo_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBlindedPayInfo arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = BlindedPathCandidate_clone_ptr(&arg_conv); + int64_t ret_conv = BlindedPayInfo_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPathCandidate_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBlindedPathCandidate orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBlindedPayInfo orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBlindedPathCandidate ret_var = BlindedPathCandidate_clone(&orig_conv); + LDKBlindedPayInfo ret_var = BlindedPayInfo_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OneHopBlindedPathCandidate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKOneHopBlindedPathCandidate this_obj_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKBlindedPayInfo o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = BlindedPayInfo_hash(&o_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKBlindedPayInfo a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKBlindedPayInfo b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = BlindedPayInfo_eq(&a_conv, &b_conv); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKBlindedPayInfo obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = BlindedPayInfo_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); + *ret_conv = BlindedPayInfo_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBlindedPaymentPath this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - OneHopBlindedPathCandidate_free(this_obj_conv); + BlindedPaymentPath_free(this_obj_conv); } -static inline uint64_t OneHopBlindedPathCandidate_clone_ptr(LDKOneHopBlindedPathCandidate *NONNULL_PTR arg) { - LDKOneHopBlindedPathCandidate ret_var = OneHopBlindedPathCandidate_clone(arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1get_1payinfo(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBlindedPaymentPath this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBlindedPayInfo ret_var = BlindedPaymentPath_get_payinfo(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OneHopBlindedPathCandidate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKOneHopBlindedPathCandidate arg_conv; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1set_1payinfo(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKBlindedPaymentPath this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBlindedPayInfo val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = BlindedPayInfo_clone(&val_conv); + BlindedPaymentPath_set_payinfo(&this_ptr_conv, val_conv); +} + +static inline uint64_t BlindedPaymentPath_clone_ptr(LDKBlindedPaymentPath *NONNULL_PTR arg) { + LDKBlindedPaymentPath ret_var = BlindedPaymentPath_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBlindedPaymentPath arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = OneHopBlindedPathCandidate_clone_ptr(&arg_conv); + int64_t ret_conv = BlindedPaymentPath_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OneHopBlindedPathCandidate_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKOneHopBlindedPathCandidate orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBlindedPaymentPath orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKOneHopBlindedPathCandidate ret_var = OneHopBlindedPathCandidate_clone(&orig_conv); + LDKBlindedPaymentPath ret_var = BlindedPaymentPath_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKCandidateRouteHop this_ptr_conv = *(LDKCandidateRouteHop*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - CandidateRouteHop_free(this_ptr_conv); -} - -static inline uint64_t CandidateRouteHop_clone_ptr(LDKCandidateRouteHop *NONNULL_PTR arg) { - LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); - *ret_copy = CandidateRouteHop_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCandidateRouteHop* arg_conv = (LDKCandidateRouteHop*)untag_ptr(arg); - int64_t ret_conv = CandidateRouteHop_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKBlindedPaymentPath o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = BlindedPaymentPath_hash(&o_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCandidateRouteHop* orig_conv = (LDKCandidateRouteHop*)untag_ptr(orig); - LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); - *ret_copy = CandidateRouteHop_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1first_1hop(JNIEnv *env, jclass clz, int64_t a) { - LDKFirstHopCandidate a_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKBlindedPaymentPath a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = FirstHopCandidate_clone(&a_conv); - LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); - *ret_copy = CandidateRouteHop_first_hop(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + a_conv.is_owned = false; + LDKBlindedPaymentPath b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = BlindedPaymentPath_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1public_1hop(JNIEnv *env, jclass clz, int64_t a) { - LDKPublicHopCandidate a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = PublicHopCandidate_clone(&a_conv); - LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); - *ret_copy = CandidateRouteHop_public_hop(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1one_1hop(JNIEnv *env, jclass clz, int8_tArray payee_node_id, int64_t payee_tlvs, int16_t min_final_cltv_expiry_delta, int64_t entropy_source) { + LDKPublicKey payee_node_id_ref; + CHECK((*env)->GetArrayLength(env, payee_node_id) == 33); + (*env)->GetByteArrayRegion(env, payee_node_id, 0, 33, payee_node_id_ref.compressed_form); + LDKReceiveTlvs payee_tlvs_conv; + payee_tlvs_conv.inner = untag_ptr(payee_tlvs); + payee_tlvs_conv.is_owned = ptr_is_owned(payee_tlvs); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payee_tlvs_conv); + payee_tlvs_conv = ReceiveTlvs_clone(&payee_tlvs_conv); + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + LDKCResult_BlindedPaymentPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPaymentPathNoneZ), "LDKCResult_BlindedPaymentPathNoneZ"); + *ret_conv = BlindedPaymentPath_one_hop(payee_node_id_ref, payee_tlvs_conv, min_final_cltv_expiry_delta, entropy_source_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1private_1hop(JNIEnv *env, jclass clz, int64_t a) { - LDKPrivateHopCandidate a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = PrivateHopCandidate_clone(&a_conv); - LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); - *ret_copy = CandidateRouteHop_private_hop(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1new(JNIEnv *env, jclass clz, int64_tArray intermediate_nodes, int8_tArray payee_node_id, int64_t payee_tlvs, int64_t htlc_maximum_msat, int16_t min_final_cltv_expiry_delta, int64_t entropy_source) { + LDKCVec_PaymentForwardNodeZ intermediate_nodes_constr; + intermediate_nodes_constr.datalen = (*env)->GetArrayLength(env, intermediate_nodes); + if (intermediate_nodes_constr.datalen > 0) + intermediate_nodes_constr.data = MALLOC(intermediate_nodes_constr.datalen * sizeof(LDKPaymentForwardNode), "LDKCVec_PaymentForwardNodeZ Elements"); + else + intermediate_nodes_constr.data = NULL; + int64_t* intermediate_nodes_vals = (*env)->GetLongArrayElements (env, intermediate_nodes, NULL); + for (size_t u = 0; u < intermediate_nodes_constr.datalen; u++) { + int64_t intermediate_nodes_conv_20 = intermediate_nodes_vals[u]; + LDKPaymentForwardNode intermediate_nodes_conv_20_conv; + intermediate_nodes_conv_20_conv.inner = untag_ptr(intermediate_nodes_conv_20); + intermediate_nodes_conv_20_conv.is_owned = ptr_is_owned(intermediate_nodes_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(intermediate_nodes_conv_20_conv); + intermediate_nodes_conv_20_conv = PaymentForwardNode_clone(&intermediate_nodes_conv_20_conv); + intermediate_nodes_constr.data[u] = intermediate_nodes_conv_20_conv; + } + (*env)->ReleaseLongArrayElements(env, intermediate_nodes, intermediate_nodes_vals, 0); + LDKPublicKey payee_node_id_ref; + CHECK((*env)->GetArrayLength(env, payee_node_id) == 33); + (*env)->GetByteArrayRegion(env, payee_node_id, 0, 33, payee_node_id_ref.compressed_form); + LDKReceiveTlvs payee_tlvs_conv; + payee_tlvs_conv.inner = untag_ptr(payee_tlvs); + payee_tlvs_conv.is_owned = ptr_is_owned(payee_tlvs); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payee_tlvs_conv); + payee_tlvs_conv = ReceiveTlvs_clone(&payee_tlvs_conv); + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + LDKCResult_BlindedPaymentPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPaymentPathNoneZ), "LDKCResult_BlindedPaymentPathNoneZ"); + *ret_conv = BlindedPaymentPath_new(intermediate_nodes_constr, payee_node_id_ref, payee_tlvs_conv, htlc_maximum_msat, min_final_cltv_expiry_delta, entropy_source_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1blinded(JNIEnv *env, jclass clz, int64_t a) { - LDKBlindedPathCandidate a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = BlindedPathCandidate_clone(&a_conv); - LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); - *ret_copy = CandidateRouteHop_blinded(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1public_1introduction_1node_1id(JNIEnv *env, jclass clz, int64_t this_arg, int64_t network_graph) { + LDKBlindedPaymentPath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKReadOnlyNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; + LDKNodeId ret_var = BlindedPaymentPath_public_introduction_node_id(&this_arg_conv, &network_graph_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1one_1hop_1blinded(JNIEnv *env, jclass clz, int64_t a) { - LDKOneHopBlindedPathCandidate a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = OneHopBlindedPathCandidate_clone(&a_conv); - LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); - *ret_copy = CandidateRouteHop_one_hop_blinded(a_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1introduction_1node(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBlindedPaymentPath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); + *ret_copy = BlindedPaymentPath_introduction_node(&this_arg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1globally_1unique_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = CandidateRouteHop_globally_unique_short_channel_id(this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1blinding_1point(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBlindedPaymentPath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, BlindedPaymentPath_blinding_point(&this_arg_conv).compressed_form); + return ret_arr; } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); - int32_t ret_conv = CandidateRouteHop_cltv_expiry_delta(this_arg_conv); - return ret_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1blinded_1hops(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBlindedPaymentPath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_BlindedHopZ ret_var = BlindedPaymentPath_blinded_hops(&this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t m = 0; m < ret_var.datalen; m++) { + LDKBlindedHop ret_conv_12_var = ret_var.data[m]; + int64_t ret_conv_12_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_var); + ret_conv_12_ref = tag_ptr(ret_conv_12_var.inner, ret_conv_12_var.is_owned); + ret_arr_ptr[m] = ret_conv_12_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); - int64_t ret_conv = CandidateRouteHop_htlc_minimum_msat(this_arg_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1advance_1path_1by_1one(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_signer, int64_t node_id_lookup) { + LDKBlindedPaymentPath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + void* node_signer_ptr = untag_ptr(node_signer); + if (ptr_is_owned(node_signer)) { CHECK_ACCESS(node_signer_ptr); } + LDKNodeSigner* node_signer_conv = (LDKNodeSigner*)node_signer_ptr; + void* node_id_lookup_ptr = untag_ptr(node_id_lookup); + if (ptr_is_owned(node_id_lookup)) { CHECK_ACCESS(node_id_lookup_ptr); } + LDKNodeIdLookUp* node_id_lookup_conv = (LDKNodeIdLookUp*)node_id_lookup_ptr; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = BlindedPaymentPath_advance_path_by_one(&this_arg_conv, node_signer_conv, node_id_lookup_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1fees(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); - LDKRoutingFees ret_var = CandidateRouteHop_fees(this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentForwardNode_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPaymentForwardNode this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + PaymentForwardNode_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1source(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); - LDKNodeId ret_var = CandidateRouteHop_source(this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentForwardNode_1get_1tlvs(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPaymentForwardNode this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKForwardTlvs ret_var = PaymentForwardNode_get_tlvs(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1target(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); - LDKNodeId ret_var = CandidateRouteHop_target(this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentForwardNode_1set_1tlvs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKPaymentForwardNode this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKForwardTlvs val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ForwardTlvs_clone(&val_conv); + PaymentForwardNode_set_tlvs(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_find_1route(JNIEnv *env, jclass clz, int8_tArray our_node_pubkey, int64_t route_params, int64_t network_graph, int64_tArray first_hops, int64_t logger, int64_t scorer, int64_t score_params, int8_tArray random_seed_bytes) { - LDKPublicKey our_node_pubkey_ref; - CHECK((*env)->GetArrayLength(env, our_node_pubkey) == 33); - (*env)->GetByteArrayRegion(env, our_node_pubkey, 0, 33, our_node_pubkey_ref.compressed_form); - LDKRouteParameters route_params_conv; - route_params_conv.inner = untag_ptr(route_params); - route_params_conv.is_owned = ptr_is_owned(route_params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); - route_params_conv.is_owned = false; - LDKNetworkGraph network_graph_conv; - network_graph_conv.inner = untag_ptr(network_graph); - network_graph_conv.is_owned = ptr_is_owned(network_graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - network_graph_conv.is_owned = false; - LDKCVec_ChannelDetailsZ first_hops_constr; - LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL; - if (first_hops != NULL) { - first_hops_constr.datalen = (*env)->GetArrayLength(env, first_hops); - if (first_hops_constr.datalen > 0) - first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); - else - first_hops_constr.data = NULL; - int64_t* first_hops_vals = (*env)->GetLongArrayElements (env, first_hops, NULL); - for (size_t q = 0; q < first_hops_constr.datalen; q++) { - int64_t first_hops_conv_16 = first_hops_vals[q]; - LDKChannelDetails first_hops_conv_16_conv; - first_hops_conv_16_conv.inner = untag_ptr(first_hops_conv_16); - first_hops_conv_16_conv.is_owned = ptr_is_owned(first_hops_conv_16); - CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv); - first_hops_conv_16_conv.is_owned = false; - first_hops_constr.data[q] = first_hops_conv_16_conv; - } - (*env)->ReleaseLongArrayElements(env, first_hops, first_hops_vals, 0); - first_hops_ptr = &first_hops_constr; - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - void* scorer_ptr = untag_ptr(scorer); - if (ptr_is_owned(scorer)) { CHECK_ACCESS(scorer_ptr); } - LDKScoreLookUp* scorer_conv = (LDKScoreLookUp*)scorer_ptr; - LDKProbabilisticScoringFeeParameters score_params_conv; - score_params_conv.inner = untag_ptr(score_params); - score_params_conv.is_owned = ptr_is_owned(score_params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(score_params_conv); - score_params_conv.is_owned = false; - uint8_t random_seed_bytes_arr[32]; - CHECK((*env)->GetArrayLength(env, random_seed_bytes) == 32); - (*env)->GetByteArrayRegion(env, random_seed_bytes, 0, 32, random_seed_bytes_arr); - uint8_t (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr; - LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); - *ret_conv = find_route(our_node_pubkey_ref, &route_params_conv, &network_graph_conv, first_hops_ptr, logger_conv, scorer_conv, &score_params_conv, random_seed_bytes_ref); - if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); } - return tag_ptr(ret_conv, true); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentForwardNode_1get_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPaymentForwardNode this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, PaymentForwardNode_get_node_id(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_build_1route_1from_1hops(JNIEnv *env, jclass clz, int8_tArray our_node_pubkey, jobjectArray hops, int64_t route_params, int64_t network_graph, int64_t logger, int8_tArray random_seed_bytes) { - LDKPublicKey our_node_pubkey_ref; - CHECK((*env)->GetArrayLength(env, our_node_pubkey) == 33); - (*env)->GetByteArrayRegion(env, our_node_pubkey, 0, 33, our_node_pubkey_ref.compressed_form); - LDKCVec_PublicKeyZ hops_constr; - hops_constr.datalen = (*env)->GetArrayLength(env, hops); - if (hops_constr.datalen > 0) - hops_constr.data = MALLOC(hops_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); - else - hops_constr.data = NULL; - for (size_t i = 0; i < hops_constr.datalen; i++) { - int8_tArray hops_conv_8 = (*env)->GetObjectArrayElement(env, hops, i); - LDKPublicKey hops_conv_8_ref; - CHECK((*env)->GetArrayLength(env, hops_conv_8) == 33); - (*env)->GetByteArrayRegion(env, hops_conv_8, 0, 33, hops_conv_8_ref.compressed_form); - hops_constr.data[i] = hops_conv_8_ref; - } - LDKRouteParameters route_params_conv; - route_params_conv.inner = untag_ptr(route_params); - route_params_conv.is_owned = ptr_is_owned(route_params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); - route_params_conv.is_owned = false; - LDKNetworkGraph network_graph_conv; - network_graph_conv.inner = untag_ptr(network_graph); - network_graph_conv.is_owned = ptr_is_owned(network_graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - network_graph_conv.is_owned = false; - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - uint8_t random_seed_bytes_arr[32]; - CHECK((*env)->GetArrayLength(env, random_seed_bytes) == 32); - (*env)->GetByteArrayRegion(env, random_seed_bytes, 0, 32, random_seed_bytes_arr); - uint8_t (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr; - LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); - *ret_conv = build_route_from_hops(our_node_pubkey_ref, hops_constr, &route_params_conv, &network_graph_conv, logger_conv, random_seed_bytes_ref); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentForwardNode_1set_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKPaymentForwardNode this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + PaymentForwardNode_set_node_id(&this_ptr_conv, val_ref); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoreLookUp_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKScoreLookUp this_ptr_conv = *(LDKScoreLookUp*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - ScoreLookUp_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentForwardNode_1get_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPaymentForwardNode this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = PaymentForwardNode_get_htlc_maximum_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoreUpdate_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKScoreUpdate this_ptr_conv = *(LDKScoreUpdate*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - ScoreUpdate_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentForwardNode_1set_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKPaymentForwardNode this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + PaymentForwardNode_set_htlc_maximum_msat(&this_ptr_conv, val); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKScore this_ptr_conv = *(LDKScore*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Score_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentForwardNode_1new(JNIEnv *env, jclass clz, int64_t tlvs_arg, int8_tArray node_id_arg, int64_t htlc_maximum_msat_arg) { + LDKForwardTlvs tlvs_arg_conv; + tlvs_arg_conv.inner = untag_ptr(tlvs_arg); + tlvs_arg_conv.is_owned = ptr_is_owned(tlvs_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(tlvs_arg_conv); + tlvs_arg_conv = ForwardTlvs_clone(&tlvs_arg_conv); + LDKPublicKey node_id_arg_ref; + CHECK((*env)->GetArrayLength(env, node_id_arg) == 33); + (*env)->GetByteArrayRegion(env, node_id_arg, 0, 33, node_id_arg_ref.compressed_form); + LDKPaymentForwardNode ret_var = PaymentForwardNode_new(tlvs_arg_conv, node_id_arg_ref, htlc_maximum_msat_arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockableScore_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKLockableScore this_ptr_conv = *(LDKLockableScore*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - LockableScore_free(this_ptr_conv); +static inline uint64_t PaymentForwardNode_clone_ptr(LDKPaymentForwardNode *NONNULL_PTR arg) { + LDKPaymentForwardNode ret_var = PaymentForwardNode_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentForwardNode_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPaymentForwardNode arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = PaymentForwardNode_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WriteableScore_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKWriteableScore this_ptr_conv = *(LDKWriteableScore*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - WriteableScore_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentForwardNode_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPaymentForwardNode orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKPaymentForwardNode ret_var = PaymentForwardNode_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKMultiThreadedLockableScore this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKForwardTlvs this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - MultiThreadedLockableScore_free(this_obj_conv); + ForwardTlvs_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1as_1LockableScore(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKMultiThreadedLockableScore this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKLockableScore* ret_ret = MALLOC(sizeof(LDKLockableScore), "LDKLockableScore"); - *ret_ret = MultiThreadedLockableScore_as_LockableScore(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ForwardTlvs_get_short_channel_id(&this_ptr_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKMultiThreadedLockableScore obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = MultiThreadedLockableScore_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ForwardTlvs_set_short_channel_id(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1as_1WriteableScore(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKMultiThreadedLockableScore this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKWriteableScore* ret_ret = MALLOC(sizeof(LDKWriteableScore), "LDKWriteableScore"); - *ret_ret = MultiThreadedLockableScore_as_WriteableScore(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1get_1payment_1relay(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPaymentRelay ret_var = ForwardTlvs_get_payment_relay(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1new(JNIEnv *env, jclass clz, int64_t score) { - void* score_ptr = untag_ptr(score); - CHECK_ACCESS(score_ptr); - LDKScore score_conv = *(LDKScore*)(score_ptr); - if (score_conv.free == LDKScore_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKScore_JCalls_cloned(&score_conv); - } - LDKMultiThreadedLockableScore ret_var = MultiThreadedLockableScore_new(score_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1set_1payment_1relay(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPaymentRelay val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = PaymentRelay_clone(&val_conv); + ForwardTlvs_set_payment_relay(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1get_1payment_1constraints(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPaymentConstraints ret_var = ForwardTlvs_get_payment_constraints(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLockRead_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKMultiThreadedScoreLockRead this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - MultiThreadedScoreLockRead_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1set_1payment_1constraints(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPaymentConstraints val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = PaymentConstraints_clone(&val_conv); + ForwardTlvs_set_payment_constraints(&this_ptr_conv, val_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLockWrite_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKMultiThreadedScoreLockWrite this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - MultiThreadedScoreLockWrite_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBlindedHopFeatures ret_var = ForwardTlvs_get_features(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLockRead_1as_1ScoreLookUp(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKMultiThreadedScoreLockRead this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKScoreLookUp* ret_ret = MALLOC(sizeof(LDKScoreLookUp), "LDKScoreLookUp"); - *ret_ret = MultiThreadedScoreLockRead_as_ScoreLookUp(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBlindedHopFeatures val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = BlindedHopFeatures_clone(&val_conv); + ForwardTlvs_set_features(&this_ptr_conv, val_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLockWrite_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKMultiThreadedScoreLockWrite obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = MultiThreadedScoreLockWrite_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1get_1next_1blinding_1override(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ForwardTlvs_get_next_blinding_override(&this_ptr_conv).compressed_form); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLockWrite_1as_1ScoreUpdate(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKMultiThreadedScoreLockWrite this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKScoreUpdate* ret_ret = MALLOC(sizeof(LDKScoreUpdate), "LDKScoreUpdate"); - *ret_ret = MultiThreadedScoreLockWrite_as_ScoreUpdate(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1set_1next_1blinding_1override(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKForwardTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + ForwardTlvs_set_next_blinding_override(&this_ptr_conv, val_ref); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelUsage this_obj_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1new(JNIEnv *env, jclass clz, int64_t short_channel_id_arg, int64_t payment_relay_arg, int64_t payment_constraints_arg, int64_t features_arg, int8_tArray next_blinding_override_arg) { + LDKPaymentRelay payment_relay_arg_conv; + payment_relay_arg_conv.inner = untag_ptr(payment_relay_arg); + payment_relay_arg_conv.is_owned = ptr_is_owned(payment_relay_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_relay_arg_conv); + payment_relay_arg_conv = PaymentRelay_clone(&payment_relay_arg_conv); + LDKPaymentConstraints payment_constraints_arg_conv; + payment_constraints_arg_conv.inner = untag_ptr(payment_constraints_arg); + payment_constraints_arg_conv.is_owned = ptr_is_owned(payment_constraints_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_constraints_arg_conv); + payment_constraints_arg_conv = PaymentConstraints_clone(&payment_constraints_arg_conv); + LDKBlindedHopFeatures features_arg_conv; + features_arg_conv.inner = untag_ptr(features_arg); + features_arg_conv.is_owned = ptr_is_owned(features_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); + features_arg_conv = BlindedHopFeatures_clone(&features_arg_conv); + LDKPublicKey next_blinding_override_arg_ref; + CHECK((*env)->GetArrayLength(env, next_blinding_override_arg) == 33); + (*env)->GetByteArrayRegion(env, next_blinding_override_arg, 0, 33, next_blinding_override_arg_ref.compressed_form); + LDKForwardTlvs ret_var = ForwardTlvs_new(short_channel_id_arg, payment_relay_arg_conv, payment_constraints_arg_conv, features_arg_conv, next_blinding_override_arg_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t ForwardTlvs_clone_ptr(LDKForwardTlvs *NONNULL_PTR arg) { + LDKForwardTlvs ret_var = ForwardTlvs_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKForwardTlvs arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = ForwardTlvs_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKForwardTlvs orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKForwardTlvs ret_var = ForwardTlvs_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKReceiveTlvs this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelUsage_free(this_obj_conv); + ReceiveTlvs_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelUsage this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1get_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKReceiveTlvs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelUsage_get_amount_msat(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ReceiveTlvs_get_payment_secret(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelUsage this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1set_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKReceiveTlvs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelUsage_set_amount_msat(&this_ptr_conv, val); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + ReceiveTlvs_set_payment_secret(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1inflight_1htlc_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelUsage this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1get_1payment_1constraints(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKReceiveTlvs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelUsage_get_inflight_htlc_msat(&this_ptr_conv); - return ret_conv; + LDKPaymentConstraints ret_var = ReceiveTlvs_get_payment_constraints(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1inflight_1htlc_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelUsage this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1set_1payment_1constraints(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKReceiveTlvs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelUsage_set_inflight_htlc_msat(&this_ptr_conv, val); + LDKPaymentConstraints val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = PaymentConstraints_clone(&val_conv); + ReceiveTlvs_set_payment_constraints(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1effective_1capacity(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelUsage this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1get_1payment_1context(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKReceiveTlvs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = ChannelUsage_get_effective_capacity(&this_ptr_conv); + LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); + *ret_copy = ReceiveTlvs_get_payment_context(&this_ptr_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1effective_1capacity(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelUsage this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1set_1payment_1context(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKReceiveTlvs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; void* val_ptr = untag_ptr(val); CHECK_ACCESS(val_ptr); - LDKEffectiveCapacity val_conv = *(LDKEffectiveCapacity*)(val_ptr); - val_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(val)); - ChannelUsage_set_effective_capacity(&this_ptr_conv, val_conv); + LDKPaymentContext val_conv = *(LDKPaymentContext*)(val_ptr); + val_conv = PaymentContext_clone((LDKPaymentContext*)untag_ptr(val)); + ReceiveTlvs_set_payment_context(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1new(JNIEnv *env, jclass clz, int64_t amount_msat_arg, int64_t inflight_htlc_msat_arg, int64_t effective_capacity_arg) { - void* effective_capacity_arg_ptr = untag_ptr(effective_capacity_arg); - CHECK_ACCESS(effective_capacity_arg_ptr); - LDKEffectiveCapacity effective_capacity_arg_conv = *(LDKEffectiveCapacity*)(effective_capacity_arg_ptr); - effective_capacity_arg_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(effective_capacity_arg)); - LDKChannelUsage ret_var = ChannelUsage_new(amount_msat_arg, inflight_htlc_msat_arg, effective_capacity_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1new(JNIEnv *env, jclass clz, int8_tArray payment_secret_arg, int64_t payment_constraints_arg, int64_t payment_context_arg) { + LDKThirtyTwoBytes payment_secret_arg_ref; + CHECK((*env)->GetArrayLength(env, payment_secret_arg) == 32); + (*env)->GetByteArrayRegion(env, payment_secret_arg, 0, 32, payment_secret_arg_ref.data); + LDKPaymentConstraints payment_constraints_arg_conv; + payment_constraints_arg_conv.inner = untag_ptr(payment_constraints_arg); + payment_constraints_arg_conv.is_owned = ptr_is_owned(payment_constraints_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_constraints_arg_conv); + payment_constraints_arg_conv = PaymentConstraints_clone(&payment_constraints_arg_conv); + void* payment_context_arg_ptr = untag_ptr(payment_context_arg); + CHECK_ACCESS(payment_context_arg_ptr); + LDKPaymentContext payment_context_arg_conv = *(LDKPaymentContext*)(payment_context_arg_ptr); + payment_context_arg_conv = PaymentContext_clone((LDKPaymentContext*)untag_ptr(payment_context_arg)); + LDKReceiveTlvs ret_var = ReceiveTlvs_new(payment_secret_arg_ref, payment_constraints_arg_conv, payment_context_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t ChannelUsage_clone_ptr(LDKChannelUsage *NONNULL_PTR arg) { - LDKChannelUsage ret_var = ChannelUsage_clone(arg); +static inline uint64_t ReceiveTlvs_clone_ptr(LDKReceiveTlvs *NONNULL_PTR arg) { + LDKReceiveTlvs ret_var = ReceiveTlvs_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelUsage arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKReceiveTlvs arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = ChannelUsage_clone_ptr(&arg_conv); + int64_t ret_conv = ReceiveTlvs_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelUsage orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKReceiveTlvs orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKChannelUsage ret_var = ChannelUsage_clone(&orig_conv); + LDKReceiveTlvs ret_var = ReceiveTlvs_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKFixedPenaltyScorer this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPaymentRelay this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - FixedPenaltyScorer_free(this_obj_conv); + PaymentRelay_free(this_obj_conv); } -static inline uint64_t FixedPenaltyScorer_clone_ptr(LDKFixedPenaltyScorer *NONNULL_PTR arg) { - LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKFixedPenaltyScorer arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = FixedPenaltyScorer_clone_ptr(&arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKFixedPenaltyScorer orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1with_1penalty(JNIEnv *env, jclass clz, int64_t penalty_msat) { - LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_with_penalty(penalty_msat); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1as_1ScoreLookUp(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKFixedPenaltyScorer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKScoreLookUp* ret_ret = MALLOC(sizeof(LDKScoreLookUp), "LDKScoreLookUp"); - *ret_ret = FixedPenaltyScorer_as_ScoreLookUp(&this_arg_conv); - return tag_ptr(ret_ret, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1as_1ScoreUpdate(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKFixedPenaltyScorer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKScoreUpdate* ret_ret = MALLOC(sizeof(LDKScoreUpdate), "LDKScoreUpdate"); - *ret_ret = FixedPenaltyScorer_as_ScoreUpdate(&this_arg_conv); - return tag_ptr(ret_ret, true); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKFixedPenaltyScorer obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = FixedPenaltyScorer_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); - *ret_conv = FixedPenaltyScorer_read(ser_ref, arg); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKProbabilisticScorer this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ProbabilisticScorer_free(this_obj_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKProbabilisticScoringFeeParameters this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ProbabilisticScoringFeeParameters_free(this_obj_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1base_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPaymentRelay this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = ProbabilisticScoringFeeParameters_get_base_penalty_msat(&this_ptr_conv); + int16_t ret_conv = PaymentRelay_get_cltv_expiry_delta(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1base_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKPaymentRelay this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_base_penalty_msat(&this_ptr_conv, val); + PaymentRelay_set_cltv_expiry_delta(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1base_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1get_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPaymentRelay this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = ProbabilisticScoringFeeParameters_get_base_penalty_amount_multiplier_msat(&this_ptr_conv); + int32_t ret_conv = PaymentRelay_get_fee_proportional_millionths(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1base_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1set_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKPaymentRelay this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_base_penalty_amount_multiplier_msat(&this_ptr_conv, val); + PaymentRelay_set_fee_proportional_millionths(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1liquidity_1penalty_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1get_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPaymentRelay this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = ProbabilisticScoringFeeParameters_get_liquidity_penalty_multiplier_msat(&this_ptr_conv); + int32_t ret_conv = PaymentRelay_get_fee_base_msat(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1liquidity_1penalty_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1set_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKPaymentRelay this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_liquidity_penalty_multiplier_msat(&this_ptr_conv, val); + PaymentRelay_set_fee_base_msat(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1liquidity_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = ProbabilisticScoringFeeParameters_get_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1new(JNIEnv *env, jclass clz, int16_t cltv_expiry_delta_arg, int32_t fee_proportional_millionths_arg, int32_t fee_base_msat_arg) { + LDKPaymentRelay ret_var = PaymentRelay_new(cltv_expiry_delta_arg, fee_proportional_millionths_arg, fee_base_msat_arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1liquidity_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val); +static inline uint64_t PaymentRelay_clone_ptr(LDKPaymentRelay *NONNULL_PTR arg) { + LDKPaymentRelay ret_var = PaymentRelay_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1historical_1liquidity_1penalty_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_multiplier_msat(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPaymentRelay arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = PaymentRelay_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1historical_1liquidity_1penalty_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_multiplier_msat(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1historical_1liquidity_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPaymentRelay orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKPaymentRelay ret_var = PaymentRelay_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1historical_1liquidity_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPaymentConstraints this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + PaymentConstraints_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1anti_1probing_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1get_1max_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPaymentConstraints this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = ProbabilisticScoringFeeParameters_get_anti_probing_penalty_msat(&this_ptr_conv); + int32_t ret_conv = PaymentConstraints_get_max_cltv_expiry(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1anti_1probing_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1set_1max_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKPaymentConstraints this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_anti_probing_penalty_msat(&this_ptr_conv, val); + PaymentConstraints_set_max_cltv_expiry(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1considered_1impossible_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPaymentConstraints this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = ProbabilisticScoringFeeParameters_get_considered_impossible_penalty_msat(&this_ptr_conv); + int64_t ret_conv = PaymentConstraints_get_htlc_minimum_msat(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1considered_1impossible_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_considered_impossible_penalty_msat(&this_ptr_conv, val); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1linear_1success_1probability(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKPaymentConstraints this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - jboolean ret_conv = ProbabilisticScoringFeeParameters_get_linear_success_probability(&this_ptr_conv); - return ret_conv; + PaymentConstraints_set_htlc_minimum_msat(&this_ptr_conv, val); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1linear_1success_1probability(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKProbabilisticScoringFeeParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_linear_success_probability(&this_ptr_conv, val); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1new(JNIEnv *env, jclass clz, int32_t max_cltv_expiry_arg, int64_t htlc_minimum_msat_arg) { + LDKPaymentConstraints ret_var = PaymentConstraints_new(max_cltv_expiry_arg, htlc_minimum_msat_arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -static inline uint64_t ProbabilisticScoringFeeParameters_clone_ptr(LDKProbabilisticScoringFeeParameters *NONNULL_PTR arg) { - LDKProbabilisticScoringFeeParameters ret_var = ProbabilisticScoringFeeParameters_clone(arg); +static inline uint64_t PaymentConstraints_clone_ptr(LDKPaymentConstraints *NONNULL_PTR arg) { + LDKPaymentConstraints ret_var = PaymentConstraints_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKProbabilisticScoringFeeParameters arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPaymentConstraints arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = ProbabilisticScoringFeeParameters_clone_ptr(&arg_conv); + int64_t ret_conv = PaymentConstraints_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKProbabilisticScoringFeeParameters orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPaymentConstraints orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKProbabilisticScoringFeeParameters ret_var = ProbabilisticScoringFeeParameters_clone(&orig_conv); + LDKPaymentConstraints ret_var = PaymentConstraints_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1default(JNIEnv *env, jclass clz) { - LDKProbabilisticScoringFeeParameters ret_var = ProbabilisticScoringFeeParameters_default(); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentContext_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKPaymentContext this_ptr_conv = *(LDKPaymentContext*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + PaymentContext_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1add_1banned(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_id) { - LDKProbabilisticScoringFeeParameters this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId node_id_conv; - node_id_conv.inner = untag_ptr(node_id); - node_id_conv.is_owned = ptr_is_owned(node_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); - node_id_conv.is_owned = false; - ProbabilisticScoringFeeParameters_add_banned(&this_arg_conv, &node_id_conv); +static inline uint64_t PaymentContext_clone_ptr(LDKPaymentContext *NONNULL_PTR arg) { + LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); + *ret_copy = PaymentContext_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentContext_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPaymentContext* arg_conv = (LDKPaymentContext*)untag_ptr(arg); + int64_t ret_conv = PaymentContext_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1add_1banned_1from_1list(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray node_ids) { - LDKProbabilisticScoringFeeParameters this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_NodeIdZ node_ids_constr; - node_ids_constr.datalen = (*env)->GetArrayLength(env, node_ids); - if (node_ids_constr.datalen > 0) - node_ids_constr.data = MALLOC(node_ids_constr.datalen * sizeof(LDKNodeId), "LDKCVec_NodeIdZ Elements"); - else - node_ids_constr.data = NULL; - int64_t* node_ids_vals = (*env)->GetLongArrayElements (env, node_ids, NULL); - for (size_t i = 0; i < node_ids_constr.datalen; i++) { - int64_t node_ids_conv_8 = node_ids_vals[i]; - LDKNodeId node_ids_conv_8_conv; - node_ids_conv_8_conv.inner = untag_ptr(node_ids_conv_8); - node_ids_conv_8_conv.is_owned = ptr_is_owned(node_ids_conv_8); - CHECK_INNER_FIELD_ACCESS_OR_NULL(node_ids_conv_8_conv); - node_ids_conv_8_conv = NodeId_clone(&node_ids_conv_8_conv); - node_ids_constr.data[i] = node_ids_conv_8_conv; - } - (*env)->ReleaseLongArrayElements(env, node_ids, node_ids_vals, 0); - ProbabilisticScoringFeeParameters_add_banned_from_list(&this_arg_conv, node_ids_constr); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentContext_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPaymentContext* orig_conv = (LDKPaymentContext*)untag_ptr(orig); + LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); + *ret_copy = PaymentContext_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1remove_1banned(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_id) { - LDKProbabilisticScoringFeeParameters this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId node_id_conv; - node_id_conv.inner = untag_ptr(node_id); - node_id_conv.is_owned = ptr_is_owned(node_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); - node_id_conv.is_owned = false; - ProbabilisticScoringFeeParameters_remove_banned(&this_arg_conv, &node_id_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentContext_1unknown(JNIEnv *env, jclass clz, int64_t a) { + LDKUnknownPaymentContext a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = UnknownPaymentContext_clone(&a_conv); + LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); + *ret_copy = PaymentContext_unknown(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1manual_1penalty(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_id, int64_t penalty) { - LDKProbabilisticScoringFeeParameters this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId node_id_conv; - node_id_conv.inner = untag_ptr(node_id); - node_id_conv.is_owned = ptr_is_owned(node_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); - node_id_conv.is_owned = false; - ProbabilisticScoringFeeParameters_set_manual_penalty(&this_arg_conv, &node_id_conv, penalty); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentContext_1bolt12_1offer(JNIEnv *env, jclass clz, int64_t a) { + LDKBolt12OfferContext a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = Bolt12OfferContext_clone(&a_conv); + LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); + *ret_copy = PaymentContext_bolt12_offer(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1remove_1manual_1penalty(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_id) { - LDKProbabilisticScoringFeeParameters this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId node_id_conv; - node_id_conv.inner = untag_ptr(node_id); - node_id_conv.is_owned = ptr_is_owned(node_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); - node_id_conv.is_owned = false; - ProbabilisticScoringFeeParameters_remove_manual_penalty(&this_arg_conv, &node_id_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentContext_1bolt12_1refund(JNIEnv *env, jclass clz, int64_t a) { + LDKBolt12RefundContext a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = Bolt12RefundContext_clone(&a_conv); + LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); + *ret_copy = PaymentContext_bolt12_refund(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1clear_1manual_1penalties(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKProbabilisticScoringFeeParameters this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - ProbabilisticScoringFeeParameters_clear_manual_penalties(&this_arg_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentContext_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKPaymentContext* a_conv = (LDKPaymentContext*)untag_ptr(a); + LDKPaymentContext* b_conv = (LDKPaymentContext*)untag_ptr(b); + jboolean ret_conv = PaymentContext_eq(a_conv, b_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKProbabilisticScoringDecayParameters this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUnknownPaymentContext this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ProbabilisticScoringDecayParameters_free(this_obj_conv); + UnknownPaymentContext_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1get_1historical_1no_1updates_1half_1life(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKProbabilisticScoringDecayParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = ProbabilisticScoringDecayParameters_get_historical_no_updates_half_life(&this_ptr_conv); +static inline uint64_t UnknownPaymentContext_clone_ptr(LDKUnknownPaymentContext *NONNULL_PTR arg) { + LDKUnknownPaymentContext ret_var = UnknownPaymentContext_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUnknownPaymentContext arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = UnknownPaymentContext_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1set_1historical_1no_1updates_1half_1life(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringDecayParameters this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKUnknownPaymentContext orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKUnknownPaymentContext ret_var = UnknownPaymentContext_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKUnknownPaymentContext a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKUnknownPaymentContext b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = UnknownPaymentContext_eq(&a_conv, &b_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBolt12OfferContext this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Bolt12OfferContext_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1get_1offer_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBolt12OfferContext this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ProbabilisticScoringDecayParameters_set_historical_no_updates_half_life(&this_ptr_conv, val); + LDKOfferId ret_var = Bolt12OfferContext_get_offer_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1get_1liquidity_1offset_1half_1life(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKProbabilisticScoringDecayParameters this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1set_1offer_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKBolt12OfferContext this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = ProbabilisticScoringDecayParameters_get_liquidity_offset_half_life(&this_ptr_conv); - return ret_conv; + LDKOfferId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = OfferId_clone(&val_conv); + Bolt12OfferContext_set_offer_id(&this_ptr_conv, val_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1set_1liquidity_1offset_1half_1life(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKProbabilisticScoringDecayParameters this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1get_1invoice_1request(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBolt12OfferContext this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ProbabilisticScoringDecayParameters_set_liquidity_offset_half_life(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1new(JNIEnv *env, jclass clz, int64_t historical_no_updates_half_life_arg, int64_t liquidity_offset_half_life_arg) { - LDKProbabilisticScoringDecayParameters ret_var = ProbabilisticScoringDecayParameters_new(historical_no_updates_half_life_arg, liquidity_offset_half_life_arg); + LDKInvoiceRequestFields ret_var = Bolt12OfferContext_get_invoice_request(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t ProbabilisticScoringDecayParameters_clone_ptr(LDKProbabilisticScoringDecayParameters *NONNULL_PTR arg) { - LDKProbabilisticScoringDecayParameters ret_var = ProbabilisticScoringDecayParameters_clone(arg); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1set_1invoice_1request(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKBolt12OfferContext this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKInvoiceRequestFields val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = InvoiceRequestFields_clone(&val_conv); + Bolt12OfferContext_set_invoice_request(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1new(JNIEnv *env, jclass clz, int64_t offer_id_arg, int64_t invoice_request_arg) { + LDKOfferId offer_id_arg_conv; + offer_id_arg_conv.inner = untag_ptr(offer_id_arg); + offer_id_arg_conv.is_owned = ptr_is_owned(offer_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(offer_id_arg_conv); + offer_id_arg_conv = OfferId_clone(&offer_id_arg_conv); + LDKInvoiceRequestFields invoice_request_arg_conv; + invoice_request_arg_conv.inner = untag_ptr(invoice_request_arg); + invoice_request_arg_conv.is_owned = ptr_is_owned(invoice_request_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_request_arg_conv); + invoice_request_arg_conv = InvoiceRequestFields_clone(&invoice_request_arg_conv); + LDKBolt12OfferContext ret_var = Bolt12OfferContext_new(offer_id_arg_conv, invoice_request_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKProbabilisticScoringDecayParameters arg_conv; + +static inline uint64_t Bolt12OfferContext_clone_ptr(LDKBolt12OfferContext *NONNULL_PTR arg) { + LDKBolt12OfferContext ret_var = Bolt12OfferContext_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBolt12OfferContext arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = ProbabilisticScoringDecayParameters_clone_ptr(&arg_conv); + int64_t ret_conv = Bolt12OfferContext_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKProbabilisticScoringDecayParameters orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBolt12OfferContext orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKProbabilisticScoringDecayParameters ret_var = ProbabilisticScoringDecayParameters_clone(&orig_conv); + LDKBolt12OfferContext ret_var = Bolt12OfferContext_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1default(JNIEnv *env, jclass clz) { - LDKProbabilisticScoringDecayParameters ret_var = ProbabilisticScoringDecayParameters_default(); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKBolt12OfferContext a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKBolt12OfferContext b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = Bolt12OfferContext_eq(&a_conv, &b_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBolt12RefundContext this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Bolt12RefundContext_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1new(JNIEnv *env, jclass clz) { + LDKBolt12RefundContext ret_var = Bolt12RefundContext_new(); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1new(JNIEnv *env, jclass clz, int64_t decay_params, int64_t network_graph, int64_t logger) { - LDKProbabilisticScoringDecayParameters decay_params_conv; - decay_params_conv.inner = untag_ptr(decay_params); - decay_params_conv.is_owned = ptr_is_owned(decay_params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(decay_params_conv); - decay_params_conv = ProbabilisticScoringDecayParameters_clone(&decay_params_conv); - LDKNetworkGraph network_graph_conv; - network_graph_conv.inner = untag_ptr(network_graph); - network_graph_conv.is_owned = ptr_is_owned(network_graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - network_graph_conv.is_owned = false; - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKProbabilisticScorer ret_var = ProbabilisticScorer_new(decay_params_conv, &network_graph_conv, logger_conv); +static inline uint64_t Bolt12RefundContext_clone_ptr(LDKBolt12RefundContext *NONNULL_PTR arg) { + LDKBolt12RefundContext ret_var = Bolt12RefundContext_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1debug_1log_1liquidity_1stats(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKProbabilisticScorer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - ProbabilisticScorer_debug_log_liquidity_stats(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBolt12RefundContext arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = Bolt12RefundContext_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1estimated_1channel_1liquidity_1range(JNIEnv *env, jclass clz, int64_t this_arg, int64_t scid, int64_t target) { - LDKProbabilisticScorer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId target_conv; - target_conv.inner = untag_ptr(target); - target_conv.is_owned = ptr_is_owned(target); - CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); - target_conv.is_owned = false; - LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ"); - *ret_copy = ProbabilisticScorer_estimated_channel_liquidity_range(&this_arg_conv, scid, &target_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBolt12RefundContext orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKBolt12RefundContext ret_var = Bolt12RefundContext_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1historical_1estimated_1channel_1liquidity_1probabilities(JNIEnv *env, jclass clz, int64_t this_arg, int64_t scid, int64_t target) { - LDKProbabilisticScorer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId target_conv; - target_conv.inner = untag_ptr(target); - target_conv.is_owned = ptr_is_owned(target); - CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); - target_conv.is_owned = false; - LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ), "LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ"); - *ret_copy = ProbabilisticScorer_historical_estimated_channel_liquidity_probabilities(&this_arg_conv, scid, &target_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKBolt12RefundContext a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKBolt12RefundContext b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = Bolt12RefundContext_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1historical_1estimated_1payment_1success_1probability(JNIEnv *env, jclass clz, int64_t this_arg, int64_t scid, int64_t target, int64_t amount_msat, int64_t params) { - LDKProbabilisticScorer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId target_conv; - target_conv.inner = untag_ptr(target); - target_conv.is_owned = ptr_is_owned(target); - CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); - target_conv.is_owned = false; - LDKProbabilisticScoringFeeParameters params_conv; - params_conv.inner = untag_ptr(params); - params_conv.is_owned = ptr_is_owned(params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); - params_conv.is_owned = false; - LDKCOption_f64Z *ret_copy = MALLOC(sizeof(LDKCOption_f64Z), "LDKCOption_f64Z"); - *ret_copy = ProbabilisticScorer_historical_estimated_payment_success_probability(&this_arg_conv, scid, &target_conv, amount_msat, ¶ms_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKForwardTlvs obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ForwardTlvs_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1as_1ScoreLookUp(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKProbabilisticScorer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKScoreLookUp* ret_ret = MALLOC(sizeof(LDKScoreLookUp), "LDKScoreLookUp"); - *ret_ret = ProbabilisticScorer_as_ScoreLookUp(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKReceiveTlvs obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ReceiveTlvs_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1as_1ScoreUpdate(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKProbabilisticScorer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKScoreUpdate* ret_ret = MALLOC(sizeof(LDKScoreUpdate), "LDKScoreUpdate"); - *ret_ret = ProbabilisticScorer_as_ScoreUpdate(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKPaymentRelay obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = PaymentRelay_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1as_1Score(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKProbabilisticScorer this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore"); - *ret_ret = ProbabilisticScorer_as_Score(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_PaymentRelayDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentRelayDecodeErrorZ), "LDKCResult_PaymentRelayDecodeErrorZ"); + *ret_conv = PaymentRelay_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKProbabilisticScorer obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKPaymentConstraints obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ProbabilisticScorer_write(&obj_conv); + LDKCVec_u8Z ret_var = PaymentConstraints_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg_a, int64_t arg_b, int64_t arg_c) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1read(JNIEnv *env, jclass clz, int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKProbabilisticScoringDecayParameters arg_a_conv; - arg_a_conv.inner = untag_ptr(arg_a); - arg_a_conv.is_owned = ptr_is_owned(arg_a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_a_conv); - arg_a_conv = ProbabilisticScoringDecayParameters_clone(&arg_a_conv); - LDKNetworkGraph arg_b_conv; - arg_b_conv.inner = untag_ptr(arg_b); - arg_b_conv.is_owned = ptr_is_owned(arg_b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_b_conv); - arg_b_conv.is_owned = false; - void* arg_c_ptr = untag_ptr(arg_c); - CHECK_ACCESS(arg_c_ptr); - LDKLogger arg_c_conv = *(LDKLogger*)(arg_c_ptr); - if (arg_c_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&arg_c_conv); - } - LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ"); - *ret_conv = ProbabilisticScorer_read(ser_ref, arg_a_conv, &arg_b_conv, arg_c_conv); + LDKCResult_PaymentConstraintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentConstraintsDecodeErrorZ), "LDKCResult_PaymentConstraintsDecodeErrorZ"); + *ret_conv = PaymentConstraints_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKDelayedPaymentOutputDescriptor this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - DelayedPaymentOutputDescriptor_free(this_obj_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentContext_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKPaymentContext* obj_conv = (LDKPaymentContext*)untag_ptr(obj); + LDKCVec_u8Z ret_var = PaymentContext_write(obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKOutPoint ret_var = DelayedPaymentOutputDescriptor_get_outpoint(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentContext_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_PaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentContextDecodeErrorZ), "LDKCResult_PaymentContextDecodeErrorZ"); + *ret_conv = PaymentContext_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKOutPoint val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = OutPoint_clone(&val_conv); - DelayedPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKUnknownPaymentContext obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = UnknownPaymentContext_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DelayedPaymentOutputDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); + *ret_conv = UnknownPaymentContext_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - DelayedPaymentOutputDescriptor_set_per_commitment_point(&this_ptr_conv, val_ref); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKBolt12OfferContext obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = Bolt12OfferContext_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int16_t ret_conv = DelayedPaymentOutputDescriptor_get_to_self_delay(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_Bolt12OfferContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12OfferContextDecodeErrorZ), "LDKCResult_Bolt12OfferContextDecodeErrorZ"); + *ret_conv = Bolt12OfferContext_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - DelayedPaymentOutputDescriptor_set_to_self_delay(&this_ptr_conv, val); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKBolt12RefundContext obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = Bolt12RefundContext_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1output(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); - *ret_ref = DelayedPaymentOutputDescriptor_get_output(&this_ptr_conv); - return tag_ptr(ret_ref, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_Bolt12RefundContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12RefundContextDecodeErrorZ), "LDKCResult_Bolt12RefundContextDecodeErrorZ"); + *ret_conv = Bolt12RefundContext_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1output(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); - val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val)); - DelayedPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBlindedMessagePath this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + BlindedMessagePath_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1revocation_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKRevocationKey ret_var = DelayedPaymentOutputDescriptor_get_revocation_pubkey(&this_ptr_conv); +static inline uint64_t BlindedMessagePath_clone_ptr(LDKBlindedMessagePath *NONNULL_PTR arg) { + LDKBlindedMessagePath ret_var = BlindedMessagePath_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1revocation_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKRevocationKey val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = RevocationKey_clone(&val_conv); - DelayedPaymentOutputDescriptor_set_revocation_pubkey(&this_ptr_conv, val_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBlindedMessagePath arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = BlindedMessagePath_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *DelayedPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv)); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBlindedMessagePath orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKBlindedMessagePath ret_var = BlindedMessagePath_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - DelayedPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKBlindedMessagePath o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = BlindedMessagePath_hash(&o_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = DelayedPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKBlindedMessagePath a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKBlindedMessagePath b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = BlindedMessagePath_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - DelayedPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKBlindedMessagePath obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = BlindedMessagePath_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1transaction_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelTransactionParameters ret_var = DelayedPaymentOutputDescriptor_get_channel_transaction_parameters(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_BlindedMessagePathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathDecodeErrorZ), "LDKCResult_BlindedMessagePathDecodeErrorZ"); + *ret_conv = BlindedMessagePath_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1transaction_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelTransactionParameters val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelTransactionParameters_clone(&val_conv); - DelayedPaymentOutputDescriptor_set_channel_transaction_parameters(&this_ptr_conv, val_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1one_1hop(JNIEnv *env, jclass clz, int8_tArray recipient_node_id, int64_t context, int64_t entropy_source) { + LDKPublicKey recipient_node_id_ref; + CHECK((*env)->GetArrayLength(env, recipient_node_id) == 33); + (*env)->GetByteArrayRegion(env, recipient_node_id, 0, 33, recipient_node_id_ref.compressed_form); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKMessageContext context_conv = *(LDKMessageContext*)(context_ptr); + context_conv = MessageContext_clone((LDKMessageContext*)untag_ptr(context)); + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + LDKCResult_BlindedMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathNoneZ), "LDKCResult_BlindedMessagePathNoneZ"); + *ret_conv = BlindedMessagePath_one_hop(recipient_node_id_ref, context_conv, entropy_source_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1new(JNIEnv *env, jclass clz, int64_t outpoint_arg, int8_tArray per_commitment_point_arg, int16_t to_self_delay_arg, int64_t output_arg, int64_t revocation_pubkey_arg, int8_tArray channel_keys_id_arg, int64_t channel_value_satoshis_arg, int64_t channel_transaction_parameters_arg) { - LDKOutPoint outpoint_arg_conv; - outpoint_arg_conv.inner = untag_ptr(outpoint_arg); - outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); - outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); - LDKPublicKey per_commitment_point_arg_ref; - CHECK((*env)->GetArrayLength(env, per_commitment_point_arg) == 33); - (*env)->GetByteArrayRegion(env, per_commitment_point_arg, 0, 33, per_commitment_point_arg_ref.compressed_form); - void* output_arg_ptr = untag_ptr(output_arg); - CHECK_ACCESS(output_arg_ptr); - LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr); - output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg)); - LDKRevocationKey revocation_pubkey_arg_conv; - revocation_pubkey_arg_conv.inner = untag_ptr(revocation_pubkey_arg); - revocation_pubkey_arg_conv.is_owned = ptr_is_owned(revocation_pubkey_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(revocation_pubkey_arg_conv); - revocation_pubkey_arg_conv = RevocationKey_clone(&revocation_pubkey_arg_conv); - LDKThirtyTwoBytes channel_keys_id_arg_ref; - CHECK((*env)->GetArrayLength(env, channel_keys_id_arg) == 32); - (*env)->GetByteArrayRegion(env, channel_keys_id_arg, 0, 32, channel_keys_id_arg_ref.data); - LDKChannelTransactionParameters channel_transaction_parameters_arg_conv; - channel_transaction_parameters_arg_conv.inner = untag_ptr(channel_transaction_parameters_arg); - channel_transaction_parameters_arg_conv.is_owned = ptr_is_owned(channel_transaction_parameters_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_transaction_parameters_arg_conv); - channel_transaction_parameters_arg_conv = ChannelTransactionParameters_clone(&channel_transaction_parameters_arg_conv); - LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_new(outpoint_arg_conv, per_commitment_point_arg_ref, to_self_delay_arg, output_arg_conv, revocation_pubkey_arg_conv, channel_keys_id_arg_ref, channel_value_satoshis_arg, channel_transaction_parameters_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1new(JNIEnv *env, jclass clz, int64_tArray intermediate_nodes, int8_tArray recipient_node_id, int64_t context, int64_t entropy_source) { + LDKCVec_MessageForwardNodeZ intermediate_nodes_constr; + intermediate_nodes_constr.datalen = (*env)->GetArrayLength(env, intermediate_nodes); + if (intermediate_nodes_constr.datalen > 0) + intermediate_nodes_constr.data = MALLOC(intermediate_nodes_constr.datalen * sizeof(LDKMessageForwardNode), "LDKCVec_MessageForwardNodeZ Elements"); + else + intermediate_nodes_constr.data = NULL; + int64_t* intermediate_nodes_vals = (*env)->GetLongArrayElements (env, intermediate_nodes, NULL); + for (size_t u = 0; u < intermediate_nodes_constr.datalen; u++) { + int64_t intermediate_nodes_conv_20 = intermediate_nodes_vals[u]; + LDKMessageForwardNode intermediate_nodes_conv_20_conv; + intermediate_nodes_conv_20_conv.inner = untag_ptr(intermediate_nodes_conv_20); + intermediate_nodes_conv_20_conv.is_owned = ptr_is_owned(intermediate_nodes_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(intermediate_nodes_conv_20_conv); + intermediate_nodes_conv_20_conv = MessageForwardNode_clone(&intermediate_nodes_conv_20_conv); + intermediate_nodes_constr.data[u] = intermediate_nodes_conv_20_conv; + } + (*env)->ReleaseLongArrayElements(env, intermediate_nodes, intermediate_nodes_vals, 0); + LDKPublicKey recipient_node_id_ref; + CHECK((*env)->GetArrayLength(env, recipient_node_id) == 33); + (*env)->GetByteArrayRegion(env, recipient_node_id, 0, 33, recipient_node_id_ref.compressed_form); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKMessageContext context_conv = *(LDKMessageContext*)(context_ptr); + context_conv = MessageContext_clone((LDKMessageContext*)untag_ptr(context)); + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + LDKCResult_BlindedMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedMessagePathNoneZ), "LDKCResult_BlindedMessagePathNoneZ"); + *ret_conv = BlindedMessagePath_new(intermediate_nodes_constr, recipient_node_id_ref, context_conv, entropy_source_conv); + return tag_ptr(ret_conv, true); } -static inline uint64_t DelayedPaymentOutputDescriptor_clone_ptr(LDKDelayedPaymentOutputDescriptor *NONNULL_PTR arg) { - LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKDelayedPaymentOutputDescriptor arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = DelayedPaymentOutputDescriptor_clone_ptr(&arg_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1use_1compact_1introduction_1node(JNIEnv *env, jclass clz, int64_t this_arg, int64_t network_graph) { + LDKBlindedMessagePath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKReadOnlyNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; + BlindedMessagePath_use_compact_introduction_node(&this_arg_conv, &network_graph_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKDelayedPaymentOutputDescriptor orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(&orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1public_1introduction_1node_1id(JNIEnv *env, jclass clz, int64_t this_arg, int64_t network_graph) { + LDKBlindedMessagePath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKReadOnlyNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; + LDKNodeId ret_var = BlindedMessagePath_public_introduction_node_id(&this_arg_conv, &network_graph_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKDelayedPaymentOutputDescriptor o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = DelayedPaymentOutputDescriptor_hash(&o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1introduction_1node(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBlindedMessagePath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); + *ret_copy = BlindedMessagePath_introduction_node(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKDelayedPaymentOutputDescriptor a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKDelayedPaymentOutputDescriptor b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = DelayedPaymentOutputDescriptor_eq(&a_conv, &b_conv); - return ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1blinding_1point(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBlindedMessagePath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, BlindedMessagePath_blinding_point(&this_arg_conv).compressed_form); + return ret_arr; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKDelayedPaymentOutputDescriptor obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = DelayedPaymentOutputDescriptor_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1blinded_1hops(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBlindedMessagePath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_BlindedHopZ ret_var = BlindedMessagePath_blinded_hops(&this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t m = 0; m < ret_var.datalen; m++) { + LDKBlindedHop ret_conv_12_var = ret_var.data[m]; + int64_t ret_conv_12_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_var); + ret_conv_12_ref = tag_ptr(ret_conv_12_var.inner, ret_conv_12_var.is_owned); + ret_arr_ptr[m] = ret_conv_12_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); - *ret_conv = DelayedPaymentOutputDescriptor_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1advance_1path_1by_1one(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_signer, int64_t node_id_lookup) { + LDKBlindedMessagePath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + void* node_signer_ptr = untag_ptr(node_signer); + if (ptr_is_owned(node_signer)) { CHECK_ACCESS(node_signer_ptr); } + LDKNodeSigner* node_signer_conv = (LDKNodeSigner*)node_signer_ptr; + void* node_id_lookup_ptr = untag_ptr(node_id_lookup); + if (ptr_is_owned(node_id_lookup)) { CHECK_ACCESS(node_id_lookup_ptr); } + LDKNodeIdLookUp* node_id_lookup_conv = (LDKNodeIdLookUp*)node_id_lookup_ptr; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = BlindedMessagePath_advance_path_by_one(&this_arg_conv, node_signer_conv, node_id_lookup_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKStaticPaymentOutputDescriptor this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - StaticPaymentOutputDescriptor_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKNextMessageHop this_ptr_conv = *(LDKNextMessageHop*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + NextMessageHop_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKOutPoint ret_var = StaticPaymentOutputDescriptor_get_outpoint(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +static inline uint64_t NextMessageHop_clone_ptr(LDKNextMessageHop *NONNULL_PTR arg) { + LDKNextMessageHop *ret_copy = MALLOC(sizeof(LDKNextMessageHop), "LDKNextMessageHop"); + *ret_copy = NextMessageHop_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNextMessageHop* arg_conv = (LDKNextMessageHop*)untag_ptr(arg); + int64_t ret_conv = NextMessageHop_clone_ptr(arg_conv); + return ret_conv; +} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKOutPoint val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = OutPoint_clone(&val_conv); - StaticPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKNextMessageHop* orig_conv = (LDKNextMessageHop*)untag_ptr(orig); + LDKNextMessageHop *ret_copy = MALLOC(sizeof(LDKNextMessageHop), "LDKNextMessageHop"); + *ret_copy = NextMessageHop_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1output(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); - *ret_ref = StaticPaymentOutputDescriptor_get_output(&this_ptr_conv); - return tag_ptr(ret_ref, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1node_1id(JNIEnv *env, jclass clz, int8_tArray a) { + LDKPublicKey a_ref; + CHECK((*env)->GetArrayLength(env, a) == 33); + (*env)->GetByteArrayRegion(env, a, 0, 33, a_ref.compressed_form); + LDKNextMessageHop *ret_copy = MALLOC(sizeof(LDKNextMessageHop), "LDKNextMessageHop"); + *ret_copy = NextMessageHop_node_id(a_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1output(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); - val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val)); - StaticPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t a) { + LDKNextMessageHop *ret_copy = MALLOC(sizeof(LDKNextMessageHop), "LDKNextMessageHop"); + *ret_copy = NextMessageHop_short_channel_id(a); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *StaticPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv)); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKNextMessageHop* o_conv = (LDKNextMessageHop*)untag_ptr(o); + int64_t ret_conv = NextMessageHop_hash(o_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - StaticPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKNextMessageHop* a_conv = (LDKNextMessageHop*)untag_ptr(a); + LDKNextMessageHop* b_conv = (LDKNextMessageHop*)untag_ptr(b); + jboolean ret_conv = NextMessageHop_eq(a_conv, b_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageForwardNode_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKMessageForwardNode this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + MessageForwardNode_free(this_obj_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_MessageForwardNode_1get_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKMessageForwardNode this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = StaticPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, MessageForwardNode_get_node_id(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageForwardNode_1set_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKMessageForwardNode this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - StaticPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + MessageForwardNode_set_node_id(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1transaction_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageForwardNode_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKMessageForwardNode this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelTransactionParameters ret_var = StaticPaymentOutputDescriptor_get_channel_transaction_parameters(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = MessageForwardNode_get_short_channel_id(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1transaction_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageForwardNode_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKMessageForwardNode this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelTransactionParameters val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelTransactionParameters_clone(&val_conv); - StaticPaymentOutputDescriptor_set_channel_transaction_parameters(&this_ptr_conv, val_conv); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + MessageForwardNode_set_short_channel_id(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1new(JNIEnv *env, jclass clz, int64_t outpoint_arg, int64_t output_arg, int8_tArray channel_keys_id_arg, int64_t channel_value_satoshis_arg, int64_t channel_transaction_parameters_arg) { - LDKOutPoint outpoint_arg_conv; - outpoint_arg_conv.inner = untag_ptr(outpoint_arg); - outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); - outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); - void* output_arg_ptr = untag_ptr(output_arg); - CHECK_ACCESS(output_arg_ptr); - LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr); - output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg)); - LDKThirtyTwoBytes channel_keys_id_arg_ref; - CHECK((*env)->GetArrayLength(env, channel_keys_id_arg) == 32); - (*env)->GetByteArrayRegion(env, channel_keys_id_arg, 0, 32, channel_keys_id_arg_ref.data); - LDKChannelTransactionParameters channel_transaction_parameters_arg_conv; - channel_transaction_parameters_arg_conv.inner = untag_ptr(channel_transaction_parameters_arg); - channel_transaction_parameters_arg_conv.is_owned = ptr_is_owned(channel_transaction_parameters_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_transaction_parameters_arg_conv); - channel_transaction_parameters_arg_conv = ChannelTransactionParameters_clone(&channel_transaction_parameters_arg_conv); - LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_new(outpoint_arg_conv, output_arg_conv, channel_keys_id_arg_ref, channel_value_satoshis_arg, channel_transaction_parameters_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageForwardNode_1new(JNIEnv *env, jclass clz, int8_tArray node_id_arg, int64_t short_channel_id_arg) { + LDKPublicKey node_id_arg_ref; + CHECK((*env)->GetArrayLength(env, node_id_arg) == 33); + (*env)->GetByteArrayRegion(env, node_id_arg, 0, 33, node_id_arg_ref.compressed_form); + void* short_channel_id_arg_ptr = untag_ptr(short_channel_id_arg); + CHECK_ACCESS(short_channel_id_arg_ptr); + LDKCOption_u64Z short_channel_id_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_arg_ptr); + short_channel_id_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id_arg)); + LDKMessageForwardNode ret_var = MessageForwardNode_new(node_id_arg_ref, short_channel_id_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t StaticPaymentOutputDescriptor_clone_ptr(LDKStaticPaymentOutputDescriptor *NONNULL_PTR arg) { - LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(arg); +static inline uint64_t MessageForwardNode_clone_ptr(LDKMessageForwardNode *NONNULL_PTR arg) { + LDKMessageForwardNode ret_var = MessageForwardNode_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKStaticPaymentOutputDescriptor arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageForwardNode_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKMessageForwardNode arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = StaticPaymentOutputDescriptor_clone_ptr(&arg_conv); + int64_t ret_conv = MessageForwardNode_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKStaticPaymentOutputDescriptor orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageForwardNode_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKMessageForwardNode orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(&orig_conv); + LDKMessageForwardNode ret_var = MessageForwardNode_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKStaticPaymentOutputDescriptor o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageForwardNode_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKMessageForwardNode o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv.is_owned = false; - int64_t ret_conv = StaticPaymentOutputDescriptor_hash(&o_conv); + int64_t ret_conv = MessageForwardNode_hash(&o_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKStaticPaymentOutputDescriptor a_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_MessageForwardNode_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKMessageForwardNode a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKStaticPaymentOutputDescriptor b_conv; + LDKMessageForwardNode b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = StaticPaymentOutputDescriptor_eq(&a_conv, &b_conv); + jboolean ret_conv = MessageForwardNode_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1witness_1script(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKStaticPaymentOutputDescriptor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = StaticPaymentOutputDescriptor_witness_script(&this_arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageContext_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKMessageContext this_ptr_conv = *(LDKMessageContext*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + MessageContext_free(this_ptr_conv); +} + +static inline uint64_t MessageContext_clone_ptr(LDKMessageContext *NONNULL_PTR arg) { + LDKMessageContext *ret_copy = MALLOC(sizeof(LDKMessageContext), "LDKMessageContext"); + *ret_copy = MessageContext_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1max_1witness_1length(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKStaticPaymentOutputDescriptor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = StaticPaymentOutputDescriptor_max_witness_length(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageContext_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKMessageContext* arg_conv = (LDKMessageContext*)untag_ptr(arg); + int64_t ret_conv = MessageContext_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKStaticPaymentOutputDescriptor obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = StaticPaymentOutputDescriptor_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageContext_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKMessageContext* orig_conv = (LDKMessageContext*)untag_ptr(orig); + LDKMessageContext *ret_copy = MALLOC(sizeof(LDKMessageContext), "LDKMessageContext"); + *ret_copy = MessageContext_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); - *ret_conv = StaticPaymentOutputDescriptor_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageContext_1offers(JNIEnv *env, jclass clz, int64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKOffersContext a_conv = *(LDKOffersContext*)(a_ptr); + a_conv = OffersContext_clone((LDKOffersContext*)untag_ptr(a)); + LDKMessageContext *ret_copy = MALLOC(sizeof(LDKMessageContext), "LDKMessageContext"); + *ret_copy = MessageContext_offers(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageContext_1custom(JNIEnv *env, jclass clz, int8_tArray a) { + LDKCVec_u8Z a_ref; + a_ref.datalen = (*env)->GetArrayLength(env, a); + a_ref.data = MALLOC(a_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, a, 0, a_ref.datalen, a_ref.data); + LDKMessageContext *ret_copy = MALLOC(sizeof(LDKMessageContext), "LDKMessageContext"); + *ret_copy = MessageContext_custom(a_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OffersContext_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); CHECK_ACCESS(this_ptr_ptr); - LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)(this_ptr_ptr); + LDKOffersContext this_ptr_conv = *(LDKOffersContext*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - SpendableOutputDescriptor_free(this_ptr_conv); + OffersContext_free(this_ptr_conv); } -static inline uint64_t SpendableOutputDescriptor_clone_ptr(LDKSpendableOutputDescriptor *NONNULL_PTR arg) { - LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_copy = SpendableOutputDescriptor_clone(arg); +static inline uint64_t OffersContext_clone_ptr(LDKOffersContext *NONNULL_PTR arg) { + LDKOffersContext *ret_copy = MALLOC(sizeof(LDKOffersContext), "LDKOffersContext"); + *ret_copy = OffersContext_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKSpendableOutputDescriptor* arg_conv = (LDKSpendableOutputDescriptor*)untag_ptr(arg); - int64_t ret_conv = SpendableOutputDescriptor_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersContext_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKOffersContext* arg_conv = (LDKOffersContext*)untag_ptr(arg); + int64_t ret_conv = OffersContext_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKSpendableOutputDescriptor* orig_conv = (LDKSpendableOutputDescriptor*)untag_ptr(orig); - LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_copy = SpendableOutputDescriptor_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersContext_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKOffersContext* orig_conv = (LDKOffersContext*)untag_ptr(orig); + LDKOffersContext *ret_copy = MALLOC(sizeof(LDKOffersContext), "LDKOffersContext"); + *ret_copy = OffersContext_clone(orig_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1static_1output(JNIEnv *env, jclass clz, int64_t outpoint, int64_t output, int8_tArray channel_keys_id) { - LDKOutPoint outpoint_conv; - outpoint_conv.inner = untag_ptr(outpoint); - outpoint_conv.is_owned = ptr_is_owned(outpoint); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv); - outpoint_conv = OutPoint_clone(&outpoint_conv); - void* output_ptr = untag_ptr(output); - CHECK_ACCESS(output_ptr); - LDKTxOut output_conv = *(LDKTxOut*)(output_ptr); - output_conv = TxOut_clone((LDKTxOut*)untag_ptr(output)); - LDKThirtyTwoBytes channel_keys_id_ref; - CHECK((*env)->GetArrayLength(env, channel_keys_id) == 32); - (*env)->GetByteArrayRegion(env, channel_keys_id, 0, 32, channel_keys_id_ref.data); - LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_copy = SpendableOutputDescriptor_static_output(outpoint_conv, output_conv, channel_keys_id_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersContext_1invoice_1request(JNIEnv *env, jclass clz, int64_t nonce) { + LDKNonce nonce_conv; + nonce_conv.inner = untag_ptr(nonce); + nonce_conv.is_owned = ptr_is_owned(nonce); + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_conv); + nonce_conv = Nonce_clone(&nonce_conv); + LDKOffersContext *ret_copy = MALLOC(sizeof(LDKOffersContext), "LDKOffersContext"); + *ret_copy = OffersContext_invoice_request(nonce_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1delayed_1payment_1output(JNIEnv *env, jclass clz, int64_t a) { - LDKDelayedPaymentOutputDescriptor a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = DelayedPaymentOutputDescriptor_clone(&a_conv); - LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_copy = SpendableOutputDescriptor_delayed_payment_output(a_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersContext_1outbound_1payment(JNIEnv *env, jclass clz, int8_tArray payment_id, int64_t nonce, int8_tArray hmac) { + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + LDKNonce nonce_conv; + nonce_conv.inner = untag_ptr(nonce); + nonce_conv.is_owned = ptr_is_owned(nonce); + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_conv); + nonce_conv = Nonce_clone(&nonce_conv); + LDKThirtyTwoBytes hmac_ref; + CHECK((*env)->GetArrayLength(env, hmac) == 32); + (*env)->GetByteArrayRegion(env, hmac, 0, 32, hmac_ref.data); + LDKOffersContext *ret_copy = MALLOC(sizeof(LDKOffersContext), "LDKOffersContext"); + *ret_copy = OffersContext_outbound_payment(payment_id_ref, nonce_conv, hmac_ref); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1static_1payment_1output(JNIEnv *env, jclass clz, int64_t a) { - LDKStaticPaymentOutputDescriptor a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = StaticPaymentOutputDescriptor_clone(&a_conv); - LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_copy = SpendableOutputDescriptor_static_payment_output(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersContext_1inbound_1payment(JNIEnv *env, jclass clz, int8_tArray payment_hash) { + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + LDKOffersContext *ret_copy = MALLOC(sizeof(LDKOffersContext), "LDKOffersContext"); + *ret_copy = OffersContext_inbound_payment(payment_hash_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKSpendableOutputDescriptor* o_conv = (LDKSpendableOutputDescriptor*)untag_ptr(o); - int64_t ret_conv = SpendableOutputDescriptor_hash(o_conv); - return ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKSpendableOutputDescriptor* a_conv = (LDKSpendableOutputDescriptor*)untag_ptr(a); - LDKSpendableOutputDescriptor* b_conv = (LDKSpendableOutputDescriptor*)untag_ptr(b); - jboolean ret_conv = SpendableOutputDescriptor_eq(a_conv, b_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OffersContext_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKOffersContext* a_conv = (LDKOffersContext*)untag_ptr(a); + LDKOffersContext* b_conv = (LDKOffersContext*)untag_ptr(b); + jboolean ret_conv = OffersContext_eq(a_conv, b_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKSpendableOutputDescriptor* obj_conv = (LDKSpendableOutputDescriptor*)untag_ptr(obj); - LDKCVec_u8Z ret_var = SpendableOutputDescriptor_write(obj_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_MessageContext_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKMessageContext* obj_conv = (LDKMessageContext*)untag_ptr(obj); + LDKCVec_u8Z ret_var = MessageContext_write(obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageContext_1read(JNIEnv *env, jclass clz, int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); - *ret_conv = SpendableOutputDescriptor_read(ser_ref); + LDKCResult_MessageContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_MessageContextDecodeErrorZ), "LDKCResult_MessageContextDecodeErrorZ"); + *ret_conv = MessageContext_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1create_1spendable_1outputs_1psbt(JNIEnv *env, jclass clz, int64_tArray descriptors, int64_tArray outputs, int8_tArray change_destination_script, int32_t feerate_sat_per_1000_weight, int64_t locktime) { - LDKCVec_SpendableOutputDescriptorZ descriptors_constr; - descriptors_constr.datalen = (*env)->GetArrayLength(env, descriptors); - if (descriptors_constr.datalen > 0) - descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); - else - descriptors_constr.data = NULL; - int64_t* descriptors_vals = (*env)->GetLongArrayElements (env, descriptors, NULL); - for (size_t b = 0; b < descriptors_constr.datalen; b++) { - int64_t descriptors_conv_27 = descriptors_vals[b]; - void* descriptors_conv_27_ptr = untag_ptr(descriptors_conv_27); - CHECK_ACCESS(descriptors_conv_27_ptr); - LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr); - descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(descriptors_conv_27)); - descriptors_constr.data[b] = descriptors_conv_27_conv; - } - (*env)->ReleaseLongArrayElements(env, descriptors, descriptors_vals, 0); - LDKCVec_TxOutZ outputs_constr; - outputs_constr.datalen = (*env)->GetArrayLength(env, outputs); - if (outputs_constr.datalen > 0) - outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements"); - else - outputs_constr.data = NULL; - int64_t* outputs_vals = (*env)->GetLongArrayElements (env, outputs, NULL); - for (size_t h = 0; h < outputs_constr.datalen; h++) { - int64_t outputs_conv_7 = outputs_vals[h]; - void* outputs_conv_7_ptr = untag_ptr(outputs_conv_7); - CHECK_ACCESS(outputs_conv_7_ptr); - LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr); - outputs_conv_7_conv = TxOut_clone((LDKTxOut*)untag_ptr(outputs_conv_7)); - outputs_constr.data[h] = outputs_conv_7_conv; - } - (*env)->ReleaseLongArrayElements(env, outputs, outputs_vals, 0); - LDKCVec_u8Z change_destination_script_ref; - change_destination_script_ref.datalen = (*env)->GetArrayLength(env, change_destination_script); - change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, change_destination_script, 0, change_destination_script_ref.datalen, change_destination_script_ref.data); - void* locktime_ptr = untag_ptr(locktime); - CHECK_ACCESS(locktime_ptr); - LDKCOption_u32Z locktime_conv = *(LDKCOption_u32Z*)(locktime_ptr); - locktime_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(locktime)); - LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ), "LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ"); - *ret_conv = SpendableOutputDescriptor_create_spendable_outputs_psbt(descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight, locktime_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OffersContext_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKOffersContext* obj_conv = (LDKOffersContext*)untag_ptr(obj); + LDKCVec_u8Z ret_var = OffersContext_write(obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersContext_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_OffersContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersContextDecodeErrorZ), "LDKCResult_OffersContextDecodeErrorZ"); + *ret_conv = OffersContext_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelDerivationParameters this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelDerivationParameters_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingInfo_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKFundingInfo this_ptr_conv = *(LDKFundingInfo*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + FundingInfo_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1get_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDerivationParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelDerivationParameters_get_value_satoshis(&this_ptr_conv); +static inline uint64_t FundingInfo_clone_ptr(LDKFundingInfo *NONNULL_PTR arg) { + LDKFundingInfo *ret_copy = MALLOC(sizeof(LDKFundingInfo), "LDKFundingInfo"); + *ret_copy = FundingInfo_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKFundingInfo* arg_conv = (LDKFundingInfo*)untag_ptr(arg); + int64_t ret_conv = FundingInfo_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1set_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelDerivationParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelDerivationParameters_set_value_satoshis(&this_ptr_conv, val); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKFundingInfo* orig_conv = (LDKFundingInfo*)untag_ptr(orig); + LDKFundingInfo *ret_copy = MALLOC(sizeof(LDKFundingInfo), "LDKFundingInfo"); + *ret_copy = FundingInfo_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1get_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDerivationParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelDerivationParameters_get_keys_id(&this_ptr_conv)); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingInfo_1tx(JNIEnv *env, jclass clz, int8_tArray transaction) { + LDKTransaction transaction_ref; + transaction_ref.datalen = (*env)->GetArrayLength(env, transaction); + transaction_ref.data = MALLOC(transaction_ref.datalen, "LDKTransaction Bytes"); + (*env)->GetByteArrayRegion(env, transaction, 0, transaction_ref.datalen, transaction_ref.data); + transaction_ref.data_is_owned = true; + LDKFundingInfo *ret_copy = MALLOC(sizeof(LDKFundingInfo), "LDKFundingInfo"); + *ret_copy = FundingInfo_tx(transaction_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingInfo_1out_1point(JNIEnv *env, jclass clz, int64_t outpoint) { + LDKOutPoint outpoint_conv; + outpoint_conv.inner = untag_ptr(outpoint); + outpoint_conv.is_owned = ptr_is_owned(outpoint); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv); + outpoint_conv = OutPoint_clone(&outpoint_conv); + LDKFundingInfo *ret_copy = MALLOC(sizeof(LDKFundingInfo), "LDKFundingInfo"); + *ret_copy = FundingInfo_out_point(outpoint_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_FundingInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKFundingInfo* a_conv = (LDKFundingInfo*)untag_ptr(a); + LDKFundingInfo* b_conv = (LDKFundingInfo*)untag_ptr(b); + jboolean ret_conv = FundingInfo_eq(a_conv, b_conv); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingInfo_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKFundingInfo* obj_conv = (LDKFundingInfo*)untag_ptr(obj); + LDKCVec_u8Z ret_var = FundingInfo_write(obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1set_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKChannelDerivationParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - ChannelDerivationParameters_set_keys_id(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_FundingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingInfoDecodeErrorZ), "LDKCResult_FundingInfoDecodeErrorZ"); + *ret_conv = FundingInfo_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1get_1transaction_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDerivationParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelTransactionParameters ret_var = ChannelDerivationParameters_get_transaction_parameters(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKPaymentPurpose this_ptr_conv = *(LDKPaymentPurpose*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + PaymentPurpose_free(this_ptr_conv); +} + +static inline uint64_t PaymentPurpose_clone_ptr(LDKPaymentPurpose *NONNULL_PTR arg) { + LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); + *ret_copy = PaymentPurpose_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPaymentPurpose* arg_conv = (LDKPaymentPurpose*)untag_ptr(arg); + int64_t ret_conv = PaymentPurpose_clone_ptr(arg_conv); + return ret_conv; +} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1set_1transaction_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelDerivationParameters this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelTransactionParameters val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelTransactionParameters_clone(&val_conv); - ChannelDerivationParameters_set_transaction_parameters(&this_ptr_conv, val_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPaymentPurpose* orig_conv = (LDKPaymentPurpose*)untag_ptr(orig); + LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); + *ret_copy = PaymentPurpose_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1new(JNIEnv *env, jclass clz, int64_t value_satoshis_arg, int8_tArray keys_id_arg, int64_t transaction_parameters_arg) { - LDKThirtyTwoBytes keys_id_arg_ref; - CHECK((*env)->GetArrayLength(env, keys_id_arg) == 32); - (*env)->GetByteArrayRegion(env, keys_id_arg, 0, 32, keys_id_arg_ref.data); - LDKChannelTransactionParameters transaction_parameters_arg_conv; - transaction_parameters_arg_conv.inner = untag_ptr(transaction_parameters_arg); - transaction_parameters_arg_conv.is_owned = ptr_is_owned(transaction_parameters_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(transaction_parameters_arg_conv); - transaction_parameters_arg_conv = ChannelTransactionParameters_clone(&transaction_parameters_arg_conv); - LDKChannelDerivationParameters ret_var = ChannelDerivationParameters_new(value_satoshis_arg, keys_id_arg_ref, transaction_parameters_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1bolt11_1invoice_1payment(JNIEnv *env, jclass clz, int64_t payment_preimage, int8_tArray payment_secret) { + void* payment_preimage_ptr = untag_ptr(payment_preimage); + CHECK_ACCESS(payment_preimage_ptr); + LDKCOption_ThirtyTwoBytesZ payment_preimage_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_preimage_ptr); + payment_preimage_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_preimage)); + LDKThirtyTwoBytes payment_secret_ref; + CHECK((*env)->GetArrayLength(env, payment_secret) == 32); + (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data); + LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); + *ret_copy = PaymentPurpose_bolt11_invoice_payment(payment_preimage_conv, payment_secret_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline uint64_t ChannelDerivationParameters_clone_ptr(LDKChannelDerivationParameters *NONNULL_PTR arg) { - LDKChannelDerivationParameters ret_var = ChannelDerivationParameters_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1bolt12_1offer_1payment(JNIEnv *env, jclass clz, int64_t payment_preimage, int8_tArray payment_secret, int64_t payment_context) { + void* payment_preimage_ptr = untag_ptr(payment_preimage); + CHECK_ACCESS(payment_preimage_ptr); + LDKCOption_ThirtyTwoBytesZ payment_preimage_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_preimage_ptr); + payment_preimage_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_preimage)); + LDKThirtyTwoBytes payment_secret_ref; + CHECK((*env)->GetArrayLength(env, payment_secret) == 32); + (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data); + LDKBolt12OfferContext payment_context_conv; + payment_context_conv.inner = untag_ptr(payment_context); + payment_context_conv.is_owned = ptr_is_owned(payment_context); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_context_conv); + payment_context_conv = Bolt12OfferContext_clone(&payment_context_conv); + LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); + *ret_copy = PaymentPurpose_bolt12_offer_payment(payment_preimage_conv, payment_secret_ref, payment_context_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelDerivationParameters arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = ChannelDerivationParameters_clone_ptr(&arg_conv); - return ret_conv; + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1bolt12_1refund_1payment(JNIEnv *env, jclass clz, int64_t payment_preimage, int8_tArray payment_secret, int64_t payment_context) { + void* payment_preimage_ptr = untag_ptr(payment_preimage); + CHECK_ACCESS(payment_preimage_ptr); + LDKCOption_ThirtyTwoBytesZ payment_preimage_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_preimage_ptr); + payment_preimage_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_preimage)); + LDKThirtyTwoBytes payment_secret_ref; + CHECK((*env)->GetArrayLength(env, payment_secret) == 32); + (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data); + LDKBolt12RefundContext payment_context_conv; + payment_context_conv.inner = untag_ptr(payment_context); + payment_context_conv.is_owned = ptr_is_owned(payment_context); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_context_conv); + payment_context_conv = Bolt12RefundContext_clone(&payment_context_conv); + LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); + *ret_copy = PaymentPurpose_bolt12_refund_payment(payment_preimage_conv, payment_secret_ref, payment_context_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelDerivationParameters orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKChannelDerivationParameters ret_var = ChannelDerivationParameters_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1spontaneous_1payment(JNIEnv *env, jclass clz, int8_tArray a) { + LDKThirtyTwoBytes a_ref; + CHECK((*env)->GetArrayLength(env, a) == 32); + (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data); + LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); + *ret_copy = PaymentPurpose_spontaneous_payment(a_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKChannelDerivationParameters a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKChannelDerivationParameters b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = ChannelDerivationParameters_eq(&a_conv, &b_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKPaymentPurpose* a_conv = (LDKPaymentPurpose*)untag_ptr(a); + LDKPaymentPurpose* b_conv = (LDKPaymentPurpose*)untag_ptr(b); + jboolean ret_conv = PaymentPurpose_eq(a_conv, b_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelDerivationParameters obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ChannelDerivationParameters_write(&obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1preimage(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKPaymentPurpose* this_arg_conv = (LDKPaymentPurpose*)untag_ptr(this_arg); + LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); + *ret_copy = PaymentPurpose_preimage(this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKPaymentPurpose* obj_conv = (LDKPaymentPurpose*)untag_ptr(obj); + LDKCVec_u8Z ret_var = PaymentPurpose_write(obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1read(JNIEnv *env, jclass clz, int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_ChannelDerivationParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDerivationParametersDecodeErrorZ), "LDKCResult_ChannelDerivationParametersDecodeErrorZ"); - *ret_conv = ChannelDerivationParameters_read(ser_ref); + LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); + *ret_conv = PaymentPurpose_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKHTLCDescriptor this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKClaimedHTLC this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - HTLCDescriptor_free(this_obj_conv); + ClaimedHTLC_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1channel_1derivation_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKHTLCDescriptor this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKClaimedHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelDerivationParameters ret_var = HTLCDescriptor_get_channel_derivation_parameters(&this_ptr_conv); + LDKChannelId ret_var = ClaimedHTLC_get_channel_id(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1channel_1derivation_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKHTLCDescriptor this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKClaimedHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelDerivationParameters val_conv; + LDKChannelId val_conv; val_conv.inner = untag_ptr(val); val_conv.is_owned = ptr_is_owned(val); CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelDerivationParameters_clone(&val_conv); - HTLCDescriptor_set_channel_derivation_parameters(&this_ptr_conv, val_conv); + val_conv = ChannelId_clone(&val_conv); + ClaimedHTLC_set_channel_id(&this_ptr_conv, val_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1commitment_1txid(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKHTLCDescriptor this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1get_1user_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKClaimedHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *HTLCDescriptor_get_commitment_txid(&this_ptr_conv)); + int8_tArray ret_arr = (*env)->NewByteArray(env, 16); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 16, ClaimedHTLC_get_user_channel_id(&this_ptr_conv).le_bytes); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1commitment_1txid(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKHTLCDescriptor this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1set_1user_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKClaimedHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - HTLCDescriptor_set_commitment_txid(&this_ptr_conv, val_ref); + LDKU128 val_ref; + CHECK((*env)->GetArrayLength(env, val) == 16); + (*env)->GetByteArrayRegion(env, val, 0, 16, val_ref.le_bytes); + ClaimedHTLC_set_user_channel_id(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1per_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKHTLCDescriptor this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1get_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKClaimedHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = HTLCDescriptor_get_per_commitment_number(&this_ptr_conv); + int32_t ret_conv = ClaimedHTLC_get_cltv_expiry(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1per_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKHTLCDescriptor this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1set_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKClaimedHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - HTLCDescriptor_set_per_commitment_number(&this_ptr_conv, val); + ClaimedHTLC_set_cltv_expiry(&this_ptr_conv, val); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKHTLCDescriptor this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1get_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKClaimedHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, HTLCDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form); - return ret_arr; + int64_t ret_conv = ClaimedHTLC_get_value_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKHTLCDescriptor this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1set_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKClaimedHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - HTLCDescriptor_set_per_commitment_point(&this_ptr_conv, val_ref); + ClaimedHTLC_set_value_msat(&this_ptr_conv, val); } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKHTLCDescriptor this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1get_1counterparty_1skimmed_1fee_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKClaimedHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int32_t ret_conv = HTLCDescriptor_get_feerate_per_kw(&this_ptr_conv); + int64_t ret_conv = ClaimedHTLC_get_counterparty_skimmed_fee_msat(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKHTLCDescriptor this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1set_1counterparty_1skimmed_1fee_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKClaimedHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - HTLCDescriptor_set_feerate_per_kw(&this_ptr_conv, val); + ClaimedHTLC_set_counterparty_skimmed_fee_msat(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1htlc(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKHTLCDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKHTLCOutputInCommitment ret_var = HTLCDescriptor_get_htlc(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1new(JNIEnv *env, jclass clz, int64_t channel_id_arg, int8_tArray user_channel_id_arg, int32_t cltv_expiry_arg, int64_t value_msat_arg, int64_t counterparty_skimmed_fee_msat_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); + LDKU128 user_channel_id_arg_ref; + CHECK((*env)->GetArrayLength(env, user_channel_id_arg) == 16); + (*env)->GetByteArrayRegion(env, user_channel_id_arg, 0, 16, user_channel_id_arg_ref.le_bytes); + LDKClaimedHTLC ret_var = ClaimedHTLC_new(channel_id_arg_conv, user_channel_id_arg_ref, cltv_expiry_arg, value_msat_arg, counterparty_skimmed_fee_msat_arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1htlc(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKHTLCDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKHTLCOutputInCommitment val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = HTLCOutputInCommitment_clone(&val_conv); - HTLCDescriptor_set_htlc(&this_ptr_conv, val_conv); +static inline uint64_t ClaimedHTLC_clone_ptr(LDKClaimedHTLC *NONNULL_PTR arg) { + LDKClaimedHTLC ret_var = ClaimedHTLC_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKClaimedHTLC arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = ClaimedHTLC_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1preimage(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKHTLCDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); - *ret_copy = HTLCDescriptor_get_preimage(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKClaimedHTLC orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKClaimedHTLC ret_var = ClaimedHTLC_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1preimage(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKHTLCDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_ThirtyTwoBytesZ val_conv = *(LDKCOption_ThirtyTwoBytesZ*)(val_ptr); - val_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(val)); - HTLCDescriptor_set_preimage(&this_ptr_conv, val_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKClaimedHTLC a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKClaimedHTLC b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ClaimedHTLC_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1counterparty_1sig(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKHTLCDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, HTLCDescriptor_get_counterparty_sig(&this_ptr_conv).compact_form); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKClaimedHTLC obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ClaimedHTLC_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1counterparty_1sig(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKHTLCDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKECDSASignature val_ref; - CHECK((*env)->GetArrayLength(env, val) == 64); - (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); - HTLCDescriptor_set_counterparty_sig(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_ClaimedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClaimedHTLCDecodeErrorZ), "LDKCResult_ClaimedHTLCDecodeErrorZ"); + *ret_conv = ClaimedHTLC_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1new(JNIEnv *env, jclass clz, int64_t channel_derivation_parameters_arg, int8_tArray commitment_txid_arg, int64_t per_commitment_number_arg, int8_tArray per_commitment_point_arg, int32_t feerate_per_kw_arg, int64_t htlc_arg, int64_t preimage_arg, int8_tArray counterparty_sig_arg) { - LDKChannelDerivationParameters channel_derivation_parameters_arg_conv; - channel_derivation_parameters_arg_conv.inner = untag_ptr(channel_derivation_parameters_arg); - channel_derivation_parameters_arg_conv.is_owned = ptr_is_owned(channel_derivation_parameters_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_derivation_parameters_arg_conv); - channel_derivation_parameters_arg_conv = ChannelDerivationParameters_clone(&channel_derivation_parameters_arg_conv); - LDKThirtyTwoBytes commitment_txid_arg_ref; - CHECK((*env)->GetArrayLength(env, commitment_txid_arg) == 32); - (*env)->GetByteArrayRegion(env, commitment_txid_arg, 0, 32, commitment_txid_arg_ref.data); - LDKPublicKey per_commitment_point_arg_ref; - CHECK((*env)->GetArrayLength(env, per_commitment_point_arg) == 33); - (*env)->GetByteArrayRegion(env, per_commitment_point_arg, 0, 33, per_commitment_point_arg_ref.compressed_form); - LDKHTLCOutputInCommitment htlc_arg_conv; - htlc_arg_conv.inner = untag_ptr(htlc_arg); - htlc_arg_conv.is_owned = ptr_is_owned(htlc_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_arg_conv); - htlc_arg_conv = HTLCOutputInCommitment_clone(&htlc_arg_conv); - void* preimage_arg_ptr = untag_ptr(preimage_arg); - CHECK_ACCESS(preimage_arg_ptr); - LDKCOption_ThirtyTwoBytesZ preimage_arg_conv = *(LDKCOption_ThirtyTwoBytesZ*)(preimage_arg_ptr); - preimage_arg_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(preimage_arg)); - LDKECDSASignature counterparty_sig_arg_ref; - CHECK((*env)->GetArrayLength(env, counterparty_sig_arg) == 64); - (*env)->GetByteArrayRegion(env, counterparty_sig_arg, 0, 64, counterparty_sig_arg_ref.compact_form); - LDKHTLCDescriptor ret_var = HTLCDescriptor_new(channel_derivation_parameters_arg_conv, commitment_txid_arg_ref, per_commitment_number_arg, per_commitment_point_arg_ref, feerate_per_kw_arg, htlc_arg_conv, preimage_arg_conv, counterparty_sig_arg_ref); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PathFailure_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKPathFailure this_ptr_conv = *(LDKPathFailure*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + PathFailure_free(this_ptr_conv); } -static inline uint64_t HTLCDescriptor_clone_ptr(LDKHTLCDescriptor *NONNULL_PTR arg) { - LDKHTLCDescriptor ret_var = HTLCDescriptor_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +static inline uint64_t PathFailure_clone_ptr(LDKPathFailure *NONNULL_PTR arg) { + LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure"); + *ret_copy = PathFailure_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKHTLCDescriptor arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = HTLCDescriptor_clone_ptr(&arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PathFailure_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPathFailure* arg_conv = (LDKPathFailure*)untag_ptr(arg); + int64_t ret_conv = PathFailure_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKHTLCDescriptor orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKHTLCDescriptor ret_var = HTLCDescriptor_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PathFailure_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPathFailure* orig_conv = (LDKPathFailure*)untag_ptr(orig); + LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure"); + *ret_copy = PathFailure_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKHTLCDescriptor a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKHTLCDescriptor b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = HTLCDescriptor_eq(&a_conv, &b_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PathFailure_1initial_1send(JNIEnv *env, jclass clz, int64_t err) { + void* err_ptr = untag_ptr(err); + CHECK_ACCESS(err_ptr); + LDKAPIError err_conv = *(LDKAPIError*)(err_ptr); + err_conv = APIError_clone((LDKAPIError*)untag_ptr(err)); + LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure"); + *ret_copy = PathFailure_initial_send(err_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PathFailure_1on_1path(JNIEnv *env, jclass clz, int64_t network_update) { + void* network_update_ptr = untag_ptr(network_update); + CHECK_ACCESS(network_update_ptr); + LDKCOption_NetworkUpdateZ network_update_conv = *(LDKCOption_NetworkUpdateZ*)(network_update_ptr); + network_update_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)untag_ptr(network_update)); + LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure"); + *ret_copy = PathFailure_on_path(network_update_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PathFailure_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKPathFailure* a_conv = (LDKPathFailure*)untag_ptr(a); + LDKPathFailure* b_conv = (LDKPathFailure*)untag_ptr(b); + jboolean ret_conv = PathFailure_eq(a_conv, b_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKHTLCDescriptor obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = HTLCDescriptor_write(&obj_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PathFailure_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKPathFailure* obj_conv = (LDKPathFailure*)untag_ptr(obj); + LDKCVec_u8Z ret_var = PathFailure_write(obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PathFailure_1read(JNIEnv *env, jclass clz, int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_HTLCDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCDescriptorDecodeErrorZ), "LDKCResult_HTLCDescriptorDecodeErrorZ"); - *ret_conv = HTLCDescriptor_read(ser_ref); + LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ"); + *ret_conv = PathFailure_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1outpoint(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKHTLCDescriptor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOutPoint ret_var = HTLCDescriptor_outpoint(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosureReason_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKClosureReason this_ptr_conv = *(LDKClosureReason*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + ClosureReason_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1previous_1utxo(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKHTLCDescriptor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); - *ret_ref = HTLCDescriptor_previous_utxo(&this_arg_conv); - return tag_ptr(ret_ref, true); +static inline uint64_t ClosureReason_clone_ptr(LDKClosureReason *NONNULL_PTR arg) { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKClosureReason* arg_conv = (LDKClosureReason*)untag_ptr(arg); + int64_t ret_conv = ClosureReason_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1unsigned_1tx_1input(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKHTLCDescriptor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKTxIn* ret_ref = MALLOC(sizeof(LDKTxIn), "LDKTxIn"); - *ret_ref = HTLCDescriptor_unsigned_tx_input(&this_arg_conv); - return tag_ptr(ret_ref, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKClosureReason* orig_conv = (LDKClosureReason*)untag_ptr(orig); + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1tx_1output(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKHTLCDescriptor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); - *ret_ref = HTLCDescriptor_tx_output(&this_arg_conv); - return tag_ptr(ret_ref, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1counterparty_1force_1closed(JNIEnv *env, jclass clz, int64_t peer_msg) { + LDKUntrustedString peer_msg_conv; + peer_msg_conv.inner = untag_ptr(peer_msg); + peer_msg_conv.is_owned = ptr_is_owned(peer_msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(peer_msg_conv); + peer_msg_conv = UntrustedString_clone(&peer_msg_conv); + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_counterparty_force_closed(peer_msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1witness_1script(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKHTLCDescriptor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_u8Z ret_var = HTLCDescriptor_witness_script(&this_arg_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1holder_1force_1closed(JNIEnv *env, jclass clz, int64_t broadcasted_latest_txn) { + void* broadcasted_latest_txn_ptr = untag_ptr(broadcasted_latest_txn); + CHECK_ACCESS(broadcasted_latest_txn_ptr); + LDKCOption_boolZ broadcasted_latest_txn_conv = *(LDKCOption_boolZ*)(broadcasted_latest_txn_ptr); + broadcasted_latest_txn_conv = COption_boolZ_clone((LDKCOption_boolZ*)untag_ptr(broadcasted_latest_txn)); + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_holder_force_closed(broadcasted_latest_txn_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1tx_1input_1witness(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray signature, int8_tArray witness_script) { - LDKHTLCDescriptor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKECDSASignature signature_ref; - CHECK((*env)->GetArrayLength(env, signature) == 64); - (*env)->GetByteArrayRegion(env, signature, 0, 64, signature_ref.compact_form); - LDKu8slice witness_script_ref; - witness_script_ref.datalen = (*env)->GetArrayLength(env, witness_script); - witness_script_ref.data = (*env)->GetByteArrayElements (env, witness_script, NULL); - LDKWitness ret_var = HTLCDescriptor_tx_input_witness(&this_arg_conv, signature_ref, witness_script_ref); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - Witness_free(ret_var); - (*env)->ReleaseByteArrayElements(env, witness_script, (int8_t*)witness_script_ref.data, 0); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1legacy_1cooperative_1closure(JNIEnv *env, jclass clz) { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_legacy_cooperative_closure(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1derive_1channel_1signer(JNIEnv *env, jclass clz, int64_t this_arg, int64_t signer_provider) { - LDKHTLCDescriptor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - void* signer_provider_ptr = untag_ptr(signer_provider); - if (ptr_is_owned(signer_provider)) { CHECK_ACCESS(signer_provider_ptr); } - LDKSignerProvider* signer_provider_conv = (LDKSignerProvider*)signer_provider_ptr; - LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner"); - *ret_ret = HTLCDescriptor_derive_channel_signer(&this_arg_conv, signer_provider_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1counterparty_1initiated_1cooperative_1closure(JNIEnv *env, jclass clz) { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_counterparty_initiated_cooperative_closure(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelSigner_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKChannelSigner this_ptr_conv = *(LDKChannelSigner*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - ChannelSigner_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1locally_1initiated_1cooperative_1closure(JNIEnv *env, jclass clz) { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_locally_initiated_cooperative_closure(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Recipient_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKRecipient* orig_conv = (LDKRecipient*)untag_ptr(orig); - jclass ret_conv = LDKRecipient_to_java(env, Recipient_clone(orig_conv)); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1commitment_1tx_1confirmed(JNIEnv *env, jclass clz) { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_commitment_tx_confirmed(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Recipient_1node(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKRecipient_to_java(env, Recipient_node()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1funding_1timed_1out(JNIEnv *env, jclass clz) { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_funding_timed_out(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Recipient_1phantom_1node(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKRecipient_to_java(env, Recipient_phantom_node()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1processing_1error(JNIEnv *env, jclass clz, jstring err) { + LDKStr err_conv = java_to_owned_str(env, err); + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_processing_error(err_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EntropySource_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKEntropySource this_ptr_conv = *(LDKEntropySource*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - EntropySource_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1disconnected_1peer(JNIEnv *env, jclass clz) { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_disconnected_peer(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeSigner_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKNodeSigner this_ptr_conv = *(LDKNodeSigner*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - NodeSigner_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1outdated_1channel_1manager(JNIEnv *env, jclass clz) { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_outdated_channel_manager(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutputSpender_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKOutputSpender this_ptr_conv = *(LDKOutputSpender*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - OutputSpender_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1counterparty_1coop_1closed_1unfunded_1channel(JNIEnv *env, jclass clz) { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_counterparty_coop_closed_unfunded_channel(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignerProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKSignerProvider this_ptr_conv = *(LDKSignerProvider*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - SignerProvider_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1funding_1batch_1closure(JNIEnv *env, jclass clz) { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_funding_batch_closure(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChangeDestinationSource_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKChangeDestinationSource this_ptr_conv = *(LDKChangeDestinationSource*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - ChangeDestinationSource_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1htlcs_1timed_1out(JNIEnv *env, jclass clz) { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_htlcs_timed_out(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKInMemorySigner this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InMemorySigner_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1peer_1feerate_1too_1low(JNIEnv *env, jclass clz, int32_t peer_feerate_sat_per_kw, int32_t required_feerate_sat_per_kw) { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_peer_feerate_too_low(peer_feerate_sat_per_kw, required_feerate_sat_per_kw); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1funding_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_funding_key(&this_ptr_conv)); - return ret_arr; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ClosureReason_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKClosureReason* a_conv = (LDKClosureReason*)untag_ptr(a); + LDKClosureReason* b_conv = (LDKClosureReason*)untag_ptr(b); + jboolean ret_conv = ClosureReason_eq(a_conv, b_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1funding_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKSecretKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); - InMemorySigner_set_funding_key(&this_ptr_conv, val_ref); +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ClosureReason_1to_1str(JNIEnv *env, jclass clz, int64_t o) { + LDKClosureReason* o_conv = (LDKClosureReason*)untag_ptr(o); + LDKStr ret_str = ClosureReason_to_str(o_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1revocation_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_revocation_base_key(&this_ptr_conv)); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosureReason_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKClosureReason* obj_conv = (LDKClosureReason*)untag_ptr(obj); + LDKCVec_u8Z ret_var = ClosureReason_write(obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1revocation_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKSecretKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); - InMemorySigner_set_revocation_base_key(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = ClosureReason_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_payment_key(&this_ptr_conv)); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKHTLCDestination this_ptr_conv = *(LDKHTLCDestination*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + HTLCDestination_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKSecretKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); - InMemorySigner_set_payment_key(&this_ptr_conv, val_ref); +static inline uint64_t HTLCDestination_clone_ptr(LDKHTLCDestination *NONNULL_PTR arg) { + LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); + *ret_copy = HTLCDestination_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKHTLCDestination* arg_conv = (LDKHTLCDestination*)untag_ptr(arg); + int64_t ret_conv = HTLCDestination_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1delayed_1payment_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_delayed_payment_base_key(&this_ptr_conv)); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKHTLCDestination* orig_conv = (LDKHTLCDestination*)untag_ptr(orig); + LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); + *ret_copy = HTLCDestination_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1delayed_1payment_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKSecretKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); - InMemorySigner_set_delayed_payment_base_key(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1next_1hop_1channel(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t channel_id) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); + LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); + *ret_copy = HTLCDestination_next_hop_channel(node_id_ref, channel_id_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1htlc_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_htlc_base_key(&this_ptr_conv)); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1htlc_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKSecretKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); - InMemorySigner_set_htlc_base_key(&this_ptr_conv, val_ref); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1commitment_1seed(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_commitment_seed(&this_ptr_conv)); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1unknown_1next_1hop(JNIEnv *env, jclass clz, int64_t requested_forward_scid) { + LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); + *ret_copy = HTLCDestination_unknown_next_hop(requested_forward_scid); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1commitment_1seed(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - InMemorySigner_set_commitment_seed(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1invalid_1forward(JNIEnv *env, jclass clz, int64_t requested_forward_scid) { + LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); + *ret_copy = HTLCDestination_invalid_forward(requested_forward_scid); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -static inline uint64_t InMemorySigner_clone_ptr(LDKInMemorySigner *NONNULL_PTR arg) { - LDKInMemorySigner ret_var = InMemorySigner_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1invalid_1onion(JNIEnv *env, jclass clz) { + LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); + *ret_copy = HTLCDestination_invalid_onion(); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKInMemorySigner arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = InMemorySigner_clone_ptr(&arg_conv); - return ret_conv; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKInMemorySigner orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKInMemorySigner ret_var = InMemorySigner_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1failed_1payment(JNIEnv *env, jclass clz, int8_tArray payment_hash) { + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); + *ret_copy = HTLCDestination_failed_payment(payment_hash_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1new(JNIEnv *env, jclass clz, int8_tArray funding_key, int8_tArray revocation_base_key, int8_tArray payment_key, int8_tArray delayed_payment_base_key, int8_tArray htlc_base_key, int8_tArray commitment_seed, int64_t channel_value_satoshis, int8_tArray channel_keys_id, int8_tArray rand_bytes_unique_start) { - LDKSecretKey funding_key_ref; - CHECK((*env)->GetArrayLength(env, funding_key) == 32); - (*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_ref.bytes); - LDKSecretKey revocation_base_key_ref; - CHECK((*env)->GetArrayLength(env, revocation_base_key) == 32); - (*env)->GetByteArrayRegion(env, revocation_base_key, 0, 32, revocation_base_key_ref.bytes); - LDKSecretKey payment_key_ref; - CHECK((*env)->GetArrayLength(env, payment_key) == 32); - (*env)->GetByteArrayRegion(env, payment_key, 0, 32, payment_key_ref.bytes); - LDKSecretKey delayed_payment_base_key_ref; - CHECK((*env)->GetArrayLength(env, delayed_payment_base_key) == 32); - (*env)->GetByteArrayRegion(env, delayed_payment_base_key, 0, 32, delayed_payment_base_key_ref.bytes); - LDKSecretKey htlc_base_key_ref; - CHECK((*env)->GetArrayLength(env, htlc_base_key) == 32); - (*env)->GetByteArrayRegion(env, htlc_base_key, 0, 32, htlc_base_key_ref.bytes); - LDKThirtyTwoBytes commitment_seed_ref; - CHECK((*env)->GetArrayLength(env, commitment_seed) == 32); - (*env)->GetByteArrayRegion(env, commitment_seed, 0, 32, commitment_seed_ref.data); - LDKThirtyTwoBytes channel_keys_id_ref; - CHECK((*env)->GetArrayLength(env, channel_keys_id) == 32); - (*env)->GetByteArrayRegion(env, channel_keys_id, 0, 32, channel_keys_id_ref.data); - LDKThirtyTwoBytes rand_bytes_unique_start_ref; - CHECK((*env)->GetArrayLength(env, rand_bytes_unique_start) == 32); - (*env)->GetByteArrayRegion(env, rand_bytes_unique_start, 0, 32, rand_bytes_unique_start_ref.data); - LDKInMemorySigner ret_var = InMemorySigner_new(funding_key_ref, revocation_base_key_ref, payment_key_ref, delayed_payment_base_key_ref, htlc_base_key_ref, commitment_seed_ref, channel_value_satoshis, channel_keys_id_ref, rand_bytes_unique_start_ref); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKHTLCDestination* a_conv = (LDKHTLCDestination*)untag_ptr(a); + LDKHTLCDestination* b_conv = (LDKHTLCDestination*)untag_ptr(b); + jboolean ret_conv = HTLCDestination_eq(a_conv, b_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterparty_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelPublicKeys ret_var = InMemorySigner_counterparty_pubkeys(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKHTLCDestination* obj_conv = (LDKHTLCDestination*)untag_ptr(obj); + LDKCVec_u8Z ret_var = HTLCDestination_write(obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterparty_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); - *ret_copy = InMemorySigner_counterparty_selected_contest_delay(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ"); + *ret_conv = HTLCDestination_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1holder_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); - *ret_copy = InMemorySigner_holder_selected_contest_delay(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPaymentFailureReason* orig_conv = (LDKPaymentFailureReason*)untag_ptr(orig); + jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_clone(orig_conv)); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCOption_boolZ *ret_copy = MALLOC(sizeof(LDKCOption_boolZ), "LDKCOption_boolZ"); - *ret_copy = InMemorySigner_is_outbound(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1recipient_1rejected(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_recipient_rejected()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOutPoint ret_var = InMemorySigner_funding_outpoint(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1user_1abandoned(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_user_abandoned()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1channel_1parameters(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelTransactionParameters ret_var = InMemorySigner_get_channel_parameters(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1retries_1exhausted(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_retries_exhausted()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1channel_1type_1features(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelTypeFeatures ret_var = InMemorySigner_channel_type_features(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1payment_1expired(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_payment_expired()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1counterparty_1payment_1input(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray spend_tx, int64_t input_idx, int64_t descriptor) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKTransaction spend_tx_ref; - spend_tx_ref.datalen = (*env)->GetArrayLength(env, spend_tx); - spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); - (*env)->GetByteArrayRegion(env, spend_tx, 0, spend_tx_ref.datalen, spend_tx_ref.data); - spend_tx_ref.data_is_owned = true; - LDKStaticPaymentOutputDescriptor descriptor_conv; - descriptor_conv.inner = untag_ptr(descriptor); - descriptor_conv.is_owned = ptr_is_owned(descriptor); - CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); - descriptor_conv.is_owned = false; - LDKCResult_WitnessNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_WitnessNoneZ), "LDKCResult_WitnessNoneZ"); - *ret_conv = InMemorySigner_sign_counterparty_payment_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1route_1not_1found(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_route_not_found()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1dynamic_1p2wsh_1input(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray spend_tx, int64_t input_idx, int64_t descriptor) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKTransaction spend_tx_ref; - spend_tx_ref.datalen = (*env)->GetArrayLength(env, spend_tx); - spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); - (*env)->GetByteArrayRegion(env, spend_tx, 0, spend_tx_ref.datalen, spend_tx_ref.data); - spend_tx_ref.data_is_owned = true; - LDKDelayedPaymentOutputDescriptor descriptor_conv; - descriptor_conv.inner = untag_ptr(descriptor); - descriptor_conv.is_owned = ptr_is_owned(descriptor); - CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); - descriptor_conv.is_owned = false; - LDKCResult_WitnessNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_WitnessNoneZ), "LDKCResult_WitnessNoneZ"); - *ret_conv = InMemorySigner_sign_dynamic_p2wsh_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1unexpected_1error(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_unexpected_error()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1EntropySource(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource"); - *ret_ret = InMemorySigner_as_EntropySource(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1unknown_1required_1features(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_unknown_required_features()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1ChannelSigner(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelSigner* ret_ret = MALLOC(sizeof(LDKChannelSigner), "LDKChannelSigner"); - *ret_ret = InMemorySigner_as_ChannelSigner(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1invoice_1request_1expired(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_invoice_request_expired()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1EcdsaChannelSigner(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner"); - *ret_ret = InMemorySigner_as_EcdsaChannelSigner(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1invoice_1request_1rejected(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_invoice_request_rejected()); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1WriteableEcdsaChannelSigner(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner"); - *ret_ret = InMemorySigner_as_WriteableEcdsaChannelSigner(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKPaymentFailureReason* a_conv = (LDKPaymentFailureReason*)untag_ptr(a); + LDKPaymentFailureReason* b_conv = (LDKPaymentFailureReason*)untag_ptr(b); + jboolean ret_conv = PaymentFailureReason_eq(a_conv, b_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKInMemorySigner obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = InMemorySigner_write(&obj_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKPaymentFailureReason* obj_conv = (LDKPaymentFailureReason*)untag_ptr(obj); + LDKCVec_u8Z ret_var = PaymentFailureReason_write(obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1read(JNIEnv *env, jclass clz, int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - void* arg_ptr = untag_ptr(arg); - CHECK_ACCESS(arg_ptr); - LDKEntropySource arg_conv = *(LDKEntropySource*)(arg_ptr); - if (arg_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&arg_conv); - } - LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); - *ret_conv = InMemorySigner_read(ser_ref, arg_conv); + LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ), "LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ"); + *ret_conv = PaymentFailureReason_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKKeysManager this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - KeysManager_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Event_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKEvent this_ptr_conv = *(LDKEvent*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Event_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1new(JNIEnv *env, jclass clz, int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos) { - uint8_t seed_arr[32]; - CHECK((*env)->GetArrayLength(env, seed) == 32); - (*env)->GetByteArrayRegion(env, seed, 0, 32, seed_arr); - uint8_t (*seed_ref)[32] = &seed_arr; - LDKKeysManager ret_var = KeysManager_new(seed_ref, starting_time_secs, starting_time_nanos); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +static inline uint64_t Event_clone_ptr(LDKEvent *NONNULL_PTR arg) { + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKEvent* arg_conv = (LDKEvent*)untag_ptr(arg); + int64_t ret_conv = Event_clone_ptr(arg_conv); + return ret_conv; +} -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_KeysManager_1get_1node_1secret_1key(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKKeysManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, KeysManager_get_node_secret_key(&this_arg_conv).bytes); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKEvent* orig_conv = (LDKEvent*)untag_ptr(orig); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1derive_1channel_1keys(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_value_satoshis, int8_tArray params) { - LDKKeysManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - uint8_t params_arr[32]; - CHECK((*env)->GetArrayLength(env, params) == 32); - (*env)->GetByteArrayRegion(env, params, 0, 32, params_arr); - uint8_t (*params_ref)[32] = ¶ms_arr; - LDKInMemorySigner ret_var = KeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1funding_1generation_1ready(JNIEnv *env, jclass clz, int64_t temporary_channel_id, int8_tArray counterparty_node_id, int64_t channel_value_satoshis, int8_tArray output_script, int8_tArray user_channel_id) { + LDKChannelId temporary_channel_id_conv; + temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); + temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); + temporary_channel_id_conv = ChannelId_clone(&temporary_channel_id_conv); + LDKPublicKey counterparty_node_id_ref; + CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); + (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); + LDKCVec_u8Z output_script_ref; + output_script_ref.datalen = (*env)->GetArrayLength(env, output_script); + output_script_ref.data = MALLOC(output_script_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, output_script, 0, output_script_ref.datalen, output_script_ref.data); + LDKU128 user_channel_id_ref; + CHECK((*env)->GetArrayLength(env, user_channel_id) == 16); + (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_funding_generation_ready(temporary_channel_id_conv, counterparty_node_id_ref, channel_value_satoshis, output_script_ref, user_channel_id_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1sign_1spendable_1outputs_1psbt(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray descriptors, int8_tArray psbt) { - LDKKeysManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_SpendableOutputDescriptorZ descriptors_constr; - descriptors_constr.datalen = (*env)->GetArrayLength(env, descriptors); - if (descriptors_constr.datalen > 0) - descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); - else - descriptors_constr.data = NULL; - int64_t* descriptors_vals = (*env)->GetLongArrayElements (env, descriptors, NULL); - for (size_t b = 0; b < descriptors_constr.datalen; b++) { - int64_t descriptors_conv_27 = descriptors_vals[b]; - void* descriptors_conv_27_ptr = untag_ptr(descriptors_conv_27); - CHECK_ACCESS(descriptors_conv_27_ptr); - LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr); - descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(descriptors_conv_27)); - descriptors_constr.data[b] = descriptors_conv_27_conv; - } - (*env)->ReleaseLongArrayElements(env, descriptors, descriptors_vals, 0); - LDKCVec_u8Z psbt_ref; - psbt_ref.datalen = (*env)->GetArrayLength(env, psbt); - psbt_ref.data = MALLOC(psbt_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, psbt, 0, psbt_ref.datalen, psbt_ref.data); - LDKCResult_CVec_u8ZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZNoneZ), "LDKCResult_CVec_u8ZNoneZ"); - *ret_conv = KeysManager_sign_spendable_outputs_psbt(&this_arg_conv, descriptors_constr, psbt_ref); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1funding_1tx_1broadcast_1safe(JNIEnv *env, jclass clz, int64_t channel_id, int8_tArray user_channel_id, int64_t funding_txo, int8_tArray counterparty_node_id, int64_t former_temporary_channel_id) { + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); + LDKU128 user_channel_id_ref; + CHECK((*env)->GetArrayLength(env, user_channel_id) == 16); + (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes); + LDKOutPoint funding_txo_conv; + funding_txo_conv.inner = untag_ptr(funding_txo); + funding_txo_conv.is_owned = ptr_is_owned(funding_txo); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); + funding_txo_conv = OutPoint_clone(&funding_txo_conv); + LDKPublicKey counterparty_node_id_ref; + CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); + (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); + LDKChannelId former_temporary_channel_id_conv; + former_temporary_channel_id_conv.inner = untag_ptr(former_temporary_channel_id); + former_temporary_channel_id_conv.is_owned = ptr_is_owned(former_temporary_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(former_temporary_channel_id_conv); + former_temporary_channel_id_conv = ChannelId_clone(&former_temporary_channel_id_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_funding_tx_broadcast_safe(channel_id_conv, user_channel_id_ref, funding_txo_conv, counterparty_node_id_ref, former_temporary_channel_id_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1EntropySource(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKKeysManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource"); - *ret_ret = KeysManager_as_EntropySource(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1claimable(JNIEnv *env, jclass clz, int8_tArray receiver_node_id, int8_tArray payment_hash, int64_t onion_fields, int64_t amount_msat, int64_t counterparty_skimmed_fee_msat, int64_t purpose, int64_t via_channel_id, int64_t via_user_channel_id, int64_t claim_deadline) { + LDKPublicKey receiver_node_id_ref; + CHECK((*env)->GetArrayLength(env, receiver_node_id) == 33); + (*env)->GetByteArrayRegion(env, receiver_node_id, 0, 33, receiver_node_id_ref.compressed_form); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + LDKRecipientOnionFields onion_fields_conv; + onion_fields_conv.inner = untag_ptr(onion_fields); + onion_fields_conv.is_owned = ptr_is_owned(onion_fields); + CHECK_INNER_FIELD_ACCESS_OR_NULL(onion_fields_conv); + onion_fields_conv = RecipientOnionFields_clone(&onion_fields_conv); + void* purpose_ptr = untag_ptr(purpose); + CHECK_ACCESS(purpose_ptr); + LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr); + purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose)); + LDKChannelId via_channel_id_conv; + via_channel_id_conv.inner = untag_ptr(via_channel_id); + via_channel_id_conv.is_owned = ptr_is_owned(via_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(via_channel_id_conv); + via_channel_id_conv = ChannelId_clone(&via_channel_id_conv); + void* via_user_channel_id_ptr = untag_ptr(via_user_channel_id); + CHECK_ACCESS(via_user_channel_id_ptr); + LDKCOption_U128Z via_user_channel_id_conv = *(LDKCOption_U128Z*)(via_user_channel_id_ptr); + via_user_channel_id_conv = COption_U128Z_clone((LDKCOption_U128Z*)untag_ptr(via_user_channel_id)); + void* claim_deadline_ptr = untag_ptr(claim_deadline); + CHECK_ACCESS(claim_deadline_ptr); + LDKCOption_u32Z claim_deadline_conv = *(LDKCOption_u32Z*)(claim_deadline_ptr); + claim_deadline_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(claim_deadline)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_claimable(receiver_node_id_ref, payment_hash_ref, onion_fields_conv, amount_msat, counterparty_skimmed_fee_msat, purpose_conv, via_channel_id_conv, via_user_channel_id_conv, claim_deadline_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1NodeSigner(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKKeysManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeSigner* ret_ret = MALLOC(sizeof(LDKNodeSigner), "LDKNodeSigner"); - *ret_ret = KeysManager_as_NodeSigner(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1claimed(JNIEnv *env, jclass clz, int8_tArray receiver_node_id, int8_tArray payment_hash, int64_t amount_msat, int64_t purpose, int64_tArray htlcs, int64_t sender_intended_total_msat, int64_t onion_fields) { + LDKPublicKey receiver_node_id_ref; + CHECK((*env)->GetArrayLength(env, receiver_node_id) == 33); + (*env)->GetByteArrayRegion(env, receiver_node_id, 0, 33, receiver_node_id_ref.compressed_form); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + void* purpose_ptr = untag_ptr(purpose); + CHECK_ACCESS(purpose_ptr); + LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr); + purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose)); + LDKCVec_ClaimedHTLCZ htlcs_constr; + htlcs_constr.datalen = (*env)->GetArrayLength(env, htlcs); + if (htlcs_constr.datalen > 0) + htlcs_constr.data = MALLOC(htlcs_constr.datalen * sizeof(LDKClaimedHTLC), "LDKCVec_ClaimedHTLCZ Elements"); + else + htlcs_constr.data = NULL; + int64_t* htlcs_vals = (*env)->GetLongArrayElements (env, htlcs, NULL); + for (size_t n = 0; n < htlcs_constr.datalen; n++) { + int64_t htlcs_conv_13 = htlcs_vals[n]; + LDKClaimedHTLC htlcs_conv_13_conv; + htlcs_conv_13_conv.inner = untag_ptr(htlcs_conv_13); + htlcs_conv_13_conv.is_owned = ptr_is_owned(htlcs_conv_13); + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlcs_conv_13_conv); + htlcs_conv_13_conv = ClaimedHTLC_clone(&htlcs_conv_13_conv); + htlcs_constr.data[n] = htlcs_conv_13_conv; + } + (*env)->ReleaseLongArrayElements(env, htlcs, htlcs_vals, 0); + void* sender_intended_total_msat_ptr = untag_ptr(sender_intended_total_msat); + CHECK_ACCESS(sender_intended_total_msat_ptr); + LDKCOption_u64Z sender_intended_total_msat_conv = *(LDKCOption_u64Z*)(sender_intended_total_msat_ptr); + sender_intended_total_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(sender_intended_total_msat)); + LDKRecipientOnionFields onion_fields_conv; + onion_fields_conv.inner = untag_ptr(onion_fields); + onion_fields_conv.is_owned = ptr_is_owned(onion_fields); + CHECK_INNER_FIELD_ACCESS_OR_NULL(onion_fields_conv); + onion_fields_conv = RecipientOnionFields_clone(&onion_fields_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_claimed(receiver_node_id_ref, payment_hash_ref, amount_msat, purpose_conv, htlcs_constr, sender_intended_total_msat_conv, onion_fields_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1OutputSpender(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKKeysManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOutputSpender* ret_ret = MALLOC(sizeof(LDKOutputSpender), "LDKOutputSpender"); - *ret_ret = KeysManager_as_OutputSpender(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1connection_1needed(JNIEnv *env, jclass clz, int8_tArray node_id, int64_tArray addresses) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKCVec_SocketAddressZ addresses_constr; + addresses_constr.datalen = (*env)->GetArrayLength(env, addresses); + if (addresses_constr.datalen > 0) + addresses_constr.data = MALLOC(addresses_constr.datalen * sizeof(LDKSocketAddress), "LDKCVec_SocketAddressZ Elements"); + else + addresses_constr.data = NULL; + int64_t* addresses_vals = (*env)->GetLongArrayElements (env, addresses, NULL); + for (size_t p = 0; p < addresses_constr.datalen; p++) { + int64_t addresses_conv_15 = addresses_vals[p]; + void* addresses_conv_15_ptr = untag_ptr(addresses_conv_15); + CHECK_ACCESS(addresses_conv_15_ptr); + LDKSocketAddress addresses_conv_15_conv = *(LDKSocketAddress*)(addresses_conv_15_ptr); + addresses_conv_15_conv = SocketAddress_clone((LDKSocketAddress*)untag_ptr(addresses_conv_15)); + addresses_constr.data[p] = addresses_conv_15_conv; + } + (*env)->ReleaseLongArrayElements(env, addresses, addresses_vals, 0); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_connection_needed(node_id_ref, addresses_constr); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1SignerProvider(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKKeysManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKSignerProvider* ret_ret = MALLOC(sizeof(LDKSignerProvider), "LDKSignerProvider"); - *ret_ret = KeysManager_as_SignerProvider(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1invoice_1received(JNIEnv *env, jclass clz, int8_tArray payment_id, int64_t invoice, int64_t context, int64_t responder) { + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + LDKBolt12Invoice invoice_conv; + invoice_conv.inner = untag_ptr(invoice); + invoice_conv.is_owned = ptr_is_owned(invoice); + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); + invoice_conv = Bolt12Invoice_clone(&invoice_conv); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKCOption_OffersContextZ context_conv = *(LDKCOption_OffersContextZ*)(context_ptr); + context_conv = COption_OffersContextZ_clone((LDKCOption_OffersContextZ*)untag_ptr(context)); + LDKResponder responder_conv; + responder_conv.inner = untag_ptr(responder); + responder_conv.is_owned = ptr_is_owned(responder); + CHECK_INNER_FIELD_ACCESS_OR_NULL(responder_conv); + responder_conv = Responder_clone(&responder_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_invoice_received(payment_id_ref, invoice_conv, context_conv, responder_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKPhantomKeysManager this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PhantomKeysManager_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1sent(JNIEnv *env, jclass clz, int64_t payment_id, int8_tArray payment_preimage, int8_tArray payment_hash, int64_t fee_paid_msat) { + void* payment_id_ptr = untag_ptr(payment_id); + CHECK_ACCESS(payment_id_ptr); + LDKCOption_ThirtyTwoBytesZ payment_id_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_id_ptr); + payment_id_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_id)); + LDKThirtyTwoBytes payment_preimage_ref; + CHECK((*env)->GetArrayLength(env, payment_preimage) == 32); + (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + void* fee_paid_msat_ptr = untag_ptr(fee_paid_msat); + CHECK_ACCESS(fee_paid_msat_ptr); + LDKCOption_u64Z fee_paid_msat_conv = *(LDKCOption_u64Z*)(fee_paid_msat_ptr); + fee_paid_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(fee_paid_msat)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_sent(payment_id_conv, payment_preimage_ref, payment_hash_ref, fee_paid_msat_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1as_1EntropySource(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKPhantomKeysManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource"); - *ret_ret = PhantomKeysManager_as_EntropySource(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1failed(JNIEnv *env, jclass clz, int8_tArray payment_id, int64_t payment_hash, int64_t reason) { + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + void* payment_hash_ptr = untag_ptr(payment_hash); + CHECK_ACCESS(payment_hash_ptr); + LDKCOption_ThirtyTwoBytesZ payment_hash_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_ptr); + payment_hash_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash)); + void* reason_ptr = untag_ptr(reason); + CHECK_ACCESS(reason_ptr); + LDKCOption_PaymentFailureReasonZ reason_conv = *(LDKCOption_PaymentFailureReasonZ*)(reason_ptr); + reason_conv = COption_PaymentFailureReasonZ_clone((LDKCOption_PaymentFailureReasonZ*)untag_ptr(reason)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_failed(payment_id_ref, payment_hash_conv, reason_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1as_1NodeSigner(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKPhantomKeysManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeSigner* ret_ret = MALLOC(sizeof(LDKNodeSigner), "LDKNodeSigner"); - *ret_ret = PhantomKeysManager_as_NodeSigner(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1successful(JNIEnv *env, jclass clz, int8_tArray payment_id, int64_t payment_hash, int64_t path) { + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + void* payment_hash_ptr = untag_ptr(payment_hash); + CHECK_ACCESS(payment_hash_ptr); + LDKCOption_ThirtyTwoBytesZ payment_hash_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_ptr); + payment_hash_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash)); + LDKPath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv = Path_clone(&path_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_path_successful(payment_id_ref, payment_hash_conv, path_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1as_1OutputSpender(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKPhantomKeysManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOutputSpender* ret_ret = MALLOC(sizeof(LDKOutputSpender), "LDKOutputSpender"); - *ret_ret = PhantomKeysManager_as_OutputSpender(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1failed(JNIEnv *env, jclass clz, int64_t payment_id, int8_tArray payment_hash, jboolean payment_failed_permanently, int64_t failure, int64_t path, int64_t short_channel_id) { + void* payment_id_ptr = untag_ptr(payment_id); + CHECK_ACCESS(payment_id_ptr); + LDKCOption_ThirtyTwoBytesZ payment_id_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_id_ptr); + payment_id_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_id)); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + void* failure_ptr = untag_ptr(failure); + CHECK_ACCESS(failure_ptr); + LDKPathFailure failure_conv = *(LDKPathFailure*)(failure_ptr); + failure_conv = PathFailure_clone((LDKPathFailure*)untag_ptr(failure)); + LDKPath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv = Path_clone(&path_conv); + void* short_channel_id_ptr = untag_ptr(short_channel_id); + CHECK_ACCESS(short_channel_id_ptr); + LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr); + short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_path_failed(payment_id_conv, payment_hash_ref, payment_failed_permanently, failure_conv, path_conv, short_channel_id_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1as_1SignerProvider(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKPhantomKeysManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKSignerProvider* ret_ret = MALLOC(sizeof(LDKSignerProvider), "LDKSignerProvider"); - *ret_ret = PhantomKeysManager_as_SignerProvider(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1probe_1successful(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_hash, int64_t path) { + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + LDKPath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv = Path_clone(&path_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_probe_successful(payment_id_ref, payment_hash_ref, path_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1new(JNIEnv *env, jclass clz, int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos, int8_tArray cross_node_seed) { - uint8_t seed_arr[32]; - CHECK((*env)->GetArrayLength(env, seed) == 32); - (*env)->GetByteArrayRegion(env, seed, 0, 32, seed_arr); - uint8_t (*seed_ref)[32] = &seed_arr; - uint8_t cross_node_seed_arr[32]; - CHECK((*env)->GetArrayLength(env, cross_node_seed) == 32); - (*env)->GetByteArrayRegion(env, cross_node_seed, 0, 32, cross_node_seed_arr); - uint8_t (*cross_node_seed_ref)[32] = &cross_node_seed_arr; - LDKPhantomKeysManager ret_var = PhantomKeysManager_new(seed_ref, starting_time_secs, starting_time_nanos, cross_node_seed_ref); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1probe_1failed(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_hash, int64_t path, int64_t short_channel_id) { + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + LDKPath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv = Path_clone(&path_conv); + void* short_channel_id_ptr = untag_ptr(short_channel_id); + CHECK_ACCESS(short_channel_id_ptr); + LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr); + short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_probe_failed(payment_id_ref, payment_hash_ref, path_conv, short_channel_id_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1derive_1channel_1keys(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_value_satoshis, int8_tArray params) { - LDKPhantomKeysManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - uint8_t params_arr[32]; - CHECK((*env)->GetArrayLength(env, params) == 32); - (*env)->GetByteArrayRegion(env, params, 0, 32, params_arr); - uint8_t (*params_ref)[32] = ¶ms_arr; - LDKInMemorySigner ret_var = PhantomKeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1pending_1htlcs_1forwardable(JNIEnv *env, jclass clz, int64_t time_forwardable) { + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_pending_htlcs_forwardable(time_forwardable); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1get_1node_1secret_1key(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKPhantomKeysManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, PhantomKeysManager_get_node_secret_key(&this_arg_conv).bytes); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1htlcintercepted(JNIEnv *env, jclass clz, int8_tArray intercept_id, int64_t requested_next_hop_scid, int8_tArray payment_hash, int64_t inbound_amount_msat, int64_t expected_outbound_amount_msat) { + LDKThirtyTwoBytes intercept_id_ref; + CHECK((*env)->GetArrayLength(env, intercept_id) == 32); + (*env)->GetByteArrayRegion(env, intercept_id, 0, 32, intercept_id_ref.data); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_htlcintercepted(intercept_id_ref, requested_next_hop_scid, payment_hash_ref, inbound_amount_msat, expected_outbound_amount_msat); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1get_1phantom_1node_1secret_1key(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKPhantomKeysManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, PhantomKeysManager_get_phantom_node_secret_key(&this_arg_conv).bytes); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1spendable_1outputs(JNIEnv *env, jclass clz, int64_tArray outputs, int64_t channel_id) { + LDKCVec_SpendableOutputDescriptorZ outputs_constr; + outputs_constr.datalen = (*env)->GetArrayLength(env, outputs); + if (outputs_constr.datalen > 0) + outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); + else + outputs_constr.data = NULL; + int64_t* outputs_vals = (*env)->GetLongArrayElements (env, outputs, NULL); + for (size_t b = 0; b < outputs_constr.datalen; b++) { + int64_t outputs_conv_27 = outputs_vals[b]; + void* outputs_conv_27_ptr = untag_ptr(outputs_conv_27); + CHECK_ACCESS(outputs_conv_27_ptr); + LDKSpendableOutputDescriptor outputs_conv_27_conv = *(LDKSpendableOutputDescriptor*)(outputs_conv_27_ptr); + outputs_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(outputs_conv_27)); + outputs_constr.data[b] = outputs_conv_27_conv; + } + (*env)->ReleaseLongArrayElements(env, outputs, outputs_vals, 0); + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_spendable_outputs(outputs_constr, channel_id_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RandomBytes_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKRandomBytes this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - RandomBytes_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1forwarded(JNIEnv *env, jclass clz, int64_t prev_channel_id, int64_t next_channel_id, int64_t prev_user_channel_id, int64_t next_user_channel_id, int64_t total_fee_earned_msat, int64_t skimmed_fee_msat, jboolean claim_from_onchain_tx, int64_t outbound_amount_forwarded_msat) { + LDKChannelId prev_channel_id_conv; + prev_channel_id_conv.inner = untag_ptr(prev_channel_id); + prev_channel_id_conv.is_owned = ptr_is_owned(prev_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(prev_channel_id_conv); + prev_channel_id_conv = ChannelId_clone(&prev_channel_id_conv); + LDKChannelId next_channel_id_conv; + next_channel_id_conv.inner = untag_ptr(next_channel_id); + next_channel_id_conv.is_owned = ptr_is_owned(next_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(next_channel_id_conv); + next_channel_id_conv = ChannelId_clone(&next_channel_id_conv); + void* prev_user_channel_id_ptr = untag_ptr(prev_user_channel_id); + CHECK_ACCESS(prev_user_channel_id_ptr); + LDKCOption_U128Z prev_user_channel_id_conv = *(LDKCOption_U128Z*)(prev_user_channel_id_ptr); + prev_user_channel_id_conv = COption_U128Z_clone((LDKCOption_U128Z*)untag_ptr(prev_user_channel_id)); + void* next_user_channel_id_ptr = untag_ptr(next_user_channel_id); + CHECK_ACCESS(next_user_channel_id_ptr); + LDKCOption_U128Z next_user_channel_id_conv = *(LDKCOption_U128Z*)(next_user_channel_id_ptr); + next_user_channel_id_conv = COption_U128Z_clone((LDKCOption_U128Z*)untag_ptr(next_user_channel_id)); + void* total_fee_earned_msat_ptr = untag_ptr(total_fee_earned_msat); + CHECK_ACCESS(total_fee_earned_msat_ptr); + LDKCOption_u64Z total_fee_earned_msat_conv = *(LDKCOption_u64Z*)(total_fee_earned_msat_ptr); + total_fee_earned_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(total_fee_earned_msat)); + void* skimmed_fee_msat_ptr = untag_ptr(skimmed_fee_msat); + CHECK_ACCESS(skimmed_fee_msat_ptr); + LDKCOption_u64Z skimmed_fee_msat_conv = *(LDKCOption_u64Z*)(skimmed_fee_msat_ptr); + skimmed_fee_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(skimmed_fee_msat)); + void* outbound_amount_forwarded_msat_ptr = untag_ptr(outbound_amount_forwarded_msat); + CHECK_ACCESS(outbound_amount_forwarded_msat_ptr); + LDKCOption_u64Z outbound_amount_forwarded_msat_conv = *(LDKCOption_u64Z*)(outbound_amount_forwarded_msat_ptr); + outbound_amount_forwarded_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_amount_forwarded_msat)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_forwarded(prev_channel_id_conv, next_channel_id_conv, prev_user_channel_id_conv, next_user_channel_id_conv, total_fee_earned_msat_conv, skimmed_fee_msat_conv, claim_from_onchain_tx, outbound_amount_forwarded_msat_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RandomBytes_1new(JNIEnv *env, jclass clz, int8_tArray seed) { - LDKThirtyTwoBytes seed_ref; - CHECK((*env)->GetArrayLength(env, seed) == 32); - (*env)->GetByteArrayRegion(env, seed, 0, 32, seed_ref.data); - LDKRandomBytes ret_var = RandomBytes_new(seed_ref); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1channel_1pending(JNIEnv *env, jclass clz, int64_t channel_id, int8_tArray user_channel_id, int64_t former_temporary_channel_id, int8_tArray counterparty_node_id, int64_t funding_txo, int64_t channel_type) { + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); + LDKU128 user_channel_id_ref; + CHECK((*env)->GetArrayLength(env, user_channel_id) == 16); + (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes); + LDKChannelId former_temporary_channel_id_conv; + former_temporary_channel_id_conv.inner = untag_ptr(former_temporary_channel_id); + former_temporary_channel_id_conv.is_owned = ptr_is_owned(former_temporary_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(former_temporary_channel_id_conv); + former_temporary_channel_id_conv = ChannelId_clone(&former_temporary_channel_id_conv); + LDKPublicKey counterparty_node_id_ref; + CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); + (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); + LDKOutPoint funding_txo_conv; + funding_txo_conv.inner = untag_ptr(funding_txo); + funding_txo_conv.is_owned = ptr_is_owned(funding_txo); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); + funding_txo_conv = OutPoint_clone(&funding_txo_conv); + LDKChannelTypeFeatures channel_type_conv; + channel_type_conv.inner = untag_ptr(channel_type); + channel_type_conv.is_owned = ptr_is_owned(channel_type); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_conv); + channel_type_conv = ChannelTypeFeatures_clone(&channel_type_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_channel_pending(channel_id_conv, user_channel_id_ref, former_temporary_channel_id_conv, counterparty_node_id_ref, funding_txo_conv, channel_type_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RandomBytes_1as_1EntropySource(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKRandomBytes this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource"); - *ret_ret = RandomBytes_as_EntropySource(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1channel_1ready(JNIEnv *env, jclass clz, int64_t channel_id, int8_tArray user_channel_id, int8_tArray counterparty_node_id, int64_t channel_type) { + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); + LDKU128 user_channel_id_ref; + CHECK((*env)->GetArrayLength(env, user_channel_id) == 16); + (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes); + LDKPublicKey counterparty_node_id_ref; + CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); + (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); + LDKChannelTypeFeatures channel_type_conv; + channel_type_conv.inner = untag_ptr(channel_type); + channel_type_conv.is_owned = ptr_is_owned(channel_type); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_conv); + channel_type_conv = ChannelTypeFeatures_clone(&channel_type_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_channel_ready(channel_id_conv, user_channel_id_ref, counterparty_node_id_ref, channel_type_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EcdsaChannelSigner_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKEcdsaChannelSigner this_ptr_conv = *(LDKEcdsaChannelSigner*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - EcdsaChannelSigner_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1channel_1closed(JNIEnv *env, jclass clz, int64_t channel_id, int8_tArray user_channel_id, int64_t reason, int8_tArray counterparty_node_id, int64_t channel_capacity_sats, int64_t channel_funding_txo) { + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); + LDKU128 user_channel_id_ref; + CHECK((*env)->GetArrayLength(env, user_channel_id) == 16); + (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes); + void* reason_ptr = untag_ptr(reason); + CHECK_ACCESS(reason_ptr); + LDKClosureReason reason_conv = *(LDKClosureReason*)(reason_ptr); + reason_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(reason)); + LDKPublicKey counterparty_node_id_ref; + CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); + (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); + void* channel_capacity_sats_ptr = untag_ptr(channel_capacity_sats); + CHECK_ACCESS(channel_capacity_sats_ptr); + LDKCOption_u64Z channel_capacity_sats_conv = *(LDKCOption_u64Z*)(channel_capacity_sats_ptr); + channel_capacity_sats_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(channel_capacity_sats)); + LDKOutPoint channel_funding_txo_conv; + channel_funding_txo_conv.inner = untag_ptr(channel_funding_txo); + channel_funding_txo_conv.is_owned = ptr_is_owned(channel_funding_txo); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_funding_txo_conv); + channel_funding_txo_conv = OutPoint_clone(&channel_funding_txo_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_channel_closed(channel_id_conv, user_channel_id_ref, reason_conv, counterparty_node_id_ref, channel_capacity_sats_conv, channel_funding_txo_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -static inline uint64_t WriteableEcdsaChannelSigner_clone_ptr(LDKWriteableEcdsaChannelSigner *NONNULL_PTR arg) { - LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner"); - *ret_ret = WriteableEcdsaChannelSigner_clone(arg); - return tag_ptr(ret_ret, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WriteableEcdsaChannelSigner_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - void* arg_ptr = untag_ptr(arg); - if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); } - LDKWriteableEcdsaChannelSigner* arg_conv = (LDKWriteableEcdsaChannelSigner*)arg_ptr; - int64_t ret_conv = WriteableEcdsaChannelSigner_clone_ptr(arg_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1discard_1funding(JNIEnv *env, jclass clz, int64_t channel_id, int64_t funding_info) { + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); + void* funding_info_ptr = untag_ptr(funding_info); + CHECK_ACCESS(funding_info_ptr); + LDKFundingInfo funding_info_conv = *(LDKFundingInfo*)(funding_info_ptr); + funding_info_conv = FundingInfo_clone((LDKFundingInfo*)untag_ptr(funding_info)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_discard_funding(channel_id_conv, funding_info_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WriteableEcdsaChannelSigner_1clone(JNIEnv *env, jclass clz, int64_t orig) { - void* orig_ptr = untag_ptr(orig); - if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); } - LDKWriteableEcdsaChannelSigner* orig_conv = (LDKWriteableEcdsaChannelSigner*)orig_ptr; - LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner"); - *ret_ret = WriteableEcdsaChannelSigner_clone(orig_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1open_1channel_1request(JNIEnv *env, jclass clz, int64_t temporary_channel_id, int8_tArray counterparty_node_id, int64_t funding_satoshis, int64_t push_msat, int64_t channel_type, jboolean is_announced, int64_t params) { + LDKChannelId temporary_channel_id_conv; + temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); + temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); + temporary_channel_id_conv = ChannelId_clone(&temporary_channel_id_conv); + LDKPublicKey counterparty_node_id_ref; + CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); + (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); + LDKChannelTypeFeatures channel_type_conv; + channel_type_conv.inner = untag_ptr(channel_type); + channel_type_conv.is_owned = ptr_is_owned(channel_type); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_conv); + channel_type_conv = ChannelTypeFeatures_clone(&channel_type_conv); + LDKChannelParameters params_conv; + params_conv.inner = untag_ptr(params); + params_conv.is_owned = ptr_is_owned(params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); + params_conv = ChannelParameters_clone(¶ms_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_open_channel_request(temporary_channel_id_conv, counterparty_node_id_ref, funding_satoshis, push_msat, channel_type_conv, is_announced, params_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WriteableEcdsaChannelSigner_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKWriteableEcdsaChannelSigner this_ptr_conv = *(LDKWriteableEcdsaChannelSigner*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - WriteableEcdsaChannelSigner_free(this_ptr_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKOnionMessenger this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - OnionMessenger_free(this_obj_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageRouter_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKMessageRouter this_ptr_conv = *(LDKMessageRouter*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - MessageRouter_free(this_ptr_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DefaultMessageRouter_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKDefaultMessageRouter this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - DefaultMessageRouter_free(this_obj_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultMessageRouter_1new(JNIEnv *env, jclass clz, int64_t network_graph, int64_t entropy_source) { - LDKNetworkGraph network_graph_conv; - network_graph_conv.inner = untag_ptr(network_graph); - network_graph_conv.is_owned = ptr_is_owned(network_graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - network_graph_conv.is_owned = false; - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - LDKDefaultMessageRouter ret_var = DefaultMessageRouter_new(&network_graph_conv, entropy_source_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1htlchandling_1failed(JNIEnv *env, jclass clz, int64_t prev_channel_id, int64_t failed_next_destination) { + LDKChannelId prev_channel_id_conv; + prev_channel_id_conv.inner = untag_ptr(prev_channel_id); + prev_channel_id_conv.is_owned = ptr_is_owned(prev_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(prev_channel_id_conv); + prev_channel_id_conv = ChannelId_clone(&prev_channel_id_conv); + void* failed_next_destination_ptr = untag_ptr(failed_next_destination); + CHECK_ACCESS(failed_next_destination_ptr); + LDKHTLCDestination failed_next_destination_conv = *(LDKHTLCDestination*)(failed_next_destination_ptr); + failed_next_destination_conv = HTLCDestination_clone((LDKHTLCDestination*)untag_ptr(failed_next_destination)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_htlchandling_failed(prev_channel_id_conv, failed_next_destination_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultMessageRouter_1as_1MessageRouter(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKDefaultMessageRouter this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKMessageRouter* ret_ret = MALLOC(sizeof(LDKMessageRouter), "LDKMessageRouter"); - *ret_ret = DefaultMessageRouter_as_MessageRouter(&this_arg_conv); - return tag_ptr(ret_ret, true); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKOnionMessagePath this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - OnionMessagePath_free(this_obj_conv); -} - -JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1get_1intermediate_1nodes(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOnionMessagePath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_PublicKeyZ ret_var = OnionMessagePath_get_intermediate_nodes(&this_ptr_conv); - jobjectArray ret_arr = NULL; - ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); - ; - for (size_t i = 0; i < ret_var.datalen; i++) { - int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 33, ret_var.data[i].compressed_form); - (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); - } - - FREE(ret_var.data); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1set_1intermediate_1nodes(JNIEnv *env, jclass clz, int64_t this_ptr, jobjectArray val) { - LDKOnionMessagePath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_PublicKeyZ val_constr; - val_constr.datalen = (*env)->GetArrayLength(env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); - else - val_constr.data = NULL; - for (size_t i = 0; i < val_constr.datalen; i++) { - int8_tArray val_conv_8 = (*env)->GetObjectArrayElement(env, val, i); - LDKPublicKey val_conv_8_ref; - CHECK((*env)->GetArrayLength(env, val_conv_8) == 33); - (*env)->GetByteArrayRegion(env, val_conv_8, 0, 33, val_conv_8_ref.compressed_form); - val_constr.data[i] = val_conv_8_ref; - } - OnionMessagePath_set_intermediate_nodes(&this_ptr_conv, val_constr); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1get_1destination(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOnionMessagePath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); - *ret_copy = OnionMessagePath_get_destination(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1bump_1transaction(JNIEnv *env, jclass clz, int64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKBumpTransactionEvent a_conv = *(LDKBumpTransactionEvent*)(a_ptr); + a_conv = BumpTransactionEvent_clone((LDKBumpTransactionEvent*)untag_ptr(a)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_bump_transaction(a_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1set_1destination(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKOnionMessagePath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKDestination val_conv = *(LDKDestination*)(val_ptr); - val_conv = Destination_clone((LDKDestination*)untag_ptr(val)); - OnionMessagePath_set_destination(&this_ptr_conv, val_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1get_1first_1node_1addresses(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOnionMessagePath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_CVec_SocketAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_SocketAddressZZ), "LDKCOption_CVec_SocketAddressZZ"); - *ret_copy = OnionMessagePath_get_first_node_addresses(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1onion_1message_1intercepted(JNIEnv *env, jclass clz, int8_tArray peer_node_id, int64_t message) { + LDKPublicKey peer_node_id_ref; + CHECK((*env)->GetArrayLength(env, peer_node_id) == 33); + (*env)->GetByteArrayRegion(env, peer_node_id, 0, 33, peer_node_id_ref.compressed_form); + LDKOnionMessage message_conv; + message_conv.inner = untag_ptr(message); + message_conv.is_owned = ptr_is_owned(message); + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_conv); + message_conv = OnionMessage_clone(&message_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_onion_message_intercepted(peer_node_id_ref, message_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1set_1first_1node_1addresses(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKOnionMessagePath this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_CVec_SocketAddressZZ val_conv = *(LDKCOption_CVec_SocketAddressZZ*)(val_ptr); - val_conv = COption_CVec_SocketAddressZZ_clone((LDKCOption_CVec_SocketAddressZZ*)untag_ptr(val)); - OnionMessagePath_set_first_node_addresses(&this_ptr_conv, val_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1new(JNIEnv *env, jclass clz, jobjectArray intermediate_nodes_arg, int64_t destination_arg, int64_t first_node_addresses_arg) { - LDKCVec_PublicKeyZ intermediate_nodes_arg_constr; - intermediate_nodes_arg_constr.datalen = (*env)->GetArrayLength(env, intermediate_nodes_arg); - if (intermediate_nodes_arg_constr.datalen > 0) - intermediate_nodes_arg_constr.data = MALLOC(intermediate_nodes_arg_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); - else - intermediate_nodes_arg_constr.data = NULL; - for (size_t i = 0; i < intermediate_nodes_arg_constr.datalen; i++) { - int8_tArray intermediate_nodes_arg_conv_8 = (*env)->GetObjectArrayElement(env, intermediate_nodes_arg, i); - LDKPublicKey intermediate_nodes_arg_conv_8_ref; - CHECK((*env)->GetArrayLength(env, intermediate_nodes_arg_conv_8) == 33); - (*env)->GetByteArrayRegion(env, intermediate_nodes_arg_conv_8, 0, 33, intermediate_nodes_arg_conv_8_ref.compressed_form); - intermediate_nodes_arg_constr.data[i] = intermediate_nodes_arg_conv_8_ref; - } - void* destination_arg_ptr = untag_ptr(destination_arg); - CHECK_ACCESS(destination_arg_ptr); - LDKDestination destination_arg_conv = *(LDKDestination*)(destination_arg_ptr); - destination_arg_conv = Destination_clone((LDKDestination*)untag_ptr(destination_arg)); - void* first_node_addresses_arg_ptr = untag_ptr(first_node_addresses_arg); - CHECK_ACCESS(first_node_addresses_arg_ptr); - LDKCOption_CVec_SocketAddressZZ first_node_addresses_arg_conv = *(LDKCOption_CVec_SocketAddressZZ*)(first_node_addresses_arg_ptr); - LDKOnionMessagePath ret_var = OnionMessagePath_new(intermediate_nodes_arg_constr, destination_arg_conv, first_node_addresses_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1onion_1message_1peer_1connected(JNIEnv *env, jclass clz, int8_tArray peer_node_id) { + LDKPublicKey peer_node_id_ref; + CHECK((*env)->GetArrayLength(env, peer_node_id) == 33); + (*env)->GetByteArrayRegion(env, peer_node_id, 0, 33, peer_node_id_ref.compressed_form); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_onion_message_peer_connected(peer_node_id_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline uint64_t OnionMessagePath_clone_ptr(LDKOnionMessagePath *NONNULL_PTR arg) { - LDKOnionMessagePath ret_var = OnionMessagePath_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKOnionMessagePath arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = OnionMessagePath_clone_ptr(&arg_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Event_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKEvent* a_conv = (LDKEvent*)untag_ptr(a); + LDKEvent* b_conv = (LDKEvent*)untag_ptr(b); + jboolean ret_conv = Event_eq(a_conv, b_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKOnionMessagePath orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKOnionMessagePath ret_var = OnionMessagePath_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Event_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKEvent* obj_conv = (LDKEvent*)untag_ptr(obj); + LDKCVec_u8Z ret_var = Event_write(obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1first_1node(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOnionMessagePath this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OnionMessagePath_first_node(&this_arg_conv).compressed_form); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = Event_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Destination_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); CHECK_ACCESS(this_ptr_ptr); - LDKDestination this_ptr_conv = *(LDKDestination*)(this_ptr_ptr); + LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - Destination_free(this_ptr_conv); + MessageSendEvent_free(this_ptr_conv); } -static inline uint64_t Destination_clone_ptr(LDKDestination *NONNULL_PTR arg) { - LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); - *ret_copy = Destination_clone(arg); +static inline uint64_t MessageSendEvent_clone_ptr(LDKMessageSendEvent *NONNULL_PTR arg) { + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKDestination* arg_conv = (LDKDestination*)untag_ptr(arg); - int64_t ret_conv = Destination_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKMessageSendEvent* arg_conv = (LDKMessageSendEvent*)untag_ptr(arg); + int64_t ret_conv = MessageSendEvent_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKDestination* orig_conv = (LDKDestination*)untag_ptr(orig); - LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); - *ret_copy = Destination_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKMessageSendEvent* orig_conv = (LDKMessageSendEvent*)untag_ptr(orig); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_clone(orig_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1node(JNIEnv *env, jclass clz, int8_tArray a) { - LDKPublicKey a_ref; - CHECK((*env)->GetArrayLength(env, a) == 33); - (*env)->GetByteArrayRegion(env, a, 0, 33, a_ref.compressed_form); - LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); - *ret_copy = Destination_node(a_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1accept_1channel(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKAcceptChannel msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = AcceptChannel_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_accept_channel(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1blinded_1path(JNIEnv *env, jclass clz, int64_t a) { - LDKBlindedPath a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = BlindedPath_clone(&a_conv); - LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); - *ret_copy = Destination_blinded_path(a_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1accept_1channel_1v2(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKAcceptChannelV2 msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = AcceptChannelV2_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_accept_channel_v2(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKDestination* o_conv = (LDKDestination*)untag_ptr(o); - int64_t ret_conv = Destination_hash(o_conv); - return ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Destination_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKDestination* a_conv = (LDKDestination*)untag_ptr(a); - LDKDestination* b_conv = (LDKDestination*)untag_ptr(b); - jboolean ret_conv = Destination_eq(a_conv, b_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Destination_1resolve(JNIEnv *env, jclass clz, int64_t this_arg, int64_t network_graph) { - LDKDestination* this_arg_conv = (LDKDestination*)untag_ptr(this_arg); - LDKReadOnlyNetworkGraph network_graph_conv; - network_graph_conv.inner = untag_ptr(network_graph); - network_graph_conv.is_owned = ptr_is_owned(network_graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - network_graph_conv.is_owned = false; - Destination_resolve(this_arg_conv, &network_graph_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SendSuccess_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKSendSuccess this_ptr_conv = *(LDKSendSuccess*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - SendSuccess_free(this_ptr_conv); -} - -static inline uint64_t SendSuccess_clone_ptr(LDKSendSuccess *NONNULL_PTR arg) { - LDKSendSuccess *ret_copy = MALLOC(sizeof(LDKSendSuccess), "LDKSendSuccess"); - *ret_copy = SendSuccess_clone(arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1open_1channel(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKOpenChannel msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = OpenChannel_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_open_channel(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendSuccess_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKSendSuccess* arg_conv = (LDKSendSuccess*)untag_ptr(arg); - int64_t ret_conv = SendSuccess_clone_ptr(arg_conv); - return ret_conv; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendSuccess_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKSendSuccess* orig_conv = (LDKSendSuccess*)untag_ptr(orig); - LDKSendSuccess *ret_copy = MALLOC(sizeof(LDKSendSuccess), "LDKSendSuccess"); - *ret_copy = SendSuccess_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1open_1channel_1v2(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKOpenChannelV2 msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = OpenChannelV2_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_open_channel_v2(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendSuccess_1buffered(JNIEnv *env, jclass clz) { - LDKSendSuccess *ret_copy = MALLOC(sizeof(LDKSendSuccess), "LDKSendSuccess"); - *ret_copy = SendSuccess_buffered(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1funding_1created(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKFundingCreated msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = FundingCreated_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_funding_created(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendSuccess_1buffered_1awaiting_1connection(JNIEnv *env, jclass clz, int8_tArray a) { - LDKPublicKey a_ref; - CHECK((*env)->GetArrayLength(env, a) == 33); - (*env)->GetByteArrayRegion(env, a, 0, 33, a_ref.compressed_form); - LDKSendSuccess *ret_copy = MALLOC(sizeof(LDKSendSuccess), "LDKSendSuccess"); - *ret_copy = SendSuccess_buffered_awaiting_connection(a_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1funding_1signed(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKFundingSigned msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = FundingSigned_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_funding_signed(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendSuccess_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKSendSuccess* o_conv = (LDKSendSuccess*)untag_ptr(o); - int64_t ret_conv = SendSuccess_hash(o_conv); - return ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SendSuccess_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKSendSuccess* a_conv = (LDKSendSuccess*)untag_ptr(a); - LDKSendSuccess* b_conv = (LDKSendSuccess*)untag_ptr(b); - jboolean ret_conv = SendSuccess_eq(a_conv, b_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SendError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKSendError this_ptr_conv = *(LDKSendError*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - SendError_free(this_ptr_conv); -} - -static inline uint64_t SendError_clone_ptr(LDKSendError *NONNULL_PTR arg) { - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_clone(arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1stfu(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKStfu msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = Stfu_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_stfu(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKSendError* arg_conv = (LDKSendError*)untag_ptr(arg); - int64_t ret_conv = SendError_clone_ptr(arg_conv); - return ret_conv; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKSendError* orig_conv = (LDKSendError*)untag_ptr(orig); - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1splice_1init(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKSpliceInit msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = SpliceInit_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_splice_init(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1secp256k1(JNIEnv *env, jclass clz, jclass a) { - LDKSecp256k1Error a_conv = LDKSecp256k1Error_from_java(env, a); - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_secp256k1(a_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1splice_1ack(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKSpliceAck msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = SpliceAck_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_splice_ack(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1too_1big_1packet(JNIEnv *env, jclass clz) { - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_too_big_packet(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1splice_1locked(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKSpliceLocked msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = SpliceLocked_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_splice_locked(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1too_1few_1blinded_1hops(JNIEnv *env, jclass clz) { - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_too_few_blinded_hops(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1add_1input(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKTxAddInput msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = TxAddInput_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_tx_add_input(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1invalid_1first_1hop(JNIEnv *env, jclass clz, int8_tArray a) { - LDKPublicKey a_ref; - CHECK((*env)->GetArrayLength(env, a) == 33); - (*env)->GetByteArrayRegion(env, a, 0, 33, a_ref.compressed_form); - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_invalid_first_hop(a_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1add_1output(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKTxAddOutput msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = TxAddOutput_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_tx_add_output(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1path_1not_1found(JNIEnv *env, jclass clz) { - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_path_not_found(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1remove_1input(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKTxRemoveInput msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = TxRemoveInput_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_tx_remove_input(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1invalid_1message(JNIEnv *env, jclass clz) { - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_invalid_message(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1remove_1output(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKTxRemoveOutput msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = TxRemoveOutput_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_tx_remove_output(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1buffer_1full(JNIEnv *env, jclass clz) { - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_buffer_full(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1complete(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKTxComplete msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = TxComplete_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_tx_complete(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1get_1node_1id_1failed(JNIEnv *env, jclass clz) { - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_get_node_id_failed(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1signatures(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKTxSignatures msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = TxSignatures_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_tx_signatures(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1unresolved_1introduction_1node(JNIEnv *env, jclass clz) { - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_unresolved_introduction_node(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1init_1rbf(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKTxInitRbf msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = TxInitRbf_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_tx_init_rbf(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1blinded_1path_1advance_1failed(JNIEnv *env, jclass clz) { - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_blinded_path_advance_failed(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1ack_1rbf(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKTxAckRbf msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = TxAckRbf_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_tx_ack_rbf(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKSendError* o_conv = (LDKSendError*)untag_ptr(o); - int64_t ret_conv = SendError_hash(o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1abort(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKTxAbort msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = TxAbort_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_tx_abort(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SendError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKSendError* a_conv = (LDKSendError*)untag_ptr(a); - LDKSendError* b_conv = (LDKSendError*)untag_ptr(b); - jboolean ret_conv = SendError_eq(a_conv, b_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1ready(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKChannelReady msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = ChannelReady_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_channel_ready(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKCustomOnionMessageHandler this_ptr_conv = *(LDKCustomOnionMessageHandler*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - CustomOnionMessageHandler_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1announcement_1signatures(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKAnnouncementSignatures msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = AnnouncementSignatures_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_announcement_signatures(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeeledOnion_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKPeeledOnion this_ptr_conv = *(LDKPeeledOnion*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - PeeledOnion_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1update_1htlcs(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t updates) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKCommitmentUpdate updates_conv; + updates_conv.inner = untag_ptr(updates); + updates_conv.is_owned = ptr_is_owned(updates); + CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv); + updates_conv = CommitmentUpdate_clone(&updates_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_update_htlcs(node_id_ref, updates_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -static inline uint64_t PeeledOnion_clone_ptr(LDKPeeledOnion *NONNULL_PTR arg) { - LDKPeeledOnion *ret_copy = MALLOC(sizeof(LDKPeeledOnion), "LDKPeeledOnion"); - *ret_copy = PeeledOnion_clone(arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1revoke_1and_1ack(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKRevokeAndACK msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = RevokeAndACK_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_revoke_and_ack(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeeledOnion_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKPeeledOnion* arg_conv = (LDKPeeledOnion*)untag_ptr(arg); - int64_t ret_conv = PeeledOnion_clone_ptr(arg_conv); - return ret_conv; + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1closing_1signed(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKClosingSigned msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = ClosingSigned_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_closing_signed(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeeledOnion_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPeeledOnion* orig_conv = (LDKPeeledOnion*)untag_ptr(orig); - LDKPeeledOnion *ret_copy = MALLOC(sizeof(LDKPeeledOnion), "LDKPeeledOnion"); - *ret_copy = PeeledOnion_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1shutdown(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKShutdown msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = Shutdown_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_shutdown(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeeledOnion_1forward(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKNextMessageHop a_conv = *(LDKNextMessageHop*)(a_ptr); - a_conv = NextMessageHop_clone((LDKNextMessageHop*)untag_ptr(a)); - LDKOnionMessage b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv = OnionMessage_clone(&b_conv); - LDKPeeledOnion *ret_copy = MALLOC(sizeof(LDKPeeledOnion), "LDKPeeledOnion"); - *ret_copy = PeeledOnion_forward(a_conv, b_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1reestablish(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKChannelReestablish msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = ChannelReestablish_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_channel_reestablish(node_id_ref, msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeeledOnion_1receive(JNIEnv *env, jclass clz, int64_t a, int8_tArray b, int64_t c) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKParsedOnionMessageContents a_conv = *(LDKParsedOnionMessageContents*)(a_ptr); - a_conv = ParsedOnionMessageContents_clone((LDKParsedOnionMessageContents*)untag_ptr(a)); - LDKThirtyTwoBytes b_ref; - CHECK((*env)->GetArrayLength(env, b) == 32); - (*env)->GetByteArrayRegion(env, b, 0, 32, b_ref.data); - LDKBlindedPath c_conv; - c_conv.inner = untag_ptr(c); - c_conv.is_owned = ptr_is_owned(c); - CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv); - c_conv = BlindedPath_clone(&c_conv); - LDKPeeledOnion *ret_copy = MALLOC(sizeof(LDKPeeledOnion), "LDKPeeledOnion"); - *ret_copy = PeeledOnion_receive(a_conv, b_ref, c_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1announcement(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg, int64_t update_msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKChannelAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = ChannelAnnouncement_clone(&msg_conv); + LDKChannelUpdate update_msg_conv; + update_msg_conv.inner = untag_ptr(update_msg); + update_msg_conv.is_owned = ptr_is_owned(update_msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv); + update_msg_conv = ChannelUpdate_clone(&update_msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_channel_announcement(node_id_ref, msg_conv, update_msg_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1onion_1message_1resolving_1destination(JNIEnv *env, jclass clz, int64_t entropy_source, int64_t node_signer, int64_t node_id_lookup, int64_t network_graph, int64_t path, int64_t contents, int64_t reply_path) { - void* entropy_source_ptr = untag_ptr(entropy_source); - if (ptr_is_owned(entropy_source)) { CHECK_ACCESS(entropy_source_ptr); } - LDKEntropySource* entropy_source_conv = (LDKEntropySource*)entropy_source_ptr; - void* node_signer_ptr = untag_ptr(node_signer); - if (ptr_is_owned(node_signer)) { CHECK_ACCESS(node_signer_ptr); } - LDKNodeSigner* node_signer_conv = (LDKNodeSigner*)node_signer_ptr; - void* node_id_lookup_ptr = untag_ptr(node_id_lookup); - if (ptr_is_owned(node_id_lookup)) { CHECK_ACCESS(node_id_lookup_ptr); } - LDKNodeIdLookUp* node_id_lookup_conv = (LDKNodeIdLookUp*)node_id_lookup_ptr; - LDKReadOnlyNetworkGraph network_graph_conv; - network_graph_conv.inner = untag_ptr(network_graph); - network_graph_conv.is_owned = ptr_is_owned(network_graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - network_graph_conv.is_owned = false; - LDKOnionMessagePath path_conv; - path_conv.inner = untag_ptr(path); - path_conv.is_owned = ptr_is_owned(path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); - path_conv = OnionMessagePath_clone(&path_conv); - void* contents_ptr = untag_ptr(contents); - CHECK_ACCESS(contents_ptr); - LDKOnionMessageContents contents_conv = *(LDKOnionMessageContents*)(contents_ptr); - if (contents_conv.free == LDKOnionMessageContents_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKOnionMessageContents_JCalls_cloned(&contents_conv); - } - LDKBlindedPath reply_path_conv; - reply_path_conv.inner = untag_ptr(reply_path); - reply_path_conv.is_owned = ptr_is_owned(reply_path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(reply_path_conv); - reply_path_conv = BlindedPath_clone(&reply_path_conv); - LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ), "LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ"); - *ret_conv = create_onion_message_resolving_destination(entropy_source_conv, node_signer_conv, node_id_lookup_conv, &network_graph_conv, path_conv, contents_conv, reply_path_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1channel_1announcement(JNIEnv *env, jclass clz, int64_t msg, int64_t update_msg) { + LDKChannelAnnouncement msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = ChannelAnnouncement_clone(&msg_conv); + LDKChannelUpdate update_msg_conv; + update_msg_conv.inner = untag_ptr(update_msg); + update_msg_conv.is_owned = ptr_is_owned(update_msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv); + update_msg_conv = ChannelUpdate_clone(&update_msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_broadcast_channel_announcement(msg_conv, update_msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1onion_1message(JNIEnv *env, jclass clz, int64_t entropy_source, int64_t node_signer, int64_t node_id_lookup, int64_t path, int64_t contents, int64_t reply_path) { - void* entropy_source_ptr = untag_ptr(entropy_source); - if (ptr_is_owned(entropy_source)) { CHECK_ACCESS(entropy_source_ptr); } - LDKEntropySource* entropy_source_conv = (LDKEntropySource*)entropy_source_ptr; - void* node_signer_ptr = untag_ptr(node_signer); - if (ptr_is_owned(node_signer)) { CHECK_ACCESS(node_signer_ptr); } - LDKNodeSigner* node_signer_conv = (LDKNodeSigner*)node_signer_ptr; - void* node_id_lookup_ptr = untag_ptr(node_id_lookup); - if (ptr_is_owned(node_id_lookup)) { CHECK_ACCESS(node_id_lookup_ptr); } - LDKNodeIdLookUp* node_id_lookup_conv = (LDKNodeIdLookUp*)node_id_lookup_ptr; - LDKOnionMessagePath path_conv; - path_conv.inner = untag_ptr(path); - path_conv.is_owned = ptr_is_owned(path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); - path_conv = OnionMessagePath_clone(&path_conv); - void* contents_ptr = untag_ptr(contents); - CHECK_ACCESS(contents_ptr); - LDKOnionMessageContents contents_conv = *(LDKOnionMessageContents*)(contents_ptr); - if (contents_conv.free == LDKOnionMessageContents_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKOnionMessageContents_JCalls_cloned(&contents_conv); - } - LDKBlindedPath reply_path_conv; - reply_path_conv.inner = untag_ptr(reply_path); - reply_path_conv.is_owned = ptr_is_owned(reply_path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(reply_path_conv); - reply_path_conv = BlindedPath_clone(&reply_path_conv); - LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ), "LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ"); - *ret_conv = create_onion_message(entropy_source_conv, node_signer_conv, node_id_lookup_conv, path_conv, contents_conv, reply_path_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1channel_1update(JNIEnv *env, jclass clz, int64_t msg) { + LDKChannelUpdate msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = ChannelUpdate_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_broadcast_channel_update(msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_peel_1onion_1message(JNIEnv *env, jclass clz, int64_t msg, int64_t node_signer, int64_t logger, int64_t custom_handler) { - LDKOnionMessage msg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1node_1announcement(JNIEnv *env, jclass clz, int64_t msg) { + LDKNodeAnnouncement msg_conv; msg_conv.inner = untag_ptr(msg); msg_conv.is_owned = ptr_is_owned(msg); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - void* custom_handler_ptr = untag_ptr(custom_handler); - CHECK_ACCESS(custom_handler_ptr); - LDKCustomOnionMessageHandler custom_handler_conv = *(LDKCustomOnionMessageHandler*)(custom_handler_ptr); - if (custom_handler_conv.free == LDKCustomOnionMessageHandler_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKCustomOnionMessageHandler_JCalls_cloned(&custom_handler_conv); - } - LDKCResult_PeeledOnionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PeeledOnionNoneZ), "LDKCResult_PeeledOnionNoneZ"); - *ret_conv = peel_onion_message(&msg_conv, node_signer_conv, logger_conv, custom_handler_conv); - return tag_ptr(ret_conv, true); + msg_conv = NodeAnnouncement_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_broadcast_node_announcement(msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1new(JNIEnv *env, jclass clz, int64_t entropy_source, int64_t node_signer, int64_t logger, int64_t node_id_lookup, int64_t message_router, int64_t offers_handler, int64_t custom_handler) { - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - void* node_id_lookup_ptr = untag_ptr(node_id_lookup); - CHECK_ACCESS(node_id_lookup_ptr); - LDKNodeIdLookUp node_id_lookup_conv = *(LDKNodeIdLookUp*)(node_id_lookup_ptr); - if (node_id_lookup_conv.free == LDKNodeIdLookUp_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeIdLookUp_JCalls_cloned(&node_id_lookup_conv); - } - void* message_router_ptr = untag_ptr(message_router); - CHECK_ACCESS(message_router_ptr); - LDKMessageRouter message_router_conv = *(LDKMessageRouter*)(message_router_ptr); - if (message_router_conv.free == LDKMessageRouter_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKMessageRouter_JCalls_cloned(&message_router_conv); - } - void* offers_handler_ptr = untag_ptr(offers_handler); - CHECK_ACCESS(offers_handler_ptr); - LDKOffersMessageHandler offers_handler_conv = *(LDKOffersMessageHandler*)(offers_handler_ptr); - if (offers_handler_conv.free == LDKOffersMessageHandler_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKOffersMessageHandler_JCalls_cloned(&offers_handler_conv); - } - void* custom_handler_ptr = untag_ptr(custom_handler); - CHECK_ACCESS(custom_handler_ptr); - LDKCustomOnionMessageHandler custom_handler_conv = *(LDKCustomOnionMessageHandler*)(custom_handler_ptr); - if (custom_handler_conv.free == LDKCustomOnionMessageHandler_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKCustomOnionMessageHandler_JCalls_cloned(&custom_handler_conv); - } - LDKOnionMessenger ret_var = OnionMessenger_new(entropy_source_conv, node_signer_conv, logger_conv, node_id_lookup_conv, message_router_conv, offers_handler_conv, custom_handler_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1update(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKChannelUpdate msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = ChannelUpdate_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_channel_update(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1send_1onion_1message(JNIEnv *env, jclass clz, int64_t this_arg, int64_t contents, int64_t destination, int64_t reply_path) { - LDKOnionMessenger this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - void* contents_ptr = untag_ptr(contents); - CHECK_ACCESS(contents_ptr); - LDKOnionMessageContents contents_conv = *(LDKOnionMessageContents*)(contents_ptr); - if (contents_conv.free == LDKOnionMessageContents_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKOnionMessageContents_JCalls_cloned(&contents_conv); - } - void* destination_ptr = untag_ptr(destination); - CHECK_ACCESS(destination_ptr); - LDKDestination destination_conv = *(LDKDestination*)(destination_ptr); - destination_conv = Destination_clone((LDKDestination*)untag_ptr(destination)); - LDKBlindedPath reply_path_conv; - reply_path_conv.inner = untag_ptr(reply_path); - reply_path_conv.is_owned = ptr_is_owned(reply_path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(reply_path_conv); - reply_path_conv = BlindedPath_clone(&reply_path_conv); - LDKCResult_SendSuccessSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SendSuccessSendErrorZ), "LDKCResult_SendSuccessSendErrorZ"); - *ret_conv = OnionMessenger_send_onion_message(&this_arg_conv, contents_conv, destination_conv, reply_path_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1handle_1error(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t action) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + void* action_ptr = untag_ptr(action); + CHECK_ACCESS(action_ptr); + LDKErrorAction action_conv = *(LDKErrorAction*)(action_ptr); + action_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(action)); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_handle_error(node_id_ref, action_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1as_1OnionMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOnionMessenger this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKOnionMessageHandler* ret_ret = MALLOC(sizeof(LDKOnionMessageHandler), "LDKOnionMessageHandler"); - *ret_ret = OnionMessenger_as_OnionMessageHandler(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1range_1query(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKQueryChannelRange msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = QueryChannelRange_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_channel_range_query(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OffersMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1short_1ids_1query(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKQueryShortChannelIds msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = QueryShortChannelIds_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_short_ids_query(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1reply_1channel_1range(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKReplyChannelRange msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = ReplyChannelRange_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_reply_channel_range(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1gossip_1timestamp_1filter(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + LDKGossipTimestampFilter msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = GossipTimestampFilter_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_gossip_timestamp_filter(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); CHECK_ACCESS(this_ptr_ptr); - LDKOffersMessageHandler this_ptr_conv = *(LDKOffersMessageHandler*)(this_ptr_ptr); + LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - OffersMessageHandler_free(this_ptr_conv); + MessageSendEventsProvider_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OffersMessage_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); CHECK_ACCESS(this_ptr_ptr); - LDKOffersMessage this_ptr_conv = *(LDKOffersMessage*)(this_ptr_ptr); + LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - OffersMessage_free(this_ptr_conv); -} - -static inline uint64_t OffersMessage_clone_ptr(LDKOffersMessage *NONNULL_PTR arg) { - LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); - *ret_copy = OffersMessage_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKOffersMessage* arg_conv = (LDKOffersMessage*)untag_ptr(arg); - int64_t ret_conv = OffersMessage_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessage_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKOffersMessage* orig_conv = (LDKOffersMessage*)untag_ptr(orig); - LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); - *ret_copy = OffersMessage_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + EventsProvider_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessage_1invoice_1request(JNIEnv *env, jclass clz, int64_t a) { - LDKInvoiceRequest a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = InvoiceRequest_clone(&a_conv); - LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); - *ret_copy = OffersMessage_invoice_request(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplayEvent_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKReplayEvent this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ReplayEvent_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessage_1invoice(JNIEnv *env, jclass clz, int64_t a) { - LDKBolt12Invoice a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = Bolt12Invoice_clone(&a_conv); - LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); - *ret_copy = OffersMessage_invoice(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplayEvent_1new(JNIEnv *env, jclass clz) { + LDKReplayEvent ret_var = ReplayEvent_new(); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessage_1invoice_1error(JNIEnv *env, jclass clz, int64_t a) { - LDKInvoiceError a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = InvoiceError_clone(&a_conv); - LDKOffersMessage *ret_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); - *ret_copy = OffersMessage_invoice_error(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +static inline uint64_t ReplayEvent_clone_ptr(LDKReplayEvent *NONNULL_PTR arg) { + LDKReplayEvent ret_var = ReplayEvent_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OffersMessage_1is_1known_1type(JNIEnv *env, jclass clz, int64_t tlv_type) { - jboolean ret_conv = OffersMessage_is_known_type(tlv_type); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplayEvent_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKReplayEvent arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = ReplayEvent_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessage_1as_1OnionMessageContents(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOffersMessage* this_arg_conv = (LDKOffersMessage*)untag_ptr(this_arg); - LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); - *ret_ret = OffersMessage_as_OnionMessageContents(this_arg_conv); - return tag_ptr(ret_ret, true); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OffersMessage_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKOffersMessage* obj_conv = (LDKOffersMessage*)untag_ptr(obj); - LDKCVec_u8Z ret_var = OffersMessage_write(obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplayEvent_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKReplayEvent orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKReplayEvent ret_var = ReplayEvent_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessage_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg_a, int64_t arg_b) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - void* arg_b_ptr = untag_ptr(arg_b); - if (ptr_is_owned(arg_b)) { CHECK_ACCESS(arg_b_ptr); } - LDKLogger* arg_b_conv = (LDKLogger*)arg_b_ptr; - LDKCResult_OffersMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersMessageDecodeErrorZ), "LDKCResult_OffersMessageDecodeErrorZ"); - *ret_conv = OffersMessage_read(ser_ref, arg_a, arg_b_conv); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKEventHandler this_ptr_conv = *(LDKEventHandler*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + EventHandler_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Packet_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKPacket this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKAnchorDescriptor this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Packet_free(this_obj_conv); -} - -JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_Packet_1get_1version(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPacket this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_t ret_conv = Packet_get_version(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Packet_1set_1version(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) { - LDKPacket this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - Packet_set_version(&this_ptr_conv, val); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Packet_1get_1public_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPacket this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Packet_get_public_key(&this_ptr_conv).compressed_form); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Packet_1set_1public_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKPacket this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - Packet_set_public_key(&this_ptr_conv, val_ref); + AnchorDescriptor_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Packet_1get_1hop_1data(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPacket this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1get_1channel_1derivation_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAnchorDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u8Z ret_var = Packet_get_hop_data(&this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; + LDKChannelDerivationParameters ret_var = AnchorDescriptor_get_channel_derivation_parameters(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Packet_1set_1hop_1data(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKPacket this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1set_1channel_1derivation_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKAnchorDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u8Z val_ref; - val_ref.datalen = (*env)->GetArrayLength(env, val); - val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data); - Packet_set_hop_data(&this_ptr_conv, val_ref); + LDKChannelDerivationParameters val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelDerivationParameters_clone(&val_conv); + AnchorDescriptor_set_channel_derivation_parameters(&this_ptr_conv, val_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Packet_1get_1hmac(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPacket this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAnchorDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *Packet_get_hmac(&this_ptr_conv)); - return ret_arr; + LDKOutPoint ret_var = AnchorDescriptor_get_outpoint(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Packet_1set_1hmac(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKPacket this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKAnchorDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - Packet_set_hmac(&this_ptr_conv, val_ref); + LDKOutPoint val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = OutPoint_clone(&val_conv); + AnchorDescriptor_set_outpoint(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Packet_1new(JNIEnv *env, jclass clz, int8_t version_arg, int8_tArray public_key_arg, int8_tArray hop_data_arg, int8_tArray hmac_arg) { - LDKPublicKey public_key_arg_ref; - CHECK((*env)->GetArrayLength(env, public_key_arg) == 33); - (*env)->GetByteArrayRegion(env, public_key_arg, 0, 33, public_key_arg_ref.compressed_form); - LDKCVec_u8Z hop_data_arg_ref; - hop_data_arg_ref.datalen = (*env)->GetArrayLength(env, hop_data_arg); - hop_data_arg_ref.data = MALLOC(hop_data_arg_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, hop_data_arg, 0, hop_data_arg_ref.datalen, hop_data_arg_ref.data); - LDKThirtyTwoBytes hmac_arg_ref; - CHECK((*env)->GetArrayLength(env, hmac_arg) == 32); - (*env)->GetByteArrayRegion(env, hmac_arg, 0, 32, hmac_arg_ref.data); - LDKPacket ret_var = Packet_new(version_arg, public_key_arg_ref, hop_data_arg_ref, hmac_arg_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1new(JNIEnv *env, jclass clz, int64_t channel_derivation_parameters_arg, int64_t outpoint_arg) { + LDKChannelDerivationParameters channel_derivation_parameters_arg_conv; + channel_derivation_parameters_arg_conv.inner = untag_ptr(channel_derivation_parameters_arg); + channel_derivation_parameters_arg_conv.is_owned = ptr_is_owned(channel_derivation_parameters_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_derivation_parameters_arg_conv); + channel_derivation_parameters_arg_conv = ChannelDerivationParameters_clone(&channel_derivation_parameters_arg_conv); + LDKOutPoint outpoint_arg_conv; + outpoint_arg_conv.inner = untag_ptr(outpoint_arg); + outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); + outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); + LDKAnchorDescriptor ret_var = AnchorDescriptor_new(channel_derivation_parameters_arg_conv, outpoint_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t Packet_clone_ptr(LDKPacket *NONNULL_PTR arg) { - LDKPacket ret_var = Packet_clone(arg); +static inline uint64_t AnchorDescriptor_clone_ptr(LDKAnchorDescriptor *NONNULL_PTR arg) { + LDKAnchorDescriptor ret_var = AnchorDescriptor_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Packet_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKPacket arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKAnchorDescriptor arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Packet_clone_ptr(&arg_conv); + int64_t ret_conv = AnchorDescriptor_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Packet_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPacket orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKAnchorDescriptor orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKPacket ret_var = Packet_clone(&orig_conv); + LDKAnchorDescriptor ret_var = AnchorDescriptor_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Packet_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKPacket o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv.is_owned = false; - int64_t ret_conv = Packet_hash(&o_conv); - return ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Packet_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKPacket a_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKAnchorDescriptor a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKPacket b_conv; + LDKAnchorDescriptor b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = Packet_eq(&a_conv, &b_conv); + jboolean ret_conv = AnchorDescriptor_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Packet_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKPacket obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = Packet_write(&obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1previous_1utxo(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKAnchorDescriptor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = AnchorDescriptor_previous_utxo(&this_arg_conv); + return tag_ptr(ret_ref, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1unsigned_1tx_1input(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKAnchorDescriptor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKTxIn* ret_ref = MALLOC(sizeof(LDKTxIn), "LDKTxIn"); + *ret_ref = AnchorDescriptor_unsigned_tx_input(&this_arg_conv); + return tag_ptr(ret_ref, true); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1witness_1script(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKAnchorDescriptor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_u8Z ret_var = AnchorDescriptor_witness_script(&this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1tx_1input_1witness(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray signature) { + LDKAnchorDescriptor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKECDSASignature signature_ref; + CHECK((*env)->GetArrayLength(env, signature) == 64); + (*env)->GetByteArrayRegion(env, signature, 0, 64, signature_ref.compact_form); + LDKWitness ret_var = AnchorDescriptor_tx_input_witness(&this_arg_conv, signature_ref); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + Witness_free(ret_var); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1derive_1channel_1signer(JNIEnv *env, jclass clz, int64_t this_arg, int64_t signer_provider) { + LDKAnchorDescriptor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + void* signer_provider_ptr = untag_ptr(signer_provider); + if (ptr_is_owned(signer_provider)) { CHECK_ACCESS(signer_provider_ptr); } + LDKSignerProvider* signer_provider_conv = (LDKSignerProvider*)signer_provider_ptr; + LDKEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner"); + *ret_ret = AnchorDescriptor_derive_channel_signer(&this_arg_conv, signer_provider_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BumpTransactionEvent_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); CHECK_ACCESS(this_ptr_ptr); - LDKParsedOnionMessageContents this_ptr_conv = *(LDKParsedOnionMessageContents*)(this_ptr_ptr); + LDKBumpTransactionEvent this_ptr_conv = *(LDKBumpTransactionEvent*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - ParsedOnionMessageContents_free(this_ptr_conv); + BumpTransactionEvent_free(this_ptr_conv); } -static inline uint64_t ParsedOnionMessageContents_clone_ptr(LDKParsedOnionMessageContents *NONNULL_PTR arg) { - LDKParsedOnionMessageContents *ret_copy = MALLOC(sizeof(LDKParsedOnionMessageContents), "LDKParsedOnionMessageContents"); - *ret_copy = ParsedOnionMessageContents_clone(arg); +static inline uint64_t BumpTransactionEvent_clone_ptr(LDKBumpTransactionEvent *NONNULL_PTR arg) { + LDKBumpTransactionEvent *ret_copy = MALLOC(sizeof(LDKBumpTransactionEvent), "LDKBumpTransactionEvent"); + *ret_copy = BumpTransactionEvent_clone(arg); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKParsedOnionMessageContents* arg_conv = (LDKParsedOnionMessageContents*)untag_ptr(arg); - int64_t ret_conv = ParsedOnionMessageContents_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BumpTransactionEvent_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBumpTransactionEvent* arg_conv = (LDKBumpTransactionEvent*)untag_ptr(arg); + int64_t ret_conv = BumpTransactionEvent_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKParsedOnionMessageContents* orig_conv = (LDKParsedOnionMessageContents*)untag_ptr(orig); - LDKParsedOnionMessageContents *ret_copy = MALLOC(sizeof(LDKParsedOnionMessageContents), "LDKParsedOnionMessageContents"); - *ret_copy = ParsedOnionMessageContents_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BumpTransactionEvent_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBumpTransactionEvent* orig_conv = (LDKBumpTransactionEvent*)untag_ptr(orig); + LDKBumpTransactionEvent *ret_copy = MALLOC(sizeof(LDKBumpTransactionEvent), "LDKBumpTransactionEvent"); + *ret_copy = BumpTransactionEvent_clone(orig_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1offers(JNIEnv *env, jclass clz, int64_t a) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKOffersMessage a_conv = *(LDKOffersMessage*)(a_ptr); - a_conv = OffersMessage_clone((LDKOffersMessage*)untag_ptr(a)); - LDKParsedOnionMessageContents *ret_copy = MALLOC(sizeof(LDKParsedOnionMessageContents), "LDKParsedOnionMessageContents"); - *ret_copy = ParsedOnionMessageContents_offers(a_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BumpTransactionEvent_1channel_1close(JNIEnv *env, jclass clz, int64_t channel_id, int8_tArray counterparty_node_id, int8_tArray claim_id, int32_t package_target_feerate_sat_per_1000_weight, int8_tArray commitment_tx, int64_t commitment_tx_fee_satoshis, int64_t anchor_descriptor, int64_tArray pending_htlcs) { + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); + LDKPublicKey counterparty_node_id_ref; + CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); + (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); + LDKThirtyTwoBytes claim_id_ref; + CHECK((*env)->GetArrayLength(env, claim_id) == 32); + (*env)->GetByteArrayRegion(env, claim_id, 0, 32, claim_id_ref.data); + LDKTransaction commitment_tx_ref; + commitment_tx_ref.datalen = (*env)->GetArrayLength(env, commitment_tx); + commitment_tx_ref.data = MALLOC(commitment_tx_ref.datalen, "LDKTransaction Bytes"); + (*env)->GetByteArrayRegion(env, commitment_tx, 0, commitment_tx_ref.datalen, commitment_tx_ref.data); + commitment_tx_ref.data_is_owned = true; + LDKAnchorDescriptor anchor_descriptor_conv; + anchor_descriptor_conv.inner = untag_ptr(anchor_descriptor); + anchor_descriptor_conv.is_owned = ptr_is_owned(anchor_descriptor); + CHECK_INNER_FIELD_ACCESS_OR_NULL(anchor_descriptor_conv); + anchor_descriptor_conv = AnchorDescriptor_clone(&anchor_descriptor_conv); + LDKCVec_HTLCOutputInCommitmentZ pending_htlcs_constr; + pending_htlcs_constr.datalen = (*env)->GetArrayLength(env, pending_htlcs); + if (pending_htlcs_constr.datalen > 0) + pending_htlcs_constr.data = MALLOC(pending_htlcs_constr.datalen * sizeof(LDKHTLCOutputInCommitment), "LDKCVec_HTLCOutputInCommitmentZ Elements"); + else + pending_htlcs_constr.data = NULL; + int64_t* pending_htlcs_vals = (*env)->GetLongArrayElements (env, pending_htlcs, NULL); + for (size_t y = 0; y < pending_htlcs_constr.datalen; y++) { + int64_t pending_htlcs_conv_24 = pending_htlcs_vals[y]; + LDKHTLCOutputInCommitment pending_htlcs_conv_24_conv; + pending_htlcs_conv_24_conv.inner = untag_ptr(pending_htlcs_conv_24); + pending_htlcs_conv_24_conv.is_owned = ptr_is_owned(pending_htlcs_conv_24); + CHECK_INNER_FIELD_ACCESS_OR_NULL(pending_htlcs_conv_24_conv); + pending_htlcs_conv_24_conv = HTLCOutputInCommitment_clone(&pending_htlcs_conv_24_conv); + pending_htlcs_constr.data[y] = pending_htlcs_conv_24_conv; + } + (*env)->ReleaseLongArrayElements(env, pending_htlcs, pending_htlcs_vals, 0); + LDKBumpTransactionEvent *ret_copy = MALLOC(sizeof(LDKBumpTransactionEvent), "LDKBumpTransactionEvent"); + *ret_copy = BumpTransactionEvent_channel_close(channel_id_conv, counterparty_node_id_ref, claim_id_ref, package_target_feerate_sat_per_1000_weight, commitment_tx_ref, commitment_tx_fee_satoshis, anchor_descriptor_conv, pending_htlcs_constr); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1custom(JNIEnv *env, jclass clz, int64_t a) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKOnionMessageContents a_conv = *(LDKOnionMessageContents*)(a_ptr); - if (a_conv.free == LDKOnionMessageContents_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKOnionMessageContents_JCalls_cloned(&a_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BumpTransactionEvent_1htlcresolution(JNIEnv *env, jclass clz, int64_t channel_id, int8_tArray counterparty_node_id, int8_tArray claim_id, int32_t target_feerate_sat_per_1000_weight, int64_tArray htlc_descriptors, int32_t tx_lock_time) { + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); + LDKPublicKey counterparty_node_id_ref; + CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); + (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); + LDKThirtyTwoBytes claim_id_ref; + CHECK((*env)->GetArrayLength(env, claim_id) == 32); + (*env)->GetByteArrayRegion(env, claim_id, 0, 32, claim_id_ref.data); + LDKCVec_HTLCDescriptorZ htlc_descriptors_constr; + htlc_descriptors_constr.datalen = (*env)->GetArrayLength(env, htlc_descriptors); + if (htlc_descriptors_constr.datalen > 0) + htlc_descriptors_constr.data = MALLOC(htlc_descriptors_constr.datalen * sizeof(LDKHTLCDescriptor), "LDKCVec_HTLCDescriptorZ Elements"); + else + htlc_descriptors_constr.data = NULL; + int64_t* htlc_descriptors_vals = (*env)->GetLongArrayElements (env, htlc_descriptors, NULL); + for (size_t q = 0; q < htlc_descriptors_constr.datalen; q++) { + int64_t htlc_descriptors_conv_16 = htlc_descriptors_vals[q]; + LDKHTLCDescriptor htlc_descriptors_conv_16_conv; + htlc_descriptors_conv_16_conv.inner = untag_ptr(htlc_descriptors_conv_16); + htlc_descriptors_conv_16_conv.is_owned = ptr_is_owned(htlc_descriptors_conv_16); + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_descriptors_conv_16_conv); + htlc_descriptors_conv_16_conv = HTLCDescriptor_clone(&htlc_descriptors_conv_16_conv); + htlc_descriptors_constr.data[q] = htlc_descriptors_conv_16_conv; } - LDKParsedOnionMessageContents *ret_copy = MALLOC(sizeof(LDKParsedOnionMessageContents), "LDKParsedOnionMessageContents"); - *ret_copy = ParsedOnionMessageContents_custom(a_conv); + (*env)->ReleaseLongArrayElements(env, htlc_descriptors, htlc_descriptors_vals, 0); + LDKBumpTransactionEvent *ret_copy = MALLOC(sizeof(LDKBumpTransactionEvent), "LDKBumpTransactionEvent"); + *ret_copy = BumpTransactionEvent_htlcresolution(channel_id_conv, counterparty_node_id_ref, claim_id_ref, target_feerate_sat_per_1000_weight, htlc_descriptors_constr, tx_lock_time); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1as_1OnionMessageContents(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKParsedOnionMessageContents* this_arg_conv = (LDKParsedOnionMessageContents*)untag_ptr(this_arg); - LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); - *ret_ret = ParsedOnionMessageContents_as_OnionMessageContents(this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BumpTransactionEvent_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKBumpTransactionEvent* a_conv = (LDKBumpTransactionEvent*)untag_ptr(a); + LDKBumpTransactionEvent* b_conv = (LDKBumpTransactionEvent*)untag_ptr(b); + jboolean ret_conv = BumpTransactionEvent_eq(a_conv, b_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKParsedOnionMessageContents* obj_conv = (LDKParsedOnionMessageContents*)untag_ptr(obj); - LDKCVec_u8Z ret_var = ParsedOnionMessageContents_write(obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -static inline uint64_t OnionMessageContents_clone_ptr(LDKOnionMessageContents *NONNULL_PTR arg) { - LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); - *ret_ret = OnionMessageContents_clone(arg); - return tag_ptr(ret_ret, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - void* arg_ptr = untag_ptr(arg); - if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); } - LDKOnionMessageContents* arg_conv = (LDKOnionMessageContents*)arg_ptr; - int64_t ret_conv = OnionMessageContents_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1clone(JNIEnv *env, jclass clz, int64_t orig) { - void* orig_ptr = untag_ptr(orig); - if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); } - LDKOnionMessageContents* orig_conv = (LDKOnionMessageContents*)orig_ptr; - LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); - *ret_ret = OnionMessageContents_clone(orig_conv); - return tag_ptr(ret_ret, true); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKOnionMessageContents this_ptr_conv = *(LDKOnionMessageContents*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - OnionMessageContents_free(this_ptr_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKNextMessageHop this_ptr_conv = *(LDKNextMessageHop*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - NextMessageHop_free(this_ptr_conv); -} - -static inline uint64_t NextMessageHop_clone_ptr(LDKNextMessageHop *NONNULL_PTR arg) { - LDKNextMessageHop *ret_copy = MALLOC(sizeof(LDKNextMessageHop), "LDKNextMessageHop"); - *ret_copy = NextMessageHop_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKNextMessageHop* arg_conv = (LDKNextMessageHop*)untag_ptr(arg); - int64_t ret_conv = NextMessageHop_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKNextMessageHop* orig_conv = (LDKNextMessageHop*)untag_ptr(orig); - LDKNextMessageHop *ret_copy = MALLOC(sizeof(LDKNextMessageHop), "LDKNextMessageHop"); - *ret_copy = NextMessageHop_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1node_1id(JNIEnv *env, jclass clz, int8_tArray a) { - LDKPublicKey a_ref; - CHECK((*env)->GetArrayLength(env, a) == 33); - (*env)->GetByteArrayRegion(env, a, 0, 33, a_ref.compressed_form); - LDKNextMessageHop *ret_copy = MALLOC(sizeof(LDKNextMessageHop), "LDKNextMessageHop"); - *ret_copy = NextMessageHop_node_id(a_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t a) { - LDKNextMessageHop *ret_copy = MALLOC(sizeof(LDKNextMessageHop), "LDKNextMessageHop"); - *ret_copy = NextMessageHop_short_channel_id(a); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKNextMessageHop* o_conv = (LDKNextMessageHop*)untag_ptr(o); - int64_t ret_conv = NextMessageHop_hash(o_conv); - return ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKNextMessageHop* a_conv = (LDKNextMessageHop*)untag_ptr(a); - LDKNextMessageHop* b_conv = (LDKNextMessageHop*)untag_ptr(b); - jboolean ret_conv = NextMessageHop_eq(a_conv, b_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPath_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKBlindedPath this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Input_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInput this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BlindedPath_free(this_obj_conv); + Input_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1get_1introduction_1node(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBlindedPath this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Input_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); - *ret_copy = BlindedPath_get_introduction_node(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); + LDKOutPoint ret_var = Input_get_outpoint(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPath_1set_1introduction_1node(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKBlindedPath this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Input_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKInput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKIntroductionNode val_conv = *(LDKIntroductionNode*)(val_ptr); - val_conv = IntroductionNode_clone((LDKIntroductionNode*)untag_ptr(val)); - BlindedPath_set_introduction_node(&this_ptr_conv, val_conv); + LDKOutPoint val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = OutPoint_clone(&val_conv); + Input_set_outpoint(&this_ptr_conv, val_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedPath_1get_1blinding_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBlindedPath this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Input_1get_1previous_1utxo(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, BlindedPath_get_blinding_point(&this_ptr_conv).compressed_form); - return ret_arr; + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = Input_get_previous_utxo(&this_ptr_conv); + return tag_ptr(ret_ref, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPath_1set_1blinding_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKBlindedPath this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Input_1set_1previous_1utxo(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKInput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - BlindedPath_set_blinding_point(&this_ptr_conv, val_ref); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); + val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val)); + Input_set_previous_utxo(&this_ptr_conv, val_conv); } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_BlindedPath_1get_1blinded_1hops(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBlindedPath this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Input_1get_1satisfaction_1weight(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_BlindedHopZ ret_var = BlindedPath_get_blinded_hops(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t m = 0; m < ret_var.datalen; m++) { - LDKBlindedHop ret_conv_12_var = ret_var.data[m]; - int64_t ret_conv_12_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_var); - ret_conv_12_ref = tag_ptr(ret_conv_12_var.inner, ret_conv_12_var.is_owned); - ret_arr_ptr[m] = ret_conv_12_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; + int64_t ret_conv = Input_get_satisfaction_weight(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPath_1set_1blinded_1hops(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { - LDKBlindedPath this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Input_1set_1satisfaction_1weight(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKInput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_BlindedHopZ val_constr; - val_constr.datalen = (*env)->GetArrayLength(env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKBlindedHop), "LDKCVec_BlindedHopZ Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); - for (size_t m = 0; m < val_constr.datalen; m++) { - int64_t val_conv_12 = val_vals[m]; - LDKBlindedHop val_conv_12_conv; - val_conv_12_conv.inner = untag_ptr(val_conv_12); - val_conv_12_conv.is_owned = ptr_is_owned(val_conv_12); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_12_conv); - val_conv_12_conv = BlindedHop_clone(&val_conv_12_conv); - val_constr.data[m] = val_conv_12_conv; - } - (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); - BlindedPath_set_blinded_hops(&this_ptr_conv, val_constr); + Input_set_satisfaction_weight(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1new(JNIEnv *env, jclass clz, int64_t introduction_node_arg, int8_tArray blinding_point_arg, int64_tArray blinded_hops_arg) { - void* introduction_node_arg_ptr = untag_ptr(introduction_node_arg); - CHECK_ACCESS(introduction_node_arg_ptr); - LDKIntroductionNode introduction_node_arg_conv = *(LDKIntroductionNode*)(introduction_node_arg_ptr); - introduction_node_arg_conv = IntroductionNode_clone((LDKIntroductionNode*)untag_ptr(introduction_node_arg)); - LDKPublicKey blinding_point_arg_ref; - CHECK((*env)->GetArrayLength(env, blinding_point_arg) == 33); - (*env)->GetByteArrayRegion(env, blinding_point_arg, 0, 33, blinding_point_arg_ref.compressed_form); - LDKCVec_BlindedHopZ blinded_hops_arg_constr; - blinded_hops_arg_constr.datalen = (*env)->GetArrayLength(env, blinded_hops_arg); - if (blinded_hops_arg_constr.datalen > 0) - blinded_hops_arg_constr.data = MALLOC(blinded_hops_arg_constr.datalen * sizeof(LDKBlindedHop), "LDKCVec_BlindedHopZ Elements"); - else - blinded_hops_arg_constr.data = NULL; - int64_t* blinded_hops_arg_vals = (*env)->GetLongArrayElements (env, blinded_hops_arg, NULL); - for (size_t m = 0; m < blinded_hops_arg_constr.datalen; m++) { - int64_t blinded_hops_arg_conv_12 = blinded_hops_arg_vals[m]; - LDKBlindedHop blinded_hops_arg_conv_12_conv; - blinded_hops_arg_conv_12_conv.inner = untag_ptr(blinded_hops_arg_conv_12); - blinded_hops_arg_conv_12_conv.is_owned = ptr_is_owned(blinded_hops_arg_conv_12); - CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_hops_arg_conv_12_conv); - blinded_hops_arg_conv_12_conv = BlindedHop_clone(&blinded_hops_arg_conv_12_conv); - blinded_hops_arg_constr.data[m] = blinded_hops_arg_conv_12_conv; - } - (*env)->ReleaseLongArrayElements(env, blinded_hops_arg, blinded_hops_arg_vals, 0); - LDKBlindedPath ret_var = BlindedPath_new(introduction_node_arg_conv, blinding_point_arg_ref, blinded_hops_arg_constr); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Input_1new(JNIEnv *env, jclass clz, int64_t outpoint_arg, int64_t previous_utxo_arg, int64_t satisfaction_weight_arg) { + LDKOutPoint outpoint_arg_conv; + outpoint_arg_conv.inner = untag_ptr(outpoint_arg); + outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); + outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); + void* previous_utxo_arg_ptr = untag_ptr(previous_utxo_arg); + CHECK_ACCESS(previous_utxo_arg_ptr); + LDKTxOut previous_utxo_arg_conv = *(LDKTxOut*)(previous_utxo_arg_ptr); + previous_utxo_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(previous_utxo_arg)); + LDKInput ret_var = Input_new(outpoint_arg_conv, previous_utxo_arg_conv, satisfaction_weight_arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t BlindedPath_clone_ptr(LDKBlindedPath *NONNULL_PTR arg) { - LDKBlindedPath ret_var = BlindedPath_clone(arg); +static inline uint64_t Input_clone_ptr(LDKInput *NONNULL_PTR arg) { + LDKInput ret_var = Input_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKBlindedPath arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Input_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInput arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = BlindedPath_clone_ptr(&arg_conv); + int64_t ret_conv = Input_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBlindedPath orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Input_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKInput orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBlindedPath ret_var = BlindedPath_clone(&orig_conv); + LDKInput ret_var = Input_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKBlindedPath o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Input_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKInput o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv.is_owned = false; - int64_t ret_conv = BlindedPath_hash(&o_conv); + int64_t ret_conv = Input_hash(&o_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedPath_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKBlindedPath a_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Input_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKInput a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKBlindedPath b_conv; + LDKInput b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = BlindedPath_eq(&a_conv, &b_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKIntroductionNode this_ptr_conv = *(LDKIntroductionNode*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - IntroductionNode_free(this_ptr_conv); -} - -static inline uint64_t IntroductionNode_clone_ptr(LDKIntroductionNode *NONNULL_PTR arg) { - LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); - *ret_copy = IntroductionNode_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKIntroductionNode* arg_conv = (LDKIntroductionNode*)untag_ptr(arg); - int64_t ret_conv = IntroductionNode_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKIntroductionNode* orig_conv = (LDKIntroductionNode*)untag_ptr(orig); - LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); - *ret_copy = IntroductionNode_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1node_1id(JNIEnv *env, jclass clz, int8_tArray a) { - LDKPublicKey a_ref; - CHECK((*env)->GetArrayLength(env, a) == 33); - (*env)->GetByteArrayRegion(env, a, 0, 33, a_ref.compressed_form); - LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); - *ret_copy = IntroductionNode_node_id(a_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1directed_1short_1channel_1id(JNIEnv *env, jclass clz, jclass a, int64_t b) { - LDKDirection a_conv = LDKDirection_from_java(env, a); - LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); - *ret_copy = IntroductionNode_directed_short_channel_id(a_conv, b); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKIntroductionNode* o_conv = (LDKIntroductionNode*)untag_ptr(o); - int64_t ret_conv = IntroductionNode_hash(o_conv); - return ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKIntroductionNode* a_conv = (LDKIntroductionNode*)untag_ptr(a); - LDKIntroductionNode* b_conv = (LDKIntroductionNode*)untag_ptr(b); - jboolean ret_conv = IntroductionNode_eq(a_conv, b_conv); - return ret_conv; -} - -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Direction_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKDirection* orig_conv = (LDKDirection*)untag_ptr(orig); - jclass ret_conv = LDKDirection_to_java(env, Direction_clone(orig_conv)); - return ret_conv; -} - -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Direction_1node_1one(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKDirection_to_java(env, Direction_node_one()); - return ret_conv; -} - -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Direction_1node_1two(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKDirection_to_java(env, Direction_node_two()); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Direction_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKDirection* o_conv = (LDKDirection*)untag_ptr(o); - int64_t ret_conv = Direction_hash(o_conv); - return ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Direction_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKDirection* a_conv = (LDKDirection*)untag_ptr(a); - LDKDirection* b_conv = (LDKDirection*)untag_ptr(b); - jboolean ret_conv = Direction_eq(a_conv, b_conv); + jboolean ret_conv = Input_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeIdLookUp_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKNodeIdLookUp this_ptr_conv = *(LDKNodeIdLookUp*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - NodeIdLookUp_free(this_ptr_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EmptyNodeIdLookUp_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKEmptyNodeIdLookUp this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Utxo_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUtxo this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - EmptyNodeIdLookUp_free(this_obj_conv); + Utxo_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EmptyNodeIdLookUp_1new(JNIEnv *env, jclass clz) { - LDKEmptyNodeIdLookUp ret_var = EmptyNodeIdLookUp_new(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Utxo_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUtxo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKOutPoint ret_var = Utxo_get_outpoint(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EmptyNodeIdLookUp_1as_1NodeIdLookUp(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKEmptyNodeIdLookUp this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeIdLookUp* ret_ret = MALLOC(sizeof(LDKNodeIdLookUp), "LDKNodeIdLookUp"); - *ret_ret = EmptyNodeIdLookUp_as_NodeIdLookUp(&this_arg_conv); - return tag_ptr(ret_ret, true); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedHop_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKBlindedHop this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BlindedHop_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Utxo_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUtxo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKOutPoint val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = OutPoint_clone(&val_conv); + Utxo_set_outpoint(&this_ptr_conv, val_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedHop_1get_1blinded_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBlindedHop this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Utxo_1get_1output(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUtxo this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, BlindedHop_get_blinded_node_id(&this_ptr_conv).compressed_form); - return ret_arr; + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = Utxo_get_output(&this_ptr_conv); + return tag_ptr(ret_ref, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedHop_1set_1blinded_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKBlindedHop this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Utxo_1set_1output(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUtxo this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - BlindedHop_set_blinded_node_id(&this_ptr_conv, val_ref); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); + val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val)); + Utxo_set_output(&this_ptr_conv, val_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedHop_1get_1encrypted_1payload(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBlindedHop this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Utxo_1get_1satisfaction_1weight(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUtxo this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u8Z ret_var = BlindedHop_get_encrypted_payload(&this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; + int64_t ret_conv = Utxo_get_satisfaction_weight(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedHop_1set_1encrypted_1payload(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKBlindedHop this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Utxo_1set_1satisfaction_1weight(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUtxo this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCVec_u8Z val_ref; - val_ref.datalen = (*env)->GetArrayLength(env, val); - val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data); - BlindedHop_set_encrypted_payload(&this_ptr_conv, val_ref); + Utxo_set_satisfaction_weight(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHop_1new(JNIEnv *env, jclass clz, int8_tArray blinded_node_id_arg, int8_tArray encrypted_payload_arg) { - LDKPublicKey blinded_node_id_arg_ref; - CHECK((*env)->GetArrayLength(env, blinded_node_id_arg) == 33); - (*env)->GetByteArrayRegion(env, blinded_node_id_arg, 0, 33, blinded_node_id_arg_ref.compressed_form); - LDKCVec_u8Z encrypted_payload_arg_ref; - encrypted_payload_arg_ref.datalen = (*env)->GetArrayLength(env, encrypted_payload_arg); - encrypted_payload_arg_ref.data = MALLOC(encrypted_payload_arg_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, encrypted_payload_arg, 0, encrypted_payload_arg_ref.datalen, encrypted_payload_arg_ref.data); - LDKBlindedHop ret_var = BlindedHop_new(blinded_node_id_arg_ref, encrypted_payload_arg_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Utxo_1new(JNIEnv *env, jclass clz, int64_t outpoint_arg, int64_t output_arg, int64_t satisfaction_weight_arg) { + LDKOutPoint outpoint_arg_conv; + outpoint_arg_conv.inner = untag_ptr(outpoint_arg); + outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); + outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); + void* output_arg_ptr = untag_ptr(output_arg); + CHECK_ACCESS(output_arg_ptr); + LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr); + output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg)); + LDKUtxo ret_var = Utxo_new(outpoint_arg_conv, output_arg_conv, satisfaction_weight_arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t BlindedHop_clone_ptr(LDKBlindedHop *NONNULL_PTR arg) { - LDKBlindedHop ret_var = BlindedHop_clone(arg); +static inline uint64_t Utxo_clone_ptr(LDKUtxo *NONNULL_PTR arg) { + LDKUtxo ret_var = Utxo_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKBlindedHop arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Utxo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUtxo arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = BlindedHop_clone_ptr(&arg_conv); + int64_t ret_conv = Utxo_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHop_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBlindedHop orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Utxo_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKUtxo orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBlindedHop ret_var = BlindedHop_clone(&orig_conv); + LDKUtxo ret_var = Utxo_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHop_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKBlindedHop o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Utxo_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKUtxo o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv.is_owned = false; - int64_t ret_conv = BlindedHop_hash(&o_conv); + int64_t ret_conv = Utxo_hash(&o_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedHop_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKBlindedHop a_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Utxo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKUtxo a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKBlindedHop b_conv; + LDKUtxo b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = BlindedHop_eq(&a_conv, &b_conv); + jboolean ret_conv = Utxo_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1one_1hop_1for_1message(JNIEnv *env, jclass clz, int8_tArray recipient_node_id, int64_t entropy_source) { - LDKPublicKey recipient_node_id_ref; - CHECK((*env)->GetArrayLength(env, recipient_node_id) == 33); - (*env)->GetByteArrayRegion(env, recipient_node_id, 0, 33, recipient_node_id_ref.compressed_form); - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); - *ret_conv = BlindedPath_one_hop_for_message(recipient_node_id_ref, entropy_source_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Utxo_1new_1p2pkh(JNIEnv *env, jclass clz, int64_t outpoint, int64_t value, int8_tArray pubkey_hash) { + LDKOutPoint outpoint_conv; + outpoint_conv.inner = untag_ptr(outpoint); + outpoint_conv.is_owned = ptr_is_owned(outpoint); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv); + outpoint_conv = OutPoint_clone(&outpoint_conv); + uint8_t pubkey_hash_arr[20]; + CHECK((*env)->GetArrayLength(env, pubkey_hash) == 20); + (*env)->GetByteArrayRegion(env, pubkey_hash, 0, 20, pubkey_hash_arr); + uint8_t (*pubkey_hash_ref)[20] = &pubkey_hash_arr; + LDKUtxo ret_var = Utxo_new_p2pkh(outpoint_conv, value, pubkey_hash_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1new_1for_1message(JNIEnv *env, jclass clz, jobjectArray node_pks, int64_t entropy_source) { - LDKCVec_PublicKeyZ node_pks_constr; - node_pks_constr.datalen = (*env)->GetArrayLength(env, node_pks); - if (node_pks_constr.datalen > 0) - node_pks_constr.data = MALLOC(node_pks_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); - else - node_pks_constr.data = NULL; - for (size_t i = 0; i < node_pks_constr.datalen; i++) { - int8_tArray node_pks_conv_8 = (*env)->GetObjectArrayElement(env, node_pks, i); - LDKPublicKey node_pks_conv_8_ref; - CHECK((*env)->GetArrayLength(env, node_pks_conv_8) == 33); - (*env)->GetByteArrayRegion(env, node_pks_conv_8, 0, 33, node_pks_conv_8_ref.compressed_form); - node_pks_constr.data[i] = node_pks_conv_8_ref; - } - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); - *ret_conv = BlindedPath_new_for_message(node_pks_constr, entropy_source_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CoinSelection_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKCoinSelection this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + CoinSelection_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1one_1hop_1for_1payment(JNIEnv *env, jclass clz, int8_tArray payee_node_id, int64_t payee_tlvs, int16_t min_final_cltv_expiry_delta, int64_t entropy_source) { - LDKPublicKey payee_node_id_ref; - CHECK((*env)->GetArrayLength(env, payee_node_id) == 33); - (*env)->GetByteArrayRegion(env, payee_node_id, 0, 33, payee_node_id_ref.compressed_form); - LDKReceiveTlvs payee_tlvs_conv; - payee_tlvs_conv.inner = untag_ptr(payee_tlvs); - payee_tlvs_conv.is_owned = ptr_is_owned(payee_tlvs); - CHECK_INNER_FIELD_ACCESS_OR_NULL(payee_tlvs_conv); - payee_tlvs_conv = ReceiveTlvs_clone(&payee_tlvs_conv); - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CoinSelection_1get_1confirmed_1utxos(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKCoinSelection this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_UtxoZ ret_var = CoinSelection_get_confirmed_utxos(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t g = 0; g < ret_var.datalen; g++) { + LDKUtxo ret_conv_6_var = ret_var.data[g]; + int64_t ret_conv_6_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_6_var); + ret_conv_6_ref = tag_ptr(ret_conv_6_var.inner, ret_conv_6_var.is_owned); + ret_arr_ptr[g] = ret_conv_6_ref; } - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ), "LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ"); - *ret_conv = BlindedPath_one_hop_for_payment(payee_node_id_ref, payee_tlvs_conv, min_final_cltv_expiry_delta, entropy_source_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1new_1for_1payment(JNIEnv *env, jclass clz, int64_tArray intermediate_nodes, int8_tArray payee_node_id, int64_t payee_tlvs, int64_t htlc_maximum_msat, int16_t min_final_cltv_expiry_delta, int64_t entropy_source) { - LDKCVec_ForwardNodeZ intermediate_nodes_constr; - intermediate_nodes_constr.datalen = (*env)->GetArrayLength(env, intermediate_nodes); - if (intermediate_nodes_constr.datalen > 0) - intermediate_nodes_constr.data = MALLOC(intermediate_nodes_constr.datalen * sizeof(LDKForwardNode), "LDKCVec_ForwardNodeZ Elements"); - else - intermediate_nodes_constr.data = NULL; - int64_t* intermediate_nodes_vals = (*env)->GetLongArrayElements (env, intermediate_nodes, NULL); - for (size_t n = 0; n < intermediate_nodes_constr.datalen; n++) { - int64_t intermediate_nodes_conv_13 = intermediate_nodes_vals[n]; - LDKForwardNode intermediate_nodes_conv_13_conv; - intermediate_nodes_conv_13_conv.inner = untag_ptr(intermediate_nodes_conv_13); - intermediate_nodes_conv_13_conv.is_owned = ptr_is_owned(intermediate_nodes_conv_13); - CHECK_INNER_FIELD_ACCESS_OR_NULL(intermediate_nodes_conv_13_conv); - intermediate_nodes_conv_13_conv = ForwardNode_clone(&intermediate_nodes_conv_13_conv); - intermediate_nodes_constr.data[n] = intermediate_nodes_conv_13_conv; - } - (*env)->ReleaseLongArrayElements(env, intermediate_nodes, intermediate_nodes_vals, 0); - LDKPublicKey payee_node_id_ref; - CHECK((*env)->GetArrayLength(env, payee_node_id) == 33); - (*env)->GetByteArrayRegion(env, payee_node_id, 0, 33, payee_node_id_ref.compressed_form); - LDKReceiveTlvs payee_tlvs_conv; - payee_tlvs_conv.inner = untag_ptr(payee_tlvs); - payee_tlvs_conv.is_owned = ptr_is_owned(payee_tlvs); - CHECK_INNER_FIELD_ACCESS_OR_NULL(payee_tlvs_conv); - payee_tlvs_conv = ReceiveTlvs_clone(&payee_tlvs_conv); - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ), "LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ"); - *ret_conv = BlindedPath_new_for_payment(intermediate_nodes_constr, payee_node_id_ref, payee_tlvs_conv, htlc_maximum_msat, min_final_cltv_expiry_delta, entropy_source_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1public_1introduction_1node_1id(JNIEnv *env, jclass clz, int64_t this_arg, int64_t network_graph) { - LDKBlindedPath this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKReadOnlyNetworkGraph network_graph_conv; - network_graph_conv.inner = untag_ptr(network_graph); - network_graph_conv.is_owned = ptr_is_owned(network_graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - network_graph_conv.is_owned = false; - LDKNodeId ret_var = BlindedPath_public_introduction_node_id(&this_arg_conv, &network_graph_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedPath_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKBlindedPath obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = BlindedPath_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ"); - *ret_conv = BlindedPath_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedHop_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKBlindedHop obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = BlindedHop_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHop_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); - *ret_conv = BlindedHop_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardNode_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKForwardNode this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ForwardNode_free(this_obj_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardNode_1get_1tlvs(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKForwardNode this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKForwardTlvs ret_var = ForwardNode_get_tlvs(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardNode_1set_1tlvs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKForwardNode this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKForwardTlvs val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ForwardTlvs_clone(&val_conv); - ForwardNode_set_tlvs(&this_ptr_conv, val_conv); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ForwardNode_1get_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKForwardNode this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ForwardNode_get_node_id(&this_ptr_conv).compressed_form); + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardNode_1set_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKForwardNode this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CoinSelection_1set_1confirmed_1utxos(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { + LDKCoinSelection this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - ForwardNode_set_node_id(&this_ptr_conv, val_ref); + LDKCVec_UtxoZ val_constr; + val_constr.datalen = (*env)->GetArrayLength(env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUtxo), "LDKCVec_UtxoZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); + for (size_t g = 0; g < val_constr.datalen; g++) { + int64_t val_conv_6 = val_vals[g]; + LDKUtxo val_conv_6_conv; + val_conv_6_conv.inner = untag_ptr(val_conv_6); + val_conv_6_conv.is_owned = ptr_is_owned(val_conv_6); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_6_conv); + val_conv_6_conv = Utxo_clone(&val_conv_6_conv); + val_constr.data[g] = val_conv_6_conv; + } + (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); + CoinSelection_set_confirmed_utxos(&this_ptr_conv, val_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardNode_1get_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKForwardNode this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CoinSelection_1get_1change_1output(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKCoinSelection this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = ForwardNode_get_htlc_maximum_msat(&this_ptr_conv); - return ret_conv; + LDKCOption_TxOutZ *ret_copy = MALLOC(sizeof(LDKCOption_TxOutZ), "LDKCOption_TxOutZ"); + *ret_copy = CoinSelection_get_change_output(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardNode_1set_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKForwardNode this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CoinSelection_1set_1change_1output(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKCoinSelection this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ForwardNode_set_htlc_maximum_msat(&this_ptr_conv, val); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_TxOutZ val_conv = *(LDKCOption_TxOutZ*)(val_ptr); + val_conv = COption_TxOutZ_clone((LDKCOption_TxOutZ*)untag_ptr(val)); + CoinSelection_set_change_output(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardNode_1new(JNIEnv *env, jclass clz, int64_t tlvs_arg, int8_tArray node_id_arg, int64_t htlc_maximum_msat_arg) { - LDKForwardTlvs tlvs_arg_conv; - tlvs_arg_conv.inner = untag_ptr(tlvs_arg); - tlvs_arg_conv.is_owned = ptr_is_owned(tlvs_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(tlvs_arg_conv); - tlvs_arg_conv = ForwardTlvs_clone(&tlvs_arg_conv); - LDKPublicKey node_id_arg_ref; - CHECK((*env)->GetArrayLength(env, node_id_arg) == 33); - (*env)->GetByteArrayRegion(env, node_id_arg, 0, 33, node_id_arg_ref.compressed_form); - LDKForwardNode ret_var = ForwardNode_new(tlvs_arg_conv, node_id_arg_ref, htlc_maximum_msat_arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CoinSelection_1new(JNIEnv *env, jclass clz, int64_tArray confirmed_utxos_arg, int64_t change_output_arg) { + LDKCVec_UtxoZ confirmed_utxos_arg_constr; + confirmed_utxos_arg_constr.datalen = (*env)->GetArrayLength(env, confirmed_utxos_arg); + if (confirmed_utxos_arg_constr.datalen > 0) + confirmed_utxos_arg_constr.data = MALLOC(confirmed_utxos_arg_constr.datalen * sizeof(LDKUtxo), "LDKCVec_UtxoZ Elements"); + else + confirmed_utxos_arg_constr.data = NULL; + int64_t* confirmed_utxos_arg_vals = (*env)->GetLongArrayElements (env, confirmed_utxos_arg, NULL); + for (size_t g = 0; g < confirmed_utxos_arg_constr.datalen; g++) { + int64_t confirmed_utxos_arg_conv_6 = confirmed_utxos_arg_vals[g]; + LDKUtxo confirmed_utxos_arg_conv_6_conv; + confirmed_utxos_arg_conv_6_conv.inner = untag_ptr(confirmed_utxos_arg_conv_6); + confirmed_utxos_arg_conv_6_conv.is_owned = ptr_is_owned(confirmed_utxos_arg_conv_6); + CHECK_INNER_FIELD_ACCESS_OR_NULL(confirmed_utxos_arg_conv_6_conv); + confirmed_utxos_arg_conv_6_conv = Utxo_clone(&confirmed_utxos_arg_conv_6_conv); + confirmed_utxos_arg_constr.data[g] = confirmed_utxos_arg_conv_6_conv; + } + (*env)->ReleaseLongArrayElements(env, confirmed_utxos_arg, confirmed_utxos_arg_vals, 0); + void* change_output_arg_ptr = untag_ptr(change_output_arg); + CHECK_ACCESS(change_output_arg_ptr); + LDKCOption_TxOutZ change_output_arg_conv = *(LDKCOption_TxOutZ*)(change_output_arg_ptr); + change_output_arg_conv = COption_TxOutZ_clone((LDKCOption_TxOutZ*)untag_ptr(change_output_arg)); + LDKCoinSelection ret_var = CoinSelection_new(confirmed_utxos_arg_constr, change_output_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t ForwardNode_clone_ptr(LDKForwardNode *NONNULL_PTR arg) { - LDKForwardNode ret_var = ForwardNode_clone(arg); +static inline uint64_t CoinSelection_clone_ptr(LDKCoinSelection *NONNULL_PTR arg) { + LDKCoinSelection ret_var = CoinSelection_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardNode_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKForwardNode arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CoinSelection_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCoinSelection arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = ForwardNode_clone_ptr(&arg_conv); + int64_t ret_conv = CoinSelection_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardNode_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKForwardNode orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CoinSelection_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCoinSelection orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKForwardNode ret_var = ForwardNode_clone(&orig_conv); + LDKCoinSelection ret_var = CoinSelection_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKForwardTlvs this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ForwardTlvs_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CoinSelectionSource_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKCoinSelectionSource this_ptr_conv = *(LDKCoinSelectionSource*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + CoinSelectionSource_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKForwardTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = ForwardTlvs_get_short_channel_id(&this_ptr_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WalletSource_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKWalletSource this_ptr_conv = *(LDKWalletSource*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + WalletSource_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKForwardTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ForwardTlvs_set_short_channel_id(&this_ptr_conv, val); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Wallet_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKWallet this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Wallet_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1get_1payment_1relay(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKForwardTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPaymentRelay ret_var = ForwardTlvs_get_payment_relay(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Wallet_1new(JNIEnv *env, jclass clz, int64_t source, int64_t logger) { + void* source_ptr = untag_ptr(source); + CHECK_ACCESS(source_ptr); + LDKWalletSource source_conv = *(LDKWalletSource*)(source_ptr); + if (source_conv.free == LDKWalletSource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKWalletSource_JCalls_cloned(&source_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKWallet ret_var = Wallet_new(source_conv, logger_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1set_1payment_1relay(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKForwardTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPaymentRelay val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = PaymentRelay_clone(&val_conv); - ForwardTlvs_set_payment_relay(&this_ptr_conv, val_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1get_1payment_1constraints(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKForwardTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPaymentConstraints ret_var = ForwardTlvs_get_payment_constraints(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Wallet_1as_1CoinSelectionSource(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKWallet this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCoinSelectionSource* ret_ret = MALLOC(sizeof(LDKCoinSelectionSource), "LDKCoinSelectionSource"); + *ret_ret = Wallet_as_CoinSelectionSource(&this_arg_conv); + return tag_ptr(ret_ret, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1set_1payment_1constraints(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKForwardTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPaymentConstraints val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = PaymentConstraints_clone(&val_conv); - ForwardTlvs_set_payment_constraints(&this_ptr_conv, val_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BumpTransactionEventHandler_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBumpTransactionEventHandler this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + BumpTransactionEventHandler_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKForwardTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKBlindedHopFeatures ret_var = ForwardTlvs_get_features(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BumpTransactionEventHandler_1new(JNIEnv *env, jclass clz, int64_t broadcaster, int64_t utxo_source, int64_t signer_provider, int64_t logger) { + void* broadcaster_ptr = untag_ptr(broadcaster); + CHECK_ACCESS(broadcaster_ptr); + LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); + if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); + } + void* utxo_source_ptr = untag_ptr(utxo_source); + CHECK_ACCESS(utxo_source_ptr); + LDKCoinSelectionSource utxo_source_conv = *(LDKCoinSelectionSource*)(utxo_source_ptr); + if (utxo_source_conv.free == LDKCoinSelectionSource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKCoinSelectionSource_JCalls_cloned(&utxo_source_conv); + } + void* signer_provider_ptr = untag_ptr(signer_provider); + CHECK_ACCESS(signer_provider_ptr); + LDKSignerProvider signer_provider_conv = *(LDKSignerProvider*)(signer_provider_ptr); + if (signer_provider_conv.free == LDKSignerProvider_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKSignerProvider_JCalls_cloned(&signer_provider_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKBumpTransactionEventHandler ret_var = BumpTransactionEventHandler_new(broadcaster_conv, utxo_source_conv, signer_provider_conv, logger_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKForwardTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKBlindedHopFeatures val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = BlindedHopFeatures_clone(&val_conv); - ForwardTlvs_set_features(&this_ptr_conv, val_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BumpTransactionEventHandler_1handle_1event(JNIEnv *env, jclass clz, int64_t this_arg, int64_t event) { + LDKBumpTransactionEventHandler this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKBumpTransactionEvent* event_conv = (LDKBumpTransactionEvent*)untag_ptr(event); + BumpTransactionEventHandler_handle_event(&this_arg_conv, event_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1new(JNIEnv *env, jclass clz, int64_t short_channel_id_arg, int64_t payment_relay_arg, int64_t payment_constraints_arg, int64_t features_arg) { - LDKPaymentRelay payment_relay_arg_conv; - payment_relay_arg_conv.inner = untag_ptr(payment_relay_arg); - payment_relay_arg_conv.is_owned = ptr_is_owned(payment_relay_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_relay_arg_conv); - payment_relay_arg_conv = PaymentRelay_clone(&payment_relay_arg_conv); - LDKPaymentConstraints payment_constraints_arg_conv; - payment_constraints_arg_conv.inner = untag_ptr(payment_constraints_arg); - payment_constraints_arg_conv.is_owned = ptr_is_owned(payment_constraints_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_constraints_arg_conv); - payment_constraints_arg_conv = PaymentConstraints_clone(&payment_constraints_arg_conv); - LDKBlindedHopFeatures features_arg_conv; - features_arg_conv.inner = untag_ptr(features_arg); - features_arg_conv.is_owned = ptr_is_owned(features_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); - features_arg_conv = BlindedHopFeatures_clone(&features_arg_conv); - LDKForwardTlvs ret_var = ForwardTlvs_new(short_channel_id_arg, payment_relay_arg_conv, payment_constraints_arg_conv, features_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKInitFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKInitFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = InitFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -static inline uint64_t ForwardTlvs_clone_ptr(LDKForwardTlvs *NONNULL_PTR arg) { - LDKForwardTlvs ret_var = ForwardTlvs_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKForwardTlvs arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = ForwardTlvs_clone_ptr(&arg_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKNodeFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKNodeFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKForwardTlvs orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKForwardTlvs ret_var = ForwardTlvs_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKChannelFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKChannelFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ChannelFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKReceiveTlvs this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ReceiveTlvs_free(this_obj_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKBolt11InvoiceFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKBolt11InvoiceFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = Bolt11InvoiceFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1get_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKReceiveTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ReceiveTlvs_get_payment_secret(&this_ptr_conv)); - return ret_arr; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKOfferFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKOfferFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = OfferFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1set_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKReceiveTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - ReceiveTlvs_set_payment_secret(&this_ptr_conv, val_ref); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKInvoiceRequestFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKInvoiceRequestFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = InvoiceRequestFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1get_1payment_1constraints(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKReceiveTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPaymentConstraints ret_var = ReceiveTlvs_get_payment_constraints(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1set_1payment_1constraints(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKReceiveTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPaymentConstraints val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = PaymentConstraints_clone(&val_conv); - ReceiveTlvs_set_payment_constraints(&this_ptr_conv, val_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1get_1payment_1context(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKReceiveTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); - *ret_copy = ReceiveTlvs_get_payment_context(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKBolt12InvoiceFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKBolt12InvoiceFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = Bolt12InvoiceFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1set_1payment_1context(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKReceiveTlvs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKPaymentContext val_conv = *(LDKPaymentContext*)(val_ptr); - val_conv = PaymentContext_clone((LDKPaymentContext*)untag_ptr(val)); - ReceiveTlvs_set_payment_context(&this_ptr_conv, val_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKBlindedHopFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKBlindedHopFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = BlindedHopFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1new(JNIEnv *env, jclass clz, int8_tArray payment_secret_arg, int64_t payment_constraints_arg, int64_t payment_context_arg) { - LDKThirtyTwoBytes payment_secret_arg_ref; - CHECK((*env)->GetArrayLength(env, payment_secret_arg) == 32); - (*env)->GetByteArrayRegion(env, payment_secret_arg, 0, 32, payment_secret_arg_ref.data); - LDKPaymentConstraints payment_constraints_arg_conv; - payment_constraints_arg_conv.inner = untag_ptr(payment_constraints_arg); - payment_constraints_arg_conv.is_owned = ptr_is_owned(payment_constraints_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_constraints_arg_conv); - payment_constraints_arg_conv = PaymentConstraints_clone(&payment_constraints_arg_conv); - void* payment_context_arg_ptr = untag_ptr(payment_context_arg); - CHECK_ACCESS(payment_context_arg_ptr); - LDKPaymentContext payment_context_arg_conv = *(LDKPaymentContext*)(payment_context_arg_ptr); - payment_context_arg_conv = PaymentContext_clone((LDKPaymentContext*)untag_ptr(payment_context_arg)); - LDKReceiveTlvs ret_var = ReceiveTlvs_new(payment_secret_arg_ref, payment_constraints_arg_conv, payment_context_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKChannelTypeFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKChannelTypeFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -static inline uint64_t ReceiveTlvs_clone_ptr(LDKReceiveTlvs *NONNULL_PTR arg) { - LDKReceiveTlvs ret_var = ReceiveTlvs_clone(arg); +static inline uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg) { + LDKInitFeatures ret_var = InitFeatures_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKReceiveTlvs arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInitFeatures arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = ReceiveTlvs_clone_ptr(&arg_conv); + int64_t ret_conv = InitFeatures_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKReceiveTlvs orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKInitFeatures orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKReceiveTlvs ret_var = ReceiveTlvs_clone(&orig_conv); + LDKInitFeatures ret_var = InitFeatures_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKPaymentRelay this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PaymentRelay_free(this_obj_conv); -} - -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPaymentRelay this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int16_t ret_conv = PaymentRelay_get_cltv_expiry_delta(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKPaymentRelay this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - PaymentRelay_set_cltv_expiry_delta(&this_ptr_conv, val); -} - -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1get_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPaymentRelay this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int32_t ret_conv = PaymentRelay_get_fee_proportional_millionths(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1set_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKPaymentRelay this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - PaymentRelay_set_fee_proportional_millionths(&this_ptr_conv, val); +static inline uint64_t NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg) { + LDKNodeFeatures ret_var = NodeFeatures_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } - -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1get_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPaymentRelay this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int32_t ret_conv = PaymentRelay_get_fee_base_msat(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNodeFeatures arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = NodeFeatures_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1set_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKPaymentRelay this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - PaymentRelay_set_fee_base_msat(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1new(JNIEnv *env, jclass clz, int16_t cltv_expiry_delta_arg, int32_t fee_proportional_millionths_arg, int32_t fee_base_msat_arg) { - LDKPaymentRelay ret_var = PaymentRelay_new(cltv_expiry_delta_arg, fee_proportional_millionths_arg, fee_base_msat_arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKNodeFeatures orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKNodeFeatures ret_var = NodeFeatures_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t PaymentRelay_clone_ptr(LDKPaymentRelay *NONNULL_PTR arg) { - LDKPaymentRelay ret_var = PaymentRelay_clone(arg); +static inline uint64_t ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg) { + LDKChannelFeatures ret_var = ChannelFeatures_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKPaymentRelay arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelFeatures arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = PaymentRelay_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelFeatures_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPaymentRelay orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelFeatures orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKPaymentRelay ret_var = PaymentRelay_clone(&orig_conv); + LDKChannelFeatures ret_var = ChannelFeatures_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKPaymentConstraints this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PaymentConstraints_free(this_obj_conv); -} - -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1get_1max_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPaymentConstraints this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int32_t ret_conv = PaymentConstraints_get_max_cltv_expiry(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1set_1max_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKPaymentConstraints this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - PaymentConstraints_set_max_cltv_expiry(&this_ptr_conv, val); +static inline uint64_t Bolt11InvoiceFeatures_clone_ptr(LDKBolt11InvoiceFeatures *NONNULL_PTR arg) { + LDKBolt11InvoiceFeatures ret_var = Bolt11InvoiceFeatures_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPaymentConstraints this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = PaymentConstraints_get_htlc_minimum_msat(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBolt11InvoiceFeatures arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = Bolt11InvoiceFeatures_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKPaymentConstraints this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - PaymentConstraints_set_htlc_minimum_msat(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1new(JNIEnv *env, jclass clz, int32_t max_cltv_expiry_arg, int64_t htlc_minimum_msat_arg) { - LDKPaymentConstraints ret_var = PaymentConstraints_new(max_cltv_expiry_arg, htlc_minimum_msat_arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBolt11InvoiceFeatures orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKBolt11InvoiceFeatures ret_var = Bolt11InvoiceFeatures_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t PaymentConstraints_clone_ptr(LDKPaymentConstraints *NONNULL_PTR arg) { - LDKPaymentConstraints ret_var = PaymentConstraints_clone(arg); +static inline uint64_t OfferFeatures_clone_ptr(LDKOfferFeatures *NONNULL_PTR arg) { + LDKOfferFeatures ret_var = OfferFeatures_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKPaymentConstraints arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKOfferFeatures arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = PaymentConstraints_clone_ptr(&arg_conv); + int64_t ret_conv = OfferFeatures_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPaymentConstraints orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKOfferFeatures orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKPaymentConstraints ret_var = PaymentConstraints_clone(&orig_conv); + LDKOfferFeatures ret_var = OfferFeatures_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentContext_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKPaymentContext this_ptr_conv = *(LDKPaymentContext*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - PaymentContext_free(this_ptr_conv); -} - -static inline uint64_t PaymentContext_clone_ptr(LDKPaymentContext *NONNULL_PTR arg) { - LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); - *ret_copy = PaymentContext_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentContext_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKPaymentContext* arg_conv = (LDKPaymentContext*)untag_ptr(arg); - int64_t ret_conv = PaymentContext_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentContext_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPaymentContext* orig_conv = (LDKPaymentContext*)untag_ptr(orig); - LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); - *ret_copy = PaymentContext_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentContext_1unknown(JNIEnv *env, jclass clz, int64_t a) { - LDKUnknownPaymentContext a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = UnknownPaymentContext_clone(&a_conv); - LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); - *ret_copy = PaymentContext_unknown(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentContext_1bolt12_1offer(JNIEnv *env, jclass clz, int64_t a) { - LDKBolt12OfferContext a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = Bolt12OfferContext_clone(&a_conv); - LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); - *ret_copy = PaymentContext_bolt12_offer(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentContext_1bolt12_1refund(JNIEnv *env, jclass clz, int64_t a) { - LDKBolt12RefundContext a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = Bolt12RefundContext_clone(&a_conv); - LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); - *ret_copy = PaymentContext_bolt12_refund(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentContext_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKPaymentContext* a_conv = (LDKPaymentContext*)untag_ptr(a); - LDKPaymentContext* b_conv = (LDKPaymentContext*)untag_ptr(b); - jboolean ret_conv = PaymentContext_eq(a_conv, b_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKUnknownPaymentContext this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - UnknownPaymentContext_free(this_obj_conv); -} - -static inline uint64_t UnknownPaymentContext_clone_ptr(LDKUnknownPaymentContext *NONNULL_PTR arg) { - LDKUnknownPaymentContext ret_var = UnknownPaymentContext_clone(arg); +static inline uint64_t InvoiceRequestFeatures_clone_ptr(LDKInvoiceRequestFeatures *NONNULL_PTR arg) { + LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKUnknownPaymentContext arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInvoiceRequestFeatures arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = UnknownPaymentContext_clone_ptr(&arg_conv); + int64_t ret_conv = InvoiceRequestFeatures_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKUnknownPaymentContext orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKInvoiceRequestFeatures orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKUnknownPaymentContext ret_var = UnknownPaymentContext_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKUnknownPaymentContext a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKUnknownPaymentContext b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = UnknownPaymentContext_eq(&a_conv, &b_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKBolt12OfferContext this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Bolt12OfferContext_free(this_obj_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1get_1offer_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBolt12OfferContext this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKOfferId ret_var = Bolt12OfferContext_get_offer_id(&this_ptr_conv); + LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1set_1offer_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKBolt12OfferContext this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKOfferId val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = OfferId_clone(&val_conv); - Bolt12OfferContext_set_offer_id(&this_ptr_conv, val_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1get_1invoice_1request(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBolt12OfferContext this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKInvoiceRequestFields ret_var = Bolt12OfferContext_get_invoice_request(&this_ptr_conv); +static inline uint64_t Bolt12InvoiceFeatures_clone_ptr(LDKBolt12InvoiceFeatures *NONNULL_PTR arg) { + LDKBolt12InvoiceFeatures ret_var = Bolt12InvoiceFeatures_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1set_1invoice_1request(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKBolt12OfferContext this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKInvoiceRequestFields val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = InvoiceRequestFields_clone(&val_conv); - Bolt12OfferContext_set_invoice_request(&this_ptr_conv, val_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBolt12InvoiceFeatures arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = Bolt12InvoiceFeatures_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1new(JNIEnv *env, jclass clz, int64_t offer_id_arg, int64_t invoice_request_arg) { - LDKOfferId offer_id_arg_conv; - offer_id_arg_conv.inner = untag_ptr(offer_id_arg); - offer_id_arg_conv.is_owned = ptr_is_owned(offer_id_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(offer_id_arg_conv); - offer_id_arg_conv = OfferId_clone(&offer_id_arg_conv); - LDKInvoiceRequestFields invoice_request_arg_conv; - invoice_request_arg_conv.inner = untag_ptr(invoice_request_arg); - invoice_request_arg_conv.is_owned = ptr_is_owned(invoice_request_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_request_arg_conv); - invoice_request_arg_conv = InvoiceRequestFields_clone(&invoice_request_arg_conv); - LDKBolt12OfferContext ret_var = Bolt12OfferContext_new(offer_id_arg_conv, invoice_request_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBolt12InvoiceFeatures orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKBolt12InvoiceFeatures ret_var = Bolt12InvoiceFeatures_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t Bolt12OfferContext_clone_ptr(LDKBolt12OfferContext *NONNULL_PTR arg) { - LDKBolt12OfferContext ret_var = Bolt12OfferContext_clone(arg); +static inline uint64_t BlindedHopFeatures_clone_ptr(LDKBlindedHopFeatures *NONNULL_PTR arg) { + LDKBlindedHopFeatures ret_var = BlindedHopFeatures_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKBolt12OfferContext arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBlindedHopFeatures arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Bolt12OfferContext_clone_ptr(&arg_conv); + int64_t ret_conv = BlindedHopFeatures_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBolt12OfferContext orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBlindedHopFeatures orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBolt12OfferContext ret_var = Bolt12OfferContext_clone(&orig_conv); + LDKBlindedHopFeatures ret_var = BlindedHopFeatures_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKBolt12OfferContext a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKBolt12OfferContext b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = Bolt12OfferContext_eq(&a_conv, &b_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKBolt12RefundContext this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Bolt12RefundContext_free(this_obj_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1new(JNIEnv *env, jclass clz) { - LDKBolt12RefundContext ret_var = Bolt12RefundContext_new(); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline uint64_t Bolt12RefundContext_clone_ptr(LDKBolt12RefundContext *NONNULL_PTR arg) { - LDKBolt12RefundContext ret_var = Bolt12RefundContext_clone(arg); +static inline uint64_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg) { + LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKBolt12RefundContext arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelTypeFeatures arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Bolt12RefundContext_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelTypeFeatures_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBolt12RefundContext orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelTypeFeatures orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKBolt12RefundContext ret_var = Bolt12RefundContext_clone(&orig_conv); + LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKBolt12RefundContext a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKBolt12RefundContext b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = Bolt12RefundContext_eq(&a_conv, &b_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKInitFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = InitFeatures_hash(&o_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKForwardTlvs obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ForwardTlvs_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKNodeFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = NodeFeatures_hash(&o_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKReceiveTlvs obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ReceiveTlvs_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKChannelFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = ChannelFeatures_hash(&o_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKPaymentRelay obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = PaymentRelay_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKBolt11InvoiceFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = Bolt11InvoiceFeatures_hash(&o_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_PaymentRelayDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentRelayDecodeErrorZ), "LDKCResult_PaymentRelayDecodeErrorZ"); - *ret_conv = PaymentRelay_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKOfferFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = OfferFeatures_hash(&o_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKPaymentConstraints obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = PaymentConstraints_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKInvoiceRequestFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = InvoiceRequestFeatures_hash(&o_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_PaymentConstraintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentConstraintsDecodeErrorZ), "LDKCResult_PaymentConstraintsDecodeErrorZ"); - *ret_conv = PaymentConstraints_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKBolt12InvoiceFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = Bolt12InvoiceFeatures_hash(&o_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentContext_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKPaymentContext* obj_conv = (LDKPaymentContext*)untag_ptr(obj); - LDKCVec_u8Z ret_var = PaymentContext_write(obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKBlindedHopFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = BlindedHopFeatures_hash(&o_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentContext_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_PaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentContextDecodeErrorZ), "LDKCResult_PaymentContextDecodeErrorZ"); - *ret_conv = PaymentContext_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKChannelTypeFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = ChannelTypeFeatures_hash(&o_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKUnknownPaymentContext obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = UnknownPaymentContext_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInitFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InitFeatures_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); - *ret_conv = UnknownPaymentContext_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKNodeFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + NodeFeatures_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKBolt12OfferContext obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = Bolt12OfferContext_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelFeatures_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_Bolt12OfferContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12OfferContextDecodeErrorZ), "LDKCResult_Bolt12OfferContextDecodeErrorZ"); - *ret_conv = Bolt12OfferContext_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBolt11InvoiceFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Bolt11InvoiceFeatures_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKBolt12RefundContext obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = Bolt12RefundContext_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKOfferFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OfferFeatures_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_Bolt12RefundContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12RefundContextDecodeErrorZ), "LDKCResult_Bolt12RefundContextDecodeErrorZ"); - *ret_conv = Bolt12RefundContext_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInvoiceRequestFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InvoiceRequestFeatures_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKPaymentPurpose this_ptr_conv = *(LDKPaymentPurpose*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - PaymentPurpose_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBolt12InvoiceFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Bolt12InvoiceFeatures_free(this_obj_conv); } -static inline uint64_t PaymentPurpose_clone_ptr(LDKPaymentPurpose *NONNULL_PTR arg) { - LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); - *ret_copy = PaymentPurpose_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBlindedHopFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + BlindedHopFeatures_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKPaymentPurpose* arg_conv = (LDKPaymentPurpose*)untag_ptr(arg); - int64_t ret_conv = PaymentPurpose_clone_ptr(arg_conv); - return ret_conv; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelTypeFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelTypeFeatures_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPaymentPurpose* orig_conv = (LDKPaymentPurpose*)untag_ptr(orig); - LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); - *ret_copy = PaymentPurpose_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1for_1keysend(JNIEnv *env, jclass clz, jboolean allow_mpp) { + LDKBolt11InvoiceFeatures ret_var = Bolt11InvoiceFeatures_for_keysend(allow_mpp); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1bolt11_1invoice_1payment(JNIEnv *env, jclass clz, int64_t payment_preimage, int8_tArray payment_secret) { - void* payment_preimage_ptr = untag_ptr(payment_preimage); - CHECK_ACCESS(payment_preimage_ptr); - LDKCOption_ThirtyTwoBytesZ payment_preimage_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_preimage_ptr); - payment_preimage_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_preimage)); - LDKThirtyTwoBytes payment_secret_ref; - CHECK((*env)->GetArrayLength(env, payment_secret) == 32); - (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data); - LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); - *ret_copy = PaymentPurpose_bolt11_invoice_payment(payment_preimage_conv, payment_secret_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1only_1static_1remote_1key(JNIEnv *env, jclass clz) { + LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_only_static_remote_key(); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1bolt12_1offer_1payment(JNIEnv *env, jclass clz, int64_t payment_preimage, int8_tArray payment_secret, int64_t payment_context) { - void* payment_preimage_ptr = untag_ptr(payment_preimage); - CHECK_ACCESS(payment_preimage_ptr); - LDKCOption_ThirtyTwoBytesZ payment_preimage_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_preimage_ptr); - payment_preimage_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_preimage)); - LDKThirtyTwoBytes payment_secret_ref; - CHECK((*env)->GetArrayLength(env, payment_secret) == 32); - (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data); - LDKBolt12OfferContext payment_context_conv; - payment_context_conv.inner = untag_ptr(payment_context); - payment_context_conv.is_owned = ptr_is_owned(payment_context); - CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_context_conv); - payment_context_conv = Bolt12OfferContext_clone(&payment_context_conv); - LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); - *ret_copy = PaymentPurpose_bolt12_offer_payment(payment_preimage_conv, payment_secret_ref, payment_context_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1anchors_1zero_1htlc_1fee_1and_1dependencies(JNIEnv *env, jclass clz) { + LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_anchors_zero_htlc_fee_and_dependencies(); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1bolt12_1refund_1payment(JNIEnv *env, jclass clz, int64_t payment_preimage, int8_tArray payment_secret, int64_t payment_context) { - void* payment_preimage_ptr = untag_ptr(payment_preimage); - CHECK_ACCESS(payment_preimage_ptr); - LDKCOption_ThirtyTwoBytesZ payment_preimage_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_preimage_ptr); - payment_preimage_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_preimage)); - LDKThirtyTwoBytes payment_secret_ref; - CHECK((*env)->GetArrayLength(env, payment_secret) == 32); - (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data); - LDKBolt12RefundContext payment_context_conv; - payment_context_conv.inner = untag_ptr(payment_context); - payment_context_conv.is_owned = ptr_is_owned(payment_context); - CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_context_conv); - payment_context_conv = Bolt12RefundContext_clone(&payment_context_conv); - LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); - *ret_copy = PaymentPurpose_bolt12_refund_payment(payment_preimage_conv, payment_secret_ref, payment_context_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1empty(JNIEnv *env, jclass clz) { + LDKInitFeatures ret_var = InitFeatures_empty(); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1spontaneous_1payment(JNIEnv *env, jclass clz, int8_tArray a) { - LDKThirtyTwoBytes a_ref; - CHECK((*env)->GetArrayLength(env, a) == 32); - (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data); - LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); - *ret_copy = PaymentPurpose_spontaneous_payment(a_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InitFeatures_1le_1flags(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKu8slice ret_var = InitFeatures_le_flags(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKPaymentPurpose* a_conv = (LDKPaymentPurpose*)untag_ptr(a); - LDKPaymentPurpose* b_conv = (LDKPaymentPurpose*)untag_ptr(b); - jboolean ret_conv = PaymentPurpose_eq(a_conv, b_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1any_1optional_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_any_optional_bits(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1preimage(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKPaymentPurpose* this_arg_conv = (LDKPaymentPurpose*)untag_ptr(this_arg); - LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); - *ret_copy = PaymentPurpose_preimage(this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKInitFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKPaymentPurpose* obj_conv = (LDKPaymentPurpose*)untag_ptr(obj); - LDKCVec_u8Z ret_var = PaymentPurpose_write(obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_InitFeatures_1required_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKInitFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + LDKCVec_u64Z ret_var = InitFeatures_required_unknown_bits_from(&this_arg_conv, &other_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); - *ret_conv = PaymentPurpose_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_unknown_bits(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKClaimedHTLC this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ClaimedHTLC_free(this_obj_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_unknown_bits(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKClaimedHTLC this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelId ret_var = ClaimedHTLC_get_channel_id(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1required_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = InitFeatures_set_required_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKClaimedHTLC this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelId val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelId_clone(&val_conv); - ClaimedHTLC_set_channel_id(&this_ptr_conv, val_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1optional_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = InitFeatures_set_optional_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1get_1user_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKClaimedHTLC this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = (*env)->NewByteArray(env, 16); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 16, ClaimedHTLC_get_user_channel_id(&this_ptr_conv).le_bytes); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1required_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = InitFeatures_set_required_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1set_1user_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKClaimedHTLC this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKU128 val_ref; - CHECK((*env)->GetArrayLength(env, val) == 16); - (*env)->GetByteArrayRegion(env, val, 0, 16, val_ref.le_bytes); - ClaimedHTLC_set_user_channel_id(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1optional_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = InitFeatures_set_optional_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1get_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKClaimedHTLC this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int32_t ret_conv = ClaimedHTLC_get_cltv_expiry(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1empty(JNIEnv *env, jclass clz) { + LDKNodeFeatures ret_var = NodeFeatures_empty(); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1set_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKClaimedHTLC this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ClaimedHTLC_set_cltv_expiry(&this_ptr_conv, val); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1le_1flags(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKu8slice ret_var = NodeFeatures_le_flags(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1get_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKClaimedHTLC this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = ClaimedHTLC_get_value_msat(&this_ptr_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1any_1optional_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_any_optional_bits(&this_arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1set_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKClaimedHTLC this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ClaimedHTLC_set_value_msat(&this_ptr_conv, val); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1get_1counterparty_1skimmed_1fee_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKClaimedHTLC this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = ClaimedHTLC_get_counterparty_skimmed_fee_msat(&this_ptr_conv); +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1required_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + LDKCVec_u64Z ret_var = NodeFeatures_required_unknown_bits_from(&this_arg_conv, &other_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_unknown_bits(&this_arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1set_1counterparty_1skimmed_1fee_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKClaimedHTLC this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ClaimedHTLC_set_counterparty_skimmed_fee_msat(&this_ptr_conv, val); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_unknown_bits(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1new(JNIEnv *env, jclass clz, int64_t channel_id_arg, int8_tArray user_channel_id_arg, int32_t cltv_expiry_arg, int64_t value_msat_arg, int64_t counterparty_skimmed_fee_msat_arg) { - LDKChannelId channel_id_arg_conv; - channel_id_arg_conv.inner = untag_ptr(channel_id_arg); - channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); - channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); - LDKU128 user_channel_id_arg_ref; - CHECK((*env)->GetArrayLength(env, user_channel_id_arg) == 16); - (*env)->GetByteArrayRegion(env, user_channel_id_arg, 0, 16, user_channel_id_arg_ref.le_bytes); - LDKClaimedHTLC ret_var = ClaimedHTLC_new(channel_id_arg_conv, user_channel_id_arg_ref, cltv_expiry_arg, value_msat_arg, counterparty_skimmed_fee_msat_arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1required_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = NodeFeatures_set_required_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -static inline uint64_t ClaimedHTLC_clone_ptr(LDKClaimedHTLC *NONNULL_PTR arg) { - LDKClaimedHTLC ret_var = ClaimedHTLC_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1optional_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = NodeFeatures_set_optional_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKClaimedHTLC arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = ClaimedHTLC_clone_ptr(&arg_conv); - return ret_conv; + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1required_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = NodeFeatures_set_required_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKClaimedHTLC orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKClaimedHTLC ret_var = ClaimedHTLC_clone(&orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1optional_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = NodeFeatures_set_optional_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1empty(JNIEnv *env, jclass clz) { + LDKChannelFeatures ret_var = ChannelFeatures_empty(); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKClaimedHTLC a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKClaimedHTLC b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = ClaimedHTLC_eq(&a_conv, &b_conv); - return ret_conv; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKClaimedHTLC obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = ClaimedHTLC_write(&obj_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1le_1flags(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKu8slice ret_var = ChannelFeatures_le_flags(&this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_ClaimedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClaimedHTLCDecodeErrorZ), "LDKCResult_ClaimedHTLCDecodeErrorZ"); - *ret_conv = ClaimedHTLC_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1supports_1any_1optional_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelFeatures_supports_any_optional_bits(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PathFailure_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKPathFailure this_ptr_conv = *(LDKPathFailure*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - PathFailure_free(this_ptr_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1requires_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + jboolean ret_conv = ChannelFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); + return ret_conv; } -static inline uint64_t PathFailure_clone_ptr(LDKPathFailure *NONNULL_PTR arg) { - LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure"); - *ret_copy = PathFailure_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1required_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + LDKCVec_u64Z ret_var = ChannelFeatures_required_unknown_bits_from(&this_arg_conv, &other_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PathFailure_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKPathFailure* arg_conv = (LDKPathFailure*)untag_ptr(arg); - int64_t ret_conv = PathFailure_clone_ptr(arg_conv); + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelFeatures_requires_unknown_bits(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PathFailure_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPathFailure* orig_conv = (LDKPathFailure*)untag_ptr(orig); - LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure"); - *ret_copy = PathFailure_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1supports_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelFeatures_supports_unknown_bits(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PathFailure_1initial_1send(JNIEnv *env, jclass clz, int64_t err) { - void* err_ptr = untag_ptr(err); - CHECK_ACCESS(err_ptr); - LDKAPIError err_conv = *(LDKAPIError*)(err_ptr); - err_conv = APIError_clone((LDKAPIError*)untag_ptr(err)); - LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure"); - *ret_copy = PathFailure_initial_send(err_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1set_1required_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelFeatures_set_required_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PathFailure_1on_1path(JNIEnv *env, jclass clz, int64_t network_update) { - void* network_update_ptr = untag_ptr(network_update); - CHECK_ACCESS(network_update_ptr); - LDKCOption_NetworkUpdateZ network_update_conv = *(LDKCOption_NetworkUpdateZ*)(network_update_ptr); - network_update_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)untag_ptr(network_update)); - LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure"); - *ret_copy = PathFailure_on_path(network_update_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1set_1optional_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelFeatures_set_optional_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PathFailure_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKPathFailure* a_conv = (LDKPathFailure*)untag_ptr(a); - LDKPathFailure* b_conv = (LDKPathFailure*)untag_ptr(b); - jboolean ret_conv = PathFailure_eq(a_conv, b_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1set_1required_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelFeatures_set_required_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PathFailure_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKPathFailure* obj_conv = (LDKPathFailure*)untag_ptr(obj); - LDKCVec_u8Z ret_var = PathFailure_write(obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1set_1optional_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKChannelFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelFeatures_set_optional_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1empty(JNIEnv *env, jclass clz) { + LDKBolt11InvoiceFeatures ret_var = Bolt11InvoiceFeatures_empty(); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1le_1flags(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKu8slice ret_var = Bolt11InvoiceFeatures_le_flags(&this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PathFailure_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ"); - *ret_conv = PathFailure_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1supports_1any_1optional_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt11InvoiceFeatures_supports_any_optional_bits(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosureReason_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKClosureReason this_ptr_conv = *(LDKClosureReason*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - ClosureReason_free(this_ptr_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKBolt11InvoiceFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + jboolean ret_conv = Bolt11InvoiceFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); + return ret_conv; } -static inline uint64_t ClosureReason_clone_ptr(LDKClosureReason *NONNULL_PTR arg) { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1required_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKBolt11InvoiceFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + LDKCVec_u64Z ret_var = Bolt11InvoiceFeatures_required_unknown_bits_from(&this_arg_conv, &other_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKClosureReason* arg_conv = (LDKClosureReason*)untag_ptr(arg); - int64_t ret_conv = ClosureReason_clone_ptr(arg_conv); + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt11InvoiceFeatures_requires_unknown_bits(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKClosureReason* orig_conv = (LDKClosureReason*)untag_ptr(orig); - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1supports_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt11InvoiceFeatures_supports_unknown_bits(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1counterparty_1force_1closed(JNIEnv *env, jclass clz, int64_t peer_msg) { - LDKUntrustedString peer_msg_conv; - peer_msg_conv.inner = untag_ptr(peer_msg); - peer_msg_conv.is_owned = ptr_is_owned(peer_msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(peer_msg_conv); - peer_msg_conv = UntrustedString_clone(&peer_msg_conv); - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_counterparty_force_closed(peer_msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1required_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = Bolt11InvoiceFeatures_set_required_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1holder_1force_1closed(JNIEnv *env, jclass clz) { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_holder_force_closed(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1optional_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = Bolt11InvoiceFeatures_set_optional_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1legacy_1cooperative_1closure(JNIEnv *env, jclass clz) { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_legacy_cooperative_closure(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1required_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = Bolt11InvoiceFeatures_set_required_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1counterparty_1initiated_1cooperative_1closure(JNIEnv *env, jclass clz) { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_counterparty_initiated_cooperative_closure(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1optional_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = Bolt11InvoiceFeatures_set_optional_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1locally_1initiated_1cooperative_1closure(JNIEnv *env, jclass clz) { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_locally_initiated_cooperative_closure(); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1empty(JNIEnv *env, jclass clz) { + LDKOfferFeatures ret_var = OfferFeatures_empty(); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1commitment_1tx_1confirmed(JNIEnv *env, jclass clz) { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_commitment_tx_confirmed(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1le_1flags(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKu8slice ret_var = OfferFeatures_le_flags(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1funding_1timed_1out(JNIEnv *env, jclass clz) { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_funding_timed_out(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1supports_1any_1optional_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = OfferFeatures_supports_any_optional_bits(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1processing_1error(JNIEnv *env, jclass clz, jstring err) { - LDKStr err_conv = java_to_owned_str(env, err); - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_processing_error(err_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1requires_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKOfferFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + jboolean ret_conv = OfferFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1disconnected_1peer(JNIEnv *env, jclass clz) { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_disconnected_peer(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1required_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKOfferFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + LDKCVec_u64Z ret_var = OfferFeatures_required_unknown_bits_from(&this_arg_conv, &other_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1outdated_1channel_1manager(JNIEnv *env, jclass clz) { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_outdated_channel_manager(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = OfferFeatures_requires_unknown_bits(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1counterparty_1coop_1closed_1unfunded_1channel(JNIEnv *env, jclass clz) { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_counterparty_coop_closed_unfunded_channel(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1supports_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = OfferFeatures_supports_unknown_bits(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1funding_1batch_1closure(JNIEnv *env, jclass clz) { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_funding_batch_closure(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1set_1required_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = OfferFeatures_set_required_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1htlcs_1timed_1out(JNIEnv *env, jclass clz) { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_htlcs_timed_out(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1set_1optional_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = OfferFeatures_set_optional_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ClosureReason_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKClosureReason* a_conv = (LDKClosureReason*)untag_ptr(a); - LDKClosureReason* b_conv = (LDKClosureReason*)untag_ptr(b); - jboolean ret_conv = ClosureReason_eq(a_conv, b_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1set_1required_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = OfferFeatures_set_required_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ClosureReason_1to_1str(JNIEnv *env, jclass clz, int64_t o) { - LDKClosureReason* o_conv = (LDKClosureReason*)untag_ptr(o); - LDKStr ret_str = ClosureReason_to_str(o_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1set_1optional_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = OfferFeatures_set_optional_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosureReason_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKClosureReason* obj_conv = (LDKClosureReason*)untag_ptr(obj); - LDKCVec_u8Z ret_var = ClosureReason_write(obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1empty(JNIEnv *env, jclass clz) { + LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_empty(); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1le_1flags(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKu8slice ret_var = InvoiceRequestFeatures_le_flags(&this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); - *ret_conv = ClosureReason_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1supports_1any_1optional_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InvoiceRequestFeatures_supports_any_optional_bits(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKHTLCDestination this_ptr_conv = *(LDKHTLCDestination*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - HTLCDestination_free(this_ptr_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1requires_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKInvoiceRequestFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + jboolean ret_conv = InvoiceRequestFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); + return ret_conv; } -static inline uint64_t HTLCDestination_clone_ptr(LDKHTLCDestination *NONNULL_PTR arg) { - LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); - *ret_copy = HTLCDestination_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1required_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKInvoiceRequestFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + LDKCVec_u64Z ret_var = InvoiceRequestFeatures_required_unknown_bits_from(&this_arg_conv, &other_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKHTLCDestination* arg_conv = (LDKHTLCDestination*)untag_ptr(arg); - int64_t ret_conv = HTLCDestination_clone_ptr(arg_conv); + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InvoiceRequestFeatures_requires_unknown_bits(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKHTLCDestination* orig_conv = (LDKHTLCDestination*)untag_ptr(orig); - LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); - *ret_copy = HTLCDestination_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1supports_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InvoiceRequestFeatures_supports_unknown_bits(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1next_1hop_1channel(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t channel_id) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKChannelId channel_id_conv; - channel_id_conv.inner = untag_ptr(channel_id); - channel_id_conv.is_owned = ptr_is_owned(channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); - channel_id_conv = ChannelId_clone(&channel_id_conv); - LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); - *ret_copy = HTLCDestination_next_hop_channel(node_id_ref, channel_id_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1set_1required_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = InvoiceRequestFeatures_set_required_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1unknown_1next_1hop(JNIEnv *env, jclass clz, int64_t requested_forward_scid) { - LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); - *ret_copy = HTLCDestination_unknown_next_hop(requested_forward_scid); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1set_1optional_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = InvoiceRequestFeatures_set_optional_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1invalid_1forward(JNIEnv *env, jclass clz, int64_t requested_forward_scid) { - LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); - *ret_copy = HTLCDestination_invalid_forward(requested_forward_scid); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1set_1required_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = InvoiceRequestFeatures_set_required_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1invalid_1onion(JNIEnv *env, jclass clz) { - LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); - *ret_copy = HTLCDestination_invalid_onion(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1set_1optional_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = InvoiceRequestFeatures_set_optional_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1failed_1payment(JNIEnv *env, jclass clz, int8_tArray payment_hash) { - LDKThirtyTwoBytes payment_hash_ref; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); - *ret_copy = HTLCDestination_failed_payment(payment_hash_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1empty(JNIEnv *env, jclass clz) { + LDKBolt12InvoiceFeatures ret_var = Bolt12InvoiceFeatures_empty(); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKHTLCDestination* a_conv = (LDKHTLCDestination*)untag_ptr(a); - LDKHTLCDestination* b_conv = (LDKHTLCDestination*)untag_ptr(b); - jboolean ret_conv = HTLCDestination_eq(a_conv, b_conv); - return ret_conv; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKHTLCDestination* obj_conv = (LDKHTLCDestination*)untag_ptr(obj); - LDKCVec_u8Z ret_var = HTLCDestination_write(obj_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1le_1flags(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKu8slice ret_var = Bolt12InvoiceFeatures_le_flags(&this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ"); - *ret_conv = HTLCDestination_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1supports_1any_1optional_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt12InvoiceFeatures_supports_any_optional_bits(&this_arg_conv); + return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPaymentFailureReason* orig_conv = (LDKPaymentFailureReason*)untag_ptr(orig); - jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_clone(orig_conv)); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1requires_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKBolt12InvoiceFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + jboolean ret_conv = Bolt12InvoiceFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1recipient_1rejected(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_recipient_rejected()); - return ret_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1required_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKBolt12InvoiceFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + LDKCVec_u64Z ret_var = Bolt12InvoiceFeatures_required_unknown_bits_from(&this_arg_conv, &other_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1user_1abandoned(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_user_abandoned()); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt12InvoiceFeatures_requires_unknown_bits(&this_arg_conv); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1retries_1exhausted(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_retries_exhausted()); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1supports_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt12InvoiceFeatures_supports_unknown_bits(&this_arg_conv); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1payment_1expired(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_payment_expired()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1required_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = Bolt12InvoiceFeatures_set_required_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1route_1not_1found(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_route_not_found()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1optional_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = Bolt12InvoiceFeatures_set_optional_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1unexpected_1error(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_unexpected_error()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1required_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = Bolt12InvoiceFeatures_set_required_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKPaymentFailureReason* a_conv = (LDKPaymentFailureReason*)untag_ptr(a); - LDKPaymentFailureReason* b_conv = (LDKPaymentFailureReason*)untag_ptr(b); - jboolean ret_conv = PaymentFailureReason_eq(a_conv, b_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1optional_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = Bolt12InvoiceFeatures_set_optional_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKPaymentFailureReason* obj_conv = (LDKPaymentFailureReason*)untag_ptr(obj); - LDKCVec_u8Z ret_var = PaymentFailureReason_write(obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1empty(JNIEnv *env, jclass clz) { + LDKBlindedHopFeatures ret_var = BlindedHopFeatures_empty(); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1le_1flags(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKu8slice ret_var = BlindedHopFeatures_le_flags(&this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_PaymentFailureReasonDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentFailureReasonDecodeErrorZ), "LDKCResult_PaymentFailureReasonDecodeErrorZ"); - *ret_conv = PaymentFailureReason_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1supports_1any_1optional_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = BlindedHopFeatures_supports_any_optional_bits(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Event_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKEvent this_ptr_conv = *(LDKEvent*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Event_free(this_ptr_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1requires_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKBlindedHopFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + jboolean ret_conv = BlindedHopFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); + return ret_conv; } -static inline uint64_t Event_clone_ptr(LDKEvent *NONNULL_PTR arg) { - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1required_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKBlindedHopFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + LDKCVec_u64Z ret_var = BlindedHopFeatures_required_unknown_bits_from(&this_arg_conv, &other_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKEvent* arg_conv = (LDKEvent*)untag_ptr(arg); - int64_t ret_conv = Event_clone_ptr(arg_conv); + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = BlindedHopFeatures_requires_unknown_bits(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKEvent* orig_conv = (LDKEvent*)untag_ptr(orig); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1supports_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = BlindedHopFeatures_supports_unknown_bits(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1funding_1generation_1ready(JNIEnv *env, jclass clz, int64_t temporary_channel_id, int8_tArray counterparty_node_id, int64_t channel_value_satoshis, int8_tArray output_script, int8_tArray user_channel_id) { - LDKChannelId temporary_channel_id_conv; - temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); - temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); - temporary_channel_id_conv = ChannelId_clone(&temporary_channel_id_conv); - LDKPublicKey counterparty_node_id_ref; - CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); - (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); - LDKCVec_u8Z output_script_ref; - output_script_ref.datalen = (*env)->GetArrayLength(env, output_script); - output_script_ref.data = MALLOC(output_script_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, output_script, 0, output_script_ref.datalen, output_script_ref.data); - LDKU128 user_channel_id_ref; - CHECK((*env)->GetArrayLength(env, user_channel_id) == 16); - (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_funding_generation_ready(temporary_channel_id_conv, counterparty_node_id_ref, channel_value_satoshis, output_script_ref, user_channel_id_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1set_1required_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = BlindedHopFeatures_set_required_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1claimable(JNIEnv *env, jclass clz, int8_tArray receiver_node_id, int8_tArray payment_hash, int64_t onion_fields, int64_t amount_msat, int64_t counterparty_skimmed_fee_msat, int64_t purpose, int64_t via_channel_id, int64_t via_user_channel_id, int64_t claim_deadline) { - LDKPublicKey receiver_node_id_ref; - CHECK((*env)->GetArrayLength(env, receiver_node_id) == 33); - (*env)->GetByteArrayRegion(env, receiver_node_id, 0, 33, receiver_node_id_ref.compressed_form); - LDKThirtyTwoBytes payment_hash_ref; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - LDKRecipientOnionFields onion_fields_conv; - onion_fields_conv.inner = untag_ptr(onion_fields); - onion_fields_conv.is_owned = ptr_is_owned(onion_fields); - CHECK_INNER_FIELD_ACCESS_OR_NULL(onion_fields_conv); - onion_fields_conv = RecipientOnionFields_clone(&onion_fields_conv); - void* purpose_ptr = untag_ptr(purpose); - CHECK_ACCESS(purpose_ptr); - LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr); - purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose)); - LDKChannelId via_channel_id_conv; - via_channel_id_conv.inner = untag_ptr(via_channel_id); - via_channel_id_conv.is_owned = ptr_is_owned(via_channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(via_channel_id_conv); - via_channel_id_conv = ChannelId_clone(&via_channel_id_conv); - void* via_user_channel_id_ptr = untag_ptr(via_user_channel_id); - CHECK_ACCESS(via_user_channel_id_ptr); - LDKCOption_U128Z via_user_channel_id_conv = *(LDKCOption_U128Z*)(via_user_channel_id_ptr); - via_user_channel_id_conv = COption_U128Z_clone((LDKCOption_U128Z*)untag_ptr(via_user_channel_id)); - void* claim_deadline_ptr = untag_ptr(claim_deadline); - CHECK_ACCESS(claim_deadline_ptr); - LDKCOption_u32Z claim_deadline_conv = *(LDKCOption_u32Z*)(claim_deadline_ptr); - claim_deadline_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(claim_deadline)); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_claimable(receiver_node_id_ref, payment_hash_ref, onion_fields_conv, amount_msat, counterparty_skimmed_fee_msat, purpose_conv, via_channel_id_conv, via_user_channel_id_conv, claim_deadline_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1set_1optional_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = BlindedHopFeatures_set_optional_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1claimed(JNIEnv *env, jclass clz, int8_tArray receiver_node_id, int8_tArray payment_hash, int64_t amount_msat, int64_t purpose, int64_tArray htlcs, int64_t sender_intended_total_msat) { - LDKPublicKey receiver_node_id_ref; - CHECK((*env)->GetArrayLength(env, receiver_node_id) == 33); - (*env)->GetByteArrayRegion(env, receiver_node_id, 0, 33, receiver_node_id_ref.compressed_form); - LDKThirtyTwoBytes payment_hash_ref; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - void* purpose_ptr = untag_ptr(purpose); - CHECK_ACCESS(purpose_ptr); - LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr); - purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose)); - LDKCVec_ClaimedHTLCZ htlcs_constr; - htlcs_constr.datalen = (*env)->GetArrayLength(env, htlcs); - if (htlcs_constr.datalen > 0) - htlcs_constr.data = MALLOC(htlcs_constr.datalen * sizeof(LDKClaimedHTLC), "LDKCVec_ClaimedHTLCZ Elements"); - else - htlcs_constr.data = NULL; - int64_t* htlcs_vals = (*env)->GetLongArrayElements (env, htlcs, NULL); - for (size_t n = 0; n < htlcs_constr.datalen; n++) { - int64_t htlcs_conv_13 = htlcs_vals[n]; - LDKClaimedHTLC htlcs_conv_13_conv; - htlcs_conv_13_conv.inner = untag_ptr(htlcs_conv_13); - htlcs_conv_13_conv.is_owned = ptr_is_owned(htlcs_conv_13); - CHECK_INNER_FIELD_ACCESS_OR_NULL(htlcs_conv_13_conv); - htlcs_conv_13_conv = ClaimedHTLC_clone(&htlcs_conv_13_conv); - htlcs_constr.data[n] = htlcs_conv_13_conv; - } - (*env)->ReleaseLongArrayElements(env, htlcs, htlcs_vals, 0); - void* sender_intended_total_msat_ptr = untag_ptr(sender_intended_total_msat); - CHECK_ACCESS(sender_intended_total_msat_ptr); - LDKCOption_u64Z sender_intended_total_msat_conv = *(LDKCOption_u64Z*)(sender_intended_total_msat_ptr); - sender_intended_total_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(sender_intended_total_msat)); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_claimed(receiver_node_id_ref, payment_hash_ref, amount_msat, purpose_conv, htlcs_constr, sender_intended_total_msat_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1set_1required_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = BlindedHopFeatures_set_required_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1connection_1needed(JNIEnv *env, jclass clz, int8_tArray node_id, int64_tArray addresses) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKCVec_SocketAddressZ addresses_constr; - addresses_constr.datalen = (*env)->GetArrayLength(env, addresses); - if (addresses_constr.datalen > 0) - addresses_constr.data = MALLOC(addresses_constr.datalen * sizeof(LDKSocketAddress), "LDKCVec_SocketAddressZ Elements"); - else - addresses_constr.data = NULL; - int64_t* addresses_vals = (*env)->GetLongArrayElements (env, addresses, NULL); - for (size_t p = 0; p < addresses_constr.datalen; p++) { - int64_t addresses_conv_15 = addresses_vals[p]; - void* addresses_conv_15_ptr = untag_ptr(addresses_conv_15); - CHECK_ACCESS(addresses_conv_15_ptr); - LDKSocketAddress addresses_conv_15_conv = *(LDKSocketAddress*)(addresses_conv_15_ptr); - addresses_constr.data[p] = addresses_conv_15_conv; - } - (*env)->ReleaseLongArrayElements(env, addresses, addresses_vals, 0); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_connection_needed(node_id_ref, addresses_constr); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1set_1optional_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKBlindedHopFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = BlindedHopFeatures_set_optional_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1invoice_1request_1failed(JNIEnv *env, jclass clz, int8_tArray payment_id) { - LDKThirtyTwoBytes payment_id_ref; - CHECK((*env)->GetArrayLength(env, payment_id) == 32); - (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_invoice_request_failed(payment_id_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1empty(JNIEnv *env, jclass clz) { + LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_empty(); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1sent(JNIEnv *env, jclass clz, int64_t payment_id, int8_tArray payment_preimage, int8_tArray payment_hash, int64_t fee_paid_msat) { - void* payment_id_ptr = untag_ptr(payment_id); - CHECK_ACCESS(payment_id_ptr); - LDKCOption_ThirtyTwoBytesZ payment_id_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_id_ptr); - payment_id_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_id)); - LDKThirtyTwoBytes payment_preimage_ref; - CHECK((*env)->GetArrayLength(env, payment_preimage) == 32); - (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data); - LDKThirtyTwoBytes payment_hash_ref; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - void* fee_paid_msat_ptr = untag_ptr(fee_paid_msat); - CHECK_ACCESS(fee_paid_msat_ptr); - LDKCOption_u64Z fee_paid_msat_conv = *(LDKCOption_u64Z*)(fee_paid_msat_ptr); - fee_paid_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(fee_paid_msat)); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_sent(payment_id_conv, payment_preimage_ref, payment_hash_ref, fee_paid_msat_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1le_1flags(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKu8slice ret_var = ChannelTypeFeatures_le_flags(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1failed(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_hash, int64_t reason) { - LDKThirtyTwoBytes payment_id_ref; - CHECK((*env)->GetArrayLength(env, payment_id) == 32); - (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); - LDKThirtyTwoBytes payment_hash_ref; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - void* reason_ptr = untag_ptr(reason); - CHECK_ACCESS(reason_ptr); - LDKCOption_PaymentFailureReasonZ reason_conv = *(LDKCOption_PaymentFailureReasonZ*)(reason_ptr); - reason_conv = COption_PaymentFailureReasonZ_clone((LDKCOption_PaymentFailureReasonZ*)untag_ptr(reason)); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_failed(payment_id_ref, payment_hash_ref, reason_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1any_1optional_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_supports_any_optional_bits(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1successful(JNIEnv *env, jclass clz, int8_tArray payment_id, int64_t payment_hash, int64_t path) { - LDKThirtyTwoBytes payment_id_ref; - CHECK((*env)->GetArrayLength(env, payment_id) == 32); - (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); - void* payment_hash_ptr = untag_ptr(payment_hash); - CHECK_ACCESS(payment_hash_ptr); - LDKCOption_ThirtyTwoBytesZ payment_hash_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_ptr); - payment_hash_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash)); - LDKPath path_conv; - path_conv.inner = untag_ptr(path); - path_conv.is_owned = ptr_is_owned(path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); - path_conv = Path_clone(&path_conv); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_path_successful(payment_id_ref, payment_hash_conv, path_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelTypeFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_requires_unknown_bits_from(&this_arg_conv, &other_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1failed(JNIEnv *env, jclass clz, int64_t payment_id, int8_tArray payment_hash, jboolean payment_failed_permanently, int64_t failure, int64_t path, int64_t short_channel_id) { - void* payment_id_ptr = untag_ptr(payment_id); - CHECK_ACCESS(payment_id_ptr); - LDKCOption_ThirtyTwoBytesZ payment_id_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_id_ptr); - payment_id_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_id)); - LDKThirtyTwoBytes payment_hash_ref; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - void* failure_ptr = untag_ptr(failure); - CHECK_ACCESS(failure_ptr); - LDKPathFailure failure_conv = *(LDKPathFailure*)(failure_ptr); - failure_conv = PathFailure_clone((LDKPathFailure*)untag_ptr(failure)); - LDKPath path_conv; - path_conv.inner = untag_ptr(path); - path_conv.is_owned = ptr_is_owned(path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); - path_conv = Path_clone(&path_conv); - void* short_channel_id_ptr = untag_ptr(short_channel_id); - CHECK_ACCESS(short_channel_id_ptr); - LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr); - short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id)); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_path_failed(payment_id_conv, payment_hash_ref, payment_failed_permanently, failure_conv, path_conv, short_channel_id_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1required_1unknown_1bits_1from(JNIEnv *env, jclass clz, int64_t this_arg, int64_t other) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelTypeFeatures other_conv; + other_conv.inner = untag_ptr(other); + other_conv.is_owned = ptr_is_owned(other); + CHECK_INNER_FIELD_ACCESS_OR_NULL(other_conv); + other_conv.is_owned = false; + LDKCVec_u64Z ret_var = ChannelTypeFeatures_required_unknown_bits_from(&this_arg_conv, &other_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1probe_1successful(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_hash, int64_t path) { - LDKThirtyTwoBytes payment_id_ref; - CHECK((*env)->GetArrayLength(env, payment_id) == 32); - (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); - LDKThirtyTwoBytes payment_hash_ref; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - LDKPath path_conv; - path_conv.inner = untag_ptr(path); - path_conv.is_owned = ptr_is_owned(path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); - path_conv = Path_clone(&path_conv); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_probe_successful(payment_id_ref, payment_hash_ref, path_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_requires_unknown_bits(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1probe_1failed(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_hash, int64_t path, int64_t short_channel_id) { - LDKThirtyTwoBytes payment_id_ref; - CHECK((*env)->GetArrayLength(env, payment_id) == 32); - (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); - LDKThirtyTwoBytes payment_hash_ref; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - LDKPath path_conv; - path_conv.inner = untag_ptr(path); - path_conv.is_owned = ptr_is_owned(path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); - path_conv = Path_clone(&path_conv); - void* short_channel_id_ptr = untag_ptr(short_channel_id); - CHECK_ACCESS(short_channel_id_ptr); - LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr); - short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id)); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_probe_failed(payment_id_ref, payment_hash_ref, path_conv, short_channel_id_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_supports_unknown_bits(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1pending_1htlcs_1forwardable(JNIEnv *env, jclass clz, int64_t time_forwardable) { - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_pending_htlcs_forwardable(time_forwardable); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1required_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelTypeFeatures_set_required_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1htlcintercepted(JNIEnv *env, jclass clz, int8_tArray intercept_id, int64_t requested_next_hop_scid, int8_tArray payment_hash, int64_t inbound_amount_msat, int64_t expected_outbound_amount_msat) { - LDKThirtyTwoBytes intercept_id_ref; - CHECK((*env)->GetArrayLength(env, intercept_id) == 32); - (*env)->GetByteArrayRegion(env, intercept_id, 0, 32, intercept_id_ref.data); - LDKThirtyTwoBytes payment_hash_ref; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_htlcintercepted(intercept_id_ref, requested_next_hop_scid, payment_hash_ref, inbound_amount_msat, expected_outbound_amount_msat); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1optional_1feature_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelTypeFeatures_set_optional_feature_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1spendable_1outputs(JNIEnv *env, jclass clz, int64_tArray outputs, int64_t channel_id) { - LDKCVec_SpendableOutputDescriptorZ outputs_constr; - outputs_constr.datalen = (*env)->GetArrayLength(env, outputs); - if (outputs_constr.datalen > 0) - outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); - else - outputs_constr.data = NULL; - int64_t* outputs_vals = (*env)->GetLongArrayElements (env, outputs, NULL); - for (size_t b = 0; b < outputs_constr.datalen; b++) { - int64_t outputs_conv_27 = outputs_vals[b]; - void* outputs_conv_27_ptr = untag_ptr(outputs_conv_27); - CHECK_ACCESS(outputs_conv_27_ptr); - LDKSpendableOutputDescriptor outputs_conv_27_conv = *(LDKSpendableOutputDescriptor*)(outputs_conv_27_ptr); - outputs_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(outputs_conv_27)); - outputs_constr.data[b] = outputs_conv_27_conv; - } - (*env)->ReleaseLongArrayElements(env, outputs, outputs_vals, 0); - LDKChannelId channel_id_conv; - channel_id_conv.inner = untag_ptr(channel_id); - channel_id_conv.is_owned = ptr_is_owned(channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); - channel_id_conv = ChannelId_clone(&channel_id_conv); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_spendable_outputs(outputs_constr, channel_id_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1required_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelTypeFeatures_set_required_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1forwarded(JNIEnv *env, jclass clz, int64_t prev_channel_id, int64_t next_channel_id, int64_t prev_user_channel_id, int64_t next_user_channel_id, int64_t total_fee_earned_msat, int64_t skimmed_fee_msat, jboolean claim_from_onchain_tx, int64_t outbound_amount_forwarded_msat) { - LDKChannelId prev_channel_id_conv; - prev_channel_id_conv.inner = untag_ptr(prev_channel_id); - prev_channel_id_conv.is_owned = ptr_is_owned(prev_channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(prev_channel_id_conv); - prev_channel_id_conv = ChannelId_clone(&prev_channel_id_conv); - LDKChannelId next_channel_id_conv; - next_channel_id_conv.inner = untag_ptr(next_channel_id); - next_channel_id_conv.is_owned = ptr_is_owned(next_channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(next_channel_id_conv); - next_channel_id_conv = ChannelId_clone(&next_channel_id_conv); - void* prev_user_channel_id_ptr = untag_ptr(prev_user_channel_id); - CHECK_ACCESS(prev_user_channel_id_ptr); - LDKCOption_U128Z prev_user_channel_id_conv = *(LDKCOption_U128Z*)(prev_user_channel_id_ptr); - prev_user_channel_id_conv = COption_U128Z_clone((LDKCOption_U128Z*)untag_ptr(prev_user_channel_id)); - void* next_user_channel_id_ptr = untag_ptr(next_user_channel_id); - CHECK_ACCESS(next_user_channel_id_ptr); - LDKCOption_U128Z next_user_channel_id_conv = *(LDKCOption_U128Z*)(next_user_channel_id_ptr); - next_user_channel_id_conv = COption_U128Z_clone((LDKCOption_U128Z*)untag_ptr(next_user_channel_id)); - void* total_fee_earned_msat_ptr = untag_ptr(total_fee_earned_msat); - CHECK_ACCESS(total_fee_earned_msat_ptr); - LDKCOption_u64Z total_fee_earned_msat_conv = *(LDKCOption_u64Z*)(total_fee_earned_msat_ptr); - total_fee_earned_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(total_fee_earned_msat)); - void* skimmed_fee_msat_ptr = untag_ptr(skimmed_fee_msat); - CHECK_ACCESS(skimmed_fee_msat_ptr); - LDKCOption_u64Z skimmed_fee_msat_conv = *(LDKCOption_u64Z*)(skimmed_fee_msat_ptr); - skimmed_fee_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(skimmed_fee_msat)); - void* outbound_amount_forwarded_msat_ptr = untag_ptr(outbound_amount_forwarded_msat); - CHECK_ACCESS(outbound_amount_forwarded_msat_ptr); - LDKCOption_u64Z outbound_amount_forwarded_msat_conv = *(LDKCOption_u64Z*)(outbound_amount_forwarded_msat_ptr); - outbound_amount_forwarded_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_amount_forwarded_msat)); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_forwarded(prev_channel_id_conv, next_channel_id_conv, prev_user_channel_id_conv, next_user_channel_id_conv, total_fee_earned_msat_conv, skimmed_fee_msat_conv, claim_from_onchain_tx, outbound_amount_forwarded_msat_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1optional_1custom_1bit(JNIEnv *env, jclass clz, int64_t this_arg, int64_t bit) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelTypeFeatures_set_optional_custom_bit(&this_arg_conv, bit); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clear_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = InitFeatures_clone(&this_arg_conv); + LDKInitFeatures ret_var = InitFeatures_clear_upfront_shutdown_script(this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1channel_1pending(JNIEnv *env, jclass clz, int64_t channel_id, int8_tArray user_channel_id, int64_t former_temporary_channel_id, int8_tArray counterparty_node_id, int64_t funding_txo, int64_t channel_type) { - LDKChannelId channel_id_conv; - channel_id_conv.inner = untag_ptr(channel_id); - channel_id_conv.is_owned = ptr_is_owned(channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); - channel_id_conv = ChannelId_clone(&channel_id_conv); - LDKU128 user_channel_id_ref; - CHECK((*env)->GetArrayLength(env, user_channel_id) == 16); - (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes); - LDKChannelId former_temporary_channel_id_conv; - former_temporary_channel_id_conv.inner = untag_ptr(former_temporary_channel_id); - former_temporary_channel_id_conv.is_owned = ptr_is_owned(former_temporary_channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(former_temporary_channel_id_conv); - former_temporary_channel_id_conv = ChannelId_clone(&former_temporary_channel_id_conv); - LDKPublicKey counterparty_node_id_ref; - CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); - (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); - LDKOutPoint funding_txo_conv; - funding_txo_conv.inner = untag_ptr(funding_txo); - funding_txo_conv.is_owned = ptr_is_owned(funding_txo); - CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); - funding_txo_conv = OutPoint_clone(&funding_txo_conv); - LDKChannelTypeFeatures channel_type_conv; - channel_type_conv.inner = untag_ptr(channel_type); - channel_type_conv.is_owned = ptr_is_owned(channel_type); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_conv); - channel_type_conv = ChannelTypeFeatures_clone(&channel_type_conv); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_channel_pending(channel_id_conv, user_channel_id_ref, former_temporary_channel_id_conv, counterparty_node_id_ref, funding_txo_conv, channel_type_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clear_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = NodeFeatures_clone(&this_arg_conv); + LDKNodeFeatures ret_var = NodeFeatures_clear_upfront_shutdown_script(this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1channel_1ready(JNIEnv *env, jclass clz, int64_t channel_id, int8_tArray user_channel_id, int8_tArray counterparty_node_id, int64_t channel_type) { - LDKChannelId channel_id_conv; - channel_id_conv.inner = untag_ptr(channel_id); - channel_id_conv.is_owned = ptr_is_owned(channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); - channel_id_conv = ChannelId_clone(&channel_id_conv); - LDKU128 user_channel_id_ref; - CHECK((*env)->GetArrayLength(env, user_channel_id) == 16); - (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes); - LDKPublicKey counterparty_node_id_ref; - CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); - (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); - LDKChannelTypeFeatures channel_type_conv; - channel_type_conv.inner = untag_ptr(channel_type); - channel_type_conv.is_owned = ptr_is_owned(channel_type); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_conv); - channel_type_conv = ChannelTypeFeatures_clone(&channel_type_conv); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_channel_ready(channel_id_conv, user_channel_id_ref, counterparty_node_id_ref, channel_type_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clear_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = InitFeatures_clone(&this_arg_conv); + LDKInitFeatures ret_var = InitFeatures_clear_shutdown_anysegwit(this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1channel_1closed(JNIEnv *env, jclass clz, int64_t channel_id, int8_tArray user_channel_id, int64_t reason, int8_tArray counterparty_node_id, int64_t channel_capacity_sats, int64_t channel_funding_txo) { - LDKChannelId channel_id_conv; - channel_id_conv.inner = untag_ptr(channel_id); - channel_id_conv.is_owned = ptr_is_owned(channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); - channel_id_conv = ChannelId_clone(&channel_id_conv); - LDKU128 user_channel_id_ref; - CHECK((*env)->GetArrayLength(env, user_channel_id) == 16); - (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes); - void* reason_ptr = untag_ptr(reason); - CHECK_ACCESS(reason_ptr); - LDKClosureReason reason_conv = *(LDKClosureReason*)(reason_ptr); - reason_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(reason)); - LDKPublicKey counterparty_node_id_ref; - CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); - (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); - void* channel_capacity_sats_ptr = untag_ptr(channel_capacity_sats); - CHECK_ACCESS(channel_capacity_sats_ptr); - LDKCOption_u64Z channel_capacity_sats_conv = *(LDKCOption_u64Z*)(channel_capacity_sats_ptr); - channel_capacity_sats_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(channel_capacity_sats)); - LDKOutPoint channel_funding_txo_conv; - channel_funding_txo_conv.inner = untag_ptr(channel_funding_txo); - channel_funding_txo_conv.is_owned = ptr_is_owned(channel_funding_txo); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_funding_txo_conv); - channel_funding_txo_conv = OutPoint_clone(&channel_funding_txo_conv); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_channel_closed(channel_id_conv, user_channel_id_ref, reason_conv, counterparty_node_id_ref, channel_capacity_sats_conv, channel_funding_txo_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clear_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = NodeFeatures_clone(&this_arg_conv); + LDKNodeFeatures ret_var = NodeFeatures_clear_shutdown_anysegwit(this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1discard_1funding(JNIEnv *env, jclass clz, int64_t channel_id, int8_tArray transaction) { - LDKChannelId channel_id_conv; - channel_id_conv.inner = untag_ptr(channel_id); - channel_id_conv.is_owned = ptr_is_owned(channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); - channel_id_conv = ChannelId_clone(&channel_id_conv); - LDKTransaction transaction_ref; - transaction_ref.datalen = (*env)->GetArrayLength(env, transaction); - transaction_ref.data = MALLOC(transaction_ref.datalen, "LDKTransaction Bytes"); - (*env)->GetByteArrayRegion(env, transaction, 0, transaction_ref.datalen, transaction_ref.data); - transaction_ref.data_is_owned = true; - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_discard_funding(channel_id_conv, transaction_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clear_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = InitFeatures_clone(&this_arg_conv); + LDKInitFeatures ret_var = InitFeatures_clear_wumbo(this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1open_1channel_1request(JNIEnv *env, jclass clz, int64_t temporary_channel_id, int8_tArray counterparty_node_id, int64_t funding_satoshis, int64_t push_msat, int64_t channel_type) { - LDKChannelId temporary_channel_id_conv; - temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); - temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); - temporary_channel_id_conv = ChannelId_clone(&temporary_channel_id_conv); - LDKPublicKey counterparty_node_id_ref; - CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); - (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); - LDKChannelTypeFeatures channel_type_conv; - channel_type_conv.inner = untag_ptr(channel_type); - channel_type_conv.is_owned = ptr_is_owned(channel_type); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_conv); - channel_type_conv = ChannelTypeFeatures_clone(&channel_type_conv); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_open_channel_request(temporary_channel_id_conv, counterparty_node_id_ref, funding_satoshis, push_msat, channel_type_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clear_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = NodeFeatures_clone(&this_arg_conv); + LDKNodeFeatures ret_var = NodeFeatures_clear_wumbo(this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1htlchandling_1failed(JNIEnv *env, jclass clz, int64_t prev_channel_id, int64_t failed_next_destination) { - LDKChannelId prev_channel_id_conv; - prev_channel_id_conv.inner = untag_ptr(prev_channel_id); - prev_channel_id_conv.is_owned = ptr_is_owned(prev_channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(prev_channel_id_conv); - prev_channel_id_conv = ChannelId_clone(&prev_channel_id_conv); - void* failed_next_destination_ptr = untag_ptr(failed_next_destination); - CHECK_ACCESS(failed_next_destination_ptr); - LDKHTLCDestination failed_next_destination_conv = *(LDKHTLCDestination*)(failed_next_destination_ptr); - failed_next_destination_conv = HTLCDestination_clone((LDKHTLCDestination*)untag_ptr(failed_next_destination)); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_htlchandling_failed(prev_channel_id_conv, failed_next_destination_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clear_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_clear_scid_privacy(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clear_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_clear_scid_privacy(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clear_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_clear_scid_privacy(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clear_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_clear_anchors_zero_fee_htlc_tx(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clear_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_clear_anchors_zero_fee_htlc_tx(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clear_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_clear_anchors_zero_fee_htlc_tx(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clear_1route_1blinding(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_clear_route_blinding(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clear_1route_1blinding(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_clear_route_blinding(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1data_1loss_1protect_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_data_loss_protect_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1data_1loss_1protect_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_data_loss_protect_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_data_loss_protect(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1data_1loss_1protect_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_data_loss_protect_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1data_1loss_1protect_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_data_loss_protect_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_data_loss_protect(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_data_loss_protect(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_data_loss_protect(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1initial_1routing_1sync_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_initial_routing_sync_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1initial_1routing_1sync_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_initial_routing_sync_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1initial_1routing_1sync(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_initial_routing_sync(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1upfront_1shutdown_1script_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_upfront_shutdown_script_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1upfront_1shutdown_1script_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_upfront_shutdown_script_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_upfront_shutdown_script(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1upfront_1shutdown_1script_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_upfront_shutdown_script_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1upfront_1shutdown_1script_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_upfront_shutdown_script_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_upfront_shutdown_script(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_upfront_shutdown_script(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_upfront_shutdown_script(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1gossip_1queries_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_gossip_queries_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1gossip_1queries_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_gossip_queries_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_gossip_queries(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1gossip_1queries_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_gossip_queries_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1gossip_1queries_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_gossip_queries_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_gossip_queries(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_gossip_queries(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_gossip_queries(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1variable_1length_1onion_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_variable_length_onion_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1variable_1length_1onion_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_variable_length_onion_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_variable_length_onion(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1variable_1length_1onion_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_variable_length_onion_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1variable_1length_1onion_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_variable_length_onion_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_variable_length_onion(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1variable_1length_1onion_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + Bolt11InvoiceFeatures_set_variable_length_onion_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1variable_1length_1onion_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + Bolt11InvoiceFeatures_set_variable_length_onion_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1supports_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt11InvoiceFeatures_supports_variable_length_onion(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_variable_length_onion(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_variable_length_onion(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt11InvoiceFeatures_requires_variable_length_onion(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1static_1remote_1key_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_static_remote_key_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1static_1remote_1key_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_static_remote_key_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_static_remote_key(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1static_1remote_1key_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_static_remote_key_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1static_1remote_1key_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_static_remote_key_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_static_remote_key(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1static_1remote_1key_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_static_remote_key_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1static_1remote_1key_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_static_remote_key_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_supports_static_remote_key(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_static_remote_key(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_static_remote_key(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_requires_static_remote_key(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1payment_1secret_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_payment_secret_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1payment_1secret_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_payment_secret_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_payment_secret(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1payment_1secret_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_payment_secret_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1payment_1secret_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_payment_secret_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_payment_secret(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1payment_1secret_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + Bolt11InvoiceFeatures_set_payment_secret_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1payment_1secret_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + Bolt11InvoiceFeatures_set_payment_secret_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1supports_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt11InvoiceFeatures_supports_payment_secret(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_payment_secret(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_payment_secret(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt11InvoiceFeatures_requires_payment_secret(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1basic_1mpp_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_basic_mpp_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1basic_1mpp_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_basic_mpp_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_basic_mpp(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1basic_1mpp_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_basic_mpp_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1basic_1mpp_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_basic_mpp_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_basic_mpp(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1basic_1mpp_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + Bolt11InvoiceFeatures_set_basic_mpp_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1basic_1mpp_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + Bolt11InvoiceFeatures_set_basic_mpp_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1supports_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt11InvoiceFeatures_supports_basic_mpp(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1basic_1mpp_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + Bolt12InvoiceFeatures_set_basic_mpp_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1basic_1mpp_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + Bolt12InvoiceFeatures_set_basic_mpp_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1supports_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt12InvoiceFeatures_supports_basic_mpp(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_basic_mpp(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_basic_mpp(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt11InvoiceFeatures_requires_basic_mpp(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1requires_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt12InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt12InvoiceFeatures_requires_basic_mpp(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1wumbo_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_wumbo_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1wumbo_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_wumbo_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_wumbo(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1wumbo_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_wumbo_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1wumbo_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_wumbo_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_wumbo(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_wumbo(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_wumbo(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1anchors_1nonzero_1fee_1htlc_1tx_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1anchors_1nonzero_1fee_1htlc_1tx_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1anchors_1nonzero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_anchors_nonzero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1anchors_1nonzero_1fee_1htlc_1tx_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1anchors_1nonzero_1fee_1htlc_1tx_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1anchors_1nonzero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1anchors_1nonzero_1fee_1htlc_1tx_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1anchors_1nonzero_1fee_1htlc_1tx_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1anchors_1nonzero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1anchors_1nonzero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_anchors_nonzero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1anchors_1nonzero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1anchors_1nonzero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_anchors_zero_fee_htlc_tx_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_anchors_zero_fee_htlc_tx_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_anchors_zero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_anchors_zero_fee_htlc_tx_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_anchors_zero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_anchors_zero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_anchors_zero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1route_1blinding_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_route_blinding_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1route_1blinding_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_route_blinding_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1route_1blinding(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_route_blinding(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1route_1blinding_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_route_blinding_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1route_1blinding_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_route_blinding_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1route_1blinding(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_route_blinding(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1route_1blinding(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_route_blinding(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1route_1blinding(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_route_blinding(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1shutdown_1any_1segwit_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_shutdown_any_segwit_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1shutdown_1any_1segwit_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_shutdown_any_segwit_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_shutdown_anysegwit(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1shutdown_1any_1segwit_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_shutdown_any_segwit_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1shutdown_1any_1segwit_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_shutdown_any_segwit_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_shutdown_anysegwit(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_shutdown_anysegwit(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_shutdown_anysegwit(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1bump_1transaction(JNIEnv *env, jclass clz, int64_t a) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKBumpTransactionEvent a_conv = *(LDKBumpTransactionEvent*)(a_ptr); - a_conv = BumpTransactionEvent_clone((LDKBumpTransactionEvent*)untag_ptr(a)); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_bump_transaction(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1taproot_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_taproot_optional(&this_arg_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Event_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKEvent* a_conv = (LDKEvent*)untag_ptr(a); - LDKEvent* b_conv = (LDKEvent*)untag_ptr(b); - jboolean ret_conv = Event_eq(a_conv, b_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1taproot_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_taproot_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1taproot(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_taproot(&this_arg_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Event_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKEvent* obj_conv = (LDKEvent*)untag_ptr(obj); - LDKCVec_u8Z ret_var = Event_write(obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1taproot_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_taproot_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); - *ret_conv = Event_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1taproot_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_taproot_required(&this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - MessageSendEvent_free(this_ptr_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1taproot(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_taproot(&this_arg_conv); + return ret_conv; } -static inline uint64_t MessageSendEvent_clone_ptr(LDKMessageSendEvent *NONNULL_PTR arg) { - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1taproot_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_taproot_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKMessageSendEvent* arg_conv = (LDKMessageSendEvent*)untag_ptr(arg); - int64_t ret_conv = MessageSendEvent_clone_ptr(arg_conv); - return ret_conv; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1taproot_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_taproot_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKMessageSendEvent* orig_conv = (LDKMessageSendEvent*)untag_ptr(orig); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1taproot(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_supports_taproot(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1accept_1channel(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKAcceptChannel msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = AcceptChannel_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_accept_channel(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1taproot(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_taproot(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1accept_1channel_1v2(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKAcceptChannelV2 msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = AcceptChannelV2_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_accept_channel_v2(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1taproot(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_taproot(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1open_1channel(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKOpenChannel msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = OpenChannel_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_open_channel(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1taproot(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_requires_taproot(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1open_1channel_1v2(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKOpenChannelV2 msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = OpenChannelV2_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_open_channel_v2(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1onion_1messages_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_onion_messages_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1funding_1created(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKFundingCreated msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = FundingCreated_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_funding_created(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1onion_1messages_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_onion_messages_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1funding_1signed(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKFundingSigned msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = FundingSigned_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_funding_signed(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1onion_1messages(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_onion_messages(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1stfu(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKStfu msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = Stfu_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_stfu(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1onion_1messages_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_onion_messages_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1splice(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKSplice msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = Splice_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_splice(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1onion_1messages_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_onion_messages_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1splice_1ack(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKSpliceAck msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = SpliceAck_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_splice_ack(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1onion_1messages(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_onion_messages(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1splice_1locked(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKSpliceLocked msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = SpliceLocked_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_splice_locked(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1onion_1messages(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_onion_messages(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1add_1input(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKTxAddInput msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = TxAddInput_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_tx_add_input(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1onion_1messages(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_onion_messages(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1add_1output(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKTxAddOutput msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = TxAddOutput_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_tx_add_output(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1channel_1type_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_channel_type_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1remove_1input(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKTxRemoveInput msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = TxRemoveInput_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_tx_remove_input(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1channel_1type_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_channel_type_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1remove_1output(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKTxRemoveOutput msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = TxRemoveOutput_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_tx_remove_output(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_channel_type(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1complete(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKTxComplete msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = TxComplete_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_tx_complete(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1channel_1type_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_channel_type_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1signatures(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKTxSignatures msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = TxSignatures_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_tx_signatures(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1channel_1type_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_channel_type_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1init_1rbf(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKTxInitRbf msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = TxInitRbf_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_tx_init_rbf(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_channel_type(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1ack_1rbf(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKTxAckRbf msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = TxAckRbf_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_tx_ack_rbf(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_channel_type(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_channel_type(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1abort(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKTxAbort msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = TxAbort_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_tx_abort(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1scid_1privacy_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_scid_privacy_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1ready(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKChannelReady msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ChannelReady_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_channel_ready(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1scid_1privacy_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_scid_privacy_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1announcement_1signatures(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKAnnouncementSignatures msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = AnnouncementSignatures_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_announcement_signatures(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_scid_privacy(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1update_1htlcs(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t updates) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKCommitmentUpdate updates_conv; - updates_conv.inner = untag_ptr(updates); - updates_conv.is_owned = ptr_is_owned(updates); - CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv); - updates_conv = CommitmentUpdate_clone(&updates_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_update_htlcs(node_id_ref, updates_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1scid_1privacy_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_scid_privacy_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1revoke_1and_1ack(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKRevokeAndACK msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = RevokeAndACK_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_revoke_and_ack(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1scid_1privacy_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_scid_privacy_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1closing_1signed(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKClosingSigned msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ClosingSigned_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_closing_signed(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_scid_privacy(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1shutdown(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKShutdown msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = Shutdown_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_shutdown(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1scid_1privacy_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_scid_privacy_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1reestablish(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKChannelReestablish msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ChannelReestablish_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_channel_reestablish(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1scid_1privacy_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_scid_privacy_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1announcement(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg, int64_t update_msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKChannelAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ChannelAnnouncement_clone(&msg_conv); - LDKChannelUpdate update_msg_conv; - update_msg_conv.inner = untag_ptr(update_msg); - update_msg_conv.is_owned = ptr_is_owned(update_msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv); - update_msg_conv = ChannelUpdate_clone(&update_msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_channel_announcement(node_id_ref, msg_conv, update_msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_supports_scid_privacy(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1channel_1announcement(JNIEnv *env, jclass clz, int64_t msg, int64_t update_msg) { - LDKChannelAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ChannelAnnouncement_clone(&msg_conv); - LDKChannelUpdate update_msg_conv; - update_msg_conv.inner = untag_ptr(update_msg); - update_msg_conv.is_owned = ptr_is_owned(update_msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv); - update_msg_conv = ChannelUpdate_clone(&update_msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_broadcast_channel_announcement(msg_conv, update_msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_scid_privacy(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1channel_1update(JNIEnv *env, jclass clz, int64_t msg) { - LDKChannelUpdate msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ChannelUpdate_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_broadcast_channel_update(msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_scid_privacy(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1node_1announcement(JNIEnv *env, jclass clz, int64_t msg) { - LDKNodeAnnouncement msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = NodeAnnouncement_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_broadcast_node_announcement(msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_requires_scid_privacy(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1update(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKChannelUpdate msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ChannelUpdate_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_channel_update(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1payment_1metadata_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + Bolt11InvoiceFeatures_set_payment_metadata_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1handle_1error(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t action) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - void* action_ptr = untag_ptr(action); - CHECK_ACCESS(action_ptr); - LDKErrorAction action_conv = *(LDKErrorAction*)(action_ptr); - action_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(action)); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_handle_error(node_id_ref, action_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1payment_1metadata_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + Bolt11InvoiceFeatures_set_payment_metadata_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1range_1query(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKQueryChannelRange msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = QueryChannelRange_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_channel_range_query(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1supports_1payment_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt11InvoiceFeatures_supports_payment_metadata(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1short_1ids_1query(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKQueryShortChannelIds msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = QueryShortChannelIds_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_short_ids_query(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1payment_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt11InvoiceFeatures_requires_payment_metadata(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1reply_1channel_1range(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKReplyChannelRange msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ReplyChannelRange_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_reply_channel_range(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1zero_1conf_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_zero_conf_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1gossip_1timestamp_1filter(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKGossipTimestampFilter msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = GossipTimestampFilter_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_gossip_timestamp_filter(node_id_ref, msg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1zero_1conf_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_zero_conf_required(&this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - MessageSendEventsProvider_free(this_ptr_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_zero_conf(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - EventsProvider_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1zero_1conf_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_zero_conf_optional(&this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKEventHandler this_ptr_conv = *(LDKEventHandler*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - EventHandler_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1zero_1conf_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_zero_conf_required(&this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKAnchorDescriptor this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - AnchorDescriptor_free(this_obj_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_zero_conf(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1get_1channel_1derivation_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAnchorDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelDerivationParameters ret_var = AnchorDescriptor_get_channel_derivation_parameters(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1zero_1conf_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_zero_conf_optional(&this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1set_1channel_1derivation_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKAnchorDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelDerivationParameters val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelDerivationParameters_clone(&val_conv); - AnchorDescriptor_set_channel_derivation_parameters(&this_ptr_conv, val_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1zero_1conf_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_set_zero_conf_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAnchorDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKOutPoint ret_var = AnchorDescriptor_get_outpoint(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_supports_zero_conf(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKAnchorDescriptor this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKOutPoint val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = OutPoint_clone(&val_conv); - AnchorDescriptor_set_outpoint(&this_ptr_conv, val_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_zero_conf(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_zero_conf(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1new(JNIEnv *env, jclass clz, int64_t channel_derivation_parameters_arg, int64_t outpoint_arg) { - LDKChannelDerivationParameters channel_derivation_parameters_arg_conv; - channel_derivation_parameters_arg_conv.inner = untag_ptr(channel_derivation_parameters_arg); - channel_derivation_parameters_arg_conv.is_owned = ptr_is_owned(channel_derivation_parameters_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_derivation_parameters_arg_conv); - channel_derivation_parameters_arg_conv = ChannelDerivationParameters_clone(&channel_derivation_parameters_arg_conv); - LDKOutPoint outpoint_arg_conv; - outpoint_arg_conv.inner = untag_ptr(outpoint_arg); - outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); - outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); - LDKAnchorDescriptor ret_var = AnchorDescriptor_new(channel_derivation_parameters_arg_conv, outpoint_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_requires_zero_conf(&this_arg_conv); + return ret_conv; } -static inline uint64_t AnchorDescriptor_clone_ptr(LDKAnchorDescriptor *NONNULL_PTR arg) { - LDKAnchorDescriptor ret_var = AnchorDescriptor_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1keysend_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_keysend_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKAnchorDescriptor arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = AnchorDescriptor_clone_ptr(&arg_conv); - return ret_conv; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1keysend_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_keysend_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKAnchorDescriptor orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKAnchorDescriptor ret_var = AnchorDescriptor_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1keysend(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_keysend(&this_arg_conv); + return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKAnchorDescriptor a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKAnchorDescriptor b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = AnchorDescriptor_eq(&a_conv, &b_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1keysend(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_keysend(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1previous_1utxo(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKAnchorDescriptor this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1trampoline_1routing_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); - *ret_ref = AnchorDescriptor_previous_utxo(&this_arg_conv); - return tag_ptr(ret_ref, true); + InitFeatures_set_trampoline_routing_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1unsigned_1tx_1input(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKAnchorDescriptor this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1trampoline_1routing_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKTxIn* ret_ref = MALLOC(sizeof(LDKTxIn), "LDKTxIn"); - *ret_ref = AnchorDescriptor_unsigned_tx_input(&this_arg_conv); - return tag_ptr(ret_ref, true); + InitFeatures_set_trampoline_routing_required(&this_arg_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1witness_1script(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKAnchorDescriptor this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1trampoline_1routing(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_u8Z ret_var = AnchorDescriptor_witness_script(&this_arg_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; + jboolean ret_conv = InitFeatures_supports_trampoline_routing(&this_arg_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1tx_1input_1witness(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray signature) { - LDKAnchorDescriptor this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1trampoline_1routing_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKECDSASignature signature_ref; - CHECK((*env)->GetArrayLength(env, signature) == 64); - (*env)->GetByteArrayRegion(env, signature, 0, 64, signature_ref.compact_form); - LDKWitness ret_var = AnchorDescriptor_tx_input_witness(&this_arg_conv, signature_ref); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - Witness_free(ret_var); - return ret_arr; + NodeFeatures_set_trampoline_routing_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1derive_1channel_1signer(JNIEnv *env, jclass clz, int64_t this_arg, int64_t signer_provider) { - LDKAnchorDescriptor this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1trampoline_1routing_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - void* signer_provider_ptr = untag_ptr(signer_provider); - if (ptr_is_owned(signer_provider)) { CHECK_ACCESS(signer_provider_ptr); } - LDKSignerProvider* signer_provider_conv = (LDKSignerProvider*)signer_provider_ptr; - LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner"); - *ret_ret = AnchorDescriptor_derive_channel_signer(&this_arg_conv, signer_provider_conv); - return tag_ptr(ret_ret, true); + NodeFeatures_set_trampoline_routing_required(&this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BumpTransactionEvent_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKBumpTransactionEvent this_ptr_conv = *(LDKBumpTransactionEvent*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - BumpTransactionEvent_free(this_ptr_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1trampoline_1routing(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_trampoline_routing(&this_arg_conv); + return ret_conv; } -static inline uint64_t BumpTransactionEvent_clone_ptr(LDKBumpTransactionEvent *NONNULL_PTR arg) { - LDKBumpTransactionEvent *ret_copy = MALLOC(sizeof(LDKBumpTransactionEvent), "LDKBumpTransactionEvent"); - *ret_copy = BumpTransactionEvent_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1trampoline_1routing_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + Bolt11InvoiceFeatures_set_trampoline_routing_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BumpTransactionEvent_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKBumpTransactionEvent* arg_conv = (LDKBumpTransactionEvent*)untag_ptr(arg); - int64_t ret_conv = BumpTransactionEvent_clone_ptr(arg_conv); - return ret_conv; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1trampoline_1routing_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + Bolt11InvoiceFeatures_set_trampoline_routing_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BumpTransactionEvent_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBumpTransactionEvent* orig_conv = (LDKBumpTransactionEvent*)untag_ptr(orig); - LDKBumpTransactionEvent *ret_copy = MALLOC(sizeof(LDKBumpTransactionEvent), "LDKBumpTransactionEvent"); - *ret_copy = BumpTransactionEvent_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1supports_1trampoline_1routing(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt11InvoiceFeatures_supports_trampoline_routing(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BumpTransactionEvent_1channel_1close(JNIEnv *env, jclass clz, int64_t channel_id, int8_tArray counterparty_node_id, int8_tArray claim_id, int32_t package_target_feerate_sat_per_1000_weight, int8_tArray commitment_tx, int64_t commitment_tx_fee_satoshis, int64_t anchor_descriptor, int64_tArray pending_htlcs) { - LDKChannelId channel_id_conv; - channel_id_conv.inner = untag_ptr(channel_id); - channel_id_conv.is_owned = ptr_is_owned(channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); - channel_id_conv = ChannelId_clone(&channel_id_conv); - LDKPublicKey counterparty_node_id_ref; - CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); - (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); - LDKThirtyTwoBytes claim_id_ref; - CHECK((*env)->GetArrayLength(env, claim_id) == 32); - (*env)->GetByteArrayRegion(env, claim_id, 0, 32, claim_id_ref.data); - LDKTransaction commitment_tx_ref; - commitment_tx_ref.datalen = (*env)->GetArrayLength(env, commitment_tx); - commitment_tx_ref.data = MALLOC(commitment_tx_ref.datalen, "LDKTransaction Bytes"); - (*env)->GetByteArrayRegion(env, commitment_tx, 0, commitment_tx_ref.datalen, commitment_tx_ref.data); - commitment_tx_ref.data_is_owned = true; - LDKAnchorDescriptor anchor_descriptor_conv; - anchor_descriptor_conv.inner = untag_ptr(anchor_descriptor); - anchor_descriptor_conv.is_owned = ptr_is_owned(anchor_descriptor); - CHECK_INNER_FIELD_ACCESS_OR_NULL(anchor_descriptor_conv); - anchor_descriptor_conv = AnchorDescriptor_clone(&anchor_descriptor_conv); - LDKCVec_HTLCOutputInCommitmentZ pending_htlcs_constr; - pending_htlcs_constr.datalen = (*env)->GetArrayLength(env, pending_htlcs); - if (pending_htlcs_constr.datalen > 0) - pending_htlcs_constr.data = MALLOC(pending_htlcs_constr.datalen * sizeof(LDKHTLCOutputInCommitment), "LDKCVec_HTLCOutputInCommitmentZ Elements"); - else - pending_htlcs_constr.data = NULL; - int64_t* pending_htlcs_vals = (*env)->GetLongArrayElements (env, pending_htlcs, NULL); - for (size_t y = 0; y < pending_htlcs_constr.datalen; y++) { - int64_t pending_htlcs_conv_24 = pending_htlcs_vals[y]; - LDKHTLCOutputInCommitment pending_htlcs_conv_24_conv; - pending_htlcs_conv_24_conv.inner = untag_ptr(pending_htlcs_conv_24); - pending_htlcs_conv_24_conv.is_owned = ptr_is_owned(pending_htlcs_conv_24); - CHECK_INNER_FIELD_ACCESS_OR_NULL(pending_htlcs_conv_24_conv); - pending_htlcs_conv_24_conv = HTLCOutputInCommitment_clone(&pending_htlcs_conv_24_conv); - pending_htlcs_constr.data[y] = pending_htlcs_conv_24_conv; - } - (*env)->ReleaseLongArrayElements(env, pending_htlcs, pending_htlcs_vals, 0); - LDKBumpTransactionEvent *ret_copy = MALLOC(sizeof(LDKBumpTransactionEvent), "LDKBumpTransactionEvent"); - *ret_copy = BumpTransactionEvent_channel_close(channel_id_conv, counterparty_node_id_ref, claim_id_ref, package_target_feerate_sat_per_1000_weight, commitment_tx_ref, commitment_tx_fee_satoshis, anchor_descriptor_conv, pending_htlcs_constr); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1trampoline_1routing(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_trampoline_routing(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BumpTransactionEvent_1htlcresolution(JNIEnv *env, jclass clz, int64_t channel_id, int8_tArray counterparty_node_id, int8_tArray claim_id, int32_t target_feerate_sat_per_1000_weight, int64_tArray htlc_descriptors, int32_t tx_lock_time) { - LDKChannelId channel_id_conv; - channel_id_conv.inner = untag_ptr(channel_id); - channel_id_conv.is_owned = ptr_is_owned(channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); - channel_id_conv = ChannelId_clone(&channel_id_conv); - LDKPublicKey counterparty_node_id_ref; - CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); - (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); - LDKThirtyTwoBytes claim_id_ref; - CHECK((*env)->GetArrayLength(env, claim_id) == 32); - (*env)->GetByteArrayRegion(env, claim_id, 0, 32, claim_id_ref.data); - LDKCVec_HTLCDescriptorZ htlc_descriptors_constr; - htlc_descriptors_constr.datalen = (*env)->GetArrayLength(env, htlc_descriptors); - if (htlc_descriptors_constr.datalen > 0) - htlc_descriptors_constr.data = MALLOC(htlc_descriptors_constr.datalen * sizeof(LDKHTLCDescriptor), "LDKCVec_HTLCDescriptorZ Elements"); - else - htlc_descriptors_constr.data = NULL; - int64_t* htlc_descriptors_vals = (*env)->GetLongArrayElements (env, htlc_descriptors, NULL); - for (size_t q = 0; q < htlc_descriptors_constr.datalen; q++) { - int64_t htlc_descriptors_conv_16 = htlc_descriptors_vals[q]; - LDKHTLCDescriptor htlc_descriptors_conv_16_conv; - htlc_descriptors_conv_16_conv.inner = untag_ptr(htlc_descriptors_conv_16); - htlc_descriptors_conv_16_conv.is_owned = ptr_is_owned(htlc_descriptors_conv_16); - CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_descriptors_conv_16_conv); - htlc_descriptors_conv_16_conv = HTLCDescriptor_clone(&htlc_descriptors_conv_16_conv); - htlc_descriptors_constr.data[q] = htlc_descriptors_conv_16_conv; - } - (*env)->ReleaseLongArrayElements(env, htlc_descriptors, htlc_descriptors_vals, 0); - LDKBumpTransactionEvent *ret_copy = MALLOC(sizeof(LDKBumpTransactionEvent), "LDKBumpTransactionEvent"); - *ret_copy = BumpTransactionEvent_htlcresolution(channel_id_conv, counterparty_node_id_ref, claim_id_ref, target_feerate_sat_per_1000_weight, htlc_descriptors_constr, tx_lock_time); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1trampoline_1routing(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_trampoline_routing(&this_arg_conv); + return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BumpTransactionEvent_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKBumpTransactionEvent* a_conv = (LDKBumpTransactionEvent*)untag_ptr(a); - LDKBumpTransactionEvent* b_conv = (LDKBumpTransactionEvent*)untag_ptr(b); - jboolean ret_conv = BumpTransactionEvent_eq(a_conv, b_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1trampoline_1routing(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt11InvoiceFeatures_requires_trampoline_routing(&this_arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Input_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKInput this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKRoutingFees this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Input_free(this_obj_conv); + RoutingFees_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Input_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInput this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRoutingFees this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKOutPoint ret_var = Input_get_outpoint(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + int32_t ret_conv = RoutingFees_get_base_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Input_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKInput this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKRoutingFees this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKOutPoint val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = OutPoint_clone(&val_conv); - Input_set_outpoint(&this_ptr_conv, val_conv); + RoutingFees_set_base_msat(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Input_1get_1previous_1utxo(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInput this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRoutingFees this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); - *ret_ref = Input_get_previous_utxo(&this_ptr_conv); - return tag_ptr(ret_ref, true); + int32_t ret_conv = RoutingFees_get_proportional_millionths(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Input_1set_1previous_1utxo(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKInput this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKRoutingFees this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); - val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val)); - Input_set_previous_utxo(&this_ptr_conv, val_conv); + RoutingFees_set_proportional_millionths(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Input_1get_1satisfaction_1weight(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInput this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1new(JNIEnv *env, jclass clz, int32_t base_msat_arg, int32_t proportional_millionths_arg) { + LDKRoutingFees ret_var = RoutingFees_new(base_msat_arg, proportional_millionths_arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RoutingFees_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKRoutingFees a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKRoutingFees b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = RoutingFees_eq(&a_conv, &b_conv); + return ret_conv; +} + +static inline uint64_t RoutingFees_clone_ptr(LDKRoutingFees *NONNULL_PTR arg) { + LDKRoutingFees ret_var = RoutingFees_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRoutingFees arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = RoutingFees_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKRoutingFees orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKRoutingFees ret_var = RoutingFees_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKRoutingFees o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = RoutingFees_hash(&o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKRouteHint this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + RouteHint_free(this_obj_conv); +} + +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRouteHint this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = Input_get_satisfaction_weight(&this_ptr_conv); - return ret_conv; + LDKCVec_RouteHintHopZ ret_var = RouteHint_get_a(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t o = 0; o < ret_var.datalen; o++) { + LDKRouteHintHop ret_conv_14_var = ret_var.data[o]; + int64_t ret_conv_14_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var); + ret_conv_14_ref = tag_ptr(ret_conv_14_var.inner, ret_conv_14_var.is_owned); + ret_arr_ptr[o] = ret_conv_14_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Input_1set_1satisfaction_1weight(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKInput this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { + LDKRouteHint this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - Input_set_satisfaction_weight(&this_ptr_conv, val); + LDKCVec_RouteHintHopZ val_constr; + val_constr.datalen = (*env)->GetArrayLength(env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); + for (size_t o = 0; o < val_constr.datalen; o++) { + int64_t val_conv_14 = val_vals[o]; + LDKRouteHintHop val_conv_14_conv; + val_conv_14_conv.inner = untag_ptr(val_conv_14); + val_conv_14_conv.is_owned = ptr_is_owned(val_conv_14); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_14_conv); + val_conv_14_conv = RouteHintHop_clone(&val_conv_14_conv); + val_constr.data[o] = val_conv_14_conv; + } + (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); + RouteHint_set_a(&this_ptr_conv, val_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Input_1new(JNIEnv *env, jclass clz, int64_t outpoint_arg, int64_t previous_utxo_arg, int64_t satisfaction_weight_arg) { - LDKOutPoint outpoint_arg_conv; - outpoint_arg_conv.inner = untag_ptr(outpoint_arg); - outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); - outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); - void* previous_utxo_arg_ptr = untag_ptr(previous_utxo_arg); - CHECK_ACCESS(previous_utxo_arg_ptr); - LDKTxOut previous_utxo_arg_conv = *(LDKTxOut*)(previous_utxo_arg_ptr); - previous_utxo_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(previous_utxo_arg)); - LDKInput ret_var = Input_new(outpoint_arg_conv, previous_utxo_arg_conv, satisfaction_weight_arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1new(JNIEnv *env, jclass clz, int64_tArray a_arg) { + LDKCVec_RouteHintHopZ a_arg_constr; + a_arg_constr.datalen = (*env)->GetArrayLength(env, a_arg); + if (a_arg_constr.datalen > 0) + a_arg_constr.data = MALLOC(a_arg_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements"); + else + a_arg_constr.data = NULL; + int64_t* a_arg_vals = (*env)->GetLongArrayElements (env, a_arg, NULL); + for (size_t o = 0; o < a_arg_constr.datalen; o++) { + int64_t a_arg_conv_14 = a_arg_vals[o]; + LDKRouteHintHop a_arg_conv_14_conv; + a_arg_conv_14_conv.inner = untag_ptr(a_arg_conv_14); + a_arg_conv_14_conv.is_owned = ptr_is_owned(a_arg_conv_14); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_arg_conv_14_conv); + a_arg_conv_14_conv = RouteHintHop_clone(&a_arg_conv_14_conv); + a_arg_constr.data[o] = a_arg_conv_14_conv; + } + (*env)->ReleaseLongArrayElements(env, a_arg, a_arg_vals, 0); + LDKRouteHint ret_var = RouteHint_new(a_arg_constr); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t Input_clone_ptr(LDKInput *NONNULL_PTR arg) { - LDKInput ret_var = Input_clone(arg); +static inline uint64_t RouteHint_clone_ptr(LDKRouteHint *NONNULL_PTR arg) { + LDKRouteHint ret_var = RouteHint_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Input_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKInput arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRouteHint arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Input_clone_ptr(&arg_conv); + int64_t ret_conv = RouteHint_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Input_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKInput orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKRouteHint orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKInput ret_var = Input_clone(&orig_conv); + LDKRouteHint ret_var = RouteHint_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Input_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKInput o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKRouteHint o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv.is_owned = false; - int64_t ret_conv = Input_hash(&o_conv); + int64_t ret_conv = RouteHint_hash(&o_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Input_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKInput a_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHint_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKRouteHint a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKInput b_conv; + LDKRouteHint b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = Input_eq(&a_conv, &b_conv); + jboolean ret_conv = RouteHint_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Utxo_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKUtxo this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKRouteHintHop this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Utxo_free(this_obj_conv); + RouteHintHop_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Utxo_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUtxo this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1src_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKOutPoint ret_var = Utxo_get_outpoint(&this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RouteHintHop_get_src_node_id(&this_ptr_conv).compressed_form); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1src_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKRouteHintHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + RouteHintHop_set_src_node_id(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRouteHintHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = RouteHintHop_get_short_channel_id(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKRouteHintHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + RouteHintHop_set_short_channel_id(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1fees(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRouteHintHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKRoutingFees ret_var = RouteHintHop_get_fees(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Utxo_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKUtxo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1fees(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKOutPoint val_conv; + LDKRoutingFees val_conv; val_conv.inner = untag_ptr(val); val_conv.is_owned = ptr_is_owned(val); CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = OutPoint_clone(&val_conv); - Utxo_set_outpoint(&this_ptr_conv, val_conv); + val_conv = RoutingFees_clone(&val_conv); + RouteHintHop_set_fees(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Utxo_1get_1output(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUtxo this_ptr_conv; +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); - *ret_ref = Utxo_get_output(&this_ptr_conv); - return tag_ptr(ret_ref, true); + int16_t ret_conv = RouteHintHop_get_cltv_expiry_delta(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Utxo_1set_1output(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKUtxo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKRouteHintHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + RouteHintHop_set_cltv_expiry_delta(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRouteHintHop this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = RouteHintHop_get_htlc_minimum_msat(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; void* val_ptr = untag_ptr(val); CHECK_ACCESS(val_ptr); - LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); - val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val)); - Utxo_set_output(&this_ptr_conv, val_conv); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + RouteHintHop_set_htlc_minimum_msat(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Utxo_1get_1satisfaction_1weight(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUtxo this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = Utxo_get_satisfaction_weight(&this_ptr_conv); - return ret_conv; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = RouteHintHop_get_htlc_maximum_msat(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Utxo_1set_1satisfaction_1weight(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKUtxo this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - Utxo_set_satisfaction_weight(&this_ptr_conv, val); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + RouteHintHop_set_htlc_maximum_msat(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Utxo_1new(JNIEnv *env, jclass clz, int64_t outpoint_arg, int64_t output_arg, int64_t satisfaction_weight_arg) { - LDKOutPoint outpoint_arg_conv; - outpoint_arg_conv.inner = untag_ptr(outpoint_arg); - outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); - outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); - void* output_arg_ptr = untag_ptr(output_arg); - CHECK_ACCESS(output_arg_ptr); - LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr); - output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg)); - LDKUtxo ret_var = Utxo_new(outpoint_arg_conv, output_arg_conv, satisfaction_weight_arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1new(JNIEnv *env, jclass clz, int8_tArray src_node_id_arg, int64_t short_channel_id_arg, int64_t fees_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg) { + LDKPublicKey src_node_id_arg_ref; + CHECK((*env)->GetArrayLength(env, src_node_id_arg) == 33); + (*env)->GetByteArrayRegion(env, src_node_id_arg, 0, 33, src_node_id_arg_ref.compressed_form); + LDKRoutingFees fees_arg_conv; + fees_arg_conv.inner = untag_ptr(fees_arg); + fees_arg_conv.is_owned = ptr_is_owned(fees_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv); + fees_arg_conv = RoutingFees_clone(&fees_arg_conv); + void* htlc_minimum_msat_arg_ptr = untag_ptr(htlc_minimum_msat_arg); + CHECK_ACCESS(htlc_minimum_msat_arg_ptr); + LDKCOption_u64Z htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_minimum_msat_arg_ptr); + htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_minimum_msat_arg)); + void* htlc_maximum_msat_arg_ptr = untag_ptr(htlc_maximum_msat_arg); + CHECK_ACCESS(htlc_maximum_msat_arg_ptr); + LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_arg_ptr); + htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_maximum_msat_arg)); + LDKRouteHintHop ret_var = RouteHintHop_new(src_node_id_arg_ref, short_channel_id_arg, fees_arg_conv, cltv_expiry_delta_arg, htlc_minimum_msat_arg_conv, htlc_maximum_msat_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t Utxo_clone_ptr(LDKUtxo *NONNULL_PTR arg) { - LDKUtxo ret_var = Utxo_clone(arg); +static inline uint64_t RouteHintHop_clone_ptr(LDKRouteHintHop *NONNULL_PTR arg) { + LDKRouteHintHop ret_var = RouteHintHop_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Utxo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKUtxo arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRouteHintHop arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Utxo_clone_ptr(&arg_conv); + int64_t ret_conv = RouteHintHop_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Utxo_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKUtxo orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKRouteHintHop orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKUtxo ret_var = Utxo_clone(&orig_conv); + LDKRouteHintHop ret_var = RouteHintHop_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Utxo_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKUtxo o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKRouteHintHop o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv.is_owned = false; - int64_t ret_conv = Utxo_hash(&o_conv); + int64_t ret_conv = RouteHintHop_hash(&o_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Utxo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKUtxo a_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKRouteHintHop a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKUtxo b_conv; + LDKRouteHintHop b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = Utxo_eq(&a_conv, &b_conv); + jboolean ret_conv = RouteHintHop_eq(&a_conv, &b_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Utxo_1new_1p2pkh(JNIEnv *env, jclass clz, int64_t outpoint, int64_t value, int8_tArray pubkey_hash) { - LDKOutPoint outpoint_conv; - outpoint_conv.inner = untag_ptr(outpoint); - outpoint_conv.is_owned = ptr_is_owned(outpoint); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv); - outpoint_conv = OutPoint_clone(&outpoint_conv); - uint8_t pubkey_hash_arr[20]; - CHECK((*env)->GetArrayLength(env, pubkey_hash) == 20); - (*env)->GetByteArrayRegion(env, pubkey_hash, 0, 20, pubkey_hash_arr); - uint8_t (*pubkey_hash_ref)[20] = &pubkey_hash_arr; - LDKUtxo ret_var = Utxo_new_p2pkh(outpoint_conv, value, pubkey_hash_ref); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CoinSelection_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKCoinSelection this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UntrustedString_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUntrustedString this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - CoinSelection_free(this_obj_conv); -} - -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CoinSelection_1get_1confirmed_1utxos(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKCoinSelection this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_UtxoZ ret_var = CoinSelection_get_confirmed_utxos(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t g = 0; g < ret_var.datalen; g++) { - LDKUtxo ret_conv_6_var = ret_var.data[g]; - int64_t ret_conv_6_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_6_var); - ret_conv_6_ref = tag_ptr(ret_conv_6_var.inner, ret_conv_6_var.is_owned); - ret_arr_ptr[g] = ret_conv_6_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CoinSelection_1set_1confirmed_1utxos(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { - LDKCoinSelection this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCVec_UtxoZ val_constr; - val_constr.datalen = (*env)->GetArrayLength(env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUtxo), "LDKCVec_UtxoZ Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); - for (size_t g = 0; g < val_constr.datalen; g++) { - int64_t val_conv_6 = val_vals[g]; - LDKUtxo val_conv_6_conv; - val_conv_6_conv.inner = untag_ptr(val_conv_6); - val_conv_6_conv.is_owned = ptr_is_owned(val_conv_6); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_6_conv); - val_conv_6_conv = Utxo_clone(&val_conv_6_conv); - val_constr.data[g] = val_conv_6_conv; - } - (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); - CoinSelection_set_confirmed_utxos(&this_ptr_conv, val_constr); + UntrustedString_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CoinSelection_1get_1change_1output(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKCoinSelection this_ptr_conv; +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_UntrustedString_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUntrustedString this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_TxOutZ *ret_copy = MALLOC(sizeof(LDKCOption_TxOutZ), "LDKCOption_TxOutZ"); - *ret_copy = CoinSelection_get_change_output(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKStr ret_str = UntrustedString_get_a(&this_ptr_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CoinSelection_1set_1change_1output(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKCoinSelection this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UntrustedString_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { + LDKUntrustedString this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_TxOutZ val_conv = *(LDKCOption_TxOutZ*)(val_ptr); - val_conv = COption_TxOutZ_clone((LDKCOption_TxOutZ*)untag_ptr(val)); - CoinSelection_set_change_output(&this_ptr_conv, val_conv); + LDKStr val_conv = java_to_owned_str(env, val); + UntrustedString_set_a(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CoinSelection_1new(JNIEnv *env, jclass clz, int64_tArray confirmed_utxos_arg, int64_t change_output_arg) { - LDKCVec_UtxoZ confirmed_utxos_arg_constr; - confirmed_utxos_arg_constr.datalen = (*env)->GetArrayLength(env, confirmed_utxos_arg); - if (confirmed_utxos_arg_constr.datalen > 0) - confirmed_utxos_arg_constr.data = MALLOC(confirmed_utxos_arg_constr.datalen * sizeof(LDKUtxo), "LDKCVec_UtxoZ Elements"); - else - confirmed_utxos_arg_constr.data = NULL; - int64_t* confirmed_utxos_arg_vals = (*env)->GetLongArrayElements (env, confirmed_utxos_arg, NULL); - for (size_t g = 0; g < confirmed_utxos_arg_constr.datalen; g++) { - int64_t confirmed_utxos_arg_conv_6 = confirmed_utxos_arg_vals[g]; - LDKUtxo confirmed_utxos_arg_conv_6_conv; - confirmed_utxos_arg_conv_6_conv.inner = untag_ptr(confirmed_utxos_arg_conv_6); - confirmed_utxos_arg_conv_6_conv.is_owned = ptr_is_owned(confirmed_utxos_arg_conv_6); - CHECK_INNER_FIELD_ACCESS_OR_NULL(confirmed_utxos_arg_conv_6_conv); - confirmed_utxos_arg_conv_6_conv = Utxo_clone(&confirmed_utxos_arg_conv_6_conv); - confirmed_utxos_arg_constr.data[g] = confirmed_utxos_arg_conv_6_conv; - } - (*env)->ReleaseLongArrayElements(env, confirmed_utxos_arg, confirmed_utxos_arg_vals, 0); - void* change_output_arg_ptr = untag_ptr(change_output_arg); - CHECK_ACCESS(change_output_arg_ptr); - LDKCOption_TxOutZ change_output_arg_conv = *(LDKCOption_TxOutZ*)(change_output_arg_ptr); - change_output_arg_conv = COption_TxOutZ_clone((LDKCOption_TxOutZ*)untag_ptr(change_output_arg)); - LDKCoinSelection ret_var = CoinSelection_new(confirmed_utxos_arg_constr, change_output_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UntrustedString_1new(JNIEnv *env, jclass clz, jstring a_arg) { + LDKStr a_arg_conv = java_to_owned_str(env, a_arg); + LDKUntrustedString ret_var = UntrustedString_new(a_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t CoinSelection_clone_ptr(LDKCoinSelection *NONNULL_PTR arg) { - LDKCoinSelection ret_var = CoinSelection_clone(arg); +static inline uint64_t UntrustedString_clone_ptr(LDKUntrustedString *NONNULL_PTR arg) { + LDKUntrustedString ret_var = UntrustedString_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CoinSelection_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCoinSelection arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UntrustedString_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUntrustedString arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = CoinSelection_clone_ptr(&arg_conv); + int64_t ret_conv = UntrustedString_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CoinSelection_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCoinSelection orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UntrustedString_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKUntrustedString orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKCoinSelection ret_var = CoinSelection_clone(&orig_conv); + LDKUntrustedString ret_var = UntrustedString_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CoinSelectionSource_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKCoinSelectionSource this_ptr_conv = *(LDKCoinSelectionSource*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - CoinSelectionSource_free(this_ptr_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UntrustedString_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKUntrustedString a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKUntrustedString b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = UntrustedString_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WalletSource_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKWalletSource this_ptr_conv = *(LDKWalletSource*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - WalletSource_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UntrustedString_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKUntrustedString o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = UntrustedString_hash(&o_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Wallet_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKWallet this_obj_conv; +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_UntrustedString_1to_1str(JNIEnv *env, jclass clz, int64_t o) { + LDKUntrustedString o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = UntrustedString_to_str(&o_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PrintableString_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPrintableString this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Wallet_free(this_obj_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Wallet_1new(JNIEnv *env, jclass clz, int64_t source, int64_t logger) { - void* source_ptr = untag_ptr(source); - CHECK_ACCESS(source_ptr); - LDKWalletSource source_conv = *(LDKWalletSource*)(source_ptr); - if (source_conv.free == LDKWalletSource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKWalletSource_JCalls_cloned(&source_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKWallet ret_var = Wallet_new(source_conv, logger_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + PrintableString_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Wallet_1as_1CoinSelectionSource(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKWallet this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCoinSelectionSource* ret_ret = MALLOC(sizeof(LDKCoinSelectionSource), "LDKCoinSelectionSource"); - *ret_ret = Wallet_as_CoinSelectionSource(&this_arg_conv); - return tag_ptr(ret_ret, true); +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_PrintableString_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPrintableString this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKStr ret_str = PrintableString_get_a(&this_ptr_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BumpTransactionEventHandler_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKBumpTransactionEventHandler this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BumpTransactionEventHandler_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PrintableString_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { + LDKPrintableString this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKStr val_conv = java_to_owned_str(env, val); + PrintableString_set_a(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BumpTransactionEventHandler_1new(JNIEnv *env, jclass clz, int64_t broadcaster, int64_t utxo_source, int64_t signer_provider, int64_t logger) { - void* broadcaster_ptr = untag_ptr(broadcaster); - CHECK_ACCESS(broadcaster_ptr); - LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); - } - void* utxo_source_ptr = untag_ptr(utxo_source); - CHECK_ACCESS(utxo_source_ptr); - LDKCoinSelectionSource utxo_source_conv = *(LDKCoinSelectionSource*)(utxo_source_ptr); - if (utxo_source_conv.free == LDKCoinSelectionSource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKCoinSelectionSource_JCalls_cloned(&utxo_source_conv); - } - void* signer_provider_ptr = untag_ptr(signer_provider); - CHECK_ACCESS(signer_provider_ptr); - LDKSignerProvider signer_provider_conv = *(LDKSignerProvider*)(signer_provider_ptr); - if (signer_provider_conv.free == LDKSignerProvider_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKSignerProvider_JCalls_cloned(&signer_provider_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKBumpTransactionEventHandler ret_var = BumpTransactionEventHandler_new(broadcaster_conv, utxo_source_conv, signer_provider_conv, logger_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrintableString_1new(JNIEnv *env, jclass clz, jstring a_arg) { + LDKStr a_arg_conv = java_to_owned_str(env, a_arg); + LDKPrintableString ret_var = PrintableString_new(a_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BumpTransactionEventHandler_1handle_1event(JNIEnv *env, jclass clz, int64_t this_arg, int64_t event) { - LDKBumpTransactionEventHandler this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKBumpTransactionEvent* event_conv = (LDKBumpTransactionEvent*)untag_ptr(event); - BumpTransactionEventHandler_handle_event(&this_arg_conv, event_conv); +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_PrintableString_1to_1str(JNIEnv *env, jclass clz, int64_t o) { + LDKPrintableString o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = PrintableString_to_str(&o_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FilesystemStore_1free(JNIEnv *env, jclass clz, int64_t this_obj) { @@ -88649,7 +94108,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipSync_1none(JNIEnv *en return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1start(JNIEnv *env, jclass clz, int64_t persister, int64_t event_handler, int64_t chain_monitor, int64_t channel_manager, int64_t gossip_sync, int64_t peer_manager, int64_t logger, int64_t scorer) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1start(JNIEnv *env, jclass clz, int64_t persister, int64_t event_handler, int64_t chain_monitor, int64_t channel_manager, int64_t onion_messenger, int64_t gossip_sync, int64_t peer_manager, int64_t logger, int64_t scorer) { void* persister_ptr = untag_ptr(persister); CHECK_ACCESS(persister_ptr); LDKPersister persister_conv = *(LDKPersister*)(persister_ptr); @@ -88674,6 +94133,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1start( channel_manager_conv.is_owned = ptr_is_owned(channel_manager); CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_conv); channel_manager_conv.is_owned = false; + LDKOnionMessenger onion_messenger_conv; + onion_messenger_conv.inner = untag_ptr(onion_messenger); + onion_messenger_conv.is_owned = ptr_is_owned(onion_messenger); + CHECK_INNER_FIELD_ACCESS_OR_NULL(onion_messenger_conv); + onion_messenger_conv.is_owned = false; void* gossip_sync_ptr = untag_ptr(gossip_sync); CHECK_ACCESS(gossip_sync_ptr); LDKGossipSync gossip_sync_conv = *(LDKGossipSync*)(gossip_sync_ptr); @@ -88701,7 +94165,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1start( LDKWriteableScore_JCalls_cloned(&scorer_conv.some); } } - LDKBackgroundProcessor ret_var = BackgroundProcessor_start(persister_conv, event_handler_conv, &chain_monitor_conv, &channel_manager_conv, gossip_sync_conv, &peer_manager_conv, logger_conv, scorer_conv); + LDKBackgroundProcessor ret_var = BackgroundProcessor_start(persister_conv, event_handler_conv, &chain_monitor_conv, &channel_manager_conv, &onion_messenger_conv, gossip_sync_conv, &peer_manager_conv, logger_conv, scorer_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -89885,6 +95349,40 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceSignature_1free(J Bolt11InvoiceSignature_free(this_obj_conv); } +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceSignature_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBolt11InvoiceSignature this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 68); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 68, Bolt11InvoiceSignature_get_a(&this_ptr_conv).serialized_form); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceSignature_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKBolt11InvoiceSignature this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKRecoverableSignature val_ref; + CHECK((*env)->GetArrayLength(env, val) == 68); + (*env)->GetByteArrayRegion(env, val, 0, 68, val_ref.serialized_form); + Bolt11InvoiceSignature_set_a(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceSignature_1new(JNIEnv *env, jclass clz, int8_tArray a_arg) { + LDKRecoverableSignature a_arg_ref; + CHECK((*env)->GetArrayLength(env, a_arg) == 68); + (*env)->GetByteArrayRegion(env, a_arg, 0, 68, a_arg_ref.serialized_form); + LDKBolt11InvoiceSignature ret_var = Bolt11InvoiceSignature_new(a_arg_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + static inline uint64_t Bolt11InvoiceSignature_clone_ptr(LDKBolt11InvoiceSignature *NONNULL_PTR arg) { LDKBolt11InvoiceSignature ret_var = Bolt11InvoiceSignature_clone(arg); int64_t ret_ref = 0; @@ -90616,6 +96114,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Description_1into_1inner(JN return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Description_1as_1inner(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKDescription this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKUntrustedString ret_var = Description_as_inner(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Description_1to_1str(JNIEnv *env, jclass clz, int64_t o) { LDKDescription o_conv; o_conv.inner = untag_ptr(o); @@ -90869,334 +96380,6 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1to_1st return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_payment_1parameters_1from_1zero_1amount_1invoice(JNIEnv *env, jclass clz, int64_t invoice, int64_t amount_msat) { - LDKBolt11Invoice invoice_conv; - invoice_conv.inner = untag_ptr(invoice); - invoice_conv.is_owned = ptr_is_owned(invoice); - CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); - invoice_conv.is_owned = false; - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); - *ret_conv = payment_parameters_from_zero_amount_invoice(&invoice_conv, amount_msat); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_payment_1parameters_1from_1invoice(JNIEnv *env, jclass clz, int64_t invoice) { - LDKBolt11Invoice invoice_conv; - invoice_conv.inner = untag_ptr(invoice); - invoice_conv.is_owned = ptr_is_owned(invoice); - CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); - invoice_conv.is_owned = false; - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); - *ret_conv = payment_parameters_from_invoice(&invoice_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice(JNIEnv *env, jclass clz, int64_t amt_msat, int64_t payment_hash, jstring description, int32_t invoice_expiry_delta_secs, int64_tArray phantom_route_hints, int64_t entropy_source, int64_t node_signer, int64_t logger, jclass network, int64_t min_final_cltv_expiry_delta, int64_t duration_since_epoch) { - void* amt_msat_ptr = untag_ptr(amt_msat); - CHECK_ACCESS(amt_msat_ptr); - LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); - amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); - void* payment_hash_ptr = untag_ptr(payment_hash); - CHECK_ACCESS(payment_hash_ptr); - LDKCOption_ThirtyTwoBytesZ payment_hash_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_ptr); - payment_hash_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash)); - LDKStr description_conv = java_to_owned_str(env, description); - LDKCVec_PhantomRouteHintsZ phantom_route_hints_constr; - phantom_route_hints_constr.datalen = (*env)->GetArrayLength(env, phantom_route_hints); - if (phantom_route_hints_constr.datalen > 0) - phantom_route_hints_constr.data = MALLOC(phantom_route_hints_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements"); - else - phantom_route_hints_constr.data = NULL; - int64_t* phantom_route_hints_vals = (*env)->GetLongArrayElements (env, phantom_route_hints, NULL); - for (size_t t = 0; t < phantom_route_hints_constr.datalen; t++) { - int64_t phantom_route_hints_conv_19 = phantom_route_hints_vals[t]; - LDKPhantomRouteHints phantom_route_hints_conv_19_conv; - phantom_route_hints_conv_19_conv.inner = untag_ptr(phantom_route_hints_conv_19); - phantom_route_hints_conv_19_conv.is_owned = ptr_is_owned(phantom_route_hints_conv_19); - CHECK_INNER_FIELD_ACCESS_OR_NULL(phantom_route_hints_conv_19_conv); - phantom_route_hints_conv_19_conv = PhantomRouteHints_clone(&phantom_route_hints_conv_19_conv); - phantom_route_hints_constr.data[t] = phantom_route_hints_conv_19_conv; - } - (*env)->ReleaseLongArrayElements(env, phantom_route_hints, phantom_route_hints_vals, 0); - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKCurrency network_conv = LDKCurrency_from_java(env, network); - void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); - CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); - LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); - min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = create_phantom_invoice(amt_msat_conv, payment_hash_conv, description_conv, invoice_expiry_delta_secs, phantom_route_hints_constr, entropy_source_conv, node_signer_conv, logger_conv, network_conv, min_final_cltv_expiry_delta_conv, duration_since_epoch); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice_1with_1description_1hash(JNIEnv *env, jclass clz, int64_t amt_msat, int64_t payment_hash, int32_t invoice_expiry_delta_secs, int64_t description_hash, int64_tArray phantom_route_hints, int64_t entropy_source, int64_t node_signer, int64_t logger, jclass network, int64_t min_final_cltv_expiry_delta, int64_t duration_since_epoch) { - void* amt_msat_ptr = untag_ptr(amt_msat); - CHECK_ACCESS(amt_msat_ptr); - LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); - amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); - void* payment_hash_ptr = untag_ptr(payment_hash); - CHECK_ACCESS(payment_hash_ptr); - LDKCOption_ThirtyTwoBytesZ payment_hash_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_ptr); - payment_hash_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash)); - LDKSha256 description_hash_conv; - description_hash_conv.inner = untag_ptr(description_hash); - description_hash_conv.is_owned = ptr_is_owned(description_hash); - CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv); - description_hash_conv = Sha256_clone(&description_hash_conv); - LDKCVec_PhantomRouteHintsZ phantom_route_hints_constr; - phantom_route_hints_constr.datalen = (*env)->GetArrayLength(env, phantom_route_hints); - if (phantom_route_hints_constr.datalen > 0) - phantom_route_hints_constr.data = MALLOC(phantom_route_hints_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements"); - else - phantom_route_hints_constr.data = NULL; - int64_t* phantom_route_hints_vals = (*env)->GetLongArrayElements (env, phantom_route_hints, NULL); - for (size_t t = 0; t < phantom_route_hints_constr.datalen; t++) { - int64_t phantom_route_hints_conv_19 = phantom_route_hints_vals[t]; - LDKPhantomRouteHints phantom_route_hints_conv_19_conv; - phantom_route_hints_conv_19_conv.inner = untag_ptr(phantom_route_hints_conv_19); - phantom_route_hints_conv_19_conv.is_owned = ptr_is_owned(phantom_route_hints_conv_19); - CHECK_INNER_FIELD_ACCESS_OR_NULL(phantom_route_hints_conv_19_conv); - phantom_route_hints_conv_19_conv = PhantomRouteHints_clone(&phantom_route_hints_conv_19_conv); - phantom_route_hints_constr.data[t] = phantom_route_hints_conv_19_conv; - } - (*env)->ReleaseLongArrayElements(env, phantom_route_hints, phantom_route_hints_vals, 0); - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKCurrency network_conv = LDKCurrency_from_java(env, network); - void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); - CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); - LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); - min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = create_phantom_invoice_with_description_hash(amt_msat_conv, payment_hash_conv, invoice_expiry_delta_secs, description_hash_conv, phantom_route_hints_constr, entropy_source_conv, node_signer_conv, logger_conv, network_conv, min_final_cltv_expiry_delta_conv, duration_since_epoch); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t node_signer, int64_t logger, jclass network, int64_t amt_msat, jstring description, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { - LDKChannelManager channelmanager_conv; - channelmanager_conv.inner = untag_ptr(channelmanager); - channelmanager_conv.is_owned = ptr_is_owned(channelmanager); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); - channelmanager_conv.is_owned = false; - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKCurrency network_conv = LDKCurrency_from_java(env, network); - void* amt_msat_ptr = untag_ptr(amt_msat); - CHECK_ACCESS(amt_msat_ptr); - LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); - amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); - LDKStr description_conv = java_to_owned_str(env, description); - void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); - CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); - LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); - min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = create_invoice_from_channelmanager(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_conv, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1with_1description_1hash(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t node_signer, int64_t logger, jclass network, int64_t amt_msat, int64_t description_hash, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { - LDKChannelManager channelmanager_conv; - channelmanager_conv.inner = untag_ptr(channelmanager); - channelmanager_conv.is_owned = ptr_is_owned(channelmanager); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); - channelmanager_conv.is_owned = false; - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKCurrency network_conv = LDKCurrency_from_java(env, network); - void* amt_msat_ptr = untag_ptr(amt_msat); - CHECK_ACCESS(amt_msat_ptr); - LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); - amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); - LDKSha256 description_hash_conv; - description_hash_conv.inner = untag_ptr(description_hash); - description_hash_conv.is_owned = ptr_is_owned(description_hash); - CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv); - description_hash_conv = Sha256_clone(&description_hash_conv); - void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); - CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); - LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); - min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = create_invoice_from_channelmanager_with_description_hash(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_hash_conv, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1with_1description_1hash_1and_1duration_1since_1epoch(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t node_signer, int64_t logger, jclass network, int64_t amt_msat, int64_t description_hash, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { - LDKChannelManager channelmanager_conv; - channelmanager_conv.inner = untag_ptr(channelmanager); - channelmanager_conv.is_owned = ptr_is_owned(channelmanager); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); - channelmanager_conv.is_owned = false; - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKCurrency network_conv = LDKCurrency_from_java(env, network); - void* amt_msat_ptr = untag_ptr(amt_msat); - CHECK_ACCESS(amt_msat_ptr); - LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); - amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); - LDKSha256 description_hash_conv; - description_hash_conv.inner = untag_ptr(description_hash); - description_hash_conv.is_owned = ptr_is_owned(description_hash); - CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv); - description_hash_conv = Sha256_clone(&description_hash_conv); - void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); - CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); - LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); - min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_hash_conv, duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1and_1duration_1since_1epoch(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t node_signer, int64_t logger, jclass network, int64_t amt_msat, jstring description, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { - LDKChannelManager channelmanager_conv; - channelmanager_conv.inner = untag_ptr(channelmanager); - channelmanager_conv.is_owned = ptr_is_owned(channelmanager); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); - channelmanager_conv.is_owned = false; - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKCurrency network_conv = LDKCurrency_from_java(env, network); - void* amt_msat_ptr = untag_ptr(amt_msat); - CHECK_ACCESS(amt_msat_ptr); - LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); - amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); - LDKStr description_conv = java_to_owned_str(env, description); - void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); - CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); - LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); - min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = create_invoice_from_channelmanager_and_duration_since_epoch(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_conv, duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1and_1duration_1since_1epoch_1with_1payment_1hash(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t node_signer, int64_t logger, jclass network, int64_t amt_msat, jstring description, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs, int8_tArray payment_hash, int64_t min_final_cltv_expiry_delta) { - LDKChannelManager channelmanager_conv; - channelmanager_conv.inner = untag_ptr(channelmanager); - channelmanager_conv.is_owned = ptr_is_owned(channelmanager); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); - channelmanager_conv.is_owned = false; - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - LDKCurrency network_conv = LDKCurrency_from_java(env, network); - void* amt_msat_ptr = untag_ptr(amt_msat); - CHECK_ACCESS(amt_msat_ptr); - LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); - amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); - LDKStr description_conv = java_to_owned_str(env, description); - LDKThirtyTwoBytes payment_hash_ref; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); - CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); - LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); - min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); - LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); - *ret_conv = create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_conv, duration_since_epoch, invoice_expiry_delta_secs, payment_hash_ref, min_final_cltv_expiry_delta_conv); - return tag_ptr(ret_conv, true); -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SiPrefix_1from_1str(JNIEnv *env, jclass clz, jstring s) { LDKStr s_conv = java_to_owned_str(env, s); LDKCResult_SiPrefixBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixBolt11ParseErrorZ), "LDKCResult_SiPrefixBolt11ParseErrorZ"); diff --git a/src/main/jni/org_ldk_enums_BalanceSource.h b/src/main/jni/org_ldk_enums_BalanceSource.h new file mode 100644 index 00000000..9487f5d0 --- /dev/null +++ b/src/main/jni/org_ldk_enums_BalanceSource.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_enums_BalanceSource */ + +#ifndef _Included_org_ldk_enums_BalanceSource +#define _Included_org_ldk_enums_BalanceSource +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_enums_BalanceSource + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_enums_BalanceSource_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings.h b/src/main/jni/org_ldk_impl_bindings.h index b7379cc9..d9d4448e 100644 --- a/src/main/jni/org_ldk_impl_bindings.h +++ b/src/main/jni/org_ldk_impl_bindings.h @@ -111,6 +111,30 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1RefundBolt12Semant JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u64Z_1ref_1from_1ptr (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKDecodeError_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKDecodeError; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKDecodeError_1ref_1from_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RefundDecodeErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RefundDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RefundDecodeErrorZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RefundDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_RefundBolt12ParseErrorZ_get_ok @@ -135,14 +159,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RefundBolt12ParseErr JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKRetry_1ref_1from_1ptr (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKDecodeError_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKDecodeError; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKDecodeError_1ref_1from_1ptr - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: CResult_RetryDecodeErrorZ_get_ok @@ -353,18 +369,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesNoneZ_1 /* * Class: org_ldk_impl_bindings - * Method: CResult_BlindedPayInfoDecodeErrorZ_get_ok + * Method: CResult_Bolt12InvoiceDecodeErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_BlindedPayInfoDecodeErrorZ_get_err + * Method: CResult_Bolt12InvoiceDecodeErrorZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* @@ -497,34 +513,50 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCDescriptorDecode /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneNoneZ_get_ok - * Signature: (J)V + * Method: CResult_PublicKeyNoneZ_get_ok + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1get_1ok +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneNoneZ_get_err + * Method: CResult_PublicKeyNoneZ_get_err * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1get_1err +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PublicKeyNoneZ_get_ok + * Method: CResult__u832NoneZ_get_ok * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1get_1ok +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832NoneZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PublicKeyNoneZ_get_err + * Method: CResult__u832NoneZ_get_err * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1get_1err +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832NoneZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneNoneZ_get_ok + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneNoneZ_get_err + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1get_1err (JNIEnv *, jclass, jlong); /* @@ -626,17 +658,17 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelSigner_1new /* * Class: org_ldk_impl_bindings * Method: ChannelSigner_get_per_commitment_point - * Signature: (JJ)[B + * Signature: (JJ)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelSigner_1get_1per_1commitment_1point +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelSigner_1get_1per_1commitment_1point (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings * Method: ChannelSigner_release_commitment_secret - * Signature: (JJ)[B + * Signature: (JJ)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelSigner_1release_1commitment_1secret +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelSigner_1release_1commitment_1secret (JNIEnv *, jclass, jlong, jlong); /* @@ -769,50 +801,18 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_EcdsaChannelSigner_1sign_1cha /* * Class: org_ldk_impl_bindings - * Method: LDKWriteableEcdsaChannelSigner_new - * Signature: (Lorg/ldk/impl/bindings/LDKWriteableEcdsaChannelSigner;Lorg/ldk/impl/bindings/LDKEcdsaChannelSigner;Lorg/ldk/impl/bindings/LDKChannelSigner;J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKWriteableEcdsaChannelSigner_1new - (JNIEnv *, jclass, jobject, jobject, jobject, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKWriteableEcdsaChannelSigner_get_EcdsaChannelSigner - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKWriteableEcdsaChannelSigner_1get_1EcdsaChannelSigner - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKWriteableEcdsaChannelSigner_get_ChannelSigner - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKWriteableEcdsaChannelSigner_1get_1ChannelSigner - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: WriteableEcdsaChannelSigner_write - * Signature: (J)[B - */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_WriteableEcdsaChannelSigner_1write - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_ok + * Method: CResult_EcdsaChannelSignerDecodeErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1EcdsaChannelSignerDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_err + * Method: CResult_EcdsaChannelSignerDecodeErrorZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1EcdsaChannelSignerDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* @@ -1041,50 +1041,74 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1NoneIOErrorZ_1get_ /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteLightningErrorZ_get_ok + * Method: C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_a + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1get_1a + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_b * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1get_1b (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteLightningErrorZ_get_err + * Method: C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_c * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1get_1c + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_err + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_BlindedPayInfoBlindedPathZ_get_a + * Method: CResult_RouteLightningErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlindedPayInfoBlindedPathZ_1get_1a +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_BlindedPayInfoBlindedPathZ_get_b + * Method: CResult_RouteLightningErrorZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlindedPayInfoBlindedPathZ_1get_1b +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_ok + * Method: CResult_CVec_BlindedPaymentPathZNoneZ_get_ok * Signature: (J)[J */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlindedPayInfoBlindedPathZZNoneZ_1get_1ok +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPaymentPathZNoneZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_err + * Method: CResult_CVec_BlindedPaymentPathZNoneZ_get_err * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlindedPayInfoBlindedPathZZNoneZ_1get_1err +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPaymentPathZNoneZ_1get_1err (JNIEnv *, jclass, jlong); /* @@ -1105,18 +1129,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_BlindedPathZNoneZ_get_ok + * Method: CResult_CVec_BlindedMessagePathZNoneZ_get_ok * Signature: (J)[J */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPathZNoneZ_1get_1ok +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_BlindedPathZNoneZ_get_err + * Method: CResult_CVec_BlindedMessagePathZNoneZ_get_err * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPathZNoneZ_1get_1err +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1get_1err (JNIEnv *, jclass, jlong); /* @@ -1671,6 +1695,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithEx JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_1get_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_OfferDecodeErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OfferDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_OfferDecodeErrorZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OfferDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_OfferBolt12ParseErrorZ_get_ok @@ -1935,6 +1975,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErr JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSocketAddress_1ref_1from_1ptr (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKNodeAnnouncementInfo_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKNodeAnnouncementInfo; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNodeAnnouncementInfo_1ref_1from_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok @@ -1967,6 +2015,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeError JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKCOption_NodeAnnouncementInfoZ_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_NodeAnnouncementInfoZ; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1NodeAnnouncementInfoZ_1ref_1from_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_NodeInfoDecodeErrorZ_get_ok @@ -2343,6 +2399,22 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesA JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesAPIErrorZ_1get_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKOffersContext_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKOffersContext; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKOffersContext_1ref_1from_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKCOption_OffersContextZ_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_OffersContextZ; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1OffersContextZ_1ref_1from_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: LDKOffersMessage_ref_from_ptr @@ -2353,10 +2425,26 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKOffersMessage_1ref_1from /* * Class: org_ldk_impl_bindings - * Method: LDKCOption_OffersMessageZ_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_OffersMessageZ; + * Method: C2Tuple_OffersMessageResponseInstructionZ_get_a + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OffersMessageResponseInstructionZ_1get_1a + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_OffersMessageResponseInstructionZ_get_b + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OffersMessageResponseInstructionZ_1get_1b + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ; */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1OffersMessageZ_1ref_1from_1ptr +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1OffersMessageResponseInstructionZZ_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* @@ -2369,26 +2457,82 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKDestination_1ref_1from_1 /* * Class: org_ldk_impl_bindings - * Method: C3Tuple_OffersMessageDestinationBlindedPathZ_get_a + * Method: LDKMessageContext_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKMessageContext; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageContext_1ref_1from_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKMessageSendInstructions_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKMessageSendInstructions; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendInstructions_1ref_1from_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_OffersMessageMessageSendInstructionsZ_get_a + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OffersMessageMessageSendInstructionsZ_1get_1a + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_OffersMessageMessageSendInstructionsZ_get_b + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OffersMessageMessageSendInstructionsZ_1get_1b + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_ReleaseHeldHtlcResponseInstructionZ_get_a + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1ReleaseHeldHtlcResponseInstructionZ_1get_1a + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_ReleaseHeldHtlcResponseInstructionZ_get_b * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OffersMessageDestinationBlindedPathZ_1get_1a +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1ReleaseHeldHtlcResponseInstructionZ_1get_1b + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1ReleaseHeldHtlcResponseInstructionZZ_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C3Tuple_OffersMessageDestinationBlindedPathZ_get_b + * Method: LDKAsyncPaymentsMessage_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKAsyncPaymentsMessage; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAsyncPaymentsMessage_1ref_1from_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_get_a * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OffersMessageDestinationBlindedPathZ_1get_1b +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1AsyncPaymentsMessageMessageSendInstructionsZ_1get_1a (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C3Tuple_OffersMessageDestinationBlindedPathZ_get_c + * Method: C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_get_b * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OffersMessageDestinationBlindedPathZ_1get_1c +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1AsyncPaymentsMessageMessageSendInstructionsZ_1get_1b (JNIEnv *, jclass, jlong); /* @@ -2586,10 +2730,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeSigner_1ecdh /* * Class: org_ldk_impl_bindings * Method: NodeSigner_sign_invoice - * Signature: (J[B[BLorg/ldk/enums/Recipient;)J + * Signature: (JJLorg/ldk/enums/Recipient;)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeSigner_1sign_1invoice - (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray, jobject); + (JNIEnv *, jclass, jlong, jlong, jobject); /* * Class: org_ldk_impl_bindings @@ -2698,10 +2842,18 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageRouter_1find_1path /* * Class: org_ldk_impl_bindings * Method: MessageRouter_create_blinded_paths - * Signature: (J[B[[B)J + * Signature: (J[BJ[[B)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageRouter_1create_1blinded_1paths - (JNIEnv *, jclass, jlong, jbyteArray, jobjectArray); + (JNIEnv *, jclass, jlong, jbyteArray, jlong, jobjectArray); + +/* + * Class: org_ldk_impl_bindings + * Method: MessageRouter_create_compact_blinded_paths + * Signature: (J[BJ[J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageRouter_1create_1compact_1blinded_1paths + (JNIEnv *, jclass, jlong, jbyteArray, jlong, jlongArray); /* * Class: org_ldk_impl_bindings @@ -2951,6 +3103,22 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1ThirtyTwoBytesC JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1ThirtyTwoBytesCVec_1C2Tuple_1u32CVec_1u8ZZZZ_1get_1b (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneReplayEventZ_get_ok + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneReplayEventZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneReplayEventZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneReplayEventZ_1get_1err + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: C2Tuple_u32TxOutZ_get_a @@ -3071,22 +3239,6 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1get_1b (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: C2Tuple_PublicKeyCVec_SocketAddressZZ_get_a - * Signature: (J)[B - */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyCVec_1SocketAddressZZ_1get_1a - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: C2Tuple_PublicKeyCVec_SocketAddressZZ_get_b - * Signature: (J)[J - */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyCVec_1SocketAddressZZ_1get_1b - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKOnionMessageContents_new @@ -3103,6 +3255,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKOnionMessageContents_1new JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1tlv_1type (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: OnionMessageContents_msg_type + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1msg_1type + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: OnionMessageContents_write @@ -3119,6 +3279,30 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1wr JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1debug_1str (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_OnionMessageContentsResponseInstructionZ_get_a + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OnionMessageContentsResponseInstructionZ_1get_1a + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_OnionMessageContentsResponseInstructionZ_get_b + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OnionMessageContentsResponseInstructionZ_1get_1b + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1OnionMessageContentsResponseInstructionZZ_1ref_1from_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: LDKCOption_OnionMessageContentsZ_ref_from_ptr @@ -3145,26 +3329,18 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1OnionMessag /* * Class: org_ldk_impl_bindings - * Method: C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_a + * Method: C2Tuple_OnionMessageContentsMessageSendInstructionsZ_get_a * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OnionMessageContentsDestinationBlindedPathZ_1get_1a +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OnionMessageContentsMessageSendInstructionsZ_1get_1a (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_b + * Method: C2Tuple_OnionMessageContentsMessageSendInstructionsZ_get_b * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OnionMessageContentsDestinationBlindedPathZ_1get_1b - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: C3Tuple_OnionMessageContentsDestinationBlindedPathZ_get_c - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OnionMessageContentsDestinationBlindedPathZ_1get_1c +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OnionMessageContentsMessageSendInstructionsZ_1get_1b (JNIEnv *, jclass, jlong); /* @@ -3367,14 +3543,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestBolt12 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestBolt12SemanticErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCOption_SecretKeyZ_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_SecretKeyZ; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1SecretKeyZ_1ref_1from_1ptr - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok @@ -3537,18 +3705,18 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StfuDecodeErrorZ_1ge /* * Class: org_ldk_impl_bindings - * Method: CResult_SpliceDecodeErrorZ_get_ok + * Method: CResult_SpliceInitDecodeErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceDecodeErrorZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceInitDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SpliceDecodeErrorZ_get_err + * Method: CResult_SpliceInitDecodeErrorZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceDecodeErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceInitDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* @@ -3791,6 +3959,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRang JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CommitmentSignedBatchDecodeErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedBatchDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CommitmentSignedBatchDecodeErrorZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedBatchDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_CommitmentSignedDecodeErrorZ_get_ok @@ -4303,30 +4487,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilte JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKSignOrCreationError_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKSignOrCreationError; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSignOrCreationError_1ref_1from_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_Bolt11InvoiceSignOrCreationErrorZ_get_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1get_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1get_1err - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCOption_InboundHTLCStateDetailsZ_ref_from_ptr @@ -4479,6 +4639,54 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelShutdownSta JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelShutdownStateDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_HeldHtlcAvailableDecodeErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HeldHtlcAvailableDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_HeldHtlcAvailableDecodeErrorZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HeldHtlcAvailableDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ReleaseHeldHtlcDecodeErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ReleaseHeldHtlcDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ReleaseHeldHtlcDecodeErrorZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ReleaseHeldHtlcDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_AsyncPaymentsMessageDecodeErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsMessageDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_AsyncPaymentsMessageDecodeErrorZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsMessageDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_OffersMessageDecodeErrorZ_get_ok @@ -4735,6 +4943,30 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvali JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1get_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKFundingInfo_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKFundingInfo; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFundingInfo_1ref_1from_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_FundingInfoDecodeErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FundingInfoDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_FundingInfoDecodeErrorZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FundingInfoDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: LDKPaymentPurpose_ref_from_ptr @@ -4865,34 +5097,34 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestina /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentFailureReasonDecodeErrorZ_get_ok - * Signature: (J)Lorg/ldk/enums/PaymentFailureReason; + * Method: LDKCOption_PaymentFailureReasonZ_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_PaymentFailureReasonZ; */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentFailureReasonDecodeErrorZ_1get_1ok +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1PaymentFailureReasonZ_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentFailureReasonDecodeErrorZ_get_err + * Method: CResult_COption_PaymentFailureReasonZDecodeErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentFailureReasonDecodeErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PaymentFailureReasonZDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCOption_U128Z_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_U128Z; + * Method: CResult_COption_PaymentFailureReasonZDecodeErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1U128Z_1ref_1from_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PaymentFailureReasonZDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCOption_PaymentFailureReasonZ_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_PaymentFailureReasonZ; + * Method: LDKCOption_U128Z_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_U128Z; */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1PaymentFailureReasonZ_1ref_1from_1ptr +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1U128Z_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* @@ -4935,6 +5167,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecod JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NonceDecodeErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonceDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NonceDecodeErrorZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonceDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: LDKBolt11ParseError_ref_from_ptr @@ -5151,6 +5399,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BigSizeDecodeErrorZ_ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BigSizeDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_UntrustedStringDecodeErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UntrustedStringDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_UntrustedStringDecodeErrorZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UntrustedStringDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_HostnameDecodeErrorZ_get_ok @@ -5201,50 +5465,66 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLim /* * Class: org_ldk_impl_bindings - * Method: CResult_UntrustedStringDecodeErrorZ_get_ok + * Method: CResult_ChannelIdDecodeErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UntrustedStringDecodeErrorZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelIdDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_UntrustedStringDecodeErrorZ_get_err + * Method: CResult_ChannelIdDecodeErrorZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UntrustedStringDecodeErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelIdDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelIdDecodeErrorZ_get_ok + * Method: C2Tuple__u832u16Z_get_a + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1_1u832u16Z_1get_1a + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple__u832u16Z_get_b + * Signature: (J)S + */ +JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_C2Tuple_1_1u832u16Z_1get_1b + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedPayInfoDecodeErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelIdDecodeErrorZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelIdDecodeErrorZ_get_err + * Method: CResult_BlindedPayInfoDecodeErrorZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelIdDecodeErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple__u832u16Z_get_a - * Signature: (J)[B + * Method: CResult_BlindedPaymentPathNoneZ_get_ok + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1_1u832u16Z_1get_1a +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPaymentPathNoneZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple__u832u16Z_get_b - * Signature: (J)S + * Method: CResult_BlindedPaymentPathNoneZ_get_err + * Signature: (J)V */ -JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_C2Tuple_1_1u832u16Z_1get_1b +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPaymentPathNoneZ_1get_1err (JNIEnv *, jclass, jlong); /* @@ -5345,58 +5625,26 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12RefundContextD /* * Class: org_ldk_impl_bindings - * Method: CResult_StrSecp256k1ErrorZ_get_ok - * Signature: (J)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_CResult_1StrSecp256k1ErrorZ_1get_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_StrSecp256k1ErrorZ_get_err - * Signature: (J)Lorg/ldk/enums/Secp256k1Error; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1StrSecp256k1ErrorZ_1get_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_a - * Signature: (J)[B - */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1get_1a - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_b - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1get_1b - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_c + * Method: CResult_ResponderDecodeErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1get_1c +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ResponderDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_ok + * Method: CResult_ResponderDecodeErrorZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ResponderDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_err - * Signature: (J)V + * Method: LDKCOption_MessageContextZ_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_MessageContextZ; */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1get_1err +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1MessageContextZ_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* @@ -5513,66 +5761,58 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SendSuccessSendError /* * Class: org_ldk_impl_bindings - * Method: CResult_BlindedPathNoneZ_get_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1get_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_BlindedPathNoneZ_get_err + * Method: CResult_NoneSendErrorZ_get_ok * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1get_1err +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_get_ok + * Method: CResult_NoneSendErrorZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlindedPayInfoBlindedPathZNoneZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_get_err - * Signature: (J)V + * Method: CResult_BlindedHopDecodeErrorZ_get_ok + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlindedPayInfoBlindedPathZNoneZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_BlindedPathDecodeErrorZ_get_ok + * Method: CResult_BlindedHopDecodeErrorZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_BlindedPathDecodeErrorZ_get_err - * Signature: (J)J + * Method: LDKSignOrCreationError_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKSignOrCreationError; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1get_1err +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSignOrCreationError_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_BlindedHopDecodeErrorZ_get_ok + * Method: CResult_Bolt11InvoiceSignOrCreationErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_BlindedHopDecodeErrorZ_get_err + * Method: CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* @@ -5913,18 +6153,82 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointChannelIdZ_1 /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a + * Method: C2Tuple_OutPointCVec_u64ZZ_get_a * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1get_1a +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1u64ZZ_1get_1a (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b + * Method: C2Tuple_OutPointCVec_u64ZZ_get_b * Signature: (J)[J */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1get_1b +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1u64ZZ_1get_1b + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedMessagePathDecodeErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedMessagePathDecodeErrorZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedMessagePathNoneZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathNoneZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedMessagePathNoneZ_get_err + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathNoneZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_MessageContextDecodeErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1MessageContextDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_MessageContextDecodeErrorZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1MessageContextDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_OffersContextDecodeErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OffersContextDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_OffersContextDecodeErrorZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OffersContextDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* @@ -5970,18 +6274,18 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKPersist_1new /* * Class: org_ldk_impl_bindings * Method: Persist_persist_new_channel - * Signature: (JJJJ)Lorg/ldk/enums/ChannelMonitorUpdateStatus; + * Signature: (JJJ)Lorg/ldk/enums/ChannelMonitorUpdateStatus; */ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Persist_1persist_1new_1channel - (JNIEnv *, jclass, jlong, jlong, jlong, jlong); + (JNIEnv *, jclass, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings * Method: Persist_update_persisted_channel - * Signature: (JJJJJ)Lorg/ldk/enums/ChannelMonitorUpdateStatus; + * Signature: (JJJJ)Lorg/ldk/enums/ChannelMonitorUpdateStatus; */ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Persist_1update_1persisted_1channel - (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong); + (JNIEnv *, jclass, jlong, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings @@ -6098,9 +6402,9 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKEventHandler_1new /* * Class: org_ldk_impl_bindings * Method: EventHandler_handle_event - * Signature: (JJ)V + * Signature: (JJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventHandler_1handle_1event +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_EventHandler_1handle_1event (JNIEnv *, jclass, jlong, jlong); /* @@ -6450,10 +6754,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKOffersMessageHandler_1new /* * Class: org_ldk_impl_bindings * Method: OffersMessageHandler_handle_message - * Signature: (JJ)J + * Signature: (JJJJ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OffersMessageHandler_1handle_1message - (JNIEnv *, jclass, jlong, jlong); + (JNIEnv *, jclass, jlong, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings @@ -6463,6 +6767,38 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OffersMessageHandler_1handle_ JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_OffersMessageHandler_1release_1pending_1messages (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKAsyncPaymentsMessageHandler_new + * Signature: (Lorg/ldk/impl/bindings/LDKAsyncPaymentsMessageHandler;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKAsyncPaymentsMessageHandler_1new + (JNIEnv *, jclass, jobject); + +/* + * Class: org_ldk_impl_bindings + * Method: AsyncPaymentsMessageHandler_held_htlc_available + * Signature: (JJJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessageHandler_1held_1htlc_1available + (JNIEnv *, jclass, jlong, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: AsyncPaymentsMessageHandler_release_held_htlc + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessageHandler_1release_1held_1htlc + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: AsyncPaymentsMessageHandler_release_pending_messages + * Signature: (J)[J + */ +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessageHandler_1release_1pending_1messages + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: LDKNodeIdLookUp_new @@ -6607,14 +6943,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1provid JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKOnionMessageHandler_1new (JNIEnv *, jclass, jobject); -/* - * Class: org_ldk_impl_bindings - * Method: OnionMessageHandler_get_and_clear_connections_needed - * Signature: (J)[J - */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_OnionMessageHandler_1get_1and_1clear_1connections_1needed - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: OnionMessageHandler_handle_onion_message @@ -6719,6 +7047,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CustomMessageHandler_1handle_ JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_CustomMessageHandler_1get_1and_1clear_1pending_1msg (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CustomMessageHandler_peer_disconnected + * Signature: (J[B)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomMessageHandler_1peer_1disconnected + (JNIEnv *, jclass, jlong, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CustomMessageHandler_peer_connected + * Signature: (J[BJZ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CustomMessageHandler_1peer_1connected + (JNIEnv *, jclass, jlong, jbyteArray, jlong, jboolean); + /* * Class: org_ldk_impl_bindings * Method: CustomMessageHandler_provided_node_features @@ -6746,10 +7090,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCustomOnionMessageHandler_ /* * Class: org_ldk_impl_bindings * Method: CustomOnionMessageHandler_handle_custom_message - * Signature: (JJ)J + * Signature: (JJJJ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageHandler_1handle_1custom_1message - (JNIEnv *, jclass, jlong, jlong); + (JNIEnv *, jclass, jlong, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings @@ -6799,6 +7143,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1disconnect_1 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1hash (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKBolt12PaymentError_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKBolt12PaymentError; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBolt12PaymentError_1ref_1from_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: LDKSignBolt12InvoiceFn_new @@ -7369,12 +7721,60 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1clone /* * Class: org_ldk_impl_bindings - * Method: CVec_BlindedPathZ_free + * Method: CVec_BlindedMessagePathZ_free * Signature: ([J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1BlindedPathZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1BlindedMessagePathZ_1free (JNIEnv *, jclass, jlongArray); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RefundDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RefundDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RefundDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RefundDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RefundDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RefundDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RefundDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RefundDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RefundDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RefundDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RefundDecodeErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RefundDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_RefundBolt12ParseErrorZ_ok @@ -7895,6 +8295,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SchnorrSignatureNone JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SchnorrSignatureNoneZ_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CVec_StrZ_free + * Signature: ([Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1StrZ_1free + (JNIEnv *, jclass, jobjectArray); + /* * Class: org_ldk_impl_bindings * Method: CVec_ThirtyTwoBytesZ_free @@ -8073,50 +8481,50 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesNoneZ_ /* * Class: org_ldk_impl_bindings - * Method: CResult_BlindedPayInfoDecodeErrorZ_ok + * Method: CResult_Bolt12InvoiceDecodeErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceDecodeErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_BlindedPayInfoDecodeErrorZ_err + * Method: CResult_Bolt12InvoiceDecodeErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_BlindedPayInfoDecodeErrorZ_is_ok + * Method: CResult_Bolt12InvoiceDecodeErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_BlindedPayInfoDecodeErrorZ_free + * Method: CResult_Bolt12InvoiceDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_BlindedPayInfoDecodeErrorZ_clone_ptr + * Method: CResult_Bolt12InvoiceDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_BlindedPayInfoDecodeErrorZ_clone + * Method: CResult_Bolt12InvoiceDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* @@ -8497,98 +8905,146 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCDescriptorDecode /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneNoneZ_ok - * Signature: ()J + * Method: CResult_PublicKeyNoneZ_ok + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1ok - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1ok + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneNoneZ_err + * Method: CResult_PublicKeyNoneZ_err * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1err (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneNoneZ_is_ok + * Method: CResult_PublicKeyNoneZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneNoneZ_free + * Method: CResult_PublicKeyNoneZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneNoneZ_clone_ptr + * Method: CResult_PublicKeyNoneZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneNoneZ_clone + * Method: CResult_PublicKeyNoneZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PublicKeyNoneZ_ok + * Method: CResult__u832NoneZ_ok * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832NoneZ_1ok (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_PublicKeyNoneZ_err + * Method: CResult__u832NoneZ_err * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832NoneZ_1err (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: CResult_PublicKeyNoneZ_is_ok + * Method: CResult__u832NoneZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832NoneZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PublicKeyNoneZ_free + * Method: CResult__u832NoneZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832NoneZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PublicKeyNoneZ_clone_ptr + * Method: CResult__u832NoneZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832NoneZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PublicKeyNoneZ_clone + * Method: CResult__u832NoneZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832NoneZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneNoneZ_ok + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1ok + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneNoneZ_err + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1err + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneNoneZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneNoneZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneNoneZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneNoneZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1clone (JNIEnv *, jclass, jlong); /* @@ -8631,14 +9087,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1BigEndianScalarZ_1cl JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1BigEndianScalarZ_1clone (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: CVec_U5Z_free - * Signature: ([B)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1U5Z_1free - (JNIEnv *, jclass, jbyteArray); - /* * Class: org_ldk_impl_bindings * Method: CResult_RecoverableSignatureNoneZ_ok @@ -8785,50 +9233,50 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1cl /* * Class: org_ldk_impl_bindings - * Method: CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok + * Method: CResult_EcdsaChannelSignerDecodeErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1EcdsaChannelSignerDecodeErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err + * Method: CResult_EcdsaChannelSignerDecodeErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1EcdsaChannelSignerDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok + * Method: CResult_EcdsaChannelSignerDecodeErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1EcdsaChannelSignerDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free + * Method: CResult_EcdsaChannelSignerDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1EcdsaChannelSignerDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone_ptr + * Method: CResult_EcdsaChannelSignerDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1EcdsaChannelSignerDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone + * Method: CResult_EcdsaChannelSignerDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1EcdsaChannelSignerDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* @@ -9263,6 +9711,86 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneIOErrorZ_1clone_ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneIOErrorZ_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new + * Signature: ([BJJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1new + (JNIEnv *, jclass, jbyteArray, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1err + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1clone + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CVec_ChannelDetailsZ_free @@ -9321,90 +9849,58 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_BlindedPayInfoBlindedPathZ_clone_ptr - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlindedPayInfoBlindedPathZ_1clone_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: C2Tuple_BlindedPayInfoBlindedPathZ_clone - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlindedPayInfoBlindedPathZ_1clone - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: C2Tuple_BlindedPayInfoBlindedPathZ_new - * Signature: (JJ)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlindedPayInfoBlindedPathZ_1new - (JNIEnv *, jclass, jlong, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: C2Tuple_BlindedPayInfoBlindedPathZ_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlindedPayInfoBlindedPathZ_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_free + * Method: CVec_BlindedPaymentPathZ_free * Signature: ([J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1BlindedPayInfoBlindedPathZZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1BlindedPaymentPathZ_1free (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_ok + * Method: CResult_CVec_BlindedPaymentPathZNoneZ_ok * Signature: ([J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlindedPayInfoBlindedPathZZNoneZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPaymentPathZNoneZ_1ok (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_err + * Method: CResult_CVec_BlindedPaymentPathZNoneZ_err * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlindedPayInfoBlindedPathZZNoneZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPaymentPathZNoneZ_1err (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_is_ok + * Method: CResult_CVec_BlindedPaymentPathZNoneZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlindedPayInfoBlindedPathZZNoneZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPaymentPathZNoneZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_free + * Method: CResult_CVec_BlindedPaymentPathZNoneZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlindedPayInfoBlindedPathZZNoneZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPaymentPathZNoneZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone_ptr + * Method: CResult_CVec_BlindedPaymentPathZNoneZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlindedPayInfoBlindedPathZZNoneZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPaymentPathZNoneZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone + * Method: CResult_CVec_BlindedPaymentPathZNoneZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlindedPayInfoBlindedPathZZNoneZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPaymentPathZNoneZ_1clone (JNIEnv *, jclass, jlong); /* @@ -9465,52 +9961,60 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNone /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_BlindedPathZNoneZ_ok + * Method: CResult_CVec_BlindedMessagePathZNoneZ_ok * Signature: ([J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPathZNoneZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1ok (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_BlindedPathZNoneZ_err + * Method: CResult_CVec_BlindedMessagePathZNoneZ_err * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPathZNoneZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1err (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_BlindedPathZNoneZ_is_ok + * Method: CResult_CVec_BlindedMessagePathZNoneZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPathZNoneZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_BlindedPathZNoneZ_free + * Method: CResult_CVec_BlindedMessagePathZNoneZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPathZNoneZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_BlindedPathZNoneZ_clone_ptr + * Method: CResult_CVec_BlindedMessagePathZNoneZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPathZNoneZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_BlindedPathZNoneZ_clone + * Method: CResult_CVec_BlindedMessagePathZNoneZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPathZNoneZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CVec_MessageForwardNodeZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MessageForwardNodeZ_1free + (JNIEnv *, jclass, jlongArray); + /* * Class: org_ldk_impl_bindings * Method: CResult_InFlightHtlcsDecodeErrorZ_ok @@ -9839,14 +10343,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDec JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintZ_1free (JNIEnv *, jclass, jlongArray); -/* - * Class: org_ldk_impl_bindings - * Method: CVec_RouteHintHopZ_free - * Signature: ([J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintHopZ_1free - (JNIEnv *, jclass, jlongArray); - /* * Class: org_ldk_impl_bindings * Method: CResult_RouteHintDecodeErrorZ_ok @@ -10967,6 +11463,54 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWit JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_OfferDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OfferDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_OfferDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OfferDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_OfferDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OfferDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_OfferDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OfferDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_OfferDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OfferDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_OfferDecodeErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OfferDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_OfferBolt12ParseErrorZ_ok @@ -11647,6 +12191,46 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeError JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: COption_NodeAnnouncementInfoZ_some + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1NodeAnnouncementInfoZ_1some + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_NodeAnnouncementInfoZ_none + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1NodeAnnouncementInfoZ_1none + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_NodeAnnouncementInfoZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NodeAnnouncementInfoZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_NodeAnnouncementInfoZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1NodeAnnouncementInfoZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_NodeAnnouncementInfoZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1NodeAnnouncementInfoZ_1clone + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_NodeInfoDecodeErrorZ_ok @@ -12745,82 +13329,266 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesAPIErr /* * Class: org_ldk_impl_bindings - * Method: COption_OffersMessageZ_some + * Method: COption_OffersContextZ_some * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1OffersMessageZ_1some +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1OffersContextZ_1some (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_OffersMessageZ_none + * Method: COption_OffersContextZ_none * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1OffersMessageZ_1none +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1OffersContextZ_1none (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: COption_OffersMessageZ_free + * Method: COption_OffersContextZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1OffersMessageZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1OffersContextZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_OffersMessageZ_clone_ptr + * Method: COption_OffersContextZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1OffersMessageZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1OffersContextZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_OffersMessageZ_clone + * Method: COption_OffersContextZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1OffersMessageZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1OffersContextZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C3Tuple_OffersMessageDestinationBlindedPathZ_clone_ptr + * Method: C2Tuple_OffersMessageResponseInstructionZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OffersMessageDestinationBlindedPathZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OffersMessageResponseInstructionZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C3Tuple_OffersMessageDestinationBlindedPathZ_clone + * Method: C2Tuple_OffersMessageResponseInstructionZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OffersMessageDestinationBlindedPathZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OffersMessageResponseInstructionZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C3Tuple_OffersMessageDestinationBlindedPathZ_new - * Signature: (JJJ)J + * Method: C2Tuple_OffersMessageResponseInstructionZ_new + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OffersMessageDestinationBlindedPathZ_1new - (JNIEnv *, jclass, jlong, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OffersMessageResponseInstructionZ_1new + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_OffersMessageResponseInstructionZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OffersMessageResponseInstructionZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_OffersMessageResponseInstructionZZ_some + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1OffersMessageResponseInstructionZZ_1some + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_OffersMessageResponseInstructionZZ_none + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1OffersMessageResponseInstructionZZ_1none + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_OffersMessageResponseInstructionZZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1OffersMessageResponseInstructionZZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_OffersMessageResponseInstructionZZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1OffersMessageResponseInstructionZZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_OffersMessageResponseInstructionZZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1OffersMessageResponseInstructionZZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_OffersMessageMessageSendInstructionsZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OffersMessageMessageSendInstructionsZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_OffersMessageMessageSendInstructionsZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OffersMessageMessageSendInstructionsZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_OffersMessageMessageSendInstructionsZ_new + * Signature: (JJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OffersMessageMessageSendInstructionsZ_1new + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: C3Tuple_OffersMessageDestinationBlindedPathZ_free + * Method: C2Tuple_OffersMessageMessageSendInstructionsZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OffersMessageDestinationBlindedPathZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OffersMessageMessageSendInstructionsZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_C3Tuple_OffersMessageDestinationBlindedPathZZ_free + * Method: CVec_C2Tuple_OffersMessageMessageSendInstructionsZZ_free * Signature: ([J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C3Tuple_1OffersMessageDestinationBlindedPathZZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1OffersMessageMessageSendInstructionsZZ_1free + (JNIEnv *, jclass, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1ReleaseHeldHtlcResponseInstructionZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1ReleaseHeldHtlcResponseInstructionZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_ReleaseHeldHtlcResponseInstructionZ_new + * Signature: (JJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1ReleaseHeldHtlcResponseInstructionZ_1new + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_ReleaseHeldHtlcResponseInstructionZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1ReleaseHeldHtlcResponseInstructionZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_some + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1ReleaseHeldHtlcResponseInstructionZZ_1some + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_none + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1ReleaseHeldHtlcResponseInstructionZZ_1none + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1ReleaseHeldHtlcResponseInstructionZZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1ReleaseHeldHtlcResponseInstructionZZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1ReleaseHeldHtlcResponseInstructionZZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1AsyncPaymentsMessageMessageSendInstructionsZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1AsyncPaymentsMessageMessageSendInstructionsZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_new + * Signature: (JJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1AsyncPaymentsMessageMessageSendInstructionsZ_1new + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1AsyncPaymentsMessageMessageSendInstructionsZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1AsyncPaymentsMessageMessageSendInstructionsZZ_1free (JNIEnv *, jclass, jlongArray); /* @@ -13639,6 +14407,54 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1ThirtyTwoBytesCVec_1C JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1ThirtyTwoBytesCVec_1C2Tuple_1u32CVec_1u8ZZZZZ_1free (JNIEnv *, jclass, jlongArray); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneReplayEventZ_ok + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneReplayEventZ_1ok + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneReplayEventZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneReplayEventZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneReplayEventZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneReplayEventZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneReplayEventZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneReplayEventZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneReplayEventZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneReplayEventZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneReplayEventZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneReplayEventZ_1clone + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CVec_CommitmentTransactionZ_free @@ -13857,43 +14673,75 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1PublicKeyTypeZZ /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_PublicKeyCVec_SocketAddressZZ_clone_ptr + * Method: C2Tuple_OnionMessageContentsResponseInstructionZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyCVec_1SocketAddressZZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OnionMessageContentsResponseInstructionZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_PublicKeyCVec_SocketAddressZZ_clone + * Method: C2Tuple_OnionMessageContentsResponseInstructionZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyCVec_1SocketAddressZZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OnionMessageContentsResponseInstructionZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_PublicKeyCVec_SocketAddressZZ_new - * Signature: ([B[J)J + * Method: C2Tuple_OnionMessageContentsResponseInstructionZ_new + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyCVec_1SocketAddressZZ_1new - (JNIEnv *, jclass, jbyteArray, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OnionMessageContentsResponseInstructionZ_1new + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_PublicKeyCVec_SocketAddressZZ_free + * Method: C2Tuple_OnionMessageContentsResponseInstructionZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyCVec_1SocketAddressZZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OnionMessageContentsResponseInstructionZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ_free - * Signature: ([J)V + * Method: COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_some + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1PublicKeyCVec_1SocketAddressZZZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1OnionMessageContentsResponseInstructionZZ_1some + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_none + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1OnionMessageContentsResponseInstructionZZ_1none + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1OnionMessageContentsResponseInstructionZZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1OnionMessageContentsResponseInstructionZZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1OnionMessageContentsResponseInstructionZZ_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings @@ -13985,42 +14833,42 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1OnionMessag /* * Class: org_ldk_impl_bindings - * Method: C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone_ptr + * Method: C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OnionMessageContentsDestinationBlindedPathZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OnionMessageContentsMessageSendInstructionsZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone + * Method: C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OnionMessageContentsDestinationBlindedPathZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OnionMessageContentsMessageSendInstructionsZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C3Tuple_OnionMessageContentsDestinationBlindedPathZ_new - * Signature: (JJJ)J + * Method: C2Tuple_OnionMessageContentsMessageSendInstructionsZ_new + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OnionMessageContentsDestinationBlindedPathZ_1new - (JNIEnv *, jclass, jlong, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OnionMessageContentsMessageSendInstructionsZ_1new + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: C3Tuple_OnionMessageContentsDestinationBlindedPathZ_free + * Method: C2Tuple_OnionMessageContentsMessageSendInstructionsZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OnionMessageContentsDestinationBlindedPathZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OnionMessageContentsMessageSendInstructionsZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ_free + * Method: CVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ_free * Signature: ([J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C3Tuple_1OnionMessageContentsDestinationBlindedPathZZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1OnionMessageContentsMessageSendInstructionsZZ_1free (JNIEnv *, jclass, jlongArray); /* @@ -14383,14 +15231,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZIOErrorZ_1c JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZIOErrorZ_1clone (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: CVec_StrZ_free - * Signature: ([Ljava/lang/String;)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1StrZ_1free - (JNIEnv *, jclass, jobjectArray); - /* * Class: org_ldk_impl_bindings * Method: CResult_CVec_StrZIOErrorZ_ok @@ -14639,46 +15479,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestBolt12 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestBolt12SemanticErrorZ_1clone (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: COption_SecretKeyZ_some - * Signature: ([B)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1SecretKeyZ_1some - (JNIEnv *, jclass, jbyteArray); - -/* - * Class: org_ldk_impl_bindings - * Method: COption_SecretKeyZ_none - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1SecretKeyZ_1none - (JNIEnv *, jclass); - -/* - * Class: org_ldk_impl_bindings - * Method: COption_SecretKeyZ_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1SecretKeyZ_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: COption_SecretKeyZ_clone_ptr - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1SecretKeyZ_1clone_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: COption_SecretKeyZ_clone - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1SecretKeyZ_1clone - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_ok @@ -15225,50 +16025,50 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StfuDecodeErrorZ_1cl /* * Class: org_ldk_impl_bindings - * Method: CResult_SpliceDecodeErrorZ_ok + * Method: CResult_SpliceInitDecodeErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceDecodeErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceInitDecodeErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SpliceDecodeErrorZ_err + * Method: CResult_SpliceInitDecodeErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceInitDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SpliceDecodeErrorZ_is_ok + * Method: CResult_SpliceInitDecodeErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceDecodeErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceInitDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SpliceDecodeErrorZ_free + * Method: CResult_SpliceInitDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceInitDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SpliceDecodeErrorZ_clone_ptr + * Method: CResult_SpliceInitDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceInitDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SpliceDecodeErrorZ_clone + * Method: CResult_SpliceInitDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SpliceInitDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* @@ -15991,6 +16791,54 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRang JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CommitmentSignedBatchDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedBatchDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CommitmentSignedBatchDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedBatchDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CommitmentSignedBatchDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedBatchDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CommitmentSignedBatchDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedBatchDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CommitmentSignedBatchDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedBatchDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CommitmentSignedBatchDecodeErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedBatchDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_CommitmentSignedDecodeErrorZ_ok @@ -17527,62 +18375,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilte JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: CVec_PhantomRouteHintsZ_free - * Signature: ([J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PhantomRouteHintsZ_1free - (JNIEnv *, jclass, jlongArray); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_Bolt11InvoiceSignOrCreationErrorZ_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_Bolt11InvoiceSignOrCreationErrorZ_err - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1is_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_Bolt11InvoiceSignOrCreationErrorZ_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_Bolt11InvoiceSignOrCreationErrorZ_clone_ptr - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1clone_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_Bolt11InvoiceSignOrCreationErrorZ_clone - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1clone - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: COption_InboundHTLCStateDetailsZ_some @@ -18111,6 +18903,150 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelShutdownState JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1FutureZ_1free (JNIEnv *, jclass, jlongArray); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_HeldHtlcAvailableDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HeldHtlcAvailableDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_HeldHtlcAvailableDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HeldHtlcAvailableDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_HeldHtlcAvailableDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HeldHtlcAvailableDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_HeldHtlcAvailableDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HeldHtlcAvailableDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_HeldHtlcAvailableDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HeldHtlcAvailableDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_HeldHtlcAvailableDecodeErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HeldHtlcAvailableDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ReleaseHeldHtlcDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ReleaseHeldHtlcDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ReleaseHeldHtlcDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ReleaseHeldHtlcDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ReleaseHeldHtlcDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ReleaseHeldHtlcDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ReleaseHeldHtlcDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ReleaseHeldHtlcDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ReleaseHeldHtlcDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ReleaseHeldHtlcDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ReleaseHeldHtlcDecodeErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ReleaseHeldHtlcDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_AsyncPaymentsMessageDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsMessageDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_AsyncPaymentsMessageDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsMessageDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_AsyncPaymentsMessageDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsMessageDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_AsyncPaymentsMessageDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsMessageDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_AsyncPaymentsMessageDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsMessageDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_AsyncPaymentsMessageDecodeErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsMessageDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_OffersMessageDecodeErrorZ_ok @@ -18871,6 +19807,54 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvali JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TransactionZ_1free (JNIEnv *, jclass, jobjectArray); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_FundingInfoDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FundingInfoDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_FundingInfoDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FundingInfoDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_FundingInfoDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FundingInfoDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_FundingInfoDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingInfoDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_FundingInfoDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FundingInfoDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_FundingInfoDecodeErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FundingInfoDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_PaymentPurposeDecodeErrorZ_ok @@ -19233,50 +20217,90 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestina /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentFailureReasonDecodeErrorZ_ok + * Method: COption_PaymentFailureReasonZ_some * Signature: (Lorg/ldk/enums/PaymentFailureReason;)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentFailureReasonDecodeErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1PaymentFailureReasonZ_1some (JNIEnv *, jclass, jobject); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentFailureReasonDecodeErrorZ_err + * Method: COption_PaymentFailureReasonZ_none + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1PaymentFailureReasonZ_1none + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_PaymentFailureReasonZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1PaymentFailureReasonZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_PaymentFailureReasonZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1PaymentFailureReasonZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_PaymentFailureReasonZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1PaymentFailureReasonZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_COption_PaymentFailureReasonZDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PaymentFailureReasonZDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_COption_PaymentFailureReasonZDecodeErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentFailureReasonDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PaymentFailureReasonZDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentFailureReasonDecodeErrorZ_is_ok + * Method: CResult_COption_PaymentFailureReasonZDecodeErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentFailureReasonDecodeErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PaymentFailureReasonZDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentFailureReasonDecodeErrorZ_free + * Method: CResult_COption_PaymentFailureReasonZDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentFailureReasonDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PaymentFailureReasonZDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentFailureReasonDecodeErrorZ_clone_ptr + * Method: CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentFailureReasonDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PaymentFailureReasonZDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentFailureReasonDecodeErrorZ_clone + * Method: CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentFailureReasonDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PaymentFailureReasonZDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* @@ -19329,132 +20353,148 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ClaimedHTLCZ_1free /* * Class: org_ldk_impl_bindings - * Method: COption_PaymentFailureReasonZ_some - * Signature: (Lorg/ldk/enums/PaymentFailureReason;)J + * Method: COption_EventZ_some + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1PaymentFailureReasonZ_1some - (JNIEnv *, jclass, jobject); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1some + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_PaymentFailureReasonZ_none + * Method: COption_EventZ_none * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1PaymentFailureReasonZ_1none +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1none (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: COption_PaymentFailureReasonZ_free + * Method: COption_EventZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1PaymentFailureReasonZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_PaymentFailureReasonZ_clone_ptr + * Method: COption_EventZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1PaymentFailureReasonZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_PaymentFailureReasonZ_clone + * Method: COption_EventZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1PaymentFailureReasonZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_EventZ_some + * Method: CResult_COption_EventZDecodeErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1some +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_EventZ_none - * Signature: ()J + * Method: CResult_COption_EventZDecodeErrorZ_err + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1none - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_EventZ_free + * Method: CResult_COption_EventZDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_COption_EventZDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_EventZ_clone_ptr + * Method: CResult_COption_EventZDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_EventZ_clone + * Method: CResult_COption_EventZDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_EventZDecodeErrorZ_ok + * Method: CResult_NonceDecodeErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonceDecodeErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_EventZDecodeErrorZ_err + * Method: CResult_NonceDecodeErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonceDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_EventZDecodeErrorZ_is_ok + * Method: CResult_NonceDecodeErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonceDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_EventZDecodeErrorZ_free + * Method: CResult_NonceDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonceDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_EventZDecodeErrorZ_clone_ptr + * Method: CResult_NonceDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonceDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_EventZDecodeErrorZ_clone + * Method: CResult_NonceDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonceDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CVec_RouteHintHopZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintHopZ_1free + (JNIEnv *, jclass, jlongArray); + /* * Class: org_ldk_impl_bindings * Method: CResult_SiPrefixBolt11ParseErrorZ_ok @@ -20023,150 +21063,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BigSizeDecodeErrorZ_ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BigSizeDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: CResult_HostnameDecodeErrorZ_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HostnameDecodeErrorZ_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_HostnameDecodeErrorZ_err - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HostnameDecodeErrorZ_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_HostnameDecodeErrorZ_is_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HostnameDecodeErrorZ_1is_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_HostnameDecodeErrorZ_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HostnameDecodeErrorZ_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_HostnameDecodeErrorZ_clone_ptr - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HostnameDecodeErrorZ_1clone_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_HostnameDecodeErrorZ_clone - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HostnameDecodeErrorZ_1clone - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_TransactionU16LenLimitedNoneZ_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedNoneZ_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_TransactionU16LenLimitedNoneZ_err - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedNoneZ_1err - (JNIEnv *, jclass); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_TransactionU16LenLimitedNoneZ_is_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedNoneZ_1is_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_TransactionU16LenLimitedNoneZ_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedNoneZ_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_TransactionU16LenLimitedNoneZ_clone_ptr - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedNoneZ_1clone_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_TransactionU16LenLimitedNoneZ_clone - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedNoneZ_1clone - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_TransactionU16LenLimitedDecodeErrorZ_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedDecodeErrorZ_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_TransactionU16LenLimitedDecodeErrorZ_err - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedDecodeErrorZ_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedDecodeErrorZ_1is_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_TransactionU16LenLimitedDecodeErrorZ_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedDecodeErrorZ_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_TransactionU16LenLimitedDecodeErrorZ_clone_ptr - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedDecodeErrorZ_1clone_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_TransactionU16LenLimitedDecodeErrorZ_clone - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedDecodeErrorZ_1clone - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: CResult_UntrustedStringDecodeErrorZ_ok @@ -20215,6 +21111,150 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UntrustedStringDecod JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UntrustedStringDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_HostnameDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HostnameDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_HostnameDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HostnameDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_HostnameDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HostnameDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_HostnameDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HostnameDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_HostnameDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HostnameDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_HostnameDecodeErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HostnameDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_TransactionU16LenLimitedNoneZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedNoneZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_TransactionU16LenLimitedNoneZ_err + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedNoneZ_1err + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_TransactionU16LenLimitedNoneZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedNoneZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_TransactionU16LenLimitedNoneZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedNoneZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_TransactionU16LenLimitedNoneZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedNoneZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_TransactionU16LenLimitedNoneZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedNoneZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_TransactionU16LenLimitedDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_TransactionU16LenLimitedDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_TransactionU16LenLimitedDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_TransactionU16LenLimitedDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_TransactionU16LenLimitedDecodeErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionU16LenLimitedDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_ChannelIdDecodeErrorZ_ok @@ -20295,6 +21335,110 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1_1u832u16Z_1new JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1_1u832u16Z_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedPayInfoDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedPayInfoDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedPayInfoDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedPayInfoDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedPayInfoDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedPayInfoDecodeErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedPaymentPathNoneZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPaymentPathNoneZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedPaymentPathNoneZ_err + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPaymentPathNoneZ_1err + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedPaymentPathNoneZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPaymentPathNoneZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedPaymentPathNoneZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPaymentPathNoneZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedPaymentPathNoneZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPaymentPathNoneZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedPaymentPathNoneZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPaymentPathNoneZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CVec_PaymentForwardNodeZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PaymentForwardNodeZ_1free + (JNIEnv *, jclass, jlongArray); + /* * Class: org_ldk_impl_bindings * Method: CResult_PaymentRelayDecodeErrorZ_ok @@ -20585,178 +21729,138 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12RefundContextD /* * Class: org_ldk_impl_bindings - * Method: CResult_StrSecp256k1ErrorZ_ok - * Signature: (Ljava/lang/String;)J + * Method: CResult_TxOutUtxoLookupErrorZ_ok + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StrSecp256k1ErrorZ_1ok - (JNIEnv *, jclass, jstring); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_StrSecp256k1ErrorZ_err - * Signature: (Lorg/ldk/enums/Secp256k1Error;)J + * Method: CResult_TxOutUtxoLookupErrorZ_err + * Signature: (Lorg/ldk/enums/UtxoLookupError;)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StrSecp256k1ErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1err (JNIEnv *, jclass, jobject); /* * Class: org_ldk_impl_bindings - * Method: CResult_StrSecp256k1ErrorZ_is_ok + * Method: CResult_TxOutUtxoLookupErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1StrSecp256k1ErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_StrSecp256k1ErrorZ_free + * Method: CResult_TxOutUtxoLookupErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StrSecp256k1ErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_StrSecp256k1ErrorZ_clone_ptr + * Method: CResult_TxOutUtxoLookupErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StrSecp256k1ErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_StrSecp256k1ErrorZ_clone + * Method: CResult_TxOutUtxoLookupErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StrSecp256k1ErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone_ptr + * Method: CResult_ResponderDecodeErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ResponderDecodeErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone + * Method: CResult_ResponderDecodeErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1clone - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new - * Signature: ([BJJ)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1new - (JNIEnv *, jclass, jbyteArray, jlong, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ResponderDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1err - (JNIEnv *, jclass); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok + * Method: CResult_ResponderDecodeErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ResponderDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free + * Method: CResult_ResponderDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ResponderDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone_ptr + * Method: CResult_ResponderDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ResponderDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone + * Method: CResult_ResponderDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C3Tuple_1ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ResponderDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_TxOutUtxoLookupErrorZ_ok + * Method: COption_MessageContextZ_some * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1MessageContextZ_1some (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_TxOutUtxoLookupErrorZ_err - * Signature: (Lorg/ldk/enums/UtxoLookupError;)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1err - (JNIEnv *, jclass, jobject); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_TxOutUtxoLookupErrorZ_is_ok - * Signature: (J)Z + * Method: COption_MessageContextZ_none + * Signature: ()J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1is_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1MessageContextZ_1none + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: CResult_TxOutUtxoLookupErrorZ_free + * Method: COption_MessageContextZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1MessageContextZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_TxOutUtxoLookupErrorZ_clone_ptr + * Method: COption_MessageContextZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1MessageContextZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_TxOutUtxoLookupErrorZ_clone + * Method: COption_MessageContextZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1MessageContextZ_1clone (JNIEnv *, jclass, jlong); /* @@ -20937,202 +22041,154 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SendSuccessSendError /* * Class: org_ldk_impl_bindings - * Method: CResult_BlindedPathNoneZ_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_BlindedPathNoneZ_err + * Method: CResult_NoneSendErrorZ_ok * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1ok (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: CResult_BlindedPathNoneZ_is_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1is_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_BlindedPathNoneZ_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_BlindedPathNoneZ_clone_ptr + * Method: CResult_NoneSendErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_BlindedPathNoneZ_clone - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1clone - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlindedPayInfoBlindedPathZNoneZ_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_err - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlindedPayInfoBlindedPathZNoneZ_1err - (JNIEnv *, jclass); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_is_ok + * Method: CResult_NoneSendErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlindedPayInfoBlindedPathZNoneZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free + * Method: CResult_NoneSendErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlindedPayInfoBlindedPathZNoneZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone_ptr + * Method: CResult_NoneSendErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlindedPayInfoBlindedPathZNoneZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone + * Method: CResult_NoneSendErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlindedPayInfoBlindedPathZNoneZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_ForwardNodeZ_free - * Signature: ([J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ForwardNodeZ_1free - (JNIEnv *, jclass, jlongArray); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_BlindedPathDecodeErrorZ_ok + * Method: CResult_BlindedHopDecodeErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_BlindedPathDecodeErrorZ_err + * Method: CResult_BlindedHopDecodeErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_BlindedPathDecodeErrorZ_is_ok + * Method: CResult_BlindedHopDecodeErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_BlindedPathDecodeErrorZ_free + * Method: CResult_BlindedHopDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_BlindedPathDecodeErrorZ_clone_ptr + * Method: CResult_BlindedHopDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_BlindedPathDecodeErrorZ_clone + * Method: CResult_BlindedHopDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_BlindedHopDecodeErrorZ_ok + * Method: CVec_PhantomRouteHintsZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PhantomRouteHintsZ_1free + (JNIEnv *, jclass, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_Bolt11InvoiceSignOrCreationErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_BlindedHopDecodeErrorZ_err + * Method: CResult_Bolt11InvoiceSignOrCreationErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_BlindedHopDecodeErrorZ_is_ok + * Method: CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_BlindedHopDecodeErrorZ_free + * Method: CResult_Bolt11InvoiceSignOrCreationErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_BlindedHopDecodeErrorZ_clone_ptr + * Method: CResult_Bolt11InvoiceSignOrCreationErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_BlindedHopDecodeErrorZ_clone + * Method: CResult_Bolt11InvoiceSignOrCreationErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceSignOrCreationErrorZ_1clone (JNIEnv *, jclass, jlong); /* @@ -21753,51 +22809,235 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1OutPointChannel /* * Class: org_ldk_impl_bindings - * Method: CVec_MonitorUpdateIdZ_free + * Method: C2Tuple_OutPointCVec_u64ZZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1u64ZZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_OutPointCVec_u64ZZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1u64ZZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_OutPointCVec_u64ZZ_new + * Signature: (J[J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1u64ZZ_1new + (JNIEnv *, jclass, jlong, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_OutPointCVec_u64ZZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1u64ZZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CVec_C2Tuple_OutPointCVec_u64ZZZ_free * Signature: ([J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MonitorUpdateIdZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1OutPointCVec_1u64ZZZ_1free (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr + * Method: CResult_BlindedMessagePathDecodeErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathDecodeErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone + * Method: CResult_BlindedMessagePathDecodeErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new - * Signature: (J[J)J + * Method: CResult_BlindedMessagePathDecodeErrorZ_is_ok + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1new - (JNIEnv *, jclass, jlong, jlongArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free + * Method: CResult_BlindedMessagePathDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free - * Signature: ([J)V + * Method: CResult_BlindedMessagePathDecodeErrorZ_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1OutPointCVec_1MonitorUpdateIdZZZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedMessagePathDecodeErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedMessagePathNoneZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathNoneZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedMessagePathNoneZ_err + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathNoneZ_1err + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedMessagePathNoneZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathNoneZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedMessagePathNoneZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathNoneZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedMessagePathNoneZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathNoneZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedMessagePathNoneZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedMessagePathNoneZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_MessageContextDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1MessageContextDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_MessageContextDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1MessageContextDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_MessageContextDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1MessageContextDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_MessageContextDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1MessageContextDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_MessageContextDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1MessageContextDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_MessageContextDecodeErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1MessageContextDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_OffersContextDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OffersContextDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_OffersContextDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OffersContextDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_OffersContextDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OffersContextDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_OffersContextDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OffersContextDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_OffersContextDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OffersContextDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_OffersContextDecodeErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OffersContextDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings @@ -21975,6 +23215,22 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BigSize_1write JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BigSize_1read (JNIEnv *, jclass, jbyteArray); +/* + * Class: org_ldk_impl_bindings + * Method: UntrustedString_write + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UntrustedString_1write + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: UntrustedString_read + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UntrustedString_1read + (JNIEnv *, jclass, jbyteArray); + /* * Class: org_ldk_impl_bindings * Method: Hostname_free @@ -22130,9 +23386,9 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TransactionU16LenLimited_1rea /* * Class: org_ldk_impl_bindings * Method: sign - * Signature: ([B[B)J + * Signature: ([B[B)Ljava/lang/String; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_sign +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_sign (JNIEnv *, jclass, jbyteArray, jbyteArray); /* @@ -22151,14 +23407,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_recover_1pk JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_verify (JNIEnv *, jclass, jbyteArray, jstring, jbyteArray); -/* - * Class: org_ldk_impl_bindings - * Method: construct_invoice_preimage - * Signature: ([B[B)[B - */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_construct_1invoice_1preimage - (JNIEnv *, jclass, jbyteArray, jbyteArray); - /* * Class: org_ldk_impl_bindings * Method: KVStore_free @@ -22194,26 +23442,26 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdatingPersister_1free /* * Class: org_ldk_impl_bindings * Method: MonitorUpdatingPersister_new - * Signature: (JJJJJ)J + * Signature: (JJJJJJJ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MonitorUpdatingPersister_1new - (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong); + (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings * Method: MonitorUpdatingPersister_read_all_channel_monitors_with_updates - * Signature: (JJJ)J + * Signature: (J)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MonitorUpdatingPersister_1read_1all_1channel_1monitors_1with_1updates - (JNIEnv *, jclass, jlong, jlong, jlong); + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings * Method: MonitorUpdatingPersister_read_channel_monitor_with_updates - * Signature: (JJJLjava/lang/String;)J + * Signature: (JLjava/lang/String;)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MonitorUpdatingPersister_1read_1channel_1monitor_1with_1updates - (JNIEnv *, jclass, jlong, jlong, jlong, jstring); + (JNIEnv *, jclass, jlong, jstring); /* * Class: org_ldk_impl_bindings @@ -22303,134 +23551,6 @@ JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_vout_1from_1scid JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_scid_1from_1parts (JNIEnv *, jclass, jlong, jlong, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: UntrustedString_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UntrustedString_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: UntrustedString_get_a - * Signature: (J)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_UntrustedString_1get_1a - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: UntrustedString_set_a - * Signature: (JLjava/lang/String;)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UntrustedString_1set_1a - (JNIEnv *, jclass, jlong, jstring); - -/* - * Class: org_ldk_impl_bindings - * Method: UntrustedString_new - * Signature: (Ljava/lang/String;)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UntrustedString_1new - (JNIEnv *, jclass, jstring); - -/* - * Class: org_ldk_impl_bindings - * Method: UntrustedString_clone_ptr - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UntrustedString_1clone_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: UntrustedString_clone - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UntrustedString_1clone - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: UntrustedString_eq - * Signature: (JJ)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UntrustedString_1eq - (JNIEnv *, jclass, jlong, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: UntrustedString_hash - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UntrustedString_1hash - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: UntrustedString_write - * Signature: (J)[B - */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UntrustedString_1write - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: UntrustedString_read - * Signature: ([B)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UntrustedString_1read - (JNIEnv *, jclass, jbyteArray); - -/* - * Class: org_ldk_impl_bindings - * Method: UntrustedString_to_str - * Signature: (J)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_UntrustedString_1to_1str - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: PrintableString_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PrintableString_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: PrintableString_get_a - * Signature: (J)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_PrintableString_1get_1a - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: PrintableString_set_a - * Signature: (JLjava/lang/String;)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PrintableString_1set_1a - (JNIEnv *, jclass, jlong, jstring); - -/* - * Class: org_ldk_impl_bindings - * Method: PrintableString_new - * Signature: (Ljava/lang/String;)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PrintableString_1new - (JNIEnv *, jclass, jstring); - -/* - * Class: org_ldk_impl_bindings - * Method: PrintableString_to_str - * Signature: (J)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_PrintableString_1to_1str - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: TrackedSpendableOutput_free @@ -22791,6 +23911,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Sleeper_1from_1single_1future JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Sleeper_1from_1two_1futures (JNIEnv *, jclass, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: Sleeper_from_three_futures + * Signature: (JJJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Sleeper_1from_1three_1futures + (JNIEnv *, jclass, jlong, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: Sleeper_new @@ -23023,13 +24151,29 @@ JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_Record_1get_1line JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1line (JNIEnv *, jclass, jlong, jint); +/* + * Class: org_ldk_impl_bindings + * Method: Record_get_payment_hash + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Record_1get_1payment_1hash + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Record_set_payment_hash + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1payment_1hash + (JNIEnv *, jclass, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: Record_new - * Signature: (Lorg/ldk/enums/Level;[BJLjava/lang/String;Ljava/lang/String;Ljava/lang/String;I)J + * Signature: (Lorg/ldk/enums/Level;[BJLjava/lang/String;Ljava/lang/String;Ljava/lang/String;IJ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Record_1new - (JNIEnv *, jclass, jobject, jbyteArray, jlong, jstring, jstring, jstring, jint); + (JNIEnv *, jclass, jobject, jbyteArray, jlong, jstring, jstring, jstring, jint, jlong); /* * Class: org_ldk_impl_bindings @@ -23145,18 +24289,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1n /* * Class: org_ldk_impl_bindings - * Method: ChannelHandshakeConfig_get_announced_channel + * Method: ChannelHandshakeConfig_get_announce_for_forwarding * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1announced_1channel +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1announce_1for_1forwarding (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelHandshakeConfig_set_announced_channel + * Method: ChannelHandshakeConfig_set_announce_for_forwarding * Signature: (JZ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1announced_1channel +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1announce_1for_1forwarding (JNIEnv *, jclass, jlong, jboolean); /* @@ -23783,14 +24927,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfigUpdate_1set_1forc JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfigUpdate_1new (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: ChannelConfigUpdate_default - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfigUpdate_1default - (JNIEnv *, jclass); - /* * Class: org_ldk_impl_bindings * Method: UserConfig_free @@ -23927,13 +25063,29 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1accept_1m JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1accept_1mpp_1keysend (JNIEnv *, jclass, jlong, jboolean); +/* + * Class: org_ldk_impl_bindings + * Method: UserConfig_get_manually_handle_bolt12_invoices + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1manually_1handle_1bolt12_1invoices + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: UserConfig_set_manually_handle_bolt12_invoices + * Signature: (JZ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1manually_1handle_1bolt12_1invoices + (JNIEnv *, jclass, jlong, jboolean); + /* * Class: org_ldk_impl_bindings * Method: UserConfig_new - * Signature: (JJJZZZZZ)J + * Signature: (JJJZZZZZZ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1new - (JNIEnv *, jclass, jlong, jlong, jlong, jboolean, jboolean, jboolean, jboolean, jboolean); + (JNIEnv *, jclass, jlong, jlong, jlong, jboolean, jboolean, jboolean, jboolean, jboolean, jboolean); /* * Class: org_ldk_impl_bindings @@ -24249,10 +25401,18 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1clone /* * Class: org_ldk_impl_bindings - * Method: ConfirmationTarget_on_chain_sweep + * Method: ConfirmationTarget_maximum_fee_estimate + * Signature: ()Lorg/ldk/enums/ConfirmationTarget; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1maximum_1fee_1estimate + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: ConfirmationTarget_urgent_on_chain_sweep * Signature: ()Lorg/ldk/enums/ConfirmationTarget; */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1on_1chain_1sweep +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1urgent_1on_1chain_1sweep (JNIEnv *, jclass); /* @@ -24327,46 +25487,6 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1eq JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1free (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: MonitorUpdateId_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: MonitorUpdateId_clone_ptr - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1clone_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: MonitorUpdateId_clone - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1clone - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: MonitorUpdateId_hash - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1hash - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: MonitorUpdateId_eq - * Signature: (JJ)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1eq - (JNIEnv *, jclass, jlong, jlong); - /* * Class: org_ldk_impl_bindings * Method: Persist_free @@ -24711,6 +25831,54 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1write JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1read (JNIEnv *, jclass, jbyteArray); +/* + * Class: org_ldk_impl_bindings + * Method: BalanceSource_clone + * Signature: (J)Lorg/ldk/enums/BalanceSource; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_BalanceSource_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: BalanceSource_holder_force_closed + * Signature: ()Lorg/ldk/enums/BalanceSource; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_BalanceSource_1holder_1force_1closed + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: BalanceSource_counterparty_force_closed + * Signature: ()Lorg/ldk/enums/BalanceSource; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_BalanceSource_1counterparty_1force_1closed + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: BalanceSource_coop_close + * Signature: ()Lorg/ldk/enums/BalanceSource; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_BalanceSource_1coop_1close + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: BalanceSource_htlc + * Signature: ()Lorg/ldk/enums/BalanceSource; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_BalanceSource_1htlc + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: BalanceSource_eq + * Signature: (JJ)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BalanceSource_1eq + (JNIEnv *, jclass, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: Balance_free @@ -24738,18 +25906,18 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Balance_1clone /* * Class: org_ldk_impl_bindings * Method: Balance_claimable_on_channel_close - * Signature: (J)J + * Signature: (JJJJJJ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Balance_1claimable_1on_1channel_1close - (JNIEnv *, jclass, jlong); + (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings * Method: Balance_claimable_awaiting_confirmations - * Signature: (JI)J + * Signature: (JILorg/ldk/enums/BalanceSource;)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Balance_1claimable_1awaiting_1confirmations - (JNIEnv *, jclass, jlong, jint); + (JNIEnv *, jclass, jlong, jint, jobject); /* * Class: org_ldk_impl_bindings @@ -24762,10 +25930,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Balance_1contentious_1claimab /* * Class: org_ldk_impl_bindings * Method: Balance_maybe_timeout_claimable_htlc - * Signature: (JI[B)J + * Signature: (JI[BZ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Balance_1maybe_1timeout_1claimable_1htlc - (JNIEnv *, jclass, jlong, jint, jbyteArray); + (JNIEnv *, jclass, jlong, jint, jbyteArray, jboolean); /* * Class: org_ldk_impl_bindings @@ -24890,9 +26058,9 @@ JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and /* * Class: org_ldk_impl_bindings * Method: ChannelMonitor_process_pending_events - * Signature: (JJ)V + * Signature: (JJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1process_1pending_1events +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1process_1pending_1events (JNIEnv *, jclass, jlong, jlong); /* @@ -24999,6 +26167,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1current_1best JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1rebroadcast_1pending_1claims (JNIEnv *, jclass, jlong, jlong, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelMonitor_has_pending_claims + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1has_1pending_1claims + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChannelMonitor_signer_unblocked @@ -25335,13 +26511,29 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_BlindedForward_1get_1failur JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedForward_1set_1failure (JNIEnv *, jclass, jlong, jobject); +/* + * Class: org_ldk_impl_bindings + * Method: BlindedForward_get_next_blinding_override + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BlindedForward_1get_1next_1blinding_1override + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: BlindedForward_set_next_blinding_override + * Signature: (J[B)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedForward_1set_1next_1blinding_1override + (JNIEnv *, jclass, jlong, jbyteArray); + /* * Class: org_ldk_impl_bindings * Method: BlindedForward_new - * Signature: ([BLorg/ldk/enums/BlindedFailure;)J + * Signature: ([BLorg/ldk/enums/BlindedFailure;[B)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedForward_1new - (JNIEnv *, jclass, jbyteArray, jobject); + (JNIEnv *, jclass, jbyteArray, jobject, jbyteArray); /* * Class: org_ldk_impl_bindings @@ -25898,34 +27090,34 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1close_1channe /* * Class: org_ldk_impl_bindings * Method: ChannelManager_force_close_broadcasting_latest_txn - * Signature: (JJ[B)J + * Signature: (JJ[BLjava/lang/String;)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1broadcasting_1latest_1txn - (JNIEnv *, jclass, jlong, jlong, jbyteArray); + (JNIEnv *, jclass, jlong, jlong, jbyteArray, jstring); /* * Class: org_ldk_impl_bindings * Method: ChannelManager_force_close_without_broadcasting_txn - * Signature: (JJ[B)J + * Signature: (JJ[BLjava/lang/String;)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1without_1broadcasting_1txn - (JNIEnv *, jclass, jlong, jlong, jbyteArray); + (JNIEnv *, jclass, jlong, jlong, jbyteArray, jstring); /* * Class: org_ldk_impl_bindings * Method: ChannelManager_force_close_all_channels_broadcasting_latest_txn - * Signature: (J)V + * Signature: (JLjava/lang/String;)V */ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1all_1channels_1broadcasting_1latest_1txn - (JNIEnv *, jclass, jlong); + (JNIEnv *, jclass, jlong, jstring); /* * Class: org_ldk_impl_bindings * Method: ChannelManager_force_close_all_channels_without_broadcasting_txn - * Signature: (J)V + * Signature: (JLjava/lang/String;)V */ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1all_1channels_1without_1broadcasting_1txn - (JNIEnv *, jclass, jlong); + (JNIEnv *, jclass, jlong, jstring); /* * Class: org_ldk_impl_bindings @@ -25999,6 +27191,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1preflig JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1funding_1transaction_1generated (JNIEnv *, jclass, jlong, jlong, jbyteArray, jbyteArray); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelManager_unsafe_manual_funding_transaction_generated + * Signature: (JJ[BJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1unsafe_1manual_1funding_1transaction_1generated + (JNIEnv *, jclass, jlong, jlong, jbyteArray, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChannelManager_batch_funding_transaction_generated @@ -26114,10 +27314,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1accept_1inbou /* * Class: org_ldk_impl_bindings * Method: ChannelManager_create_offer_builder - * Signature: (J)J + * Signature: (JJ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1offer_1builder - (JNIEnv *, jclass, jlong); + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings @@ -26303,6 +27503,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1ChannelMe JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1OffersMessageHandler (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelManager_as_AsyncPaymentsMessageHandler + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1AsyncPaymentsMessageHandler + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChannelManager_as_NodeIdLookUp @@ -28185,18 +29393,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1usabl /* * Class: org_ldk_impl_bindings - * Method: ChannelDetails_get_is_public + * Method: ChannelDetails_get_is_announced * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1public +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1announced (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelDetails_set_is_public + * Method: ChannelDetails_set_is_announced * Signature: (JZ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1public +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1announced (JNIEnv *, jclass, jlong, jboolean); /* @@ -29279,6 +30487,158 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommonOpenChannelFields_1hash JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CommonOpenChannelFields_1eq (JNIEnv *, jclass, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CommonOpenChannelFields_channel_parameters + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommonOpenChannelFields_1channel_1parameters + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelParameters_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelParameters_get_dust_limit_satoshis + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1get_1dust_1limit_1satoshis + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelParameters_set_dust_limit_satoshis + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1set_1dust_1limit_1satoshis + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelParameters_get_max_htlc_value_in_flight_msat + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1get_1max_1htlc_1value_1in_1flight_1msat + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelParameters_set_max_htlc_value_in_flight_msat + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1set_1max_1htlc_1value_1in_1flight_1msat + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelParameters_get_htlc_minimum_msat + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1get_1htlc_1minimum_1msat + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelParameters_set_htlc_minimum_msat + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1set_1htlc_1minimum_1msat + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelParameters_get_commitment_feerate_sat_per_1000_weight + * Signature: (J)I + */ +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1get_1commitment_1feerate_1sat_1per_11000_1weight + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelParameters_set_commitment_feerate_sat_per_1000_weight + * Signature: (JI)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1set_1commitment_1feerate_1sat_1per_11000_1weight + (JNIEnv *, jclass, jlong, jint); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelParameters_get_to_self_delay + * Signature: (J)S + */ +JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1get_1to_1self_1delay + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelParameters_set_to_self_delay + * Signature: (JS)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1set_1to_1self_1delay + (JNIEnv *, jclass, jlong, jshort); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelParameters_get_max_accepted_htlcs + * Signature: (J)S + */ +JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1get_1max_1accepted_1htlcs + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelParameters_set_max_accepted_htlcs + * Signature: (JS)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1set_1max_1accepted_1htlcs + (JNIEnv *, jclass, jlong, jshort); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelParameters_new + * Signature: (JJJISS)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1new + (JNIEnv *, jclass, jlong, jlong, jlong, jint, jshort, jshort); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelParameters_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelParameters_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelParameters_hash + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1hash + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelParameters_eq + * Signature: (JJ)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelParameters_1eq + (JNIEnv *, jclass, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: OpenChannel_free @@ -30345,138 +31705,138 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Stfu_1eq /* * Class: org_ldk_impl_bindings - * Method: Splice_free + * Method: SpliceInit_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Splice_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceInit_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Splice_get_channel_id + * Method: SpliceInit_get_channel_id * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Splice_1get_1channel_1id +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpliceInit_1get_1channel_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Splice_set_channel_id + * Method: SpliceInit_set_channel_id * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Splice_1set_1channel_1id +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceInit_1set_1channel_1id (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Splice_get_chain_hash - * Signature: (J)[B - */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Splice_1get_1chain_1hash - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: Splice_set_chain_hash - * Signature: (J[B)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Splice_1set_1chain_1hash - (JNIEnv *, jclass, jlong, jbyteArray); - -/* - * Class: org_ldk_impl_bindings - * Method: Splice_get_relative_satoshis + * Method: SpliceInit_get_funding_contribution_satoshis * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Splice_1get_1relative_1satoshis +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpliceInit_1get_1funding_1contribution_1satoshis (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Splice_set_relative_satoshis + * Method: SpliceInit_set_funding_contribution_satoshis * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Splice_1set_1relative_1satoshis +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceInit_1set_1funding_1contribution_1satoshis (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Splice_get_funding_feerate_perkw + * Method: SpliceInit_get_funding_feerate_perkw * Signature: (J)I */ -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_Splice_1get_1funding_1feerate_1perkw +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_SpliceInit_1get_1funding_1feerate_1perkw (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Splice_set_funding_feerate_perkw + * Method: SpliceInit_set_funding_feerate_perkw * Signature: (JI)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Splice_1set_1funding_1feerate_1perkw +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceInit_1set_1funding_1feerate_1perkw (JNIEnv *, jclass, jlong, jint); /* * Class: org_ldk_impl_bindings - * Method: Splice_get_locktime + * Method: SpliceInit_get_locktime * Signature: (J)I */ -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_Splice_1get_1locktime +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_SpliceInit_1get_1locktime (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Splice_set_locktime + * Method: SpliceInit_set_locktime * Signature: (JI)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Splice_1set_1locktime +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceInit_1set_1locktime (JNIEnv *, jclass, jlong, jint); /* * Class: org_ldk_impl_bindings - * Method: Splice_get_funding_pubkey + * Method: SpliceInit_get_funding_pubkey * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Splice_1get_1funding_1pubkey +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_SpliceInit_1get_1funding_1pubkey (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Splice_set_funding_pubkey + * Method: SpliceInit_set_funding_pubkey * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Splice_1set_1funding_1pubkey +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceInit_1set_1funding_1pubkey (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: Splice_new - * Signature: (J[BJII[B)J + * Method: SpliceInit_get_require_confirmed_inputs + * Signature: (J)Lorg/ldk/enums/COption_NoneZ; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Splice_1new - (JNIEnv *, jclass, jlong, jbyteArray, jlong, jint, jint, jbyteArray); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_SpliceInit_1get_1require_1confirmed_1inputs + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Splice_clone_ptr + * Method: SpliceInit_set_require_confirmed_inputs + * Signature: (JLorg/ldk/enums/COption_NoneZ;)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceInit_1set_1require_1confirmed_1inputs + (JNIEnv *, jclass, jlong, jobject); + +/* + * Class: org_ldk_impl_bindings + * Method: SpliceInit_new + * Signature: (JJII[BLorg/ldk/enums/COption_NoneZ;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpliceInit_1new + (JNIEnv *, jclass, jlong, jlong, jint, jint, jbyteArray, jobject); + +/* + * Class: org_ldk_impl_bindings + * Method: SpliceInit_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Splice_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpliceInit_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Splice_clone + * Method: SpliceInit_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Splice_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpliceInit_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Splice_eq + * Method: SpliceInit_eq * Signature: (JJ)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Splice_1eq +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SpliceInit_1eq (JNIEnv *, jclass, jlong, jlong); /* @@ -30505,34 +31865,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceAck_1set_1channel_1id /* * Class: org_ldk_impl_bindings - * Method: SpliceAck_get_chain_hash - * Signature: (J)[B - */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_SpliceAck_1get_1chain_1hash - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: SpliceAck_set_chain_hash - * Signature: (J[B)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceAck_1set_1chain_1hash - (JNIEnv *, jclass, jlong, jbyteArray); - -/* - * Class: org_ldk_impl_bindings - * Method: SpliceAck_get_relative_satoshis + * Method: SpliceAck_get_funding_contribution_satoshis * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpliceAck_1get_1relative_1satoshis +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpliceAck_1get_1funding_1contribution_1satoshis (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: SpliceAck_set_relative_satoshis + * Method: SpliceAck_set_funding_contribution_satoshis * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceAck_1set_1relative_1satoshis +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceAck_1set_1funding_1contribution_1satoshis (JNIEnv *, jclass, jlong, jlong); /* @@ -30551,13 +31895,29 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_SpliceAck_1get_1funding_ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceAck_1set_1funding_1pubkey (JNIEnv *, jclass, jlong, jbyteArray); +/* + * Class: org_ldk_impl_bindings + * Method: SpliceAck_get_require_confirmed_inputs + * Signature: (J)Lorg/ldk/enums/COption_NoneZ; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_SpliceAck_1get_1require_1confirmed_1inputs + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: SpliceAck_set_require_confirmed_inputs + * Signature: (JLorg/ldk/enums/COption_NoneZ;)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceAck_1set_1require_1confirmed_1inputs + (JNIEnv *, jclass, jlong, jobject); + /* * Class: org_ldk_impl_bindings * Method: SpliceAck_new - * Signature: (J[BJ[B)J + * Signature: (JJ[BLorg/ldk/enums/COption_NoneZ;)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpliceAck_1new - (JNIEnv *, jclass, jlong, jbyteArray, jlong, jbyteArray); + (JNIEnv *, jclass, jlong, jlong, jbyteArray, jobject); /* * Class: org_ldk_impl_bindings @@ -30607,13 +31967,29 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpliceLocked_1get_1channel_1i JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceLocked_1set_1channel_1id (JNIEnv *, jclass, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: SpliceLocked_get_splice_txid + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_SpliceLocked_1get_1splice_1txid + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: SpliceLocked_set_splice_txid + * Signature: (J[B)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpliceLocked_1set_1splice_1txid + (JNIEnv *, jclass, jlong, jbyteArray); + /* * Class: org_ldk_impl_bindings * Method: SpliceLocked_new - * Signature: (J)J + * Signature: (J[B)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpliceLocked_1new - (JNIEnv *, jclass, jlong); + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings @@ -30727,13 +32103,29 @@ JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_TxAddInput_1get_1sequence JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxAddInput_1set_1sequence (JNIEnv *, jclass, jlong, jint); +/* + * Class: org_ldk_impl_bindings + * Method: TxAddInput_get_shared_input_txid + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxAddInput_1get_1shared_1input_1txid + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: TxAddInput_set_shared_input_txid + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxAddInput_1set_1shared_1input_1txid + (JNIEnv *, jclass, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: TxAddInput_new - * Signature: (JJJII)J + * Signature: (JJJIIJ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxAddInput_1new - (JNIEnv *, jclass, jlong, jlong, jlong, jint, jint); + (JNIEnv *, jclass, jlong, jlong, jlong, jint, jint, jlong); /* * Class: org_ldk_impl_bindings @@ -31161,18 +32553,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxSignatures_1set_1witnesses /* * Class: org_ldk_impl_bindings - * Method: TxSignatures_get_funding_outpoint_sig + * Method: TxSignatures_get_shared_input_signature * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxSignatures_1get_1funding_1outpoint_1sig +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxSignatures_1get_1shared_1input_1signature (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: TxSignatures_set_funding_outpoint_sig + * Method: TxSignatures_set_shared_input_signature * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxSignatures_1set_1funding_1outpoint_1sig +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxSignatures_1set_1shared_1input_1signature (JNIEnv *, jclass, jlong, jlong); /* @@ -32271,6 +33663,86 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1hash JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1eq (JNIEnv *, jclass, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CommitmentSignedBatch_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSignedBatch_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CommitmentSignedBatch_get_batch_size + * Signature: (J)S + */ +JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_CommitmentSignedBatch_1get_1batch_1size + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CommitmentSignedBatch_set_batch_size + * Signature: (JS)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSignedBatch_1set_1batch_1size + (JNIEnv *, jclass, jlong, jshort); + +/* + * Class: org_ldk_impl_bindings + * Method: CommitmentSignedBatch_get_funding_txid + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CommitmentSignedBatch_1get_1funding_1txid + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CommitmentSignedBatch_set_funding_txid + * Signature: (J[B)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSignedBatch_1set_1funding_1txid + (JNIEnv *, jclass, jlong, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CommitmentSignedBatch_new + * Signature: (S[B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSignedBatch_1new + (JNIEnv *, jclass, jshort, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CommitmentSignedBatch_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSignedBatch_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CommitmentSignedBatch_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSignedBatch_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CommitmentSignedBatch_hash + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSignedBatch_1hash + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CommitmentSignedBatch_eq + * Signature: (JJ)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CommitmentSignedBatch_1eq + (JNIEnv *, jclass, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: CommitmentSigned_free @@ -32327,13 +33799,29 @@ JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1htlc_1signatures (JNIEnv *, jclass, jlong, jobjectArray); +/* + * Class: org_ldk_impl_bindings + * Method: CommitmentSigned_get_batch + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1batch + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CommitmentSigned_set_batch + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1batch + (JNIEnv *, jclass, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: CommitmentSigned_new - * Signature: (J[B[[B)J + * Signature: (J[B[[BJ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1new - (JNIEnv *, jclass, jlong, jbyteArray, jobjectArray); + (JNIEnv *, jclass, jlong, jbyteArray, jobjectArray, jlong); /* * Class: org_ldk_impl_bindings @@ -33657,18 +35145,34 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1ti /* * Class: org_ldk_impl_bindings - * Method: UnsignedChannelUpdate_get_flags + * Method: UnsignedChannelUpdate_get_message_flags + * Signature: (J)B + */ +JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1message_1flags + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: UnsignedChannelUpdate_set_message_flags + * Signature: (JB)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1message_1flags + (JNIEnv *, jclass, jlong, jbyte); + +/* + * Class: org_ldk_impl_bindings + * Method: UnsignedChannelUpdate_get_channel_flags * Signature: (J)B */ -JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1flags +JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1channel_1flags (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedChannelUpdate_set_flags + * Method: UnsignedChannelUpdate_set_channel_flags * Signature: (JB)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1flags +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1channel_1flags (JNIEnv *, jclass, jlong, jbyte); /* @@ -33770,10 +35274,10 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1ex /* * Class: org_ldk_impl_bindings * Method: UnsignedChannelUpdate_new - * Signature: ([BJIBSJJII[B)J + * Signature: ([BJIBBSJJII[B)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1new - (JNIEnv *, jclass, jbyteArray, jlong, jint, jbyte, jshort, jlong, jlong, jint, jint, jbyteArray); + (JNIEnv *, jclass, jbyteArray, jlong, jint, jbyte, jbyte, jshort, jlong, jlong, jint, jint, jbyteArray); /* * Class: org_ldk_impl_bindings @@ -35017,18 +36521,18 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Stfu_1read /* * Class: org_ldk_impl_bindings - * Method: Splice_write + * Method: SpliceInit_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Splice_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_SpliceInit_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Splice_read + * Method: SpliceInit_read * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Splice_1read +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpliceInit_1read (JNIEnv *, jclass, jbyteArray); /* @@ -35271,6 +36775,22 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1w JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1read (JNIEnv *, jclass, jbyteArray); +/* + * Class: org_ldk_impl_bindings + * Method: CommitmentSignedBatch_write + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CommitmentSignedBatch_1write + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CommitmentSignedBatch_read + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSignedBatch_1read + (JNIEnv *, jclass, jbyteArray); + /* * Class: org_ldk_impl_bindings * Method: CommitmentSigned_write @@ -35815,14 +37335,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1free JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1new (JNIEnv *, jclass); -/* - * Class: org_ldk_impl_bindings - * Method: IgnoringMessageHandler_as_EventsProvider - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1EventsProvider - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: IgnoringMessageHandler_as_MessageSendEventsProvider @@ -35855,6 +37367,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1O JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1OffersMessageHandler (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: IgnoringMessageHandler_as_AsyncPaymentsMessageHandler + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1AsyncPaymentsMessageHandler + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: IgnoringMessageHandler_as_CustomOnionMessageHandler @@ -36863,6 +38383,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1clone JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1eq (JNIEnv *, jclass, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: HTLCOutputInCommitment_to_bitcoin_amount + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1to_1bitcoin_1amount + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: HTLCOutputInCommitment_write @@ -37753,14691 +39281,16427 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_get_1commitment_1transaction_ /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_eq - * Signature: (JJ)Z + * Method: InitFeatures_write + * Signature: (J)[B */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InitFeatures_1write + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_eq - * Signature: (JJ)Z + * Method: InitFeatures_read + * Signature: ([B)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ChannelFeatures_eq - * Signature: (JJ)Z + * Method: ChannelFeatures_write + * Signature: (J)[B */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1write + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt11InvoiceFeatures_eq - * Signature: (JJ)Z + * Method: ChannelFeatures_read + * Signature: ([B)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: OfferFeatures_eq - * Signature: (JJ)Z + * Method: NodeFeatures_write + * Signature: (J)[B */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1write + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestFeatures_eq - * Signature: (JJ)Z + * Method: NodeFeatures_read + * Signature: ([B)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: Bolt12InvoiceFeatures_eq - * Signature: (JJ)Z + * Method: Bolt11InvoiceFeatures_write + * Signature: (J)[B */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1write + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedHopFeatures_eq - * Signature: (JJ)Z + * Method: Bolt11InvoiceFeatures_read + * Signature: ([B)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_eq - * Signature: (JJ)Z + * Method: Bolt12InvoiceFeatures_write + * Signature: (J)[B */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1write + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_clone_ptr - * Signature: (J)J + * Method: Bolt12InvoiceFeatures_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_clone - * Signature: (J)J + * Method: BlindedHopFeatures_write + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_clone_ptr - * Signature: (J)J + * Method: BlindedHopFeatures_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_clone - * Signature: (J)J + * Method: ChannelTypeFeatures_write + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelFeatures_clone_ptr - * Signature: (J)J + * Method: ChannelTypeFeatures_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ChannelFeatures_clone - * Signature: (J)J + * Method: ShutdownScript_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt11InvoiceFeatures_clone_ptr + * Method: ShutdownScript_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt11InvoiceFeatures_clone + * Method: ShutdownScript_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OfferFeatures_clone_ptr - * Signature: (J)J + * Method: ShutdownScript_eq + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: OfferFeatures_clone - * Signature: (J)J + * Method: InvalidShutdownScript_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1clone +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestFeatures_clone_ptr - * Signature: (J)J + * Method: InvalidShutdownScript_get_script + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1clone_1ptr +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1get_1script (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestFeatures_clone - * Signature: (J)J + * Method: InvalidShutdownScript_set_script + * Signature: (J[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1set_1script + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: Bolt12InvoiceFeatures_clone_ptr - * Signature: (J)J + * Method: InvalidShutdownScript_new + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1new + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: Bolt12InvoiceFeatures_clone + * Method: InvalidShutdownScript_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedHopFeatures_clone_ptr + * Method: InvalidShutdownScript_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedHopFeatures_clone - * Signature: (J)J + * Method: ShutdownScript_write + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1clone +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_clone_ptr - * Signature: (J)J + * Method: ShutdownScript_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_clone - * Signature: (J)J + * Method: ShutdownScript_new_p2wpkh + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1p2wpkh + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_hash - * Signature: (J)J + * Method: ShutdownScript_new_p2wsh + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1hash - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1p2wsh + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_hash + * Method: ShutdownScript_new_witness_program * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1hash +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1witness_1program (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelFeatures_hash - * Signature: (J)J + * Method: ShutdownScript_into_inner + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1hash +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1into_1inner (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt11InvoiceFeatures_hash - * Signature: (J)J + * Method: ShutdownScript_as_legacy_pubkey + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1hash +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1as_1legacy_1pubkey (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OfferFeatures_hash - * Signature: (J)J + * Method: ShutdownScript_is_compatible + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1hash - (JNIEnv *, jclass, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1is_1compatible + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestFeatures_hash - * Signature: (J)J + * Method: ShutdownScript_to_str + * Signature: (J)Ljava/lang/String; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1hash +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1to_1str (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12InvoiceFeatures_hash - * Signature: (J)J + * Method: ChannelId_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1hash +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelId_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedHopFeatures_hash - * Signature: (J)J + * Method: ChannelId_get_a + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1hash +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelId_1get_1a (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_hash - * Signature: (J)J + * Method: ChannelId_set_a + * Signature: (J[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1hash - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelId_1set_1a + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_free - * Signature: (J)V + * Method: ChannelId_new + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelId_1new + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_free - * Signature: (J)V + * Method: ChannelId_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelId_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelFeatures_free - * Signature: (J)V + * Method: ChannelId_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelId_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt11InvoiceFeatures_free - * Signature: (J)V + * Method: ChannelId_eq + * Signature: (JJ)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelId_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: OfferFeatures_free - * Signature: (J)V + * Method: ChannelId_hash + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelId_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestFeatures_free - * Signature: (J)V + * Method: ChannelId_v1_from_funding_txid + * Signature: ([BS)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelId_1v1_1from_1funding_1txid + (JNIEnv *, jclass, jbyteArray, jshort); /* * Class: org_ldk_impl_bindings - * Method: Bolt12InvoiceFeatures_free - * Signature: (J)V + * Method: ChannelId_v1_from_funding_outpoint + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelId_1v1_1from_1funding_1outpoint (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedHopFeatures_free - * Signature: (J)V + * Method: ChannelId_temporary_from_entropy_source + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelId_1temporary_1from_1entropy_1source (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_free - * Signature: (J)V + * Method: ChannelId_from_bytes + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelId_1from_1bytes + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_empty + * Method: ChannelId_new_zero * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1empty +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelId_1new_1zero (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_requires_unknown_bits_from - * Signature: (JJ)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1unknown_1bits_1from - (JNIEnv *, jclass, jlong, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: InitFeatures_requires_unknown_bits + * Method: ChannelId_is_zero * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1unknown_1bits +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelId_1is_1zero (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_required_feature_bit + * Method: ChannelId_v2_from_revocation_basepoints * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1required_1feature_1bit +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelId_1v2_1from_1revocation_1basepoints (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_optional_feature_bit - * Signature: (JJ)J + * Method: ChannelId_temporary_v2_from_revocation_basepoint + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1optional_1feature_1bit - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelId_1temporary_1v2_1from_1revocation_1basepoint + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_required_custom_bit - * Signature: (JJ)J + * Method: ChannelId_write + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1required_1custom_1bit - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelId_1write + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_optional_custom_bit - * Signature: (JJ)J + * Method: ChannelId_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1optional_1custom_1bit - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelId_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_empty - * Signature: ()J + * Method: ChannelId_to_str + * Signature: (J)Ljava/lang/String; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1empty - (JNIEnv *, jclass); +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ChannelId_1to_1str + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_requires_unknown_bits_from - * Signature: (JJ)Z + * Method: create_phantom_invoice + * Signature: (JJLjava/lang/String;I[JJJJLorg/ldk/enums/Currency;JJ)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1unknown_1bits_1from - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice + (JNIEnv *, jclass, jlong, jlong, jstring, jint, jlongArray, jlong, jlong, jlong, jobject, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_requires_unknown_bits - * Signature: (J)Z + * Method: create_phantom_invoice_with_description_hash + * Signature: (JJIJ[JJJJLorg/ldk/enums/Currency;JJ)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1unknown_1bits - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice_1with_1description_1hash + (JNIEnv *, jclass, jlong, jlong, jint, jlong, jlongArray, jlong, jlong, jlong, jobject, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_required_feature_bit - * Signature: (JJ)J + * Method: create_invoice_from_channelmanager + * Signature: (JJJLorg/ldk/enums/Currency;JLjava/lang/String;IJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1required_1feature_1bit - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager + (JNIEnv *, jclass, jlong, jlong, jlong, jobject, jlong, jstring, jint, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_optional_feature_bit - * Signature: (JJ)J + * Method: create_invoice_from_channelmanager_with_description_hash + * Signature: (JJJLorg/ldk/enums/Currency;JJIJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1optional_1feature_1bit - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1with_1description_1hash + (JNIEnv *, jclass, jlong, jlong, jlong, jobject, jlong, jlong, jint, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_required_custom_bit - * Signature: (JJ)J + * Method: create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch + * Signature: (JJJLorg/ldk/enums/Currency;JJJIJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1required_1custom_1bit - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1with_1description_1hash_1and_1duration_1since_1epoch + (JNIEnv *, jclass, jlong, jlong, jlong, jobject, jlong, jlong, jlong, jint, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_optional_custom_bit - * Signature: (JJ)J + * Method: create_invoice_from_channelmanager_and_duration_since_epoch + * Signature: (JJJLorg/ldk/enums/Currency;JLjava/lang/String;JIJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1optional_1custom_1bit - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1and_1duration_1since_1epoch + (JNIEnv *, jclass, jlong, jlong, jlong, jobject, jlong, jstring, jlong, jint, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelFeatures_empty - * Signature: ()J + * Method: create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash + * Signature: (JJJLorg/ldk/enums/Currency;JLjava/lang/String;JI[BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1empty - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1and_1duration_1since_1epoch_1with_1payment_1hash + (JNIEnv *, jclass, jlong, jlong, jlong, jobject, jlong, jstring, jlong, jint, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelFeatures_requires_unknown_bits_from - * Signature: (JJ)Z + * Method: payment_parameters_from_zero_amount_invoice + * Signature: (JJ)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1requires_1unknown_1bits_1from +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_payment_1parameters_1from_1zero_1amount_1invoice (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelFeatures_requires_unknown_bits - * Signature: (J)Z + * Method: payment_parameters_from_invoice + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1requires_1unknown_1bits +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_payment_1parameters_1from_1invoice (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelFeatures_set_required_feature_bit - * Signature: (JJ)J + * Method: Retry_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1set_1required_1feature_1bit - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Retry_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelFeatures_set_optional_feature_bit - * Signature: (JJ)J + * Method: Retry_clone_ptr + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1set_1optional_1feature_1bit - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Retry_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelFeatures_set_required_custom_bit - * Signature: (JJ)J + * Method: Retry_clone + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1set_1required_1custom_1bit - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Retry_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelFeatures_set_optional_custom_bit - * Signature: (JJ)J + * Method: Retry_attempts + * Signature: (I)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1set_1optional_1custom_1bit - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Retry_1attempts + (JNIEnv *, jclass, jint); /* * Class: org_ldk_impl_bindings - * Method: Bolt11InvoiceFeatures_empty - * Signature: ()J + * Method: Retry_timeout + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1empty - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Retry_1timeout + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt11InvoiceFeatures_requires_unknown_bits_from + * Method: Retry_eq * Signature: (JJ)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1unknown_1bits_1from +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Retry_1eq (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt11InvoiceFeatures_requires_unknown_bits - * Signature: (J)Z + * Method: Retry_hash + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1unknown_1bits +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Retry_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt11InvoiceFeatures_set_required_feature_bit - * Signature: (JJ)J + * Method: Retry_write + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1required_1feature_1bit - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Retry_1write + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt11InvoiceFeatures_set_optional_feature_bit - * Signature: (JJ)J + * Method: Retry_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1optional_1feature_1bit - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Retry_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: Bolt11InvoiceFeatures_set_required_custom_bit - * Signature: (JJ)J + * Method: RetryableSendFailure_clone + * Signature: (J)Lorg/ldk/enums/RetryableSendFailure; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1required_1custom_1bit - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt11InvoiceFeatures_set_optional_custom_bit - * Signature: (JJ)J + * Method: RetryableSendFailure_payment_expired + * Signature: ()Lorg/ldk/enums/RetryableSendFailure; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1optional_1custom_1bit - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1payment_1expired + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: OfferFeatures_empty - * Signature: ()J + * Method: RetryableSendFailure_route_not_found + * Signature: ()Lorg/ldk/enums/RetryableSendFailure; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1empty +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1route_1not_1found (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: OfferFeatures_requires_unknown_bits_from - * Signature: (JJ)Z + * Method: RetryableSendFailure_duplicate_payment + * Signature: ()Lorg/ldk/enums/RetryableSendFailure; */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1requires_1unknown_1bits_1from - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1duplicate_1payment + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: OfferFeatures_requires_unknown_bits - * Signature: (J)Z + * Method: RetryableSendFailure_onion_packet_size_exceeded + * Signature: ()Lorg/ldk/enums/RetryableSendFailure; */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1requires_1unknown_1bits - (JNIEnv *, jclass, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1onion_1packet_1size_1exceeded + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: OfferFeatures_set_required_feature_bit - * Signature: (JJ)J + * Method: RetryableSendFailure_eq + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1set_1required_1feature_1bit +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1eq (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: OfferFeatures_set_optional_feature_bit - * Signature: (JJ)J + * Method: PaymentSendFailure_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1set_1optional_1feature_1bit - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OfferFeatures_set_required_custom_bit - * Signature: (JJ)J + * Method: PaymentSendFailure_clone_ptr + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1set_1required_1custom_1bit - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OfferFeatures_set_optional_custom_bit - * Signature: (JJ)J + * Method: PaymentSendFailure_clone + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1set_1optional_1custom_1bit - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestFeatures_empty - * Signature: ()J + * Method: PaymentSendFailure_parameter_error + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1empty - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1parameter_1error + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestFeatures_requires_unknown_bits_from - * Signature: (JJ)Z + * Method: PaymentSendFailure_path_parameter_error + * Signature: ([J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1requires_1unknown_1bits_1from - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1path_1parameter_1error + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestFeatures_requires_unknown_bits - * Signature: (J)Z + * Method: PaymentSendFailure_all_failed_resend_safe + * Signature: ([J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1requires_1unknown_1bits - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1all_1failed_1resend_1safe + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestFeatures_set_required_feature_bit - * Signature: (JJ)J + * Method: PaymentSendFailure_duplicate_payment + * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1set_1required_1feature_1bit - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1duplicate_1payment + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestFeatures_set_optional_feature_bit - * Signature: (JJ)J + * Method: PaymentSendFailure_partial_failure + * Signature: ([JJ[B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1set_1optional_1feature_1bit - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1partial_1failure + (JNIEnv *, jclass, jlongArray, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestFeatures_set_required_custom_bit - * Signature: (JJ)J + * Method: PaymentSendFailure_eq + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1set_1required_1custom_1bit +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1eq (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestFeatures_set_optional_custom_bit - * Signature: (JJ)J + * Method: Bolt12PaymentError_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1set_1optional_1custom_1bit - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12PaymentError_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12InvoiceFeatures_empty - * Signature: ()J + * Method: Bolt12PaymentError_clone_ptr + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1empty - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12PaymentError_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12InvoiceFeatures_requires_unknown_bits_from - * Signature: (JJ)Z + * Method: Bolt12PaymentError_clone + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1requires_1unknown_1bits_1from - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12PaymentError_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12InvoiceFeatures_requires_unknown_bits - * Signature: (J)Z + * Method: Bolt12PaymentError_unexpected_invoice + * Signature: ()J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1requires_1unknown_1bits - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12PaymentError_1unexpected_1invoice + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: Bolt12InvoiceFeatures_set_required_feature_bit - * Signature: (JJ)J + * Method: Bolt12PaymentError_duplicate_invoice + * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1required_1feature_1bit - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12PaymentError_1duplicate_1invoice + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: Bolt12InvoiceFeatures_set_optional_feature_bit - * Signature: (JJ)J + * Method: Bolt12PaymentError_unknown_required_features + * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1optional_1feature_1bit - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12PaymentError_1unknown_1required_1features + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: Bolt12InvoiceFeatures_set_required_custom_bit - * Signature: (JJ)J + * Method: Bolt12PaymentError_sending_failed + * Signature: (Lorg/ldk/enums/RetryableSendFailure;)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1required_1custom_1bit - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12PaymentError_1sending_1failed + (JNIEnv *, jclass, jobject); /* * Class: org_ldk_impl_bindings - * Method: Bolt12InvoiceFeatures_set_optional_custom_bit - * Signature: (JJ)J + * Method: Bolt12PaymentError_eq + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1optional_1custom_1bit +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12PaymentError_1eq (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedHopFeatures_empty - * Signature: ()J + * Method: ProbeSendFailure_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1empty - (JNIEnv *, jclass); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedHopFeatures_requires_unknown_bits_from - * Signature: (JJ)Z + * Method: ProbeSendFailure_clone_ptr + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1requires_1unknown_1bits_1from - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedHopFeatures_requires_unknown_bits - * Signature: (J)Z + * Method: ProbeSendFailure_clone + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1requires_1unknown_1bits +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedHopFeatures_set_required_feature_bit - * Signature: (JJ)J + * Method: ProbeSendFailure_route_not_found + * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1set_1required_1feature_1bit - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1route_1not_1found + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: BlindedHopFeatures_set_optional_feature_bit - * Signature: (JJ)J + * Method: ProbeSendFailure_sending_failed + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1set_1optional_1feature_1bit - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1sending_1failed + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedHopFeatures_set_required_custom_bit - * Signature: (JJ)J + * Method: ProbeSendFailure_eq + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1set_1required_1custom_1bit +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1eq (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedHopFeatures_set_optional_custom_bit - * Signature: (JJ)J + * Method: RecipientOnionFields_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1set_1optional_1custom_1bit - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_empty - * Signature: ()J + * Method: RecipientOnionFields_get_payment_secret + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1empty - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1get_1payment_1secret + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_requires_unknown_bits_from - * Signature: (JJ)Z + * Method: RecipientOnionFields_set_payment_secret + * Signature: (JJ)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1unknown_1bits_1from +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1set_1payment_1secret (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_requires_unknown_bits - * Signature: (J)Z + * Method: RecipientOnionFields_get_payment_metadata + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1unknown_1bits +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1get_1payment_1metadata (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_set_required_feature_bit - * Signature: (JJ)J + * Method: RecipientOnionFields_set_payment_metadata + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1required_1feature_1bit +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1set_1payment_1metadata (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_set_optional_feature_bit - * Signature: (JJ)J + * Method: RecipientOnionFields_clone_ptr + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1optional_1feature_1bit - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_set_required_custom_bit - * Signature: (JJ)J + * Method: RecipientOnionFields_clone + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1required_1custom_1bit - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_set_optional_custom_bit - * Signature: (JJ)J + * Method: RecipientOnionFields_eq + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1optional_1custom_1bit +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1eq (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_write + * Method: RecipientOnionFields_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InitFeatures_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_read + * Method: RecipientOnionFields_read * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1read +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1read (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ChannelFeatures_write - * Signature: (J)[B - */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1write - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: ChannelFeatures_read + * Method: RecipientOnionFields_secret_only * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1read +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1secret_1only (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_write - * Signature: (J)[B + * Method: RecipientOnionFields_spontaneous_empty + * Signature: ()J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1write - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1spontaneous_1empty + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_read - * Signature: ([B)J + * Method: RecipientOnionFields_with_custom_tlvs + * Signature: (J[J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1with_1custom_1tlvs + (JNIEnv *, jclass, jlong, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: Bolt11InvoiceFeatures_write - * Signature: (J)[B + * Method: RecipientOnionFields_custom_tlvs + * Signature: (J)[J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1write +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1custom_1tlvs (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt11InvoiceFeatures_read - * Signature: ([B)J + * Method: CustomMessageReader_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomMessageReader_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12InvoiceFeatures_write - * Signature: (J)[B + * Method: Type_clone_ptr + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1write +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Type_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12InvoiceFeatures_read - * Signature: ([B)J + * Method: Type_clone + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Type_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedHopFeatures_write - * Signature: (J)[B + * Method: Type_free + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1write +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Type_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedHopFeatures_read - * Signature: ([B)J + * Method: OfferId_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferId_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_write + * Method: OfferId_get_a * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OfferId_1get_1a (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_read - * Signature: ([B)J + * Method: OfferId_set_a + * Signature: (J[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferId_1set_1a + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_data_loss_protect_optional - * Signature: (J)V + * Method: OfferId_new + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1data_1loss_1protect_1optional - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferId_1new + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_data_loss_protect_required - * Signature: (J)V + * Method: OfferId_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1data_1loss_1protect_1required +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferId_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_supports_data_loss_protect - * Signature: (J)Z + * Method: OfferId_clone + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1data_1loss_1protect +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferId_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_data_loss_protect_optional - * Signature: (J)V + * Method: OfferId_eq + * Signature: (JJ)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1data_1loss_1protect_1optional - (JNIEnv *, jclass, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferId_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_data_loss_protect_required - * Signature: (J)V + * Method: OfferId_write + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1data_1loss_1protect_1required +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OfferId_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_supports_data_loss_protect - * Signature: (J)Z + * Method: OfferId_read + * Signature: ([B)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1data_1loss_1protect - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferId_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_requires_data_loss_protect - * Signature: (J)Z + * Method: OfferWithExplicitMetadataBuilder_free + * Signature: (J)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1data_1loss_1protect +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_requires_data_loss_protect - * Signature: (J)Z + * Method: OfferWithExplicitMetadataBuilder_clone_ptr + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1data_1loss_1protect +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_initial_routing_sync_optional - * Signature: (J)V + * Method: OfferWithExplicitMetadataBuilder_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1initial_1routing_1sync_1optional +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_initial_routing_sync_required + * Method: OfferWithDerivedMetadataBuilder_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1initial_1routing_1sync_1required +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_initial_routing_sync - * Signature: (J)Z + * Method: OfferWithDerivedMetadataBuilder_clone_ptr + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1initial_1routing_1sync +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_upfront_shutdown_script_optional - * Signature: (J)V + * Method: OfferWithDerivedMetadataBuilder_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1upfront_1shutdown_1script_1optional +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_upfront_shutdown_script_required - * Signature: (J)V + * Method: OfferWithExplicitMetadataBuilder_new + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1upfront_1shutdown_1script_1required - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1new + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_supports_upfront_shutdown_script - * Signature: (J)Z + * Method: OfferWithExplicitMetadataBuilder_metadata + * Signature: (J[B)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1upfront_1shutdown_1script - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1metadata + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_upfront_shutdown_script_optional - * Signature: (J)V + * Method: OfferWithExplicitMetadataBuilder_chain + * Signature: (JLorg/ldk/enums/Network;)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1upfront_1shutdown_1script_1optional - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1chain + (JNIEnv *, jclass, jlong, jobject); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_upfront_shutdown_script_required - * Signature: (J)V + * Method: OfferWithExplicitMetadataBuilder_amount_msats + * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1upfront_1shutdown_1script_1required - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1amount_1msats + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_supports_upfront_shutdown_script - * Signature: (J)Z + * Method: OfferWithExplicitMetadataBuilder_absolute_expiry + * Signature: (JJ)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1upfront_1shutdown_1script - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1absolute_1expiry + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_requires_upfront_shutdown_script - * Signature: (J)Z + * Method: OfferWithExplicitMetadataBuilder_description + * Signature: (JLjava/lang/String;)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1upfront_1shutdown_1script - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1description + (JNIEnv *, jclass, jlong, jstring); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_requires_upfront_shutdown_script - * Signature: (J)Z + * Method: OfferWithExplicitMetadataBuilder_issuer + * Signature: (JLjava/lang/String;)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1upfront_1shutdown_1script - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1issuer + (JNIEnv *, jclass, jlong, jstring); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_gossip_queries_optional - * Signature: (J)V + * Method: OfferWithExplicitMetadataBuilder_path + * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1gossip_1queries_1optional - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1path + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_gossip_queries_required - * Signature: (J)V + * Method: OfferWithExplicitMetadataBuilder_supported_quantity + * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1gossip_1queries_1required - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1supported_1quantity + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_supports_gossip_queries - * Signature: (J)Z + * Method: OfferWithExplicitMetadataBuilder_build + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1gossip_1queries +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1build (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_gossip_queries_optional - * Signature: (J)V + * Method: OfferWithDerivedMetadataBuilder_deriving_signing_pubkey + * Signature: ([BJJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1gossip_1queries_1optional - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1deriving_1signing_1pubkey + (JNIEnv *, jclass, jbyteArray, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_gossip_queries_required - * Signature: (J)V + * Method: OfferWithDerivedMetadataBuilder_chain + * Signature: (JLorg/ldk/enums/Network;)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1gossip_1queries_1required - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1chain + (JNIEnv *, jclass, jlong, jobject); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_supports_gossip_queries - * Signature: (J)Z + * Method: OfferWithDerivedMetadataBuilder_amount_msats + * Signature: (JJ)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1gossip_1queries - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1amount_1msats + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_requires_gossip_queries - * Signature: (J)Z + * Method: OfferWithDerivedMetadataBuilder_absolute_expiry + * Signature: (JJ)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1gossip_1queries - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1absolute_1expiry + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_requires_gossip_queries - * Signature: (J)Z + * Method: OfferWithDerivedMetadataBuilder_description + * Signature: (JLjava/lang/String;)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1gossip_1queries - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1description + (JNIEnv *, jclass, jlong, jstring); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_variable_length_onion_optional - * Signature: (J)V + * Method: OfferWithDerivedMetadataBuilder_issuer + * Signature: (JLjava/lang/String;)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1variable_1length_1onion_1optional - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1issuer + (JNIEnv *, jclass, jlong, jstring); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_variable_length_onion_required - * Signature: (J)V + * Method: OfferWithDerivedMetadataBuilder_path + * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1variable_1length_1onion_1required - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1path + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_supports_variable_length_onion - * Signature: (J)Z + * Method: OfferWithDerivedMetadataBuilder_supported_quantity + * Signature: (JJ)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1variable_1length_1onion +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1supported_1quantity + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: OfferWithDerivedMetadataBuilder_build + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1build (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_variable_length_onion_optional + * Method: Offer_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1variable_1length_1onion_1optional +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Offer_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_variable_length_onion_required - * Signature: (J)V + * Method: Offer_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1variable_1length_1onion_1required +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Offer_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_supports_variable_length_onion - * Signature: (J)Z + * Method: Offer_clone + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1variable_1length_1onion +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Offer_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt11InvoiceFeatures_set_variable_length_onion_optional - * Signature: (J)V + * Method: Offer_chains + * Signature: (J)[[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1variable_1length_1onion_1optional +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_Offer_1chains (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt11InvoiceFeatures_set_variable_length_onion_required - * Signature: (J)V + * Method: Offer_metadata + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1variable_1length_1onion_1required +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Offer_1metadata (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt11InvoiceFeatures_supports_variable_length_onion - * Signature: (J)Z + * Method: Offer_amount + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1supports_1variable_1length_1onion +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Offer_1amount (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_requires_variable_length_onion - * Signature: (J)Z + * Method: Offer_description + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1variable_1length_1onion +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Offer_1description (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_requires_variable_length_onion - * Signature: (J)Z + * Method: Offer_offer_features + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1variable_1length_1onion +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Offer_1offer_1features (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt11InvoiceFeatures_requires_variable_length_onion - * Signature: (J)Z + * Method: Offer_absolute_expiry + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1variable_1length_1onion +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Offer_1absolute_1expiry (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_static_remote_key_optional - * Signature: (J)V + * Method: Offer_issuer + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1static_1remote_1key_1optional +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Offer_1issuer (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_static_remote_key_required - * Signature: (J)V + * Method: Offer_paths + * Signature: (J)[J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1static_1remote_1key_1required +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_Offer_1paths (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_supports_static_remote_key - * Signature: (J)Z + * Method: Offer_supported_quantity + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1static_1remote_1key +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Offer_1supported_1quantity (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_static_remote_key_optional - * Signature: (J)V + * Method: Offer_signing_pubkey + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1static_1remote_1key_1optional +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Offer_1signing_1pubkey (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_static_remote_key_required - * Signature: (J)V + * Method: Offer_id + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1static_1remote_1key_1required +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Offer_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_supports_static_remote_key + * Method: Offer_supports_chain + * Signature: (J[B)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1supports_1chain + (JNIEnv *, jclass, jlong, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: Offer_is_expired * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1static_1remote_1key +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1is_1expired (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_set_static_remote_key_optional - * Signature: (J)V + * Method: Offer_is_expired_no_std + * Signature: (JJ)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1static_1remote_1key_1optional - (JNIEnv *, jclass, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1is_1expired_1no_1std + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_set_static_remote_key_required - * Signature: (J)V + * Method: Offer_is_valid_quantity + * Signature: (JJ)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1static_1remote_1key_1required - (JNIEnv *, jclass, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1is_1valid_1quantity + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_supports_static_remote_key + * Method: Offer_expects_quantity * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1static_1remote_1key +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1expects_1quantity (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_requires_static_remote_key - * Signature: (J)Z + * Method: Offer_request_invoice_deriving_payer_id + * Signature: (JJJ[B)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1static_1remote_1key - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Offer_1request_1invoice_1deriving_1payer_1id + (JNIEnv *, jclass, jlong, jlong, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_requires_static_remote_key - * Signature: (J)Z + * Method: Offer_request_invoice_deriving_metadata + * Signature: (J[BJJ[B)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1static_1remote_1key - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Offer_1request_1invoice_1deriving_1metadata + (JNIEnv *, jclass, jlong, jbyteArray, jlong, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_requires_static_remote_key - * Signature: (J)Z + * Method: Offer_request_invoice + * Signature: (J[B[B)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1static_1remote_1key - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Offer_1request_1invoice + (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_payment_secret_optional - * Signature: (J)V + * Method: Offer_hash + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1payment_1secret_1optional +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Offer_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_payment_secret_required - * Signature: (J)V + * Method: Offer_read + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1payment_1secret_1required - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Offer_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_supports_payment_secret - * Signature: (J)Z + * Method: Offer_write + * Signature: (J)[B */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1payment_1secret +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Offer_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_payment_secret_optional + * Method: Amount_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1payment_1secret_1optional +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Amount_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_payment_secret_required - * Signature: (J)V + * Method: Amount_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1payment_1secret_1required +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Amount_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_supports_payment_secret - * Signature: (J)Z + * Method: Amount_clone + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1payment_1secret +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Amount_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt11InvoiceFeatures_set_payment_secret_optional - * Signature: (J)V + * Method: Amount_bitcoin + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1payment_1secret_1optional +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Amount_1bitcoin (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt11InvoiceFeatures_set_payment_secret_required + * Method: Amount_currency + * Signature: ([BJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Amount_1currency + (JNIEnv *, jclass, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Quantity_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1payment_1secret_1required +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Quantity_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt11InvoiceFeatures_supports_payment_secret - * Signature: (J)Z + * Method: Quantity_clone_ptr + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1supports_1payment_1secret +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Quantity_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_requires_payment_secret - * Signature: (J)Z + * Method: Quantity_clone + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1payment_1secret +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Quantity_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_requires_payment_secret - * Signature: (J)Z + * Method: Quantity_bounded + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1payment_1secret +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Quantity_1bounded (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt11InvoiceFeatures_requires_payment_secret - * Signature: (J)Z + * Method: Quantity_unbounded + * Signature: ()J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1payment_1secret - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Quantity_1unbounded + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_basic_mpp_optional - * Signature: (J)V + * Method: Quantity_one + * Signature: ()J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1basic_1mpp_1optional - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Quantity_1one + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_basic_mpp_required - * Signature: (J)V + * Method: Offer_from_str + * Signature: (Ljava/lang/String;)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1basic_1mpp_1required - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Offer_1from_1str + (JNIEnv *, jclass, jstring); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_supports_basic_mpp - * Signature: (J)Z + * Method: Offer_to_str + * Signature: (J)Ljava/lang/String; */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1basic_1mpp +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Offer_1to_1str (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_basic_mpp_optional + * Method: InvoiceWithExplicitSigningPubkeyBuilder_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1basic_1mpp_1optional +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_basic_mpp_required + * Method: InvoiceWithDerivedSigningPubkeyBuilder_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1basic_1mpp_1required +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_supports_basic_mpp - * Signature: (J)Z + * Method: InvoiceWithExplicitSigningPubkeyBuilder_build + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1basic_1mpp +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1build (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt11InvoiceFeatures_set_basic_mpp_optional - * Signature: (J)V + * Method: InvoiceWithExplicitSigningPubkeyBuilder_relative_expiry + * Signature: (JI)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1basic_1mpp_1optional - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1relative_1expiry + (JNIEnv *, jclass, jlong, jint); /* * Class: org_ldk_impl_bindings - * Method: Bolt11InvoiceFeatures_set_basic_mpp_required - * Signature: (J)V + * Method: InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wsh + * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1basic_1mpp_1required - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1fallback_1v0_1p2wsh + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: Bolt11InvoiceFeatures_supports_basic_mpp - * Signature: (J)Z + * Method: InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wpkh + * Signature: (J[B)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1supports_1basic_1mpp - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1fallback_1v0_1p2wpkh + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: Bolt12InvoiceFeatures_set_basic_mpp_optional - * Signature: (J)V + * Method: InvoiceWithExplicitSigningPubkeyBuilder_fallback_v1_p2tr_tweaked + * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1basic_1mpp_1optional - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1fallback_1v1_1p2tr_1tweaked + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: Bolt12InvoiceFeatures_set_basic_mpp_required + * Method: InvoiceWithExplicitSigningPubkeyBuilder_allow_mpp * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1basic_1mpp_1required +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1allow_1mpp (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12InvoiceFeatures_supports_basic_mpp - * Signature: (J)Z + * Method: InvoiceWithDerivedSigningPubkeyBuilder_build_and_sign + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1supports_1basic_1mpp +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1build_1and_1sign (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_requires_basic_mpp - * Signature: (J)Z + * Method: InvoiceWithDerivedSigningPubkeyBuilder_relative_expiry + * Signature: (JI)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1basic_1mpp - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1relative_1expiry + (JNIEnv *, jclass, jlong, jint); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_requires_basic_mpp - * Signature: (J)Z + * Method: InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wsh + * Signature: (J[B)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1basic_1mpp - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1fallback_1v0_1p2wsh + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: Bolt11InvoiceFeatures_requires_basic_mpp - * Signature: (J)Z + * Method: InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wpkh + * Signature: (J[B)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1basic_1mpp - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1fallback_1v0_1p2wpkh + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: Bolt12InvoiceFeatures_requires_basic_mpp - * Signature: (J)Z + * Method: InvoiceWithDerivedSigningPubkeyBuilder_fallback_v1_p2tr_tweaked + * Signature: (J[B)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1requires_1basic_1mpp - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1fallback_1v1_1p2tr_1tweaked + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_wumbo_optional + * Method: InvoiceWithDerivedSigningPubkeyBuilder_allow_mpp * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1wumbo_1optional +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1allow_1mpp (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_wumbo_required + * Method: UnsignedBolt12Invoice_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1wumbo_1required +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_supports_wumbo - * Signature: (J)Z + * Method: UnsignedBolt12Invoice_clone_ptr + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1wumbo +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_wumbo_optional - * Signature: (J)V + * Method: UnsignedBolt12Invoice_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1wumbo_1optional +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_wumbo_required + * Method: SignBolt12InvoiceFn_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1wumbo_1required +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignBolt12InvoiceFn_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_supports_wumbo - * Signature: (J)Z + * Method: UnsignedBolt12Invoice_tagged_hash + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1wumbo +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1tagged_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_requires_wumbo - * Signature: (J)Z + * Method: Bolt12Invoice_free + * Signature: (J)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1wumbo +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_requires_wumbo - * Signature: (J)Z + * Method: Bolt12Invoice_clone_ptr + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1wumbo +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional - * Signature: (J)V + * Method: Bolt12Invoice_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1anchors_1nonzero_1fee_1htlc_1tx_1optional +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_anchors_nonzero_fee_htlc_tx_required - * Signature: (J)V + * Method: UnsignedBolt12Invoice_created_at + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1anchors_1nonzero_1fee_1htlc_1tx_1required +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1created_1at (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_supports_anchors_nonzero_fee_htlc_tx - * Signature: (J)Z + * Method: UnsignedBolt12Invoice_relative_expiry + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1anchors_1nonzero_1fee_1htlc_1tx +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1relative_1expiry (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional - * Signature: (J)V + * Method: UnsignedBolt12Invoice_is_expired + * Signature: (J)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1anchors_1nonzero_1fee_1htlc_1tx_1optional +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1is_1expired (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required - * Signature: (J)V + * Method: UnsignedBolt12Invoice_fallbacks + * Signature: (J)[Ljava/lang/String; */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1anchors_1nonzero_1fee_1htlc_1tx_1required +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1fallbacks (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_supports_anchors_nonzero_fee_htlc_tx - * Signature: (J)Z + * Method: UnsignedBolt12Invoice_invoice_features + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1anchors_1nonzero_1fee_1htlc_1tx +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1invoice_1features (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional - * Signature: (J)V + * Method: UnsignedBolt12Invoice_signing_pubkey + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1anchors_1nonzero_1fee_1htlc_1tx_1optional +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1signing_1pubkey (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required - * Signature: (J)V + * Method: UnsignedBolt12Invoice_offer_chains + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1anchors_1nonzero_1fee_1htlc_1tx_1required +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1offer_1chains (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx - * Signature: (J)Z + * Method: UnsignedBolt12Invoice_chain + * Signature: (J)[B */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1anchors_1nonzero_1fee_1htlc_1tx +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1chain (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_requires_anchors_nonzero_fee_htlc_tx - * Signature: (J)Z + * Method: UnsignedBolt12Invoice_metadata + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1anchors_1nonzero_1fee_1htlc_1tx +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1metadata (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_requires_anchors_nonzero_fee_htlc_tx - * Signature: (J)Z + * Method: UnsignedBolt12Invoice_amount + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1anchors_1nonzero_1fee_1htlc_1tx +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1amount (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx - * Signature: (J)Z + * Method: UnsignedBolt12Invoice_offer_features + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1anchors_1nonzero_1fee_1htlc_1tx +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1offer_1features (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_anchors_zero_fee_htlc_tx_optional - * Signature: (J)V + * Method: UnsignedBolt12Invoice_description + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1optional +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1description (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_anchors_zero_fee_htlc_tx_required - * Signature: (J)V + * Method: UnsignedBolt12Invoice_absolute_expiry + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1required +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1absolute_1expiry (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_supports_anchors_zero_fee_htlc_tx - * Signature: (J)Z + * Method: UnsignedBolt12Invoice_issuer + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1anchors_1zero_1fee_1htlc_1tx +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1issuer (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_anchors_zero_fee_htlc_tx_optional - * Signature: (J)V + * Method: UnsignedBolt12Invoice_message_paths + * Signature: (J)[J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1optional +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1message_1paths (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_anchors_zero_fee_htlc_tx_required - * Signature: (J)V + * Method: UnsignedBolt12Invoice_supported_quantity + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1required +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1supported_1quantity (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_supports_anchors_zero_fee_htlc_tx - * Signature: (J)Z + * Method: UnsignedBolt12Invoice_payer_metadata + * Signature: (J)[B */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1anchors_1zero_1fee_1htlc_1tx +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1payer_1metadata (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional - * Signature: (J)V + * Method: UnsignedBolt12Invoice_invoice_request_features + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1optional +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1invoice_1request_1features (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required - * Signature: (J)V + * Method: UnsignedBolt12Invoice_quantity + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1required +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1quantity (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx - * Signature: (J)Z + * Method: UnsignedBolt12Invoice_payer_id + * Signature: (J)[B */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1anchors_1zero_1fee_1htlc_1tx +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1payer_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_requires_anchors_zero_fee_htlc_tx - * Signature: (J)Z + * Method: UnsignedBolt12Invoice_payer_note + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1anchors_1zero_1fee_1htlc_1tx +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1payer_1note (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_requires_anchors_zero_fee_htlc_tx - * Signature: (J)Z + * Method: UnsignedBolt12Invoice_payment_hash + * Signature: (J)[B */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1anchors_1zero_1fee_1htlc_1tx +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1payment_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx - * Signature: (J)Z + * Method: UnsignedBolt12Invoice_amount_msats + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1anchors_1zero_1fee_1htlc_1tx +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1amount_1msats (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_route_blinding_optional - * Signature: (J)V + * Method: Bolt12Invoice_created_at + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1route_1blinding_1optional +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1created_1at (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_route_blinding_required - * Signature: (J)V + * Method: Bolt12Invoice_relative_expiry + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1route_1blinding_1required +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1relative_1expiry (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_supports_route_blinding + * Method: Bolt12Invoice_is_expired * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1route_1blinding +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1is_1expired (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_route_blinding_optional - * Signature: (J)V + * Method: Bolt12Invoice_fallbacks + * Signature: (J)[Ljava/lang/String; */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1route_1blinding_1optional +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1fallbacks (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_route_blinding_required - * Signature: (J)V + * Method: Bolt12Invoice_invoice_features + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1route_1blinding_1required +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1invoice_1features (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_supports_route_blinding - * Signature: (J)Z + * Method: Bolt12Invoice_signing_pubkey + * Signature: (J)[B */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1route_1blinding +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1signing_1pubkey (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_requires_route_blinding - * Signature: (J)Z + * Method: Bolt12Invoice_offer_chains + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1route_1blinding +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1offer_1chains (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_requires_route_blinding - * Signature: (J)Z + * Method: Bolt12Invoice_chain + * Signature: (J)[B */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1route_1blinding +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1chain (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_shutdown_any_segwit_optional - * Signature: (J)V + * Method: Bolt12Invoice_metadata + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1shutdown_1any_1segwit_1optional +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1metadata (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_shutdown_any_segwit_required - * Signature: (J)V + * Method: Bolt12Invoice_amount + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1shutdown_1any_1segwit_1required +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1amount (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_supports_shutdown_anysegwit - * Signature: (J)Z + * Method: Bolt12Invoice_offer_features + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1shutdown_1anysegwit +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1offer_1features (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_shutdown_any_segwit_optional - * Signature: (J)V + * Method: Bolt12Invoice_description + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1shutdown_1any_1segwit_1optional +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1description (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_shutdown_any_segwit_required - * Signature: (J)V + * Method: Bolt12Invoice_absolute_expiry + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1shutdown_1any_1segwit_1required +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1absolute_1expiry (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_supports_shutdown_anysegwit - * Signature: (J)Z + * Method: Bolt12Invoice_issuer + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1shutdown_1anysegwit +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1issuer (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_requires_shutdown_anysegwit - * Signature: (J)Z + * Method: Bolt12Invoice_message_paths + * Signature: (J)[J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1shutdown_1anysegwit +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1message_1paths (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_requires_shutdown_anysegwit - * Signature: (J)Z + * Method: Bolt12Invoice_supported_quantity + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1shutdown_1anysegwit +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1supported_1quantity (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_taproot_optional - * Signature: (J)V + * Method: Bolt12Invoice_payer_metadata + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1taproot_1optional +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1payer_1metadata (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_taproot_required - * Signature: (J)V + * Method: Bolt12Invoice_invoice_request_features + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1taproot_1required +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1invoice_1request_1features (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_supports_taproot - * Signature: (J)Z + * Method: Bolt12Invoice_quantity + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1taproot +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1quantity (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_taproot_optional - * Signature: (J)V + * Method: Bolt12Invoice_payer_id + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1taproot_1optional +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1payer_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_taproot_required - * Signature: (J)V + * Method: Bolt12Invoice_payer_note + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1taproot_1required +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1payer_1note (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_supports_taproot - * Signature: (J)Z + * Method: Bolt12Invoice_payment_hash + * Signature: (J)[B */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1taproot +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1payment_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_set_taproot_optional - * Signature: (J)V + * Method: Bolt12Invoice_amount_msats + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1taproot_1optional +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1amount_1msats (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_set_taproot_required - * Signature: (J)V + * Method: Bolt12Invoice_signature + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1taproot_1required +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1signature (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_supports_taproot - * Signature: (J)Z + * Method: Bolt12Invoice_signable_hash + * Signature: (J)[B */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1taproot +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1signable_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_requires_taproot - * Signature: (J)Z + * Method: Bolt12Invoice_verify_using_metadata + * Signature: (JJ)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1taproot - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1verify_1using_1metadata + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_requires_taproot - * Signature: (J)Z + * Method: Bolt12Invoice_verify_using_payer_data + * Signature: (J[BJJ)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1taproot - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1verify_1using_1payer_1data + (JNIEnv *, jclass, jlong, jbyteArray, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_requires_taproot - * Signature: (J)Z + * Method: Bolt12Invoice_hash + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1taproot +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_onion_messages_optional - * Signature: (J)V + * Method: UnsignedBolt12Invoice_write + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1onion_1messages_1optional +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_onion_messages_required - * Signature: (J)V + * Method: Bolt12Invoice_write + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1onion_1messages_1required +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_supports_onion_messages - * Signature: (J)Z + * Method: Bolt12Invoice_read + * Signature: ([B)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1onion_1messages - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_onion_messages_optional + * Method: InvoiceError_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1onion_1messages_1optional +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceError_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_onion_messages_required - * Signature: (J)V + * Method: InvoiceError_get_erroneous_field + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1onion_1messages_1required +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceError_1get_1erroneous_1field (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_supports_onion_messages - * Signature: (J)Z + * Method: InvoiceError_set_erroneous_field + * Signature: (JJ)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1onion_1messages - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceError_1set_1erroneous_1field + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_requires_onion_messages - * Signature: (J)Z + * Method: InvoiceError_get_message + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1onion_1messages +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceError_1get_1message (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_requires_onion_messages - * Signature: (J)Z + * Method: InvoiceError_set_message + * Signature: (JJ)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1onion_1messages - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceError_1set_1message + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_channel_type_optional - * Signature: (J)V + * Method: InvoiceError_new + * Signature: (JJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1channel_1type_1optional - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceError_1new + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_channel_type_required - * Signature: (J)V + * Method: InvoiceError_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1channel_1type_1required +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceError_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_supports_channel_type - * Signature: (J)Z + * Method: InvoiceError_clone + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1channel_1type +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceError_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_channel_type_optional + * Method: ErroneousField_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1channel_1type_1optional +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErroneousField_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_channel_type_required - * Signature: (J)V + * Method: ErroneousField_get_tlv_fieldnum + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1channel_1type_1required +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErroneousField_1get_1tlv_1fieldnum (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_supports_channel_type - * Signature: (J)Z + * Method: ErroneousField_set_tlv_fieldnum + * Signature: (JJ)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1channel_1type - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErroneousField_1set_1tlv_1fieldnum + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_requires_channel_type - * Signature: (J)Z + * Method: ErroneousField_get_suggested_value + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1channel_1type +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErroneousField_1get_1suggested_1value (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_requires_channel_type - * Signature: (J)Z + * Method: ErroneousField_set_suggested_value + * Signature: (JJ)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1channel_1type - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErroneousField_1set_1suggested_1value + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_scid_privacy_optional - * Signature: (J)V + * Method: ErroneousField_new + * Signature: (JJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1scid_1privacy_1optional - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErroneousField_1new + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_scid_privacy_required - * Signature: (J)V + * Method: ErroneousField_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1scid_1privacy_1required +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErroneousField_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_supports_scid_privacy - * Signature: (J)Z + * Method: ErroneousField_clone + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1scid_1privacy +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErroneousField_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_scid_privacy_optional - * Signature: (J)V + * Method: InvoiceError_from_string + * Signature: (Ljava/lang/String;)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1scid_1privacy_1optional - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceError_1from_1string + (JNIEnv *, jclass, jstring); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_scid_privacy_required - * Signature: (J)V + * Method: InvoiceError_to_str + * Signature: (J)Ljava/lang/String; */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1scid_1privacy_1required +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_InvoiceError_1to_1str (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_supports_scid_privacy - * Signature: (J)Z + * Method: InvoiceError_write + * Signature: (J)[B */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1scid_1privacy +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InvoiceError_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_set_scid_privacy_optional - * Signature: (J)V + * Method: InvoiceError_read + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1scid_1privacy_1optional - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceError_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_set_scid_privacy_required + * Method: InvoiceRequestWithExplicitPayerIdBuilder_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1scid_1privacy_1required +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_supports_scid_privacy - * Signature: (J)Z + * Method: InvoiceRequestWithDerivedPayerIdBuilder_free + * Signature: (J)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1scid_1privacy +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_requires_scid_privacy - * Signature: (J)Z + * Method: InvoiceRequestWithExplicitPayerIdBuilder_build + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1scid_1privacy +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1build (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_requires_scid_privacy - * Signature: (J)Z + * Method: InvoiceRequestWithExplicitPayerIdBuilder_chain + * Signature: (JLorg/ldk/enums/Network;)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1scid_1privacy - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1chain + (JNIEnv *, jclass, jlong, jobject); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_requires_scid_privacy - * Signature: (J)Z + * Method: InvoiceRequestWithExplicitPayerIdBuilder_amount_msats + * Signature: (JJ)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1scid_1privacy - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1amount_1msats + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt11InvoiceFeatures_set_payment_metadata_optional - * Signature: (J)V + * Method: InvoiceRequestWithExplicitPayerIdBuilder_quantity + * Signature: (JJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1payment_1metadata_1optional - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1quantity + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt11InvoiceFeatures_set_payment_metadata_required - * Signature: (J)V + * Method: InvoiceRequestWithExplicitPayerIdBuilder_payer_note + * Signature: (JLjava/lang/String;)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1payment_1metadata_1required - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1payer_1note + (JNIEnv *, jclass, jlong, jstring); /* * Class: org_ldk_impl_bindings - * Method: Bolt11InvoiceFeatures_supports_payment_metadata - * Signature: (J)Z + * Method: InvoiceRequestWithDerivedPayerIdBuilder_build_and_sign + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1supports_1payment_1metadata +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1build_1and_1sign (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt11InvoiceFeatures_requires_payment_metadata - * Signature: (J)Z + * Method: InvoiceRequestWithDerivedPayerIdBuilder_chain + * Signature: (JLorg/ldk/enums/Network;)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1payment_1metadata - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1chain + (JNIEnv *, jclass, jlong, jobject); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_zero_conf_optional - * Signature: (J)V + * Method: InvoiceRequestWithDerivedPayerIdBuilder_amount_msats + * Signature: (JJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1zero_1conf_1optional - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1amount_1msats + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_zero_conf_required - * Signature: (J)V + * Method: InvoiceRequestWithDerivedPayerIdBuilder_quantity + * Signature: (JJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1zero_1conf_1required - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1quantity + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_supports_zero_conf - * Signature: (J)Z + * Method: InvoiceRequestWithDerivedPayerIdBuilder_payer_note + * Signature: (JLjava/lang/String;)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1zero_1conf - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1payer_1note + (JNIEnv *, jclass, jlong, jstring); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_zero_conf_optional + * Method: UnsignedInvoiceRequest_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1zero_1conf_1optional +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_zero_conf_required - * Signature: (J)V + * Method: UnsignedInvoiceRequest_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1zero_1conf_1required +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_supports_zero_conf - * Signature: (J)Z + * Method: UnsignedInvoiceRequest_clone + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1zero_1conf +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_set_zero_conf_optional + * Method: SignInvoiceRequestFn_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1zero_1conf_1optional +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignInvoiceRequestFn_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_set_zero_conf_required - * Signature: (J)V + * Method: UnsignedInvoiceRequest_tagged_hash + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1zero_1conf_1required +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1tagged_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_supports_zero_conf - * Signature: (J)Z + * Method: InvoiceRequest_free + * Signature: (J)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1zero_1conf +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_requires_zero_conf - * Signature: (J)Z + * Method: InvoiceRequest_clone_ptr + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1zero_1conf +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_requires_zero_conf - * Signature: (J)Z + * Method: InvoiceRequest_clone + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1zero_1conf +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_requires_zero_conf - * Signature: (J)Z + * Method: VerifiedInvoiceRequest_free + * Signature: (J)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1zero_1conf +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_keysend_optional - * Signature: (J)V + * Method: VerifiedInvoiceRequest_get_offer_id + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1keysend_1optional +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1get_1offer_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_keysend_required - * Signature: (J)V + * Method: VerifiedInvoiceRequest_set_offer_id + * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1keysend_1required - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1set_1offer_1id + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_supports_keysend - * Signature: (J)Z + * Method: VerifiedInvoiceRequest_clone_ptr + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1keysend +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_requires_keysend - * Signature: (J)Z + * Method: VerifiedInvoiceRequest_clone + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1keysend +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_trampoline_routing_optional - * Signature: (J)V + * Method: UnsignedInvoiceRequest_chains + * Signature: (J)[[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1trampoline_1routing_1optional +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1chains (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_set_trampoline_routing_required - * Signature: (J)V + * Method: UnsignedInvoiceRequest_metadata + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1trampoline_1routing_1required +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1metadata (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_supports_trampoline_routing - * Signature: (J)Z + * Method: UnsignedInvoiceRequest_amount + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1trampoline_1routing +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1amount (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_trampoline_routing_optional - * Signature: (J)V + * Method: UnsignedInvoiceRequest_description + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1trampoline_1routing_1optional +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1description (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_set_trampoline_routing_required - * Signature: (J)V + * Method: UnsignedInvoiceRequest_offer_features + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1trampoline_1routing_1required +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1offer_1features (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_supports_trampoline_routing - * Signature: (J)Z + * Method: UnsignedInvoiceRequest_absolute_expiry + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1trampoline_1routing +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1absolute_1expiry (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt11InvoiceFeatures_set_trampoline_routing_optional - * Signature: (J)V + * Method: UnsignedInvoiceRequest_issuer + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1trampoline_1routing_1optional +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1issuer (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt11InvoiceFeatures_set_trampoline_routing_required - * Signature: (J)V + * Method: UnsignedInvoiceRequest_paths + * Signature: (J)[J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1trampoline_1routing_1required +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1paths (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt11InvoiceFeatures_supports_trampoline_routing - * Signature: (J)Z + * Method: UnsignedInvoiceRequest_supported_quantity + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1supports_1trampoline_1routing +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1supported_1quantity (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_requires_trampoline_routing - * Signature: (J)Z + * Method: UnsignedInvoiceRequest_signing_pubkey + * Signature: (J)[B */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1trampoline_1routing +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1signing_1pubkey (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_requires_trampoline_routing - * Signature: (J)Z + * Method: UnsignedInvoiceRequest_payer_metadata + * Signature: (J)[B */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1trampoline_1routing +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1payer_1metadata (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt11InvoiceFeatures_requires_trampoline_routing - * Signature: (J)Z + * Method: UnsignedInvoiceRequest_chain + * Signature: (J)[B */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1trampoline_1routing +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1chain (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ShutdownScript_free - * Signature: (J)V + * Method: UnsignedInvoiceRequest_amount_msats + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1amount_1msats (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ShutdownScript_clone_ptr + * Method: UnsignedInvoiceRequest_invoice_request_features * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1invoice_1request_1features (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ShutdownScript_clone + * Method: UnsignedInvoiceRequest_quantity * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1quantity (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ShutdownScript_eq - * Signature: (JJ)Z + * Method: UnsignedInvoiceRequest_payer_id + * Signature: (J)[B */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1payer_1id + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvalidShutdownScript_free - * Signature: (J)V + * Method: UnsignedInvoiceRequest_payer_note + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1payer_1note (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvalidShutdownScript_get_script - * Signature: (J)[B + * Method: InvoiceRequest_chains + * Signature: (J)[[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1get_1script +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1chains (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvalidShutdownScript_set_script - * Signature: (J[B)V + * Method: InvoiceRequest_metadata + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1set_1script - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1metadata + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvalidShutdownScript_new - * Signature: ([B)J + * Method: InvoiceRequest_amount + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1new - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1amount + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvalidShutdownScript_clone_ptr + * Method: InvoiceRequest_description * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1description (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvalidShutdownScript_clone + * Method: InvoiceRequest_offer_features * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1offer_1features (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ShutdownScript_write - * Signature: (J)[B + * Method: InvoiceRequest_absolute_expiry + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1write +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1absolute_1expiry (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ShutdownScript_read - * Signature: ([B)J + * Method: InvoiceRequest_issuer + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1issuer + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ShutdownScript_new_p2wpkh - * Signature: ([B)J + * Method: InvoiceRequest_paths + * Signature: (J)[J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1p2wpkh - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1paths + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ShutdownScript_new_p2wsh - * Signature: ([B)J + * Method: InvoiceRequest_supported_quantity + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1p2wsh - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1supported_1quantity + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ShutdownScript_new_witness_program - * Signature: (J)J + * Method: InvoiceRequest_signing_pubkey + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1witness_1program +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1signing_1pubkey (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ShutdownScript_into_inner + * Method: InvoiceRequest_payer_metadata * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1into_1inner +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1payer_1metadata (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ShutdownScript_as_legacy_pubkey + * Method: InvoiceRequest_chain * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1as_1legacy_1pubkey +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1chain (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ShutdownScript_is_compatible - * Signature: (JJ)Z + * Method: InvoiceRequest_amount_msats + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1is_1compatible - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1amount_1msats + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ShutdownScript_to_str - * Signature: (J)Ljava/lang/String; + * Method: InvoiceRequest_invoice_request_features + * Signature: (J)J */ -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1to_1str +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1invoice_1request_1features (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelId_free - * Signature: (J)V + * Method: InvoiceRequest_quantity + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelId_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1quantity (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelId_get_a + * Method: InvoiceRequest_payer_id * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelId_1get_1a +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1payer_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelId_set_a - * Signature: (J[B)V + * Method: InvoiceRequest_payer_note + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelId_1set_1a - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1payer_1note + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelId_new - * Signature: ([B)J + * Method: InvoiceRequest_respond_with + * Signature: (J[J[B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelId_1new - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1respond_1with + (JNIEnv *, jclass, jlong, jlongArray, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ChannelId_clone_ptr - * Signature: (J)J + * Method: InvoiceRequest_respond_with_no_std + * Signature: (J[J[BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelId_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1respond_1with_1no_1std + (JNIEnv *, jclass, jlong, jlongArray, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelId_clone - * Signature: (J)J + * Method: InvoiceRequest_verify_using_metadata + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelId_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1verify_1using_1metadata + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelId_eq - * Signature: (JJ)Z + * Method: InvoiceRequest_verify_using_recipient_data + * Signature: (JJJ)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelId_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1verify_1using_1recipient_1data + (JNIEnv *, jclass, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelId_hash - * Signature: (J)J + * Method: InvoiceRequest_signature + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelId_1hash +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1signature (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelId_v1_from_funding_txid - * Signature: ([BS)J + * Method: VerifiedInvoiceRequest_chains + * Signature: (J)[[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelId_1v1_1from_1funding_1txid - (JNIEnv *, jclass, jbyteArray, jshort); +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1chains + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelId_v1_from_funding_outpoint + * Method: VerifiedInvoiceRequest_metadata * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelId_1v1_1from_1funding_1outpoint +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1metadata (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelId_temporary_from_entropy_source + * Method: VerifiedInvoiceRequest_amount * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelId_1temporary_1from_1entropy_1source +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1amount (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelId_from_bytes - * Signature: ([B)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelId_1from_1bytes - (JNIEnv *, jclass, jbyteArray); - -/* - * Class: org_ldk_impl_bindings - * Method: ChannelId_new_zero - * Signature: ()J + * Method: VerifiedInvoiceRequest_description + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelId_1new_1zero - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1description + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelId_is_zero - * Signature: (J)Z + * Method: VerifiedInvoiceRequest_offer_features + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelId_1is_1zero +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1offer_1features (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelId_v2_from_revocation_basepoints - * Signature: (JJ)J + * Method: VerifiedInvoiceRequest_absolute_expiry + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelId_1v2_1from_1revocation_1basepoints - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1absolute_1expiry + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelId_temporary_v2_from_revocation_basepoint + * Method: VerifiedInvoiceRequest_issuer * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelId_1temporary_1v2_1from_1revocation_1basepoint +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1issuer (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelId_write - * Signature: (J)[B + * Method: VerifiedInvoiceRequest_paths + * Signature: (J)[J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelId_1write +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1paths (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelId_read - * Signature: ([B)J + * Method: VerifiedInvoiceRequest_supported_quantity + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelId_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1supported_1quantity + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelId_to_str - * Signature: (J)Ljava/lang/String; + * Method: VerifiedInvoiceRequest_signing_pubkey + * Signature: (J)[B */ -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ChannelId_1to_1str +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1signing_1pubkey (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Retry_free - * Signature: (J)V + * Method: VerifiedInvoiceRequest_payer_metadata + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Retry_1free +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1payer_1metadata (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Retry_clone_ptr - * Signature: (J)J + * Method: VerifiedInvoiceRequest_chain + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Retry_1clone_1ptr +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1chain (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Retry_clone + * Method: VerifiedInvoiceRequest_amount_msats * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Retry_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1amount_1msats (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Retry_attempts - * Signature: (I)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Retry_1attempts - (JNIEnv *, jclass, jint); - -/* - * Class: org_ldk_impl_bindings - * Method: Retry_timeout + * Method: VerifiedInvoiceRequest_invoice_request_features * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Retry_1timeout +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1invoice_1request_1features (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Retry_eq - * Signature: (JJ)Z + * Method: VerifiedInvoiceRequest_quantity + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Retry_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1quantity + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Retry_hash - * Signature: (J)J + * Method: VerifiedInvoiceRequest_payer_id + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Retry_1hash +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1payer_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Retry_write - * Signature: (J)[B + * Method: VerifiedInvoiceRequest_payer_note + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Retry_1write +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1payer_1note (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Retry_read - * Signature: ([B)J + * Method: VerifiedInvoiceRequest_respond_with + * Signature: (J[J[B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Retry_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1respond_1with + (JNIEnv *, jclass, jlong, jlongArray, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: RetryableSendFailure_clone - * Signature: (J)Lorg/ldk/enums/RetryableSendFailure; + * Method: VerifiedInvoiceRequest_respond_with_no_std + * Signature: (J[J[BJ)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1respond_1with_1no_1std + (JNIEnv *, jclass, jlong, jlongArray, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: RetryableSendFailure_payment_expired - * Signature: ()Lorg/ldk/enums/RetryableSendFailure; + * Method: VerifiedInvoiceRequest_respond_using_derived_keys + * Signature: (J[J[B)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1payment_1expired - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1respond_1using_1derived_1keys + (JNIEnv *, jclass, jlong, jlongArray, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: RetryableSendFailure_route_not_found - * Signature: ()Lorg/ldk/enums/RetryableSendFailure; + * Method: VerifiedInvoiceRequest_respond_using_derived_keys_no_std + * Signature: (J[J[BJ)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1route_1not_1found - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1respond_1using_1derived_1keys_1no_1std + (JNIEnv *, jclass, jlong, jlongArray, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: RetryableSendFailure_duplicate_payment - * Signature: ()Lorg/ldk/enums/RetryableSendFailure; + * Method: UnsignedInvoiceRequest_write + * Signature: (J)[B */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1duplicate_1payment - (JNIEnv *, jclass); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1write + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RetryableSendFailure_eq - * Signature: (JJ)Z + * Method: InvoiceRequest_write + * Signature: (J)[B */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1write + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentSendFailure_free + * Method: InvoiceRequestFields_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentSendFailure_clone_ptr - * Signature: (J)J + * Method: InvoiceRequestFields_get_payer_id + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone_1ptr +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1get_1payer_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentSendFailure_clone - * Signature: (J)J + * Method: InvoiceRequestFields_set_payer_id + * Signature: (J[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1set_1payer_1id + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: PaymentSendFailure_parameter_error + * Method: InvoiceRequestFields_get_quantity * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1parameter_1error +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1get_1quantity (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentSendFailure_path_parameter_error - * Signature: ([J)J + * Method: InvoiceRequestFields_set_quantity + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1path_1parameter_1error - (JNIEnv *, jclass, jlongArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1set_1quantity + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentSendFailure_all_failed_resend_safe - * Signature: ([J)J + * Method: InvoiceRequestFields_get_payer_note_truncated + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1all_1failed_1resend_1safe - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1get_1payer_1note_1truncated + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentSendFailure_duplicate_payment - * Signature: ()J + * Method: InvoiceRequestFields_set_payer_note_truncated + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1duplicate_1payment - (JNIEnv *, jclass); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1set_1payer_1note_1truncated + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentSendFailure_partial_failure - * Signature: ([JJ[B)J + * Method: InvoiceRequestFields_new + * Signature: ([BJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1partial_1failure - (JNIEnv *, jclass, jlongArray, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1new + (JNIEnv *, jclass, jbyteArray, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentSendFailure_eq + * Method: InvoiceRequestFields_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InvoiceRequestFields_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InvoiceRequestFields_eq * Signature: (JJ)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1eq +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1eq (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbeSendFailure_free + * Method: InvoiceRequestFields_write + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1write + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InvoiceRequestFields_read + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1read + (JNIEnv *, jclass, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: TaggedHash_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TaggedHash_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbeSendFailure_clone_ptr + * Method: TaggedHash_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TaggedHash_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbeSendFailure_clone + * Method: TaggedHash_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TaggedHash_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbeSendFailure_route_not_found - * Signature: ()J + * Method: TaggedHash_as_digest + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1route_1not_1found - (JNIEnv *, jclass); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TaggedHash_1as_1digest + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbeSendFailure_sending_failed - * Signature: (J)J + * Method: TaggedHash_tag + * Signature: (J)Ljava/lang/String; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1sending_1failed +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_TaggedHash_1tag (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbeSendFailure_eq - * Signature: (JJ)Z + * Method: TaggedHash_merkle_root + * Signature: (J)[B */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TaggedHash_1merkle_1root + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RecipientOnionFields_free + * Method: SignError_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignError_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RecipientOnionFields_get_payment_secret + * Method: SignError_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1get_1payment_1secret +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SignError_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RecipientOnionFields_set_payment_secret - * Signature: (JJ)V + * Method: SignError_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1set_1payment_1secret - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SignError_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RecipientOnionFields_get_payment_metadata - * Signature: (J)J + * Method: SignError_signing + * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1get_1payment_1metadata - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SignError_1signing + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: RecipientOnionFields_set_payment_metadata - * Signature: (JJ)V + * Method: SignError_verification + * Signature: (Lorg/ldk/enums/Secp256k1Error;)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1set_1payment_1metadata - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SignError_1verification + (JNIEnv *, jclass, jobject); /* * Class: org_ldk_impl_bindings - * Method: RecipientOnionFields_clone_ptr + * Method: Nonce_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Nonce_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Nonce_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Nonce_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RecipientOnionFields_clone + * Method: Nonce_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Nonce_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RecipientOnionFields_eq + * Method: Nonce_eq * Signature: (JJ)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1eq +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Nonce_1eq (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: RecipientOnionFields_write + * Method: Nonce_from_entropy_source + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Nonce_1from_1entropy_1source + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Nonce_as_slice * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Nonce_1as_1slice (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RecipientOnionFields_read - * Signature: ([B)J + * Method: Nonce_write + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Nonce_1write + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RecipientOnionFields_secret_only + * Method: Nonce_read * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1secret_1only +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Nonce_1read (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: RecipientOnionFields_spontaneous_empty - * Signature: ()J + * Method: Bolt12ParseError_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1spontaneous_1empty - (JNIEnv *, jclass); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12ParseError_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RecipientOnionFields_with_custom_tlvs - * Signature: (J[J)J + * Method: Bolt12ParseError_clone_ptr + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1with_1custom_1tlvs - (JNIEnv *, jclass, jlong, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12ParseError_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RecipientOnionFields_custom_tlvs - * Signature: (J)[J + * Method: Bolt12ParseError_clone + * Signature: (J)J */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1custom_1tlvs +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12ParseError_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CustomMessageReader_free - * Signature: (J)V + * Method: Bolt12SemanticError_clone + * Signature: (J)Lorg/ldk/enums/Bolt12SemanticError; */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomMessageReader_1free +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Type_clone_ptr - * Signature: (J)J + * Method: Bolt12SemanticError_already_expired + * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Type_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1already_1expired + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: Type_clone - * Signature: (J)J + * Method: Bolt12SemanticError_unsupported_chain + * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Type_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unsupported_1chain + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: Type_free - * Signature: (J)V + * Method: Bolt12SemanticError_unexpected_chain + * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Type_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1chain + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: OfferId_free - * Signature: (J)V + * Method: Bolt12SemanticError_missing_amount + * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferId_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1amount + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: OfferId_get_a - * Signature: (J)[B + * Method: Bolt12SemanticError_invalid_amount + * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OfferId_1get_1a - (JNIEnv *, jclass, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1invalid_1amount + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: OfferId_set_a - * Signature: (J[B)V + * Method: Bolt12SemanticError_insufficient_amount + * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferId_1set_1a - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1insufficient_1amount + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: OfferId_new - * Signature: ([B)J + * Method: Bolt12SemanticError_unexpected_amount + * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferId_1new - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1amount + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: OfferId_clone_ptr - * Signature: (J)J + * Method: Bolt12SemanticError_unsupported_currency + * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferId_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unsupported_1currency + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: OfferId_clone - * Signature: (J)J + * Method: Bolt12SemanticError_unknown_required_features + * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferId_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unknown_1required_1features + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: OfferId_eq - * Signature: (JJ)Z + * Method: Bolt12SemanticError_unexpected_features + * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferId_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1features + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: OfferId_write - * Signature: (J)[B + * Method: Bolt12SemanticError_missing_description + * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OfferId_1write - (JNIEnv *, jclass, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1description + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: OfferId_read - * Signature: ([B)J + * Method: Bolt12SemanticError_missing_signing_pubkey + * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferId_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1signing_1pubkey + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: OfferWithExplicitMetadataBuilder_free - * Signature: (J)V + * Method: Bolt12SemanticError_invalid_signing_pubkey + * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1invalid_1signing_1pubkey + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: OfferWithExplicitMetadataBuilder_clone_ptr - * Signature: (J)J + * Method: Bolt12SemanticError_unexpected_signing_pubkey + * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1signing_1pubkey + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: OfferWithExplicitMetadataBuilder_clone - * Signature: (J)J + * Method: Bolt12SemanticError_missing_quantity + * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1quantity + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: OfferWithDerivedMetadataBuilder_free - * Signature: (J)V + * Method: Bolt12SemanticError_invalid_quantity + * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1invalid_1quantity + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: OfferWithDerivedMetadataBuilder_clone_ptr - * Signature: (J)J + * Method: Bolt12SemanticError_unexpected_quantity + * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1quantity + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: OfferWithDerivedMetadataBuilder_clone - * Signature: (J)J + * Method: Bolt12SemanticError_invalid_metadata + * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1invalid_1metadata + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: OfferWithExplicitMetadataBuilder_new - * Signature: ([B)J + * Method: Bolt12SemanticError_unexpected_metadata + * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1new - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1metadata + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: OfferWithExplicitMetadataBuilder_metadata - * Signature: (J[B)J + * Method: Bolt12SemanticError_missing_payer_metadata + * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1metadata - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1payer_1metadata + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: OfferWithExplicitMetadataBuilder_chain - * Signature: (JLorg/ldk/enums/Network;)V + * Method: Bolt12SemanticError_missing_payer_id + * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1chain - (JNIEnv *, jclass, jlong, jobject); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1payer_1id + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: OfferWithExplicitMetadataBuilder_amount_msats - * Signature: (JJ)V + * Method: Bolt12SemanticError_duplicate_payment_id + * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1amount_1msats - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1duplicate_1payment_1id + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: OfferWithExplicitMetadataBuilder_absolute_expiry - * Signature: (JJ)V + * Method: Bolt12SemanticError_missing_paths + * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1absolute_1expiry - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1paths + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: OfferWithExplicitMetadataBuilder_description - * Signature: (JLjava/lang/String;)V + * Method: Bolt12SemanticError_unexpected_paths + * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1description - (JNIEnv *, jclass, jlong, jstring); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1paths + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: OfferWithExplicitMetadataBuilder_issuer - * Signature: (JLjava/lang/String;)V + * Method: Bolt12SemanticError_invalid_pay_info + * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1issuer - (JNIEnv *, jclass, jlong, jstring); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1invalid_1pay_1info + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: OfferWithExplicitMetadataBuilder_path - * Signature: (JJ)V + * Method: Bolt12SemanticError_missing_creation_time + * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1path - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1creation_1time + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: OfferWithExplicitMetadataBuilder_supported_quantity - * Signature: (JJ)V + * Method: Bolt12SemanticError_missing_payment_hash + * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1supported_1quantity - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1payment_1hash + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: OfferWithExplicitMetadataBuilder_build - * Signature: (J)J + * Method: Bolt12SemanticError_unexpected_payment_hash + * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferWithExplicitMetadataBuilder_1build - (JNIEnv *, jclass, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1payment_1hash + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: OfferWithDerivedMetadataBuilder_deriving_signing_pubkey - * Signature: ([BJJ)J + * Method: Bolt12SemanticError_missing_signature + * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1deriving_1signing_1pubkey - (JNIEnv *, jclass, jbyteArray, jlong, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1signature + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: OfferWithDerivedMetadataBuilder_chain - * Signature: (JLorg/ldk/enums/Network;)V + * Method: RefundMaybeWithDerivedMetadataBuilder_free + * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1chain - (JNIEnv *, jclass, jlong, jobject); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OfferWithDerivedMetadataBuilder_amount_msats - * Signature: (JJ)V + * Method: RefundMaybeWithDerivedMetadataBuilder_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1amount_1msats - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OfferWithDerivedMetadataBuilder_absolute_expiry - * Signature: (JJ)V + * Method: RefundMaybeWithDerivedMetadataBuilder_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1absolute_1expiry - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OfferWithDerivedMetadataBuilder_description - * Signature: (JLjava/lang/String;)V + * Method: RefundMaybeWithDerivedMetadataBuilder_new + * Signature: ([B[BJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1description - (JNIEnv *, jclass, jlong, jstring); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1new + (JNIEnv *, jclass, jbyteArray, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: OfferWithDerivedMetadataBuilder_issuer + * Method: RefundMaybeWithDerivedMetadataBuilder_deriving_payer_id + * Signature: ([BJJJ[B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1deriving_1payer_1id + (JNIEnv *, jclass, jbyteArray, jlong, jlong, jlong, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: RefundMaybeWithDerivedMetadataBuilder_description * Signature: (JLjava/lang/String;)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1issuer +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1description (JNIEnv *, jclass, jlong, jstring); /* * Class: org_ldk_impl_bindings - * Method: OfferWithDerivedMetadataBuilder_path + * Method: RefundMaybeWithDerivedMetadataBuilder_absolute_expiry * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1path +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1absolute_1expiry (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: OfferWithDerivedMetadataBuilder_supported_quantity + * Method: RefundMaybeWithDerivedMetadataBuilder_issuer + * Signature: (JLjava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1issuer + (JNIEnv *, jclass, jlong, jstring); + +/* + * Class: org_ldk_impl_bindings + * Method: RefundMaybeWithDerivedMetadataBuilder_path * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1supported_1quantity +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1path (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: OfferWithDerivedMetadataBuilder_build - * Signature: (J)J + * Method: RefundMaybeWithDerivedMetadataBuilder_chain + * Signature: (JLorg/ldk/enums/Network;)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferWithDerivedMetadataBuilder_1build - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1chain + (JNIEnv *, jclass, jlong, jobject); /* * Class: org_ldk_impl_bindings - * Method: Offer_free - * Signature: (J)V + * Method: RefundMaybeWithDerivedMetadataBuilder_quantity + * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Offer_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1quantity + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Offer_clone_ptr - * Signature: (J)J + * Method: RefundMaybeWithDerivedMetadataBuilder_payer_note + * Signature: (JLjava/lang/String;)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Offer_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1payer_1note + (JNIEnv *, jclass, jlong, jstring); /* * Class: org_ldk_impl_bindings - * Method: Offer_clone + * Method: RefundMaybeWithDerivedMetadataBuilder_build * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Offer_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1build (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Offer_chains - * Signature: (J)[[B + * Method: Refund_free + * Signature: (J)V */ -JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_Offer_1chains +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Refund_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Offer_metadata + * Method: Refund_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Offer_1metadata +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Refund_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Offer_amount + * Method: Refund_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Offer_1amount +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Refund_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Offer_description + * Method: Refund_description * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Offer_1description +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Refund_1description (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Offer_offer_features + * Method: Refund_absolute_expiry * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Offer_1offer_1features +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Refund_1absolute_1expiry (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Offer_absolute_expiry - * Signature: (J)J + * Method: Refund_is_expired + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Offer_1absolute_1expiry +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Refund_1is_1expired (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Offer_issuer + * Method: Refund_is_expired_no_std + * Signature: (JJ)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Refund_1is_1expired_1no_1std + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Refund_issuer * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Offer_1issuer +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Refund_1issuer (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Offer_paths + * Method: Refund_paths * Signature: (J)[J */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_Offer_1paths +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_Refund_1paths (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Offer_supported_quantity - * Signature: (J)J + * Method: Refund_payer_metadata + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Offer_1supported_1quantity +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Refund_1payer_1metadata (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Offer_signing_pubkey + * Method: Refund_chain * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Offer_1signing_1pubkey +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Refund_1chain (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Offer_id + * Method: Refund_amount_msats * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Offer_1id +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Refund_1amount_1msats (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Offer_supports_chain - * Signature: (J[B)Z + * Method: Refund_features + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1supports_1chain - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Refund_1features + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Offer_is_expired - * Signature: (J)Z + * Method: Refund_quantity + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1is_1expired +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Refund_1quantity (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Offer_is_expired_no_std - * Signature: (JJ)Z + * Method: Refund_payer_id + * Signature: (J)[B */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1is_1expired_1no_1std - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Refund_1payer_1id + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Offer_is_valid_quantity - * Signature: (JJ)Z + * Method: Refund_payer_note + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1is_1valid_1quantity - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Refund_1payer_1note + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Offer_expects_quantity - * Signature: (J)Z + * Method: Refund_hash + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1expects_1quantity +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Refund_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Offer_request_invoice_deriving_payer_id - * Signature: (JJJ[B)J + * Method: Refund_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Offer_1request_1invoice_1deriving_1payer_1id - (JNIEnv *, jclass, jlong, jlong, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Refund_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: Offer_request_invoice_deriving_metadata - * Signature: (J[BJJ[B)J + * Method: Refund_write + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Offer_1request_1invoice_1deriving_1metadata - (JNIEnv *, jclass, jlong, jbyteArray, jlong, jlong, jbyteArray); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Refund_1write + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Offer_request_invoice - * Signature: (J[B[B)J + * Method: Refund_from_str + * Signature: (Ljava/lang/String;)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Offer_1request_1invoice - (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Refund_1from_1str + (JNIEnv *, jclass, jstring); /* * Class: org_ldk_impl_bindings - * Method: Offer_hash - * Signature: (J)J + * Method: Refund_to_str + * Signature: (J)Ljava/lang/String; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Offer_1hash +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Refund_1to_1str (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Offer_write - * Signature: (J)[B + * Method: UtxoLookupError_clone + * Signature: (J)Lorg/ldk/enums/UtxoLookupError; */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Offer_1write +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_UtxoLookupError_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Amount_free + * Method: UtxoLookupError_unknown_chain + * Signature: ()Lorg/ldk/enums/UtxoLookupError; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_UtxoLookupError_1unknown_1chain + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: UtxoLookupError_unknown_tx + * Signature: ()Lorg/ldk/enums/UtxoLookupError; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_UtxoLookupError_1unknown_1tx + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: UtxoResult_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Amount_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoResult_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Amount_clone_ptr + * Method: UtxoResult_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Amount_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UtxoResult_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Amount_clone + * Method: UtxoResult_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Amount_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UtxoResult_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Amount_bitcoin + * Method: UtxoResult_sync * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Amount_1bitcoin +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UtxoResult_1sync (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Amount_currency - * Signature: ([BJ)J + * Method: UtxoResult_async + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Amount_1currency - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UtxoResult_1async + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Quantity_free + * Method: UtxoLookup_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Quantity_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoLookup_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Quantity_clone_ptr - * Signature: (J)J + * Method: UtxoFuture_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Quantity_1clone_1ptr +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Quantity_clone + * Method: UtxoFuture_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Quantity_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Quantity_bounded + * Method: UtxoFuture_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Quantity_1bounded +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Quantity_unbounded - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Quantity_1unbounded - (JNIEnv *, jclass); - -/* - * Class: org_ldk_impl_bindings - * Method: Quantity_one + * Method: UtxoFuture_new * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Quantity_1one +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1new (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: Offer_from_str - * Signature: (Ljava/lang/String;)J + * Method: UtxoFuture_resolve_without_forwarding + * Signature: (JJJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Offer_1from_1str - (JNIEnv *, jclass, jstring); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1resolve_1without_1forwarding + (JNIEnv *, jclass, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Offer_to_str - * Signature: (J)Ljava/lang/String; + * Method: UtxoFuture_resolve + * Signature: (JJJJ)V */ -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Offer_1to_1str - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1resolve + (JNIEnv *, jclass, jlong, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceWithExplicitSigningPubkeyBuilder_free + * Method: NodeId_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeId_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceWithDerivedSigningPubkeyBuilder_free - * Signature: (J)V + * Method: NodeId_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeId_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceWithExplicitSigningPubkeyBuilder_build + * Method: NodeId_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1build +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeId_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceWithExplicitSigningPubkeyBuilder_relative_expiry - * Signature: (JI)V + * Method: NodeId_eq + * Signature: (JJ)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1relative_1expiry - (JNIEnv *, jclass, jlong, jint); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeId_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wsh - * Signature: (J[B)V + * Method: NodeId_from_pubkey + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1fallback_1v0_1p2wsh - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeId_1from_1pubkey + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wpkh - * Signature: (J[B)V + * Method: NodeId_from_slice + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1fallback_1v0_1p2wpkh - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeId_1from_1slice + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: InvoiceWithExplicitSigningPubkeyBuilder_fallback_v1_p2tr_tweaked - * Signature: (J[B)V + * Method: NodeId_as_slice + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1fallback_1v1_1p2tr_1tweaked - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeId_1as_1slice + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceWithExplicitSigningPubkeyBuilder_allow_mpp - * Signature: (J)V + * Method: NodeId_as_array + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithExplicitSigningPubkeyBuilder_1allow_1mpp +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeId_1as_1array (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceWithDerivedSigningPubkeyBuilder_build_and_sign + * Method: NodeId_as_pubkey * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1build_1and_1sign +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeId_1as_1pubkey (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceWithDerivedSigningPubkeyBuilder_relative_expiry - * Signature: (JI)V + * Method: NodeId_to_str + * Signature: (J)Ljava/lang/String; */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1relative_1expiry - (JNIEnv *, jclass, jlong, jint); +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_NodeId_1to_1str + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wsh - * Signature: (J[B)V + * Method: NodeId_hash + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1fallback_1v0_1p2wsh - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeId_1hash + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wpkh - * Signature: (J[B)V + * Method: NodeId_write + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1fallback_1v0_1p2wpkh - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeId_1write + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceWithDerivedSigningPubkeyBuilder_fallback_v1_p2tr_tweaked - * Signature: (J[B)V + * Method: NodeId_read + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1fallback_1v1_1p2tr_1tweaked - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeId_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: InvoiceWithDerivedSigningPubkeyBuilder_allow_mpp + * Method: NetworkGraph_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceWithDerivedSigningPubkeyBuilder_1allow_1mpp +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedBolt12Invoice_free + * Method: ReadOnlyNetworkGraph_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedBolt12Invoice_clone_ptr - * Signature: (J)J + * Method: NetworkUpdate_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1clone_1ptr +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedBolt12Invoice_clone + * Method: NetworkUpdate_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: SignBolt12InvoiceFn_free - * Signature: (J)V + * Method: NetworkUpdate_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignBolt12InvoiceFn_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedBolt12Invoice_tagged_hash - * Signature: (J)J + * Method: NetworkUpdate_channel_failure + * Signature: (JZ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1tagged_1hash - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1channel_1failure + (JNIEnv *, jclass, jlong, jboolean); /* * Class: org_ldk_impl_bindings - * Method: Bolt12Invoice_free - * Signature: (J)V + * Method: NetworkUpdate_node_failure + * Signature: ([BZ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1node_1failure + (JNIEnv *, jclass, jbyteArray, jboolean); /* * Class: org_ldk_impl_bindings - * Method: Bolt12Invoice_clone_ptr - * Signature: (J)J + * Method: NetworkUpdate_eq + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12Invoice_clone - * Signature: (J)J + * Method: NetworkUpdate_write + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1clone +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedBolt12Invoice_offer_chains - * Signature: (J)J + * Method: NetworkUpdate_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1offer_1chains - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: UnsignedBolt12Invoice_chain - * Signature: (J)[B + * Method: P2PGossipSync_free + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1chain +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedBolt12Invoice_metadata - * Signature: (J)J + * Method: P2PGossipSync_new + * Signature: (JJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1metadata - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1new + (JNIEnv *, jclass, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedBolt12Invoice_amount - * Signature: (J)J + * Method: P2PGossipSync_add_utxo_lookup + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1amount - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1add_1utxo_1lookup + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedBolt12Invoice_offer_features - * Signature: (J)J + * Method: NetworkGraph_handle_network_update + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1offer_1features - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1handle_1network_1update + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedBolt12Invoice_description - * Signature: (J)J + * Method: NetworkGraph_get_chain_hash + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1description +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1get_1chain_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedBolt12Invoice_absolute_expiry + * Method: verify_node_announcement * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1absolute_1expiry +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_verify_1node_1announcement (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedBolt12Invoice_issuer + * Method: verify_channel_announcement * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1issuer +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_verify_1channel_1announcement (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedBolt12Invoice_message_paths - * Signature: (J)[J + * Method: P2PGossipSync_as_RoutingMessageHandler + * Signature: (J)J */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1message_1paths +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1as_1RoutingMessageHandler (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedBolt12Invoice_supported_quantity + * Method: P2PGossipSync_as_MessageSendEventsProvider * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1supported_1quantity +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1as_1MessageSendEventsProvider (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedBolt12Invoice_payer_metadata - * Signature: (J)[B + * Method: ChannelUpdateInfo_free + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1payer_1metadata +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedBolt12Invoice_invoice_request_features + * Method: ChannelUpdateInfo_get_htlc_minimum_msat * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1invoice_1request_1features +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1htlc_1minimum_1msat (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedBolt12Invoice_quantity + * Method: ChannelUpdateInfo_set_htlc_minimum_msat + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1htlc_1minimum_1msat + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelUpdateInfo_get_htlc_maximum_msat * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1quantity +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1htlc_1maximum_1msat (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedBolt12Invoice_payer_id - * Signature: (J)[B + * Method: ChannelUpdateInfo_set_htlc_maximum_msat + * Signature: (JJ)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1payer_1id - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1htlc_1maximum_1msat + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedBolt12Invoice_payer_note + * Method: ChannelUpdateInfo_get_fees * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1payer_1note +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1fees (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedBolt12Invoice_created_at - * Signature: (J)J + * Method: ChannelUpdateInfo_set_fees + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1created_1at - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1fees + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedBolt12Invoice_relative_expiry - * Signature: (J)J + * Method: ChannelUpdateInfo_get_last_update + * Signature: (J)I */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1relative_1expiry +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1last_1update (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedBolt12Invoice_is_expired - * Signature: (J)Z + * Method: ChannelUpdateInfo_set_last_update + * Signature: (JI)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1is_1expired - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1last_1update + (JNIEnv *, jclass, jlong, jint); /* * Class: org_ldk_impl_bindings - * Method: UnsignedBolt12Invoice_payment_hash - * Signature: (J)[B + * Method: ChannelUpdateInfo_get_cltv_expiry_delta + * Signature: (J)S */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1payment_1hash +JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1cltv_1expiry_1delta (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedBolt12Invoice_amount_msats - * Signature: (J)J + * Method: ChannelUpdateInfo_set_cltv_expiry_delta + * Signature: (JS)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1amount_1msats - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1cltv_1expiry_1delta + (JNIEnv *, jclass, jlong, jshort); /* * Class: org_ldk_impl_bindings - * Method: UnsignedBolt12Invoice_invoice_features - * Signature: (J)J + * Method: ChannelUpdateInfo_get_enabled + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1invoice_1features +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1enabled (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedBolt12Invoice_signing_pubkey - * Signature: (J)[B + * Method: ChannelUpdateInfo_set_enabled + * Signature: (JZ)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1signing_1pubkey - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1enabled + (JNIEnv *, jclass, jlong, jboolean); /* * Class: org_ldk_impl_bindings - * Method: Bolt12Invoice_offer_chains + * Method: ChannelUpdateInfo_get_last_update_message * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1offer_1chains +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1last_1update_1message (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12Invoice_chain - * Signature: (J)[B + * Method: ChannelUpdateInfo_set_last_update_message + * Signature: (JJ)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1chain - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1last_1update_1message + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12Invoice_metadata - * Signature: (J)J + * Method: ChannelUpdateInfo_new + * Signature: (JJJISZJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1metadata - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1new + (JNIEnv *, jclass, jlong, jlong, jlong, jint, jshort, jboolean, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12Invoice_amount + * Method: ChannelUpdateInfo_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1amount +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12Invoice_offer_features + * Method: ChannelUpdateInfo_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1offer_1features +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12Invoice_description - * Signature: (J)J + * Method: ChannelUpdateInfo_eq + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1description - (JNIEnv *, jclass, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12Invoice_absolute_expiry - * Signature: (J)J + * Method: ChannelUpdateInfo_to_str + * Signature: (J)Ljava/lang/String; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1absolute_1expiry +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1to_1str (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12Invoice_issuer - * Signature: (J)J + * Method: ChannelUpdateInfo_write + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1issuer +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12Invoice_message_paths - * Signature: (J)[J + * Method: ChannelUpdateInfo_read + * Signature: ([B)J */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1message_1paths +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1read + (JNIEnv *, jclass, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelInfo_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12Invoice_supported_quantity + * Method: ChannelInfo_get_features * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1supported_1quantity +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1features (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12Invoice_payer_metadata - * Signature: (J)[B + * Method: ChannelInfo_set_features + * Signature: (JJ)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1payer_1metadata - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1features + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12Invoice_invoice_request_features + * Method: ChannelInfo_get_node_one * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1invoice_1request_1features +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1one (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12Invoice_quantity + * Method: ChannelInfo_set_node_one + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1one + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelInfo_get_node_two * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1quantity +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1two (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12Invoice_payer_id - * Signature: (J)[B + * Method: ChannelInfo_set_node_two + * Signature: (JJ)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1payer_1id - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1two + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12Invoice_payer_note + * Method: ChannelInfo_get_capacity_sats * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1payer_1note +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1capacity_1sats (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12Invoice_created_at - * Signature: (J)J + * Method: ChannelInfo_set_capacity_sats + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1created_1at - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1capacity_1sats + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12Invoice_relative_expiry + * Method: ChannelInfo_get_one_to_two * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1relative_1expiry +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1one_1to_1two (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12Invoice_is_expired - * Signature: (J)Z + * Method: ChannelInfo_set_one_to_two + * Signature: (JJ)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1is_1expired - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1one_1to_1two + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12Invoice_payment_hash - * Signature: (J)[B + * Method: ChannelInfo_get_two_to_one + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1payment_1hash +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1two_1to_1one (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12Invoice_amount_msats - * Signature: (J)J + * Method: ChannelInfo_set_two_to_one + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1amount_1msats - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1two_1to_1one + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12Invoice_invoice_features + * Method: ChannelInfo_get_announcement_message * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1invoice_1features +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1announcement_1message (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12Invoice_signing_pubkey - * Signature: (J)[B + * Method: ChannelInfo_set_announcement_message + * Signature: (JJ)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1signing_1pubkey - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1announcement_1message + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12Invoice_signature - * Signature: (J)[B + * Method: ChannelInfo_clone_ptr + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1signature +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12Invoice_signable_hash - * Signature: (J)[B + * Method: ChannelInfo_clone + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1signable_1hash +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12Invoice_verify - * Signature: (JJ)J + * Method: ChannelInfo_eq + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1verify +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1eq (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12Invoice_hash - * Signature: (J)J + * Method: ChannelInfo_get_directional_info + * Signature: (JB)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1hash - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1directional_1info + (JNIEnv *, jclass, jlong, jbyte); /* * Class: org_ldk_impl_bindings - * Method: UnsignedBolt12Invoice_write - * Signature: (J)[B + * Method: ChannelInfo_to_str + * Signature: (J)Ljava/lang/String; */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1write +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1to_1str (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12Invoice_write + * Method: ChannelInfo_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedPayInfo_free - * Signature: (J)V + * Method: ChannelInfo_read + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: BlindedPayInfo_get_fee_base_msat - * Signature: (J)I + * Method: DirectedChannelInfo_free + * Signature: (J)V */ -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1fee_1base_1msat +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedPayInfo_set_fee_base_msat - * Signature: (JI)V + * Method: DirectedChannelInfo_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1fee_1base_1msat - (JNIEnv *, jclass, jlong, jint); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedPayInfo_get_fee_proportional_millionths - * Signature: (J)I + * Method: DirectedChannelInfo_clone + * Signature: (J)J */ -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1fee_1proportional_1millionths +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedPayInfo_set_fee_proportional_millionths - * Signature: (JI)V + * Method: DirectedChannelInfo_channel + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1fee_1proportional_1millionths - (JNIEnv *, jclass, jlong, jint); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1channel + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedPayInfo_get_cltv_expiry_delta - * Signature: (J)S + * Method: DirectedChannelInfo_effective_capacity + * Signature: (J)J */ -JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1cltv_1expiry_1delta +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1effective_1capacity (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedPayInfo_set_cltv_expiry_delta - * Signature: (JS)V + * Method: DirectedChannelInfo_source + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1cltv_1expiry_1delta - (JNIEnv *, jclass, jlong, jshort); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1source + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedPayInfo_get_htlc_minimum_msat + * Method: DirectedChannelInfo_target * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1htlc_1minimum_1msat +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1target (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedPayInfo_set_htlc_minimum_msat - * Signature: (JJ)V + * Method: EffectiveCapacity_free + * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1htlc_1minimum_1msat - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedPayInfo_get_htlc_maximum_msat + * Method: EffectiveCapacity_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1htlc_1maximum_1msat +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedPayInfo_set_htlc_maximum_msat - * Signature: (JJ)V + * Method: EffectiveCapacity_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1htlc_1maximum_1msat - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedPayInfo_get_features + * Method: EffectiveCapacity_exact_liquidity * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1features +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1exact_1liquidity (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedPayInfo_set_features - * Signature: (JJ)V + * Method: EffectiveCapacity_advertised_max_htlc + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1features - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1advertised_1max_1htlc + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedPayInfo_new - * Signature: (IISJJJ)J + * Method: EffectiveCapacity_total + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1new - (JNIEnv *, jclass, jint, jint, jshort, jlong, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1total + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedPayInfo_clone_ptr - * Signature: (J)J + * Method: EffectiveCapacity_infinite + * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1infinite + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: BlindedPayInfo_clone + * Method: EffectiveCapacity_hint_max_htlc * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1hint_1max_1htlc (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedPayInfo_hash - * Signature: (J)J + * Method: EffectiveCapacity_unknown + * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1hash - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1unknown + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: BlindedPayInfo_eq - * Signature: (JJ)Z + * Method: EffectiveCapacity_as_msat + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1as_1msat + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedPayInfo_write + * Method: RoutingFees_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RoutingFees_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedPayInfo_read + * Method: RoutingFees_read * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1read +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1read (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: InvoiceError_free + * Method: NodeAnnouncementDetails_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceError_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceError_get_erroneous_field + * Method: NodeAnnouncementDetails_get_features * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceError_1get_1erroneous_1field +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1get_1features (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceError_set_erroneous_field + * Method: NodeAnnouncementDetails_set_features * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceError_1set_1erroneous_1field +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1set_1features (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceError_get_message - * Signature: (J)J + * Method: NodeAnnouncementDetails_get_last_update + * Signature: (J)I */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceError_1get_1message +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1get_1last_1update (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceError_set_message - * Signature: (JJ)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceError_1set_1message - (JNIEnv *, jclass, jlong, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: InvoiceError_new - * Signature: (JJ)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceError_1new - (JNIEnv *, jclass, jlong, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: InvoiceError_clone_ptr - * Signature: (J)J + * Method: NodeAnnouncementDetails_set_last_update + * Signature: (JI)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceError_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1set_1last_1update + (JNIEnv *, jclass, jlong, jint); /* * Class: org_ldk_impl_bindings - * Method: InvoiceError_clone - * Signature: (J)J + * Method: NodeAnnouncementDetails_get_rgb + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceError_1clone +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1get_1rgb (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ErroneousField_free - * Signature: (J)V + * Method: NodeAnnouncementDetails_set_rgb + * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErroneousField_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1set_1rgb + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ErroneousField_get_tlv_fieldnum + * Method: NodeAnnouncementDetails_get_alias * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErroneousField_1get_1tlv_1fieldnum +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1get_1alias (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ErroneousField_set_tlv_fieldnum + * Method: NodeAnnouncementDetails_set_alias * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErroneousField_1set_1tlv_1fieldnum +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1set_1alias (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ErroneousField_get_suggested_value - * Signature: (J)J + * Method: NodeAnnouncementDetails_get_addresses + * Signature: (J)[J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErroneousField_1get_1suggested_1value +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1get_1addresses (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ErroneousField_set_suggested_value - * Signature: (JJ)V + * Method: NodeAnnouncementDetails_set_addresses + * Signature: (J[J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErroneousField_1set_1suggested_1value - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1set_1addresses + (JNIEnv *, jclass, jlong, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: ErroneousField_new - * Signature: (JJ)J + * Method: NodeAnnouncementDetails_new + * Signature: (JI[BJ[J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErroneousField_1new - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1new + (JNIEnv *, jclass, jlong, jint, jbyteArray, jlong, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: ErroneousField_clone_ptr + * Method: NodeAnnouncementDetails_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErroneousField_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ErroneousField_clone + * Method: NodeAnnouncementDetails_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErroneousField_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceError_from_string - * Signature: (Ljava/lang/String;)J + * Method: NodeAnnouncementDetails_eq + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceError_1from_1string - (JNIEnv *, jclass, jstring); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementDetails_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceError_to_str - * Signature: (J)Ljava/lang/String; + * Method: NodeAnnouncementInfo_free + * Signature: (J)V */ -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_InvoiceError_1to_1str +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceError_write - * Signature: (J)[B + * Method: NodeAnnouncementInfo_clone_ptr + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InvoiceError_1write +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceError_read - * Signature: ([B)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceError_1read - (JNIEnv *, jclass, jbyteArray); - -/* - * Class: org_ldk_impl_bindings - * Method: InvoiceRequestWithExplicitPayerIdBuilder_free - * Signature: (J)V + * Method: NodeAnnouncementInfo_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestWithDerivedPayerIdBuilder_free - * Signature: (J)V + * Method: NodeAnnouncementInfo_relayed + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1relayed (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestWithExplicitPayerIdBuilder_build + * Method: NodeAnnouncementInfo_local * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1build +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1local (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestWithExplicitPayerIdBuilder_chain - * Signature: (JLorg/ldk/enums/Network;)J + * Method: NodeAnnouncementInfo_eq + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1chain - (JNIEnv *, jclass, jlong, jobject); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestWithExplicitPayerIdBuilder_amount_msats - * Signature: (JJ)J + * Method: NodeAnnouncementInfo_features + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1amount_1msats - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1features + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestWithExplicitPayerIdBuilder_quantity - * Signature: (JJ)J + * Method: NodeAnnouncementInfo_last_update + * Signature: (J)I */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1quantity - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1last_1update + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestWithExplicitPayerIdBuilder_payer_note - * Signature: (JLjava/lang/String;)V + * Method: NodeAnnouncementInfo_rgb + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1payer_1note - (JNIEnv *, jclass, jlong, jstring); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1rgb + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestWithDerivedPayerIdBuilder_build_and_sign + * Method: NodeAnnouncementInfo_alias * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1build_1and_1sign +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1alias (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestWithDerivedPayerIdBuilder_chain - * Signature: (JLorg/ldk/enums/Network;)J + * Method: NodeAnnouncementInfo_addresses + * Signature: (J)[J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1chain - (JNIEnv *, jclass, jlong, jobject); +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1addresses + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestWithDerivedPayerIdBuilder_amount_msats - * Signature: (JJ)J + * Method: NodeAnnouncementInfo_announcement_message + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1amount_1msats - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1announcement_1message + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestWithDerivedPayerIdBuilder_quantity - * Signature: (JJ)J + * Method: NodeAnnouncementInfo_write + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1quantity - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1write + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestWithDerivedPayerIdBuilder_payer_note - * Signature: (JLjava/lang/String;)V + * Method: NodeAnnouncementInfo_read + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1payer_1note - (JNIEnv *, jclass, jlong, jstring); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: UnsignedInvoiceRequest_free + * Method: NodeAlias_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAlias_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedInvoiceRequest_clone_ptr - * Signature: (J)J + * Method: NodeAlias_get_a + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1clone_1ptr +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAlias_1get_1a (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedInvoiceRequest_clone - * Signature: (J)J + * Method: NodeAlias_set_a + * Signature: (J[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAlias_1set_1a + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: SignInvoiceRequestFn_free - * Signature: (J)V + * Method: NodeAlias_new + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignInvoiceRequestFn_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAlias_1new + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: UnsignedInvoiceRequest_tagged_hash + * Method: NodeAlias_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1tagged_1hash +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAlias_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequest_free - * Signature: (J)V + * Method: NodeAlias_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAlias_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequest_clone_ptr + * Method: NodeAlias_hash * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAlias_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequest_clone - * Signature: (J)J + * Method: NodeAlias_eq + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeAlias_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: VerifiedInvoiceRequest_free - * Signature: (J)V + * Method: NodeAlias_to_str + * Signature: (J)Ljava/lang/String; */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1free +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_NodeAlias_1to_1str (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: VerifiedInvoiceRequest_get_offer_id - * Signature: (J)J + * Method: NodeAlias_write + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1get_1offer_1id +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAlias_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: VerifiedInvoiceRequest_set_offer_id - * Signature: (JJ)V + * Method: NodeAlias_read + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1set_1offer_1id - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAlias_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: VerifiedInvoiceRequest_get_keys - * Signature: (J)J + * Method: NodeInfo_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1get_1keys +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: VerifiedInvoiceRequest_set_keys - * Signature: (JJ)V + * Method: NodeInfo_get_channels + * Signature: (J)[J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1set_1keys - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1channels + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: VerifiedInvoiceRequest_clone_ptr - * Signature: (J)J + * Method: NodeInfo_set_channels + * Signature: (J[J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1channels + (JNIEnv *, jclass, jlong, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: VerifiedInvoiceRequest_clone + * Method: NodeInfo_get_announcement_info * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1clone - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: UnsignedInvoiceRequest_chains - * Signature: (J)[[B - */ -JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1chains +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1announcement_1info (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedInvoiceRequest_metadata - * Signature: (J)J + * Method: NodeInfo_set_announcement_info + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1metadata - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1announcement_1info + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedInvoiceRequest_amount + * Method: NodeInfo_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1amount +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedInvoiceRequest_description + * Method: NodeInfo_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1description +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedInvoiceRequest_offer_features - * Signature: (J)J + * Method: NodeInfo_eq + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1offer_1features - (JNIEnv *, jclass, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeInfo_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedInvoiceRequest_absolute_expiry - * Signature: (J)J + * Method: NodeInfo_is_tor_only + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1absolute_1expiry +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeInfo_1is_1tor_1only (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedInvoiceRequest_issuer - * Signature: (J)J + * Method: NodeInfo_to_str + * Signature: (J)Ljava/lang/String; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1issuer +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_NodeInfo_1to_1str (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedInvoiceRequest_paths - * Signature: (J)[J + * Method: NodeInfo_write + * Signature: (J)[B */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1paths +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeInfo_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedInvoiceRequest_supported_quantity - * Signature: (J)J + * Method: NodeInfo_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1supported_1quantity - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: UnsignedInvoiceRequest_signing_pubkey + * Method: NetworkGraph_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1signing_1pubkey +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedInvoiceRequest_payer_metadata - * Signature: (J)[B + * Method: NetworkGraph_read + * Signature: ([BJ)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1payer_1metadata - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedInvoiceRequest_chain - * Signature: (J)[B + * Method: NetworkGraph_to_str + * Signature: (J)Ljava/lang/String; */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1chain +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1to_1str (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedInvoiceRequest_amount_msats - * Signature: (J)J + * Method: NetworkGraph_new + * Signature: (Lorg/ldk/enums/Network;J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1amount_1msats - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1new + (JNIEnv *, jclass, jobject, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedInvoiceRequest_invoice_request_features + * Method: NetworkGraph_read_only * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1invoice_1request_1features +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read_1only (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedInvoiceRequest_quantity + * Method: NetworkGraph_get_last_rapid_gossip_sync_timestamp * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1quantity +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1get_1last_1rapid_1gossip_1sync_1timestamp (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedInvoiceRequest_payer_id - * Signature: (J)[B + * Method: NetworkGraph_set_last_rapid_gossip_sync_timestamp + * Signature: (JI)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1payer_1id - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1set_1last_1rapid_1gossip_1sync_1timestamp + (JNIEnv *, jclass, jlong, jint); /* * Class: org_ldk_impl_bindings - * Method: UnsignedInvoiceRequest_payer_note - * Signature: (J)J + * Method: NetworkGraph_update_node_from_announcement + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1payer_1note - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1node_1from_1announcement + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequest_chains - * Signature: (J)[[B + * Method: NetworkGraph_update_node_from_unsigned_announcement + * Signature: (JJ)J */ -JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1chains - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1node_1from_1unsigned_1announcement + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequest_metadata - * Signature: (J)J + * Method: NetworkGraph_update_channel_from_announcement + * Signature: (JJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1metadata - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel_1from_1announcement + (JNIEnv *, jclass, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequest_amount - * Signature: (J)J + * Method: NetworkGraph_update_channel_from_announcement_no_lookup + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1amount - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel_1from_1announcement_1no_1lookup + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequest_description - * Signature: (J)J + * Method: NetworkGraph_update_channel_from_unsigned_announcement + * Signature: (JJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1description - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel_1from_1unsigned_1announcement + (JNIEnv *, jclass, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequest_offer_features - * Signature: (J)J + * Method: NetworkGraph_add_channel_from_partial_announcement + * Signature: (JJJJ[B[B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1offer_1features - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1add_1channel_1from_1partial_1announcement + (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jbyteArray, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequest_absolute_expiry - * Signature: (J)J + * Method: NetworkGraph_channel_failed_permanent + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1absolute_1expiry - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1channel_1failed_1permanent + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequest_issuer - * Signature: (J)J + * Method: NetworkGraph_node_failed_permanent + * Signature: (J[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1issuer - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1node_1failed_1permanent + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequest_paths - * Signature: (J)[J + * Method: NetworkGraph_remove_stale_channels_and_tracking + * Signature: (J)V */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1paths +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1remove_1stale_1channels_1and_1tracking (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequest_supported_quantity - * Signature: (J)J + * Method: NetworkGraph_remove_stale_channels_and_tracking_with_time + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1supported_1quantity - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1remove_1stale_1channels_1and_1tracking_1with_1time + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequest_signing_pubkey - * Signature: (J)[B + * Method: NetworkGraph_update_channel + * Signature: (JJ)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1signing_1pubkey - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequest_payer_metadata - * Signature: (J)[B + * Method: NetworkGraph_update_channel_unsigned + * Signature: (JJ)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1payer_1metadata - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel_1unsigned + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequest_chain - * Signature: (J)[B + * Method: NetworkGraph_verify_channel_update + * Signature: (JJ)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1chain - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1verify_1channel_1update + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequest_amount_msats - * Signature: (J)J + * Method: ReadOnlyNetworkGraph_channel + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1amount_1msats - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1channel + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequest_invoice_request_features - * Signature: (J)J + * Method: ReadOnlyNetworkGraph_list_channels + * Signature: (J)[J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1invoice_1request_1features +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1list_1channels (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequest_quantity - * Signature: (J)J + * Method: ReadOnlyNetworkGraph_node + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1quantity - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1node + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequest_payer_id - * Signature: (J)[B + * Method: ReadOnlyNetworkGraph_list_nodes + * Signature: (J)[J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1payer_1id +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1list_1nodes (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequest_payer_note - * Signature: (J)J + * Method: ReadOnlyNetworkGraph_get_addresses + * Signature: (J[B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1payer_1note - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1get_1addresses + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequest_respond_with - * Signature: (J[J[B)J + * Method: DefaultRouter_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1respond_1with - (JNIEnv *, jclass, jlong, jlongArray, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequest_respond_with_no_std - * Signature: (J[J[BJ)J + * Method: DefaultRouter_new + * Signature: (JJJJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1respond_1with_1no_1std - (JNIEnv *, jclass, jlong, jlongArray, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1new + (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequest_verify - * Signature: (JJ)J + * Method: DefaultRouter_as_Router + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1verify - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1as_1Router + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequest_signature - * Signature: (J)[B + * Method: DefaultRouter_as_MessageRouter + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1signature +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1as_1MessageRouter (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: VerifiedInvoiceRequest_chains - * Signature: (J)[[B + * Method: Router_free + * Signature: (J)V */ -JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1chains +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Router_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: VerifiedInvoiceRequest_metadata - * Signature: (J)J + * Method: ScorerAccountingForInFlightHtlcs_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1metadata +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: VerifiedInvoiceRequest_amount - * Signature: (J)J + * Method: ScorerAccountingForInFlightHtlcs_new + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1amount - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1new + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: VerifiedInvoiceRequest_description + * Method: ScorerAccountingForInFlightHtlcs_as_ScoreLookUp * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1description +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1as_1ScoreLookUp (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: VerifiedInvoiceRequest_offer_features - * Signature: (J)J + * Method: InFlightHtlcs_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1offer_1features +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: VerifiedInvoiceRequest_absolute_expiry + * Method: InFlightHtlcs_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1absolute_1expiry +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: VerifiedInvoiceRequest_issuer + * Method: InFlightHtlcs_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1issuer +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: VerifiedInvoiceRequest_paths - * Signature: (J)[J + * Method: InFlightHtlcs_new + * Signature: ()J */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1paths - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1new + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: VerifiedInvoiceRequest_supported_quantity - * Signature: (J)J + * Method: InFlightHtlcs_process_path + * Signature: (JJ[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1supported_1quantity - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1process_1path + (JNIEnv *, jclass, jlong, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: VerifiedInvoiceRequest_signing_pubkey - * Signature: (J)[B + * Method: InFlightHtlcs_add_inflight_htlc + * Signature: (JJJJJ)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1signing_1pubkey - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1add_1inflight_1htlc + (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: VerifiedInvoiceRequest_payer_metadata - * Signature: (J)[B + * Method: InFlightHtlcs_used_liquidity_msat + * Signature: (JJJJ)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1payer_1metadata - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1used_1liquidity_1msat + (JNIEnv *, jclass, jlong, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: VerifiedInvoiceRequest_chain + * Method: InFlightHtlcs_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1chain +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: VerifiedInvoiceRequest_amount_msats - * Signature: (J)J + * Method: InFlightHtlcs_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1amount_1msats - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: VerifiedInvoiceRequest_invoice_request_features - * Signature: (J)J + * Method: RouteHop_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1invoice_1request_1features +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: VerifiedInvoiceRequest_quantity - * Signature: (J)J + * Method: RouteHop_get_pubkey + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1quantity +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1pubkey (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: VerifiedInvoiceRequest_payer_id - * Signature: (J)[B + * Method: RouteHop_set_pubkey + * Signature: (J[B)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1payer_1id - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1pubkey + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: VerifiedInvoiceRequest_payer_note + * Method: RouteHop_get_node_features * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1payer_1note +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1node_1features (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: VerifiedInvoiceRequest_respond_with - * Signature: (J[J[B)J + * Method: RouteHop_set_node_features + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1respond_1with - (JNIEnv *, jclass, jlong, jlongArray, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1node_1features + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: VerifiedInvoiceRequest_respond_with_no_std - * Signature: (J[J[BJ)J + * Method: RouteHop_get_short_channel_id + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1respond_1with_1no_1std - (JNIEnv *, jclass, jlong, jlongArray, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1short_1channel_1id + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: VerifiedInvoiceRequest_respond_using_derived_keys - * Signature: (J[J[B)J + * Method: RouteHop_set_short_channel_id + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1respond_1using_1derived_1keys - (JNIEnv *, jclass, jlong, jlongArray, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1short_1channel_1id + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: VerifiedInvoiceRequest_respond_using_derived_keys_no_std - * Signature: (J[J[BJ)J + * Method: RouteHop_get_channel_features + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1respond_1using_1derived_1keys_1no_1std - (JNIEnv *, jclass, jlong, jlongArray, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1channel_1features + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedInvoiceRequest_write - * Signature: (J)[B + * Method: RouteHop_set_channel_features + * Signature: (JJ)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1write - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1channel_1features + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequest_write - * Signature: (J)[B + * Method: RouteHop_get_fee_msat + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1write +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1fee_1msat (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestFields_free - * Signature: (J)V + * Method: RouteHop_set_fee_msat + * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1fee_1msat + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestFields_get_payer_id - * Signature: (J)[B + * Method: RouteHop_get_cltv_expiry_delta + * Signature: (J)I */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1get_1payer_1id +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1cltv_1expiry_1delta (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestFields_set_payer_id - * Signature: (J[B)V + * Method: RouteHop_set_cltv_expiry_delta + * Signature: (JI)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1set_1payer_1id - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1cltv_1expiry_1delta + (JNIEnv *, jclass, jlong, jint); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestFields_get_quantity - * Signature: (J)J + * Method: RouteHop_get_maybe_announced_channel + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1get_1quantity +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1maybe_1announced_1channel (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestFields_set_quantity - * Signature: (JJ)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1set_1quantity - (JNIEnv *, jclass, jlong, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: InvoiceRequestFields_get_payer_note_truncated - * Signature: (J)J + * Method: RouteHop_set_maybe_announced_channel + * Signature: (JZ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1get_1payer_1note_1truncated - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1maybe_1announced_1channel + (JNIEnv *, jclass, jlong, jboolean); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestFields_set_payer_note_truncated - * Signature: (JJ)V + * Method: RouteHop_new + * Signature: ([BJJJJIZ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1set_1payer_1note_1truncated - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1new + (JNIEnv *, jclass, jbyteArray, jlong, jlong, jlong, jlong, jint, jboolean); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestFields_new - * Signature: ([BJJ)J + * Method: RouteHop_clone_ptr + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1new - (JNIEnv *, jclass, jbyteArray, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestFields_clone_ptr + * Method: RouteHop_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestFields_clone + * Method: RouteHop_hash * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestFields_eq + * Method: RouteHop_eq * Signature: (JJ)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1eq +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHop_1eq (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestFields_write + * Method: RouteHop_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RouteHop_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestFields_read + * Method: RouteHop_read * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1read +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1read (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: TaggedHash_free + * Method: BlindedTail_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TaggedHash_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedTail_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: TaggedHash_clone_ptr - * Signature: (J)J + * Method: BlindedTail_get_hops + * Signature: (J)[J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TaggedHash_1clone_1ptr +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_BlindedTail_1get_1hops (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: TaggedHash_clone - * Signature: (J)J + * Method: BlindedTail_set_hops + * Signature: (J[J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TaggedHash_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedTail_1set_1hops + (JNIEnv *, jclass, jlong, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: TaggedHash_as_digest + * Method: BlindedTail_get_blinding_point * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TaggedHash_1as_1digest - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: TaggedHash_tag - * Signature: (J)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_TaggedHash_1tag +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BlindedTail_1get_1blinding_1point (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: TaggedHash_merkle_root - * Signature: (J)[B + * Method: BlindedTail_set_blinding_point + * Signature: (J[B)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TaggedHash_1merkle_1root - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedTail_1set_1blinding_1point + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: SignError_free - * Signature: (J)V + * Method: BlindedTail_get_excess_final_cltv_expiry_delta + * Signature: (J)I */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignError_1free +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_BlindedTail_1get_1excess_1final_1cltv_1expiry_1delta (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: SignError_clone_ptr - * Signature: (J)J + * Method: BlindedTail_set_excess_final_cltv_expiry_delta + * Signature: (JI)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SignError_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedTail_1set_1excess_1final_1cltv_1expiry_1delta + (JNIEnv *, jclass, jlong, jint); /* * Class: org_ldk_impl_bindings - * Method: SignError_clone + * Method: BlindedTail_get_final_value_msat * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SignError_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedTail_1get_1final_1value_1msat (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: SignError_signing - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SignError_1signing - (JNIEnv *, jclass); - -/* - * Class: org_ldk_impl_bindings - * Method: SignError_verification - * Signature: (Lorg/ldk/enums/Secp256k1Error;)J + * Method: BlindedTail_set_final_value_msat + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SignError_1verification - (JNIEnv *, jclass, jobject); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedTail_1set_1final_1value_1msat + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12ParseError_free - * Signature: (J)V + * Method: BlindedTail_new + * Signature: ([J[BIJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12ParseError_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedTail_1new + (JNIEnv *, jclass, jlongArray, jbyteArray, jint, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12ParseError_clone_ptr + * Method: BlindedTail_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12ParseError_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedTail_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12ParseError_clone + * Method: BlindedTail_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12ParseError_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedTail_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12SemanticError_clone - * Signature: (J)Lorg/ldk/enums/Bolt12SemanticError; + * Method: BlindedTail_hash + * Signature: (J)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedTail_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12SemanticError_already_expired - * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1already_1expired - (JNIEnv *, jclass); - -/* - * Class: org_ldk_impl_bindings - * Method: Bolt12SemanticError_unsupported_chain - * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; + * Method: BlindedTail_eq + * Signature: (JJ)Z */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unsupported_1chain - (JNIEnv *, jclass); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedTail_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12SemanticError_unexpected_chain - * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; + * Method: BlindedTail_write + * Signature: (J)[B */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1chain - (JNIEnv *, jclass); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BlindedTail_1write + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12SemanticError_missing_amount - * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; + * Method: BlindedTail_read + * Signature: ([B)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1amount - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedTail_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: Bolt12SemanticError_invalid_amount - * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; + * Method: Path_free + * Signature: (J)V */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1invalid_1amount - (JNIEnv *, jclass); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Path_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12SemanticError_insufficient_amount - * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; + * Method: Path_get_hops + * Signature: (J)[J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1insufficient_1amount - (JNIEnv *, jclass); +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_Path_1get_1hops + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12SemanticError_unexpected_amount - * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; + * Method: Path_set_hops + * Signature: (J[J)V */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1amount - (JNIEnv *, jclass); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Path_1set_1hops + (JNIEnv *, jclass, jlong, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: Bolt12SemanticError_unsupported_currency - * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; + * Method: Path_get_blinded_tail + * Signature: (J)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unsupported_1currency - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Path_1get_1blinded_1tail + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12SemanticError_unknown_required_features - * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; + * Method: Path_set_blinded_tail + * Signature: (JJ)V */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unknown_1required_1features - (JNIEnv *, jclass); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Path_1set_1blinded_1tail + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12SemanticError_unexpected_features - * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; + * Method: Path_new + * Signature: ([JJ)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1features - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Path_1new + (JNIEnv *, jclass, jlongArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12SemanticError_missing_description - * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; + * Method: Path_clone_ptr + * Signature: (J)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1description - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Path_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12SemanticError_missing_signing_pubkey - * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; + * Method: Path_clone + * Signature: (J)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1signing_1pubkey - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Path_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12SemanticError_invalid_signing_pubkey - * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; + * Method: Path_hash + * Signature: (J)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1invalid_1signing_1pubkey - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Path_1hash + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12SemanticError_unexpected_signing_pubkey - * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; + * Method: Path_eq + * Signature: (JJ)Z */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1signing_1pubkey - (JNIEnv *, jclass); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Path_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12SemanticError_missing_quantity - * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; + * Method: Path_fee_msat + * Signature: (J)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1quantity - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Path_1fee_1msat + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12SemanticError_invalid_quantity - * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; + * Method: Path_final_value_msat + * Signature: (J)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1invalid_1quantity - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Path_1final_1value_1msat + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12SemanticError_unexpected_quantity - * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; + * Method: Path_final_cltv_expiry_delta + * Signature: (J)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1quantity - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Path_1final_1cltv_1expiry_1delta + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12SemanticError_invalid_metadata - * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; + * Method: Route_free + * Signature: (J)V */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1invalid_1metadata - (JNIEnv *, jclass); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12SemanticError_unexpected_metadata - * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; + * Method: Route_get_paths + * Signature: (J)[J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1metadata - (JNIEnv *, jclass); +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_Route_1get_1paths + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12SemanticError_missing_payer_metadata - * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; + * Method: Route_set_paths + * Signature: (J[J)V */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1payer_1metadata - (JNIEnv *, jclass); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1paths + (JNIEnv *, jclass, jlong, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: Bolt12SemanticError_missing_payer_id - * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; + * Method: Route_get_route_params + * Signature: (J)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1payer_1id - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1get_1route_1params + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12SemanticError_duplicate_payment_id - * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; + * Method: Route_set_route_params + * Signature: (JJ)V */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1duplicate_1payment_1id - (JNIEnv *, jclass); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1route_1params + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12SemanticError_missing_paths - * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; + * Method: Route_new + * Signature: ([JJ)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1paths - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1new + (JNIEnv *, jclass, jlongArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12SemanticError_unexpected_paths - * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; + * Method: Route_clone_ptr + * Signature: (J)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1paths - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12SemanticError_invalid_pay_info - * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; + * Method: Route_clone + * Signature: (J)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1invalid_1pay_1info - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12SemanticError_missing_creation_time - * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; + * Method: Route_hash + * Signature: (J)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1creation_1time - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1hash + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12SemanticError_missing_payment_hash - * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; + * Method: Route_eq + * Signature: (JJ)Z */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1payment_1hash - (JNIEnv *, jclass); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Route_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12SemanticError_missing_signature - * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; + * Method: Route_get_total_fees + * Signature: (J)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1signature - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1get_1total_1fees + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RefundMaybeWithDerivedMetadataBuilder_free - * Signature: (J)V + * Method: Route_get_total_amount + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1get_1total_1amount (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RefundMaybeWithDerivedMetadataBuilder_clone_ptr - * Signature: (J)J + * Method: Route_to_str + * Signature: (J)Ljava/lang/String; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1clone_1ptr +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Route_1to_1str (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RefundMaybeWithDerivedMetadataBuilder_clone - * Signature: (J)J + * Method: Route_write + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1clone +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Route_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RefundMaybeWithDerivedMetadataBuilder_new - * Signature: ([B[BJ)J + * Method: Route_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1new - (JNIEnv *, jclass, jbyteArray, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: RefundMaybeWithDerivedMetadataBuilder_deriving_payer_id - * Signature: ([BJJJ[B)J + * Method: RouteParameters_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1deriving_1payer_1id - (JNIEnv *, jclass, jbyteArray, jlong, jlong, jlong, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RefundMaybeWithDerivedMetadataBuilder_description - * Signature: (JLjava/lang/String;)V + * Method: RouteParameters_get_payment_params + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1description - (JNIEnv *, jclass, jlong, jstring); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1payment_1params + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RefundMaybeWithDerivedMetadataBuilder_absolute_expiry + * Method: RouteParameters_set_payment_params * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1absolute_1expiry +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1payment_1params (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: RefundMaybeWithDerivedMetadataBuilder_issuer - * Signature: (JLjava/lang/String;)V + * Method: RouteParameters_get_final_value_msat + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1issuer - (JNIEnv *, jclass, jlong, jstring); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1final_1value_1msat + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RefundMaybeWithDerivedMetadataBuilder_path + * Method: RouteParameters_set_final_value_msat * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1path +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1final_1value_1msat (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: RefundMaybeWithDerivedMetadataBuilder_chain - * Signature: (JLorg/ldk/enums/Network;)V + * Method: RouteParameters_get_max_total_routing_fee_msat + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1chain - (JNIEnv *, jclass, jlong, jobject); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1max_1total_1routing_1fee_1msat + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RefundMaybeWithDerivedMetadataBuilder_quantity + * Method: RouteParameters_set_max_total_routing_fee_msat * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1quantity +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1max_1total_1routing_1fee_1msat (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: RefundMaybeWithDerivedMetadataBuilder_payer_note - * Signature: (JLjava/lang/String;)V + * Method: RouteParameters_new + * Signature: (JJJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1payer_1note - (JNIEnv *, jclass, jlong, jstring); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteParameters_1new + (JNIEnv *, jclass, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: RefundMaybeWithDerivedMetadataBuilder_build + * Method: RouteParameters_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1build +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteParameters_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Refund_free - * Signature: (J)V + * Method: RouteParameters_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Refund_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteParameters_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Refund_clone_ptr + * Method: RouteParameters_hash * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Refund_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteParameters_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Refund_clone - * Signature: (J)J + * Method: RouteParameters_eq + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Refund_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteParameters_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Refund_description - * Signature: (J)J + * Method: RouteParameters_from_payment_params_and_value + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Refund_1description - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteParameters_1from_1payment_1params_1and_1value + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Refund_absolute_expiry - * Signature: (J)J + * Method: RouteParameters_set_max_path_length + * Signature: (JJZI)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Refund_1absolute_1expiry - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1max_1path_1length + (JNIEnv *, jclass, jlong, jlong, jboolean, jint); /* * Class: org_ldk_impl_bindings - * Method: Refund_is_expired - * Signature: (J)Z + * Method: RouteParameters_write + * Signature: (J)[B */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Refund_1is_1expired +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RouteParameters_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Refund_is_expired_no_std - * Signature: (JJ)Z + * Method: RouteParameters_read + * Signature: ([B)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Refund_1is_1expired_1no_1std - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteParameters_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: Refund_issuer - * Signature: (J)J + * Method: PaymentParameters_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Refund_1issuer +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Refund_paths - * Signature: (J)[J + * Method: PaymentParameters_get_payee + * Signature: (J)J */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_Refund_1paths +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1payee (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Refund_payer_metadata - * Signature: (J)[B + * Method: PaymentParameters_set_payee + * Signature: (JJ)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Refund_1payer_1metadata - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1payee + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Refund_chain - * Signature: (J)[B + * Method: PaymentParameters_get_expiry_time + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Refund_1chain +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1expiry_1time (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Refund_amount_msats - * Signature: (J)J + * Method: PaymentParameters_set_expiry_time + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Refund_1amount_1msats - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1expiry_1time + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Refund_features - * Signature: (J)J + * Method: PaymentParameters_get_max_total_cltv_expiry_delta + * Signature: (J)I */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Refund_1features +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1max_1total_1cltv_1expiry_1delta (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Refund_quantity - * Signature: (J)J + * Method: PaymentParameters_set_max_total_cltv_expiry_delta + * Signature: (JI)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Refund_1quantity - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1max_1total_1cltv_1expiry_1delta + (JNIEnv *, jclass, jlong, jint); /* * Class: org_ldk_impl_bindings - * Method: Refund_payer_id - * Signature: (J)[B + * Method: PaymentParameters_get_max_path_count + * Signature: (J)B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Refund_1payer_1id +JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1max_1path_1count (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Refund_payer_note - * Signature: (J)J + * Method: PaymentParameters_set_max_path_count + * Signature: (JB)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Refund_1payer_1note - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1max_1path_1count + (JNIEnv *, jclass, jlong, jbyte); /* * Class: org_ldk_impl_bindings - * Method: Refund_hash - * Signature: (J)J + * Method: PaymentParameters_get_max_path_length + * Signature: (J)B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Refund_1hash +JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1max_1path_1length (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Refund_write - * Signature: (J)[B + * Method: PaymentParameters_set_max_path_length + * Signature: (JB)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Refund_1write - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1max_1path_1length + (JNIEnv *, jclass, jlong, jbyte); /* * Class: org_ldk_impl_bindings - * Method: Refund_from_str - * Signature: (Ljava/lang/String;)J + * Method: PaymentParameters_get_max_channel_saturation_power_of_half + * Signature: (J)B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Refund_1from_1str - (JNIEnv *, jclass, jstring); +JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1max_1channel_1saturation_1power_1of_1half + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Refund_to_str - * Signature: (J)Ljava/lang/String; + * Method: PaymentParameters_set_max_channel_saturation_power_of_half + * Signature: (JB)V */ -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Refund_1to_1str - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1max_1channel_1saturation_1power_1of_1half + (JNIEnv *, jclass, jlong, jbyte); /* * Class: org_ldk_impl_bindings - * Method: UtxoLookupError_clone - * Signature: (J)Lorg/ldk/enums/UtxoLookupError; + * Method: PaymentParameters_get_previously_failed_channels + * Signature: (J)[J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_UtxoLookupError_1clone +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1previously_1failed_1channels (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UtxoLookupError_unknown_chain - * Signature: ()Lorg/ldk/enums/UtxoLookupError; + * Method: PaymentParameters_set_previously_failed_channels + * Signature: (J[J)V */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_UtxoLookupError_1unknown_1chain - (JNIEnv *, jclass); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1previously_1failed_1channels + (JNIEnv *, jclass, jlong, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: UtxoLookupError_unknown_tx - * Signature: ()Lorg/ldk/enums/UtxoLookupError; + * Method: PaymentParameters_get_previously_failed_blinded_path_idxs + * Signature: (J)[J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_UtxoLookupError_1unknown_1tx - (JNIEnv *, jclass); +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1previously_1failed_1blinded_1path_1idxs + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UtxoResult_free - * Signature: (J)V + * Method: PaymentParameters_set_previously_failed_blinded_path_idxs + * Signature: (J[J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoResult_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1previously_1failed_1blinded_1path_1idxs + (JNIEnv *, jclass, jlong, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: UtxoResult_clone_ptr - * Signature: (J)J + * Method: PaymentParameters_new + * Signature: (JJIBBB[J[J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UtxoResult_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1new + (JNIEnv *, jclass, jlong, jlong, jint, jbyte, jbyte, jbyte, jlongArray, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: UtxoResult_clone + * Method: PaymentParameters_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UtxoResult_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UtxoResult_sync + * Method: PaymentParameters_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UtxoResult_1sync +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UtxoResult_async + * Method: PaymentParameters_hash * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UtxoResult_1async +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UtxoLookup_free - * Signature: (J)V + * Method: PaymentParameters_eq + * Signature: (JJ)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoLookup_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: UtxoFuture_free - * Signature: (J)V + * Method: PaymentParameters_write + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1free +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UtxoFuture_clone_ptr - * Signature: (J)J + * Method: PaymentParameters_read + * Signature: ([BI)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1read + (JNIEnv *, jclass, jbyteArray, jint); /* * Class: org_ldk_impl_bindings - * Method: UtxoFuture_clone - * Signature: (J)J + * Method: PaymentParameters_from_node_id + * Signature: ([BI)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1from_1node_1id + (JNIEnv *, jclass, jbyteArray, jint); /* * Class: org_ldk_impl_bindings - * Method: UtxoFuture_new - * Signature: ()J + * Method: PaymentParameters_for_keysend + * Signature: ([BIZ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1new - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1for_1keysend + (JNIEnv *, jclass, jbyteArray, jint, jboolean); /* * Class: org_ldk_impl_bindings - * Method: UtxoFuture_resolve_without_forwarding - * Signature: (JJJ)V + * Method: PaymentParameters_from_bolt12_invoice + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1resolve_1without_1forwarding - (JNIEnv *, jclass, jlong, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1from_1bolt12_1invoice + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UtxoFuture_resolve - * Signature: (JJJJ)V + * Method: PaymentParameters_blinded + * Signature: ([J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1resolve - (JNIEnv *, jclass, jlong, jlong, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1blinded + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: NodeId_free + * Method: Payee_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeId_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeId_clone_ptr + * Method: Payee_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeId_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Payee_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeId_clone + * Method: Payee_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeId_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Payee_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeId_from_pubkey - * Signature: ([B)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeId_1from_1pubkey - (JNIEnv *, jclass, jbyteArray); - -/* - * Class: org_ldk_impl_bindings - * Method: NodeId_from_slice - * Signature: ([B)J + * Method: Payee_blinded + * Signature: ([JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeId_1from_1slice - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Payee_1blinded + (JNIEnv *, jclass, jlongArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeId_as_slice - * Signature: (J)[B + * Method: Payee_clear + * Signature: ([B[JJI)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeId_1as_1slice - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Payee_1clear + (JNIEnv *, jclass, jbyteArray, jlongArray, jlong, jint); /* * Class: org_ldk_impl_bindings - * Method: NodeId_as_array - * Signature: (J)[B + * Method: Payee_hash + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeId_1as_1array +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Payee_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeId_as_pubkey - * Signature: (J)J + * Method: Payee_eq + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeId_1as_1pubkey - (JNIEnv *, jclass, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Payee_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeId_to_str - * Signature: (J)Ljava/lang/String; + * Method: RouteHint_write + * Signature: (J)[B */ -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_NodeId_1to_1str +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeId_hash - * Signature: (J)J + * Method: RouteHint_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeId_1hash - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: NodeId_write + * Method: RouteHintHop_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeId_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeId_read + * Method: RouteHintHop_read * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeId_1read +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1read (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: NetworkGraph_free + * Method: FirstHopCandidate_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FirstHopCandidate_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ReadOnlyNetworkGraph_free - * Signature: (J)V + * Method: FirstHopCandidate_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FirstHopCandidate_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NetworkUpdate_free + * Method: FirstHopCandidate_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FirstHopCandidate_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: PublicHopCandidate_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PublicHopCandidate_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NetworkUpdate_clone_ptr + * Method: PublicHopCandidate_get_short_channel_id * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PublicHopCandidate_1get_1short_1channel_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NetworkUpdate_clone + * Method: PublicHopCandidate_set_short_channel_id + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PublicHopCandidate_1set_1short_1channel_1id + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: PublicHopCandidate_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PublicHopCandidate_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NetworkUpdate_channel_update_message + * Method: PublicHopCandidate_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1channel_1update_1message +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PublicHopCandidate_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NetworkUpdate_channel_failure - * Signature: (JZ)J + * Method: PrivateHopCandidate_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1channel_1failure - (JNIEnv *, jclass, jlong, jboolean); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PrivateHopCandidate_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NetworkUpdate_node_failure - * Signature: ([BZ)J + * Method: PrivateHopCandidate_clone_ptr + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1node_1failure - (JNIEnv *, jclass, jbyteArray, jboolean); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PrivateHopCandidate_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NetworkUpdate_eq - * Signature: (JJ)Z + * Method: PrivateHopCandidate_clone + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PrivateHopCandidate_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NetworkUpdate_write - * Signature: (J)[B + * Method: BlindedPathCandidate_free + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1write +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPathCandidate_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NetworkUpdate_read - * Signature: ([B)J + * Method: BlindedPathCandidate_clone_ptr + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPathCandidate_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: P2PGossipSync_free - * Signature: (J)V + * Method: BlindedPathCandidate_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPathCandidate_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: P2PGossipSync_new - * Signature: (JJJ)J + * Method: OneHopBlindedPathCandidate_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1new - (JNIEnv *, jclass, jlong, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OneHopBlindedPathCandidate_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: P2PGossipSync_add_utxo_lookup - * Signature: (JJ)V + * Method: OneHopBlindedPathCandidate_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1add_1utxo_1lookup - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OneHopBlindedPathCandidate_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NetworkGraph_handle_network_update - * Signature: (JJ)V + * Method: OneHopBlindedPathCandidate_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1handle_1network_1update - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OneHopBlindedPathCandidate_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NetworkGraph_get_chain_hash - * Signature: (J)[B + * Method: CandidateRouteHop_free + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1get_1chain_1hash +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: verify_node_announcement + * Method: CandidateRouteHop_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_verify_1node_1announcement +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: verify_channel_announcement + * Method: CandidateRouteHop_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_verify_1channel_1announcement +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: P2PGossipSync_as_RoutingMessageHandler + * Method: CandidateRouteHop_first_hop * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1as_1RoutingMessageHandler +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1first_1hop (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: P2PGossipSync_as_MessageSendEventsProvider + * Method: CandidateRouteHop_public_hop * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1as_1MessageSendEventsProvider +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1public_1hop (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelUpdateInfo_free - * Signature: (J)V + * Method: CandidateRouteHop_private_hop + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1private_1hop (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelUpdateInfo_get_last_update - * Signature: (J)I + * Method: CandidateRouteHop_blinded + * Signature: (J)J */ -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1last_1update +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1blinded (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelUpdateInfo_set_last_update - * Signature: (JI)V + * Method: CandidateRouteHop_one_hop_blinded + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1last_1update - (JNIEnv *, jclass, jlong, jint); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1one_1hop_1blinded + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelUpdateInfo_get_enabled - * Signature: (J)Z + * Method: CandidateRouteHop_globally_unique_short_channel_id + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1enabled +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1globally_1unique_1short_1channel_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelUpdateInfo_set_enabled - * Signature: (JZ)V + * Method: CandidateRouteHop_cltv_expiry_delta + * Signature: (J)I */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1enabled - (JNIEnv *, jclass, jlong, jboolean); +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1cltv_1expiry_1delta + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelUpdateInfo_get_cltv_expiry_delta - * Signature: (J)S + * Method: CandidateRouteHop_htlc_minimum_msat + * Signature: (J)J */ -JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1cltv_1expiry_1delta +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1htlc_1minimum_1msat (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelUpdateInfo_set_cltv_expiry_delta - * Signature: (JS)V + * Method: CandidateRouteHop_fees + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1cltv_1expiry_1delta - (JNIEnv *, jclass, jlong, jshort); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1fees + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelUpdateInfo_get_htlc_minimum_msat + * Method: CandidateRouteHop_source * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1htlc_1minimum_1msat +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1source (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelUpdateInfo_set_htlc_minimum_msat - * Signature: (JJ)V + * Method: CandidateRouteHop_target + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1htlc_1minimum_1msat - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1target + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelUpdateInfo_get_htlc_maximum_msat - * Signature: (J)J + * Method: find_route + * Signature: ([BJJ[JJJJ[B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1htlc_1maximum_1msat - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_find_1route + (JNIEnv *, jclass, jbyteArray, jlong, jlong, jlongArray, jlong, jlong, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ChannelUpdateInfo_set_htlc_maximum_msat - * Signature: (JJ)V + * Method: build_route_from_hops + * Signature: ([B[[BJJJ[B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1htlc_1maximum_1msat - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_build_1route_1from_1hops + (JNIEnv *, jclass, jbyteArray, jobjectArray, jlong, jlong, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ChannelUpdateInfo_get_fees - * Signature: (J)J + * Method: ScoreLookUp_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1fees +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoreLookUp_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelUpdateInfo_set_fees - * Signature: (JJ)V + * Method: ScoreUpdate_free + * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1fees - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoreUpdate_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelUpdateInfo_get_last_update_message - * Signature: (J)J + * Method: Score_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1last_1update_1message +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelUpdateInfo_set_last_update_message - * Signature: (JJ)V + * Method: LockableScore_free + * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1last_1update_1message - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockableScore_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelUpdateInfo_new - * Signature: (IZSJJJJ)J + * Method: WriteableScore_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1new - (JNIEnv *, jclass, jint, jboolean, jshort, jlong, jlong, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WriteableScore_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelUpdateInfo_clone_ptr - * Signature: (J)J + * Method: MultiThreadedLockableScore_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1clone_1ptr +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelUpdateInfo_clone + * Method: MultiThreadedLockableScore_as_LockableScore * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1as_1LockableScore (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelUpdateInfo_eq - * Signature: (JJ)Z + * Method: MultiThreadedLockableScore_write + * Signature: (J)[B */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1write + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelUpdateInfo_to_str - * Signature: (J)Ljava/lang/String; + * Method: MultiThreadedLockableScore_as_WriteableScore + * Signature: (J)J */ -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1to_1str +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1as_1WriteableScore (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelUpdateInfo_write - * Signature: (J)[B + * Method: MultiThreadedLockableScore_new + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1write +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1new (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelUpdateInfo_read - * Signature: ([B)J + * Method: MultiThreadedScoreLockRead_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLockRead_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelInfo_free + * Method: MultiThreadedScoreLockWrite_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLockWrite_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelInfo_get_features + * Method: MultiThreadedScoreLockRead_as_ScoreLookUp * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1features +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLockRead_1as_1ScoreLookUp (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelInfo_set_features - * Signature: (JJ)V + * Method: MultiThreadedScoreLockWrite_write + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1features - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLockWrite_1write + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelInfo_get_node_one + * Method: MultiThreadedScoreLockWrite_as_ScoreUpdate * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1one +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLockWrite_1as_1ScoreUpdate (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelInfo_set_node_one - * Signature: (JJ)V + * Method: ChannelUsage_free + * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1one - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelInfo_get_one_to_two + * Method: ChannelUsage_get_amount_msat * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1one_1to_1two +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1amount_1msat (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelInfo_set_one_to_two + * Method: ChannelUsage_set_amount_msat * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1one_1to_1two +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1amount_1msat (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelInfo_get_node_two + * Method: ChannelUsage_get_inflight_htlc_msat * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1two +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1inflight_1htlc_1msat (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelInfo_set_node_two + * Method: ChannelUsage_set_inflight_htlc_msat * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1two +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1inflight_1htlc_1msat (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelInfo_get_two_to_one + * Method: ChannelUsage_get_effective_capacity * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1two_1to_1one +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1effective_1capacity (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelInfo_set_two_to_one + * Method: ChannelUsage_set_effective_capacity * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1two_1to_1one +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1effective_1capacity (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelInfo_get_capacity_sats - * Signature: (J)J + * Method: ChannelUsage_new + * Signature: (JJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1capacity_1sats - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1new + (JNIEnv *, jclass, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelInfo_set_capacity_sats - * Signature: (JJ)V + * Method: ChannelUsage_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1capacity_1sats - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelInfo_get_announcement_message + * Method: ChannelUsage_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1announcement_1message +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelInfo_set_announcement_message - * Signature: (JJ)V + * Method: FixedPenaltyScorer_free + * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1announcement_1message - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelInfo_clone_ptr + * Method: FixedPenaltyScorer_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelInfo_clone + * Method: FixedPenaltyScorer_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelInfo_eq - * Signature: (JJ)Z + * Method: FixedPenaltyScorer_with_penalty + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1with_1penalty + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelInfo_get_directional_info - * Signature: (JB)J + * Method: FixedPenaltyScorer_as_ScoreLookUp + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1directional_1info - (JNIEnv *, jclass, jlong, jbyte); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1as_1ScoreLookUp + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelInfo_to_str - * Signature: (J)Ljava/lang/String; + * Method: FixedPenaltyScorer_as_ScoreUpdate + * Signature: (J)J */ -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1to_1str +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1as_1ScoreUpdate (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelInfo_write + * Method: FixedPenaltyScorer_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelInfo_read - * Signature: ([B)J + * Method: FixedPenaltyScorer_read + * Signature: ([BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1read + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: DirectedChannelInfo_free + * Method: ProbabilisticScorer_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: DirectedChannelInfo_clone_ptr - * Signature: (J)J + * Method: ProbabilisticScoringFeeParameters_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1clone_1ptr +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: DirectedChannelInfo_clone + * Method: ProbabilisticScoringFeeParameters_get_base_penalty_msat * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1base_1penalty_1msat (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: DirectedChannelInfo_channel - * Signature: (J)J + * Method: ProbabilisticScoringFeeParameters_set_base_penalty_msat + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1channel - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1base_1penalty_1msat + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: DirectedChannelInfo_effective_capacity + * Method: ProbabilisticScoringFeeParameters_get_base_penalty_amount_multiplier_msat * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1effective_1capacity +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1base_1penalty_1amount_1multiplier_1msat (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: DirectedChannelInfo_source - * Signature: (J)J + * Method: ProbabilisticScoringFeeParameters_set_base_penalty_amount_multiplier_msat + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1source - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1base_1penalty_1amount_1multiplier_1msat + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: DirectedChannelInfo_target + * Method: ProbabilisticScoringFeeParameters_get_liquidity_penalty_multiplier_msat * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1target +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1liquidity_1penalty_1multiplier_1msat (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: EffectiveCapacity_free - * Signature: (J)V + * Method: ProbabilisticScoringFeeParameters_set_liquidity_penalty_multiplier_msat + * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1liquidity_1penalty_1multiplier_1msat + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: EffectiveCapacity_clone_ptr + * Method: ProbabilisticScoringFeeParameters_get_liquidity_penalty_amount_multiplier_msat * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1liquidity_1penalty_1amount_1multiplier_1msat (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: EffectiveCapacity_clone - * Signature: (J)J + * Method: ProbabilisticScoringFeeParameters_set_liquidity_penalty_amount_multiplier_msat + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1liquidity_1penalty_1amount_1multiplier_1msat + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: EffectiveCapacity_exact_liquidity + * Method: ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_multiplier_msat * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1exact_1liquidity +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1historical_1liquidity_1penalty_1multiplier_1msat (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: EffectiveCapacity_advertised_max_htlc - * Signature: (J)J + * Method: ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_multiplier_msat + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1advertised_1max_1htlc - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1historical_1liquidity_1penalty_1multiplier_1msat + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: EffectiveCapacity_total - * Signature: (JJ)J + * Method: ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_amount_multiplier_msat + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1total - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1historical_1liquidity_1penalty_1amount_1multiplier_1msat + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: EffectiveCapacity_infinite - * Signature: ()J + * Method: ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_amount_multiplier_msat + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1infinite - (JNIEnv *, jclass); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1historical_1liquidity_1penalty_1amount_1multiplier_1msat + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: EffectiveCapacity_hint_max_htlc + * Method: ProbabilisticScoringFeeParameters_get_anti_probing_penalty_msat * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1hint_1max_1htlc +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1anti_1probing_1penalty_1msat (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: EffectiveCapacity_unknown - * Signature: ()J + * Method: ProbabilisticScoringFeeParameters_set_anti_probing_penalty_msat + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1unknown - (JNIEnv *, jclass); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1anti_1probing_1penalty_1msat + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: EffectiveCapacity_as_msat + * Method: ProbabilisticScoringFeeParameters_get_considered_impossible_penalty_msat * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1as_1msat +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1considered_1impossible_1penalty_1msat (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RoutingFees_free - * Signature: (J)V + * Method: ProbabilisticScoringFeeParameters_set_considered_impossible_penalty_msat + * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1considered_1impossible_1penalty_1msat + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: RoutingFees_get_base_msat - * Signature: (J)I + * Method: ProbabilisticScoringFeeParameters_get_linear_success_probability + * Signature: (J)Z */ -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1base_1msat +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1linear_1success_1probability (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RoutingFees_set_base_msat - * Signature: (JI)V + * Method: ProbabilisticScoringFeeParameters_set_linear_success_probability + * Signature: (JZ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1base_1msat - (JNIEnv *, jclass, jlong, jint); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1linear_1success_1probability + (JNIEnv *, jclass, jlong, jboolean); /* * Class: org_ldk_impl_bindings - * Method: RoutingFees_get_proportional_millionths - * Signature: (J)I + * Method: ProbabilisticScoringFeeParameters_clone_ptr + * Signature: (J)J */ -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1proportional_1millionths +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RoutingFees_set_proportional_millionths - * Signature: (JI)V + * Method: ProbabilisticScoringFeeParameters_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1proportional_1millionths - (JNIEnv *, jclass, jlong, jint); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RoutingFees_new - * Signature: (II)J + * Method: ProbabilisticScoringFeeParameters_default + * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1new - (JNIEnv *, jclass, jint, jint); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1default + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: RoutingFees_eq - * Signature: (JJ)Z + * Method: ProbabilisticScoringFeeParameters_add_banned + * Signature: (JJ)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RoutingFees_1eq +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1add_1banned (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: RoutingFees_clone_ptr - * Signature: (J)J + * Method: ProbabilisticScoringFeeParameters_add_banned_from_list + * Signature: (J[J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1add_1banned_1from_1list + (JNIEnv *, jclass, jlong, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: RoutingFees_clone - * Signature: (J)J + * Method: ProbabilisticScoringFeeParameters_remove_banned + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1remove_1banned + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: RoutingFees_hash - * Signature: (J)J + * Method: ProbabilisticScoringFeeParameters_set_manual_penalty + * Signature: (JJJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1hash - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1manual_1penalty + (JNIEnv *, jclass, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: RoutingFees_write - * Signature: (J)[B + * Method: ProbabilisticScoringFeeParameters_remove_manual_penalty + * Signature: (JJ)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RoutingFees_1write - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1remove_1manual_1penalty + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: RoutingFees_read - * Signature: ([B)J + * Method: ProbabilisticScoringFeeParameters_clear_manual_penalties + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1clear_1manual_1penalties + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeAnnouncementInfo_free + * Method: ProbabilisticScoringDecayParameters_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeAnnouncementInfo_get_features + * Method: ProbabilisticScoringDecayParameters_get_historical_no_updates_half_life * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1features +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1get_1historical_1no_1updates_1half_1life (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeAnnouncementInfo_set_features + * Method: ProbabilisticScoringDecayParameters_set_historical_no_updates_half_life * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1features +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1set_1historical_1no_1updates_1half_1life (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeAnnouncementInfo_get_last_update - * Signature: (J)I + * Method: ProbabilisticScoringDecayParameters_get_liquidity_offset_half_life + * Signature: (J)J */ -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1last_1update +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1get_1liquidity_1offset_1half_1life (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeAnnouncementInfo_set_last_update - * Signature: (JI)V + * Method: ProbabilisticScoringDecayParameters_set_liquidity_offset_half_life + * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1last_1update - (JNIEnv *, jclass, jlong, jint); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1set_1liquidity_1offset_1half_1life + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeAnnouncementInfo_get_rgb - * Signature: (J)[B + * Method: ProbabilisticScoringDecayParameters_new + * Signature: (JJ)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1rgb - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1new + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeAnnouncementInfo_set_rgb - * Signature: (J[B)V + * Method: ProbabilisticScoringDecayParameters_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1rgb - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeAnnouncementInfo_get_alias + * Method: ProbabilisticScoringDecayParameters_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1alias +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeAnnouncementInfo_set_alias - * Signature: (JJ)V + * Method: ProbabilisticScoringDecayParameters_default + * Signature: ()J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1alias - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1default + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: NodeAnnouncementInfo_get_announcement_message - * Signature: (J)J + * Method: ProbabilisticScorer_new + * Signature: (JJJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1new + (JNIEnv *, jclass, jlong, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ProbabilisticScorer_debug_log_liquidity_stats + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1announcement_1message +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1debug_1log_1liquidity_1stats (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeAnnouncementInfo_set_announcement_message - * Signature: (JJ)V + * Method: ProbabilisticScorer_estimated_channel_liquidity_range + * Signature: (JJJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1announcement_1message - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1estimated_1channel_1liquidity_1range + (JNIEnv *, jclass, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeAnnouncementInfo_new - * Signature: (JI[BJJ)J + * Method: ProbabilisticScorer_historical_estimated_channel_liquidity_probabilities + * Signature: (JJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1new - (JNIEnv *, jclass, jlong, jint, jbyteArray, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1historical_1estimated_1channel_1liquidity_1probabilities + (JNIEnv *, jclass, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeAnnouncementInfo_clone_ptr - * Signature: (J)J + * Method: ProbabilisticScorer_historical_estimated_payment_success_probability + * Signature: (JJJJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1historical_1estimated_1payment_1success_1probability + (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeAnnouncementInfo_clone + * Method: ProbabilisticScorer_as_ScoreLookUp * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1as_1ScoreLookUp (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeAnnouncementInfo_eq - * Signature: (JJ)Z + * Method: ProbabilisticScorer_as_ScoreUpdate + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1as_1ScoreUpdate + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeAnnouncementInfo_addresses - * Signature: (J)[J + * Method: ProbabilisticScorer_as_Score + * Signature: (J)J */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1addresses +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1as_1Score (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeAnnouncementInfo_write + * Method: ProbabilisticScorer_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeAnnouncementInfo_read - * Signature: ([B)J + * Method: ProbabilisticScorer_read + * Signature: ([BJJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1read + (JNIEnv *, jclass, jbyteArray, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeAlias_free + * Method: DelayedPaymentOutputDescriptor_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAlias_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeAlias_get_a - * Signature: (J)[B + * Method: DelayedPaymentOutputDescriptor_get_outpoint + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAlias_1get_1a +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1outpoint (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeAlias_set_a - * Signature: (J[B)V + * Method: DelayedPaymentOutputDescriptor_set_outpoint + * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAlias_1set_1a - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1outpoint + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeAlias_new - * Signature: ([B)J + * Method: DelayedPaymentOutputDescriptor_get_per_commitment_point + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAlias_1new - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1per_1commitment_1point + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeAlias_clone_ptr - * Signature: (J)J + * Method: DelayedPaymentOutputDescriptor_set_per_commitment_point + * Signature: (J[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAlias_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1per_1commitment_1point + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: NodeAlias_clone - * Signature: (J)J + * Method: DelayedPaymentOutputDescriptor_get_to_self_delay + * Signature: (J)S */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAlias_1clone +JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1to_1self_1delay (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeAlias_hash + * Method: DelayedPaymentOutputDescriptor_set_to_self_delay + * Signature: (JS)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1to_1self_1delay + (JNIEnv *, jclass, jlong, jshort); + +/* + * Class: org_ldk_impl_bindings + * Method: DelayedPaymentOutputDescriptor_get_output * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAlias_1hash +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1output (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeAlias_eq - * Signature: (JJ)Z + * Method: DelayedPaymentOutputDescriptor_set_output + * Signature: (JJ)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeAlias_1eq +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1output (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeAlias_to_str - * Signature: (J)Ljava/lang/String; + * Method: DelayedPaymentOutputDescriptor_get_revocation_pubkey + * Signature: (J)J */ -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_NodeAlias_1to_1str +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1revocation_1pubkey (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeAlias_write - * Signature: (J)[B + * Method: DelayedPaymentOutputDescriptor_set_revocation_pubkey + * Signature: (JJ)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAlias_1write - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1revocation_1pubkey + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeAlias_read - * Signature: ([B)J + * Method: DelayedPaymentOutputDescriptor_get_channel_keys_id + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAlias_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1keys_1id + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeInfo_free - * Signature: (J)V + * Method: DelayedPaymentOutputDescriptor_set_channel_keys_id + * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1keys_1id + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: NodeInfo_get_channels - * Signature: (J)[J + * Method: DelayedPaymentOutputDescriptor_get_channel_value_satoshis + * Signature: (J)J */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1channels +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1value_1satoshis (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeInfo_set_channels - * Signature: (J[J)V + * Method: DelayedPaymentOutputDescriptor_set_channel_value_satoshis + * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1channels - (JNIEnv *, jclass, jlong, jlongArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1value_1satoshis + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeInfo_get_announcement_info + * Method: DelayedPaymentOutputDescriptor_get_channel_transaction_parameters * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1announcement_1info +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1transaction_1parameters (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeInfo_set_announcement_info + * Method: DelayedPaymentOutputDescriptor_set_channel_transaction_parameters * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1announcement_1info +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1transaction_1parameters (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeInfo_new - * Signature: ([JJ)J + * Method: DelayedPaymentOutputDescriptor_new + * Signature: (J[BSJJ[BJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1new - (JNIEnv *, jclass, jlongArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1new + (JNIEnv *, jclass, jlong, jbyteArray, jshort, jlong, jlong, jbyteArray, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeInfo_clone_ptr + * Method: DelayedPaymentOutputDescriptor_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeInfo_clone + * Method: DelayedPaymentOutputDescriptor_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeInfo_eq + * Method: DelayedPaymentOutputDescriptor_hash + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1hash + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DelayedPaymentOutputDescriptor_eq * Signature: (JJ)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeInfo_1eq +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1eq (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeInfo_is_tor_only - * Signature: (J)Z + * Method: DelayedPaymentOutputDescriptor_write + * Signature: (J)[B */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeInfo_1is_1tor_1only +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeInfo_to_str - * Signature: (J)Ljava/lang/String; + * Method: DelayedPaymentOutputDescriptor_read + * Signature: ([B)J */ -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_NodeInfo_1to_1str - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: NodeInfo_write - * Signature: (J)[B + * Method: StaticPaymentOutputDescriptor_free + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeInfo_1write +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeInfo_read - * Signature: ([B)J + * Method: StaticPaymentOutputDescriptor_get_outpoint + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1outpoint + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NetworkGraph_write - * Signature: (J)[B + * Method: StaticPaymentOutputDescriptor_set_outpoint + * Signature: (JJ)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1write - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1outpoint + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: NetworkGraph_read - * Signature: ([BJ)J + * Method: StaticPaymentOutputDescriptor_get_output + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1output + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NetworkGraph_to_str - * Signature: (J)Ljava/lang/String; + * Method: StaticPaymentOutputDescriptor_set_output + * Signature: (JJ)V */ -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1to_1str - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1output + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: NetworkGraph_new - * Signature: (Lorg/ldk/enums/Network;J)J + * Method: StaticPaymentOutputDescriptor_get_channel_keys_id + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1new - (JNIEnv *, jclass, jobject, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1keys_1id + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NetworkGraph_read_only - * Signature: (J)J + * Method: StaticPaymentOutputDescriptor_set_channel_keys_id + * Signature: (J[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read_1only - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1keys_1id + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: NetworkGraph_get_last_rapid_gossip_sync_timestamp + * Method: StaticPaymentOutputDescriptor_get_channel_value_satoshis * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1get_1last_1rapid_1gossip_1sync_1timestamp +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1value_1satoshis (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NetworkGraph_set_last_rapid_gossip_sync_timestamp - * Signature: (JI)V + * Method: StaticPaymentOutputDescriptor_set_channel_value_satoshis + * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1set_1last_1rapid_1gossip_1sync_1timestamp - (JNIEnv *, jclass, jlong, jint); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1value_1satoshis + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: NetworkGraph_update_node_from_announcement - * Signature: (JJ)J + * Method: StaticPaymentOutputDescriptor_get_channel_transaction_parameters + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1node_1from_1announcement - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1transaction_1parameters + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NetworkGraph_update_node_from_unsigned_announcement - * Signature: (JJ)J + * Method: StaticPaymentOutputDescriptor_set_channel_transaction_parameters + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1node_1from_1unsigned_1announcement +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1transaction_1parameters (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: NetworkGraph_update_channel_from_announcement - * Signature: (JJJ)J + * Method: StaticPaymentOutputDescriptor_new + * Signature: (JJ[BJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel_1from_1announcement - (JNIEnv *, jclass, jlong, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1new + (JNIEnv *, jclass, jlong, jlong, jbyteArray, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: NetworkGraph_update_channel_from_announcement_no_lookup - * Signature: (JJ)J + * Method: StaticPaymentOutputDescriptor_clone_ptr + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel_1from_1announcement_1no_1lookup - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NetworkGraph_update_channel_from_unsigned_announcement - * Signature: (JJJ)J + * Method: StaticPaymentOutputDescriptor_clone + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel_1from_1unsigned_1announcement - (JNIEnv *, jclass, jlong, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NetworkGraph_add_channel_from_partial_announcement - * Signature: (JJJJ[B[B)J + * Method: StaticPaymentOutputDescriptor_hash + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1add_1channel_1from_1partial_1announcement - (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jbyteArray, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1hash + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NetworkGraph_channel_failed_permanent - * Signature: (JJ)V + * Method: StaticPaymentOutputDescriptor_eq + * Signature: (JJ)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1channel_1failed_1permanent +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1eq (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: NetworkGraph_node_failed_permanent - * Signature: (J[B)V + * Method: StaticPaymentOutputDescriptor_witness_script + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1node_1failed_1permanent - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1witness_1script + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NetworkGraph_remove_stale_channels_and_tracking - * Signature: (J)V + * Method: StaticPaymentOutputDescriptor_max_witness_length + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1remove_1stale_1channels_1and_1tracking +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1max_1witness_1length (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NetworkGraph_remove_stale_channels_and_tracking_with_time - * Signature: (JJ)V + * Method: StaticPaymentOutputDescriptor_write + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1remove_1stale_1channels_1and_1tracking_1with_1time - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1write + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NetworkGraph_update_channel - * Signature: (JJ)J + * Method: StaticPaymentOutputDescriptor_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: NetworkGraph_update_channel_unsigned - * Signature: (JJ)J + * Method: SpendableOutputDescriptor_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel_1unsigned - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NetworkGraph_verify_channel_update - * Signature: (JJ)J + * Method: SpendableOutputDescriptor_clone_ptr + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1verify_1channel_1update - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ReadOnlyNetworkGraph_channel - * Signature: (JJ)J + * Method: SpendableOutputDescriptor_clone + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1channel - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ReadOnlyNetworkGraph_list_channels - * Signature: (J)[J + * Method: SpendableOutputDescriptor_static_output + * Signature: (JJ[B)J */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1list_1channels - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1static_1output + (JNIEnv *, jclass, jlong, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ReadOnlyNetworkGraph_node - * Signature: (JJ)J + * Method: SpendableOutputDescriptor_delayed_payment_output + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1node - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1delayed_1payment_1output + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ReadOnlyNetworkGraph_list_nodes - * Signature: (J)[J + * Method: SpendableOutputDescriptor_static_payment_output + * Signature: (J)J */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1list_1nodes +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1static_1payment_1output (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ReadOnlyNetworkGraph_get_addresses - * Signature: (J[B)J + * Method: SpendableOutputDescriptor_hash + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1get_1addresses - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1hash + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: DefaultRouter_free - * Signature: (J)V + * Method: SpendableOutputDescriptor_eq + * Signature: (JJ)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: DefaultRouter_new - * Signature: (JJJJJ)J + * Method: SpendableOutputDescriptor_write + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1new - (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1write + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: DefaultRouter_as_Router - * Signature: (J)J + * Method: SpendableOutputDescriptor_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1as_1Router - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: DefaultRouter_as_MessageRouter - * Signature: (J)J + * Method: SpendableOutputDescriptor_create_spendable_outputs_psbt + * Signature: ([J[J[BIJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1as_1MessageRouter - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1create_1spendable_1outputs_1psbt + (JNIEnv *, jclass, jlongArray, jlongArray, jbyteArray, jint, jlong); /* * Class: org_ldk_impl_bindings - * Method: Router_free + * Method: ChannelDerivationParameters_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Router_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ScorerAccountingForInFlightHtlcs_free - * Signature: (J)V + * Method: ChannelDerivationParameters_get_value_satoshis + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1get_1value_1satoshis (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ScorerAccountingForInFlightHtlcs_new - * Signature: (JJ)J + * Method: ChannelDerivationParameters_set_value_satoshis + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1new +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1set_1value_1satoshis (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ScorerAccountingForInFlightHtlcs_as_ScoreLookUp - * Signature: (J)J + * Method: ChannelDerivationParameters_get_keys_id + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1as_1ScoreLookUp +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1get_1keys_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InFlightHtlcs_free - * Signature: (J)V + * Method: ChannelDerivationParameters_set_keys_id + * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1set_1keys_1id + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: InFlightHtlcs_clone_ptr + * Method: ChannelDerivationParameters_get_transaction_parameters * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1get_1transaction_1parameters (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InFlightHtlcs_clone - * Signature: (J)J + * Method: ChannelDerivationParameters_set_transaction_parameters + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1set_1transaction_1parameters + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InFlightHtlcs_new - * Signature: ()J + * Method: ChannelDerivationParameters_new + * Signature: (J[BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1new - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1new + (JNIEnv *, jclass, jlong, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: InFlightHtlcs_process_path - * Signature: (JJ[B)V + * Method: ChannelDerivationParameters_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1process_1path - (JNIEnv *, jclass, jlong, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InFlightHtlcs_add_inflight_htlc - * Signature: (JJJJJ)V + * Method: ChannelDerivationParameters_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1add_1inflight_1htlc - (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InFlightHtlcs_used_liquidity_msat - * Signature: (JJJJ)J + * Method: ChannelDerivationParameters_eq + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1used_1liquidity_1msat - (JNIEnv *, jclass, jlong, jlong, jlong, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InFlightHtlcs_write + * Method: ChannelDerivationParameters_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InFlightHtlcs_read + * Method: ChannelDerivationParameters_read * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1read +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1read (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: RouteHop_free + * Method: HTLCDescriptor_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHop_get_pubkey + * Method: HTLCDescriptor_get_channel_derivation_parameters + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1channel_1derivation_1parameters + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: HTLCDescriptor_set_channel_derivation_parameters + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1channel_1derivation_1parameters + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: HTLCDescriptor_get_commitment_txid * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1pubkey +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1commitment_1txid (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHop_set_pubkey + * Method: HTLCDescriptor_set_commitment_txid * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1pubkey +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1commitment_1txid (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: RouteHop_get_node_features + * Method: HTLCDescriptor_get_per_commitment_number * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1node_1features +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1per_1commitment_1number (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHop_set_node_features + * Method: HTLCDescriptor_set_per_commitment_number * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1node_1features +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1per_1commitment_1number (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHop_get_short_channel_id - * Signature: (J)J + * Method: HTLCDescriptor_get_per_commitment_point + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1short_1channel_1id +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1per_1commitment_1point (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHop_set_short_channel_id - * Signature: (JJ)V + * Method: HTLCDescriptor_set_per_commitment_point + * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1short_1channel_1id - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1per_1commitment_1point + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: RouteHop_get_channel_features - * Signature: (J)J + * Method: HTLCDescriptor_get_feerate_per_kw + * Signature: (J)I */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1channel_1features +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1feerate_1per_1kw (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHop_set_channel_features - * Signature: (JJ)V + * Method: HTLCDescriptor_set_feerate_per_kw + * Signature: (JI)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1channel_1features - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1feerate_1per_1kw + (JNIEnv *, jclass, jlong, jint); /* * Class: org_ldk_impl_bindings - * Method: RouteHop_get_fee_msat + * Method: HTLCDescriptor_get_htlc * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1fee_1msat +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1htlc (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHop_set_fee_msat + * Method: HTLCDescriptor_set_htlc * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1fee_1msat +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1htlc (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHop_get_cltv_expiry_delta - * Signature: (J)I + * Method: HTLCDescriptor_get_preimage + * Signature: (J)J */ -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1cltv_1expiry_1delta +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1preimage (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHop_set_cltv_expiry_delta - * Signature: (JI)V + * Method: HTLCDescriptor_set_preimage + * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1cltv_1expiry_1delta - (JNIEnv *, jclass, jlong, jint); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1preimage + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHop_get_maybe_announced_channel - * Signature: (J)Z + * Method: HTLCDescriptor_get_counterparty_sig + * Signature: (J)[B */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1maybe_1announced_1channel +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1counterparty_1sig (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHop_set_maybe_announced_channel - * Signature: (JZ)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1maybe_1announced_1channel - (JNIEnv *, jclass, jlong, jboolean); - -/* - * Class: org_ldk_impl_bindings - * Method: RouteHop_new - * Signature: ([BJJJJIZ)J + * Method: HTLCDescriptor_set_counterparty_sig + * Signature: (J[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1new - (JNIEnv *, jclass, jbyteArray, jlong, jlong, jlong, jlong, jint, jboolean); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1counterparty_1sig + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: RouteHop_clone_ptr - * Signature: (J)J + * Method: HTLCDescriptor_new + * Signature: (J[BJ[BIJJ[B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1new + (JNIEnv *, jclass, jlong, jbyteArray, jlong, jbyteArray, jint, jlong, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: RouteHop_clone + * Method: HTLCDescriptor_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHop_hash + * Method: HTLCDescriptor_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1hash +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHop_eq + * Method: HTLCDescriptor_eq * Signature: (JJ)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHop_1eq +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1eq (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHop_write + * Method: HTLCDescriptor_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RouteHop_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHop_read + * Method: HTLCDescriptor_read * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1read +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1read (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: BlindedTail_free - * Signature: (J)V + * Method: HTLCDescriptor_outpoint + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedTail_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1outpoint (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedTail_get_hops - * Signature: (J)[J + * Method: HTLCDescriptor_previous_utxo + * Signature: (J)J */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_BlindedTail_1get_1hops +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1previous_1utxo (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedTail_set_hops - * Signature: (J[J)V + * Method: HTLCDescriptor_unsigned_tx_input + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedTail_1set_1hops - (JNIEnv *, jclass, jlong, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1unsigned_1tx_1input + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedTail_get_blinding_point - * Signature: (J)[B + * Method: HTLCDescriptor_tx_output + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BlindedTail_1get_1blinding_1point +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1tx_1output (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedTail_set_blinding_point - * Signature: (J[B)V + * Method: HTLCDescriptor_witness_script + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedTail_1set_1blinding_1point - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1witness_1script + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedTail_get_excess_final_cltv_expiry_delta - * Signature: (J)I + * Method: HTLCDescriptor_tx_input_witness + * Signature: (J[B[B)[B */ -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_BlindedTail_1get_1excess_1final_1cltv_1expiry_1delta - (JNIEnv *, jclass, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1tx_1input_1witness + (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: BlindedTail_set_excess_final_cltv_expiry_delta - * Signature: (JI)V + * Method: HTLCDescriptor_derive_channel_signer + * Signature: (JJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedTail_1set_1excess_1final_1cltv_1expiry_1delta - (JNIEnv *, jclass, jlong, jint); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1derive_1channel_1signer + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedTail_get_final_value_msat - * Signature: (J)J + * Method: ChannelSigner_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedTail_1get_1final_1value_1msat +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelSigner_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedTail_set_final_value_msat - * Signature: (JJ)V + * Method: Recipient_clone + * Signature: (J)Lorg/ldk/enums/Recipient; */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedTail_1set_1final_1value_1msat - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Recipient_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedTail_new - * Signature: ([J[BIJ)J + * Method: Recipient_node + * Signature: ()Lorg/ldk/enums/Recipient; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedTail_1new - (JNIEnv *, jclass, jlongArray, jbyteArray, jint, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Recipient_1node + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: BlindedTail_clone_ptr - * Signature: (J)J + * Method: Recipient_phantom_node + * Signature: ()Lorg/ldk/enums/Recipient; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedTail_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Recipient_1phantom_1node + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: BlindedTail_clone - * Signature: (J)J + * Method: EntropySource_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedTail_1clone +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EntropySource_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedTail_hash - * Signature: (J)J + * Method: NodeSigner_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedTail_1hash +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeSigner_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedTail_eq - * Signature: (JJ)Z + * Method: OutputSpender_free + * Signature: (J)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedTail_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutputSpender_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedTail_write - * Signature: (J)[B + * Method: SignerProvider_free + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BlindedTail_1write +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignerProvider_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedTail_read - * Signature: ([B)J + * Method: ChangeDestinationSource_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedTail_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChangeDestinationSource_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Path_free + * Method: InMemorySigner_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Path_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Path_get_hops - * Signature: (J)[J + * Method: InMemorySigner_get_funding_key + * Signature: (J)[B */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_Path_1get_1hops +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1funding_1key (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Path_set_hops - * Signature: (J[J)V + * Method: InMemorySigner_set_funding_key + * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Path_1set_1hops - (JNIEnv *, jclass, jlong, jlongArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1funding_1key + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: Path_get_blinded_tail - * Signature: (J)J + * Method: InMemorySigner_get_revocation_base_key + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Path_1get_1blinded_1tail +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1revocation_1base_1key (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Path_set_blinded_tail - * Signature: (JJ)V + * Method: InMemorySigner_set_revocation_base_key + * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Path_1set_1blinded_1tail - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1revocation_1base_1key + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: Path_new - * Signature: ([JJ)J + * Method: InMemorySigner_get_payment_key + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Path_1new - (JNIEnv *, jclass, jlongArray, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1payment_1key + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Path_clone_ptr - * Signature: (J)J + * Method: InMemorySigner_set_payment_key + * Signature: (J[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Path_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1payment_1key + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: Path_clone - * Signature: (J)J + * Method: InMemorySigner_get_delayed_payment_base_key + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Path_1clone +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1delayed_1payment_1base_1key (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Path_hash - * Signature: (J)J + * Method: InMemorySigner_set_delayed_payment_base_key + * Signature: (J[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Path_1hash +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1delayed_1payment_1base_1key + (JNIEnv *, jclass, jlong, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: InMemorySigner_get_htlc_base_key + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1htlc_1base_1key (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Path_eq - * Signature: (JJ)Z + * Method: InMemorySigner_set_htlc_base_key + * Signature: (J[B)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Path_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1htlc_1base_1key + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: Path_fee_msat - * Signature: (J)J + * Method: InMemorySigner_get_commitment_seed + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Path_1fee_1msat +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1commitment_1seed (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Path_final_value_msat - * Signature: (J)J + * Method: InMemorySigner_set_commitment_seed + * Signature: (J[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Path_1final_1value_1msat - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1commitment_1seed + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: Path_final_cltv_expiry_delta + * Method: InMemorySigner_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Path_1final_1cltv_1expiry_1delta +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Route_free - * Signature: (J)V + * Method: InMemorySigner_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Route_get_paths - * Signature: (J)[J + * Method: InMemorySigner_new + * Signature: ([B[B[B[B[B[BJ[B[B)J */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_Route_1get_1paths - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1new + (JNIEnv *, jclass, jbyteArray, jbyteArray, jbyteArray, jbyteArray, jbyteArray, jbyteArray, jlong, jbyteArray, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: Route_set_paths - * Signature: (J[J)V + * Method: InMemorySigner_counterparty_pubkeys + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1paths - (JNIEnv *, jclass, jlong, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterparty_1pubkeys + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Route_get_route_params + * Method: InMemorySigner_counterparty_selected_contest_delay * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1get_1route_1params +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterparty_1selected_1contest_1delay (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Route_set_route_params - * Signature: (JJ)V + * Method: InMemorySigner_holder_selected_contest_delay + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1route_1params - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1holder_1selected_1contest_1delay + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Route_new - * Signature: ([JJ)J + * Method: InMemorySigner_is_outbound + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1new - (JNIEnv *, jclass, jlongArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1is_1outbound + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Route_clone_ptr + * Method: InMemorySigner_funding_outpoint * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1funding_1outpoint (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Route_clone + * Method: InMemorySigner_get_channel_parameters * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1channel_1parameters (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Route_hash + * Method: InMemorySigner_channel_type_features * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1hash +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1channel_1type_1features (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Route_eq - * Signature: (JJ)Z + * Method: InMemorySigner_sign_counterparty_payment_input + * Signature: (J[BJJ)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Route_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1counterparty_1payment_1input + (JNIEnv *, jclass, jlong, jbyteArray, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Route_get_total_fees + * Method: InMemorySigner_sign_dynamic_p2wsh_input + * Signature: (J[BJJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1dynamic_1p2wsh_1input + (JNIEnv *, jclass, jlong, jbyteArray, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InMemorySigner_as_EntropySource * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1get_1total_1fees +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1EntropySource (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Route_get_total_amount + * Method: InMemorySigner_as_ChannelSigner * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1get_1total_1amount +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1ChannelSigner (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Route_to_str - * Signature: (J)Ljava/lang/String; + * Method: InMemorySigner_as_EcdsaChannelSigner + * Signature: (J)J */ -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Route_1to_1str +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1EcdsaChannelSigner (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Route_write + * Method: InMemorySigner_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Route_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Route_read - * Signature: ([B)J + * Method: InMemorySigner_read + * Signature: ([BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1read + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteParameters_free + * Method: KeysManager_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysManager_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteParameters_get_payment_params - * Signature: (J)J + * Method: KeysManager_new + * Signature: ([BJI)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1payment_1params +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1new + (JNIEnv *, jclass, jbyteArray, jlong, jint); + +/* + * Class: org_ldk_impl_bindings + * Method: KeysManager_get_node_secret_key + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_KeysManager_1get_1node_1secret_1key (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteParameters_set_payment_params - * Signature: (JJ)V + * Method: KeysManager_derive_channel_keys + * Signature: (JJ[B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1payment_1params - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1derive_1channel_1keys + (JNIEnv *, jclass, jlong, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: RouteParameters_get_final_value_msat + * Method: KeysManager_sign_spendable_outputs_psbt + * Signature: (J[J[B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1sign_1spendable_1outputs_1psbt + (JNIEnv *, jclass, jlong, jlongArray, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: KeysManager_as_EntropySource * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1final_1value_1msat +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1EntropySource (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteParameters_set_final_value_msat - * Signature: (JJ)V + * Method: KeysManager_as_NodeSigner + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1final_1value_1msat - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1NodeSigner + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteParameters_get_max_total_routing_fee_msat + * Method: KeysManager_as_OutputSpender * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1max_1total_1routing_1fee_1msat +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1OutputSpender (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteParameters_set_max_total_routing_fee_msat - * Signature: (JJ)V + * Method: KeysManager_as_SignerProvider + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1max_1total_1routing_1fee_1msat - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1SignerProvider + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteParameters_new - * Signature: (JJJ)J + * Method: PhantomKeysManager_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteParameters_1new - (JNIEnv *, jclass, jlong, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteParameters_clone_ptr + * Method: PhantomKeysManager_as_EntropySource * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteParameters_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1as_1EntropySource (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteParameters_clone + * Method: PhantomKeysManager_as_NodeSigner * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteParameters_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1as_1NodeSigner (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteParameters_hash + * Method: PhantomKeysManager_as_OutputSpender * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteParameters_1hash +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1as_1OutputSpender (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteParameters_eq - * Signature: (JJ)Z + * Method: PhantomKeysManager_as_SignerProvider + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteParameters_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1as_1SignerProvider + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteParameters_from_payment_params_and_value - * Signature: (JJ)J + * Method: PhantomKeysManager_new + * Signature: ([BJI[B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteParameters_1from_1payment_1params_1and_1value - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1new + (JNIEnv *, jclass, jbyteArray, jlong, jint, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: RouteParameters_write - * Signature: (J)[B + * Method: PhantomKeysManager_derive_channel_keys + * Signature: (JJ[B)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RouteParameters_1write - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1derive_1channel_1keys + (JNIEnv *, jclass, jlong, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: RouteParameters_read - * Signature: ([B)J + * Method: PhantomKeysManager_get_node_secret_key + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteParameters_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1get_1node_1secret_1key + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentParameters_free - * Signature: (J)V + * Method: PhantomKeysManager_get_phantom_node_secret_key + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1free +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1get_1phantom_1node_1secret_1key (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentParameters_get_payee - * Signature: (J)J + * Method: RandomBytes_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1payee +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RandomBytes_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentParameters_set_payee - * Signature: (JJ)V + * Method: RandomBytes_new + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1payee - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RandomBytes_1new + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: PaymentParameters_get_expiry_time + * Method: RandomBytes_as_EntropySource * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1expiry_1time +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RandomBytes_1as_1EntropySource (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentParameters_set_expiry_time - * Signature: (JJ)V + * Method: EcdsaChannelSigner_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1expiry_1time - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_EcdsaChannelSigner_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentParameters_get_max_total_cltv_expiry_delta - * Signature: (J)I + * Method: EcdsaChannelSigner_clone + * Signature: (J)J */ -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1max_1total_1cltv_1expiry_1delta +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_EcdsaChannelSigner_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentParameters_set_max_total_cltv_expiry_delta - * Signature: (JI)V + * Method: EcdsaChannelSigner_free + * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1max_1total_1cltv_1expiry_1delta - (JNIEnv *, jclass, jlong, jint); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EcdsaChannelSigner_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentParameters_get_max_path_count - * Signature: (J)B + * Method: AsyncPaymentsMessageHandler_free + * Signature: (J)V */ -JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1max_1path_1count +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessageHandler_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentParameters_set_max_path_count - * Signature: (JB)V + * Method: AsyncPaymentsMessage_free + * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1max_1path_1count - (JNIEnv *, jclass, jlong, jbyte); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessage_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentParameters_get_max_channel_saturation_power_of_half - * Signature: (J)B + * Method: AsyncPaymentsMessage_clone_ptr + * Signature: (J)J */ -JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1max_1channel_1saturation_1power_1of_1half +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessage_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentParameters_set_max_channel_saturation_power_of_half - * Signature: (JB)V + * Method: AsyncPaymentsMessage_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1max_1channel_1saturation_1power_1of_1half - (JNIEnv *, jclass, jlong, jbyte); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessage_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentParameters_get_previously_failed_channels - * Signature: (J)[J + * Method: AsyncPaymentsMessage_held_htlc_available + * Signature: (J)J */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1previously_1failed_1channels +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessage_1held_1htlc_1available (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentParameters_set_previously_failed_channels - * Signature: (J[J)V + * Method: AsyncPaymentsMessage_release_held_htlc + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1previously_1failed_1channels - (JNIEnv *, jclass, jlong, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessage_1release_1held_1htlc + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentParameters_get_previously_failed_blinded_path_idxs - * Signature: (J)[J + * Method: HeldHtlcAvailable_free + * Signature: (J)V */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1previously_1failed_1blinded_1path_1idxs +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HeldHtlcAvailable_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentParameters_set_previously_failed_blinded_path_idxs - * Signature: (J[J)V + * Method: HeldHtlcAvailable_get_payment_release_secret + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1previously_1failed_1blinded_1path_1idxs - (JNIEnv *, jclass, jlong, jlongArray); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HeldHtlcAvailable_1get_1payment_1release_1secret + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentParameters_new - * Signature: (JJIBB[J[J)J + * Method: HeldHtlcAvailable_set_payment_release_secret + * Signature: (J[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1new - (JNIEnv *, jclass, jlong, jlong, jint, jbyte, jbyte, jlongArray, jlongArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HeldHtlcAvailable_1set_1payment_1release_1secret + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: PaymentParameters_clone_ptr - * Signature: (J)J + * Method: HeldHtlcAvailable_new + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HeldHtlcAvailable_1new + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: PaymentParameters_clone + * Method: HeldHtlcAvailable_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HeldHtlcAvailable_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentParameters_hash + * Method: HeldHtlcAvailable_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1hash +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HeldHtlcAvailable_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentParameters_eq - * Signature: (JJ)Z + * Method: ReleaseHeldHtlc_free + * Signature: (J)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReleaseHeldHtlc_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentParameters_write + * Method: ReleaseHeldHtlc_get_payment_release_secret * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReleaseHeldHtlc_1get_1payment_1release_1secret (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentParameters_read - * Signature: ([BI)J + * Method: ReleaseHeldHtlc_set_payment_release_secret + * Signature: (J[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1read - (JNIEnv *, jclass, jbyteArray, jint); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReleaseHeldHtlc_1set_1payment_1release_1secret + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: PaymentParameters_from_node_id - * Signature: ([BI)J + * Method: ReleaseHeldHtlc_new + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1from_1node_1id - (JNIEnv *, jclass, jbyteArray, jint); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReleaseHeldHtlc_1new + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: PaymentParameters_for_keysend - * Signature: ([BIZ)J + * Method: ReleaseHeldHtlc_clone_ptr + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1for_1keysend - (JNIEnv *, jclass, jbyteArray, jint, jboolean); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReleaseHeldHtlc_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentParameters_from_bolt12_invoice + * Method: ReleaseHeldHtlc_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1from_1bolt12_1invoice +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReleaseHeldHtlc_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentParameters_blinded - * Signature: ([J)J + * Method: ReleaseHeldHtlc_as_OnionMessageContents + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1blinded - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReleaseHeldHtlc_1as_1OnionMessageContents + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Payee_free - * Signature: (J)V + * Method: HeldHtlcAvailable_write + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1free +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HeldHtlcAvailable_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Payee_clone_ptr - * Signature: (J)J + * Method: HeldHtlcAvailable_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Payee_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HeldHtlcAvailable_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: Payee_clone - * Signature: (J)J + * Method: ReleaseHeldHtlc_write + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Payee_1clone +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReleaseHeldHtlc_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Payee_blinded - * Signature: ([JJ)J + * Method: ReleaseHeldHtlc_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Payee_1blinded - (JNIEnv *, jclass, jlongArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReleaseHeldHtlc_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: Payee_clear - * Signature: ([B[JJI)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Payee_1clear - (JNIEnv *, jclass, jbyteArray, jlongArray, jlong, jint); - -/* - * Class: org_ldk_impl_bindings - * Method: Payee_hash - * Signature: (J)J + * Method: AsyncPaymentsMessage_is_known_type + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Payee_1hash +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessage_1is_1known_1type (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Payee_eq - * Signature: (JJ)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Payee_1eq - (JNIEnv *, jclass, jlong, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: RouteHint_free - * Signature: (J)V + * Method: AsyncPaymentsMessage_as_OnionMessageContents + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessage_1as_1OnionMessageContents (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHint_get_a - * Signature: (J)[J + * Method: AsyncPaymentsMessage_write + * Signature: (J)[B */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1a +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessage_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHint_set_a - * Signature: (J[J)V + * Method: AsyncPaymentsMessage_read + * Signature: ([BJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1a - (JNIEnv *, jclass, jlong, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessage_1read + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHint_new - * Signature: ([J)J + * Method: OnionMessenger_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1new - (JNIEnv *, jclass, jlongArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHint_clone_ptr - * Signature: (J)J + * Method: Responder_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1clone_1ptr +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Responder_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHint_clone + * Method: Responder_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Responder_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHint_hash + * Method: Responder_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1hash +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Responder_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHint_eq + * Method: Responder_eq * Signature: (JJ)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHint_1eq +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Responder_1eq (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHint_write + * Method: Responder_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Responder_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHint_read + * Method: Responder_read * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1read +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Responder_1read (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: RouteHintHop_free - * Signature: (J)V + * Method: Responder_respond + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Responder_1respond (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHintHop_get_src_node_id - * Signature: (J)[B + * Method: Responder_respond_with_reply_path + * Signature: (JJ)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1src_1node_1id - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Responder_1respond_1with_1reply_1path + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHintHop_set_src_node_id - * Signature: (J[B)V + * Method: ResponseInstruction_free + * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1src_1node_1id - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ResponseInstruction_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHintHop_get_short_channel_id + * Method: ResponseInstruction_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1short_1channel_1id +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ResponseInstruction_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHintHop_set_short_channel_id - * Signature: (JJ)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1short_1channel_1id - (JNIEnv *, jclass, jlong, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: RouteHintHop_get_fees + * Method: ResponseInstruction_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1fees +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ResponseInstruction_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHintHop_set_fees - * Signature: (JJ)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1fees - (JNIEnv *, jclass, jlong, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: RouteHintHop_get_cltv_expiry_delta - * Signature: (J)S + * Method: MessageSendInstructions_free + * Signature: (J)V */ -JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1cltv_1expiry_1delta +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendInstructions_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHintHop_set_cltv_expiry_delta - * Signature: (JS)V + * Method: MessageSendInstructions_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1cltv_1expiry_1delta - (JNIEnv *, jclass, jlong, jshort); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendInstructions_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHintHop_get_htlc_minimum_msat + * Method: MessageSendInstructions_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1htlc_1minimum_1msat +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendInstructions_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHintHop_set_htlc_minimum_msat - * Signature: (JJ)V + * Method: MessageSendInstructions_with_specified_reply_path + * Signature: (JJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1htlc_1minimum_1msat +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendInstructions_1with_1specified_1reply_1path (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHintHop_get_htlc_maximum_msat - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1htlc_1maximum_1msat - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: RouteHintHop_set_htlc_maximum_msat - * Signature: (JJ)V + * Method: MessageSendInstructions_with_reply_path + * Signature: (JJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1htlc_1maximum_1msat +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendInstructions_1with_1reply_1path (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHintHop_new - * Signature: ([BJJSJJ)J + * Method: MessageSendInstructions_without_reply_path + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1new - (JNIEnv *, jclass, jbyteArray, jlong, jlong, jshort, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendInstructions_1without_1reply_1path + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHintHop_clone_ptr + * Method: MessageSendInstructions_for_reply * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendInstructions_1for_1reply (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHintHop_clone - * Signature: (J)J + * Method: MessageRouter_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1clone +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageRouter_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHintHop_hash - * Signature: (J)J + * Method: DefaultMessageRouter_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1hash +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DefaultMessageRouter_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHintHop_eq - * Signature: (JJ)Z + * Method: DefaultMessageRouter_new + * Signature: (JJ)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1eq +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DefaultMessageRouter_1new (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHintHop_write - * Signature: (J)[B + * Method: DefaultMessageRouter_as_MessageRouter + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1write +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DefaultMessageRouter_1as_1MessageRouter (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RouteHintHop_read - * Signature: ([B)J + * Method: OnionMessagePath_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FirstHopCandidate_free - * Signature: (J)V + * Method: OnionMessagePath_get_intermediate_nodes + * Signature: (J)[[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FirstHopCandidate_1free +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1get_1intermediate_1nodes (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FirstHopCandidate_clone_ptr - * Signature: (J)J + * Method: OnionMessagePath_set_intermediate_nodes + * Signature: (J[[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FirstHopCandidate_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1set_1intermediate_1nodes + (JNIEnv *, jclass, jlong, jobjectArray); /* * Class: org_ldk_impl_bindings - * Method: FirstHopCandidate_clone + * Method: OnionMessagePath_get_destination * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FirstHopCandidate_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1get_1destination (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PublicHopCandidate_free - * Signature: (J)V + * Method: OnionMessagePath_set_destination + * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PublicHopCandidate_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1set_1destination + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: PublicHopCandidate_get_short_channel_id + * Method: OnionMessagePath_get_first_node_addresses * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PublicHopCandidate_1get_1short_1channel_1id +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1get_1first_1node_1addresses (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PublicHopCandidate_set_short_channel_id + * Method: OnionMessagePath_set_first_node_addresses * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PublicHopCandidate_1set_1short_1channel_1id +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1set_1first_1node_1addresses (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: PublicHopCandidate_clone_ptr - * Signature: (J)J + * Method: OnionMessagePath_new + * Signature: ([[BJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PublicHopCandidate_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1new + (JNIEnv *, jclass, jobjectArray, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: PublicHopCandidate_clone + * Method: OnionMessagePath_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PublicHopCandidate_1clone - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: PrivateHopCandidate_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PrivateHopCandidate_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PrivateHopCandidate_clone_ptr + * Method: OnionMessagePath_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PrivateHopCandidate_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PrivateHopCandidate_clone - * Signature: (J)J + * Method: OnionMessagePath_first_node + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PrivateHopCandidate_1clone +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1first_1node (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedPathCandidate_free + * Method: Destination_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPathCandidate_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Destination_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedPathCandidate_clone_ptr + * Method: Destination_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPathCandidate_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Destination_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedPathCandidate_clone + * Method: Destination_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPathCandidate_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Destination_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OneHopBlindedPathCandidate_free - * Signature: (J)V + * Method: Destination_node + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OneHopBlindedPathCandidate_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Destination_1node + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: OneHopBlindedPathCandidate_clone_ptr + * Method: Destination_blinded_path * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OneHopBlindedPathCandidate_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Destination_1blinded_1path (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OneHopBlindedPathCandidate_clone + * Method: Destination_hash * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OneHopBlindedPathCandidate_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Destination_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CandidateRouteHop_free - * Signature: (J)V + * Method: Destination_eq + * Signature: (JJ)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Destination_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: CandidateRouteHop_clone_ptr - * Signature: (J)J + * Method: Destination_resolve + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Destination_1resolve + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: CandidateRouteHop_clone - * Signature: (J)J + * Method: SendSuccess_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1clone +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SendSuccess_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CandidateRouteHop_first_hop + * Method: SendSuccess_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1first_1hop +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendSuccess_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CandidateRouteHop_public_hop + * Method: SendSuccess_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1public_1hop +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendSuccess_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CandidateRouteHop_private_hop - * Signature: (J)J + * Method: SendSuccess_buffered + * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1private_1hop - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendSuccess_1buffered + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: CandidateRouteHop_blinded - * Signature: (J)J + * Method: SendSuccess_buffered_awaiting_connection + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1blinded - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendSuccess_1buffered_1awaiting_1connection + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: CandidateRouteHop_one_hop_blinded + * Method: SendSuccess_hash * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1one_1hop_1blinded +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendSuccess_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CandidateRouteHop_globally_unique_short_channel_id - * Signature: (J)J + * Method: SendSuccess_eq + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1globally_1unique_1short_1channel_1id - (JNIEnv *, jclass, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SendSuccess_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: CandidateRouteHop_cltv_expiry_delta - * Signature: (J)I + * Method: SendError_free + * Signature: (J)V */ -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1cltv_1expiry_1delta +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SendError_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CandidateRouteHop_htlc_minimum_msat + * Method: SendError_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1htlc_1minimum_1msat +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendError_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CandidateRouteHop_fees + * Method: SendError_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1fees +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendError_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CandidateRouteHop_source - * Signature: (J)J + * Method: SendError_secp256k1 + * Signature: (Lorg/ldk/enums/Secp256k1Error;)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1source - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendError_1secp256k1 + (JNIEnv *, jclass, jobject); /* * Class: org_ldk_impl_bindings - * Method: CandidateRouteHop_target - * Signature: (J)J + * Method: SendError_too_big_packet + * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CandidateRouteHop_1target - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendError_1too_1big_1packet + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: find_route - * Signature: ([BJJ[JJJJ[B)J + * Method: SendError_too_few_blinded_hops + * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_find_1route - (JNIEnv *, jclass, jbyteArray, jlong, jlong, jlongArray, jlong, jlong, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendError_1too_1few_1blinded_1hops + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: build_route_from_hops - * Signature: ([B[[BJJJ[B)J + * Method: SendError_invalid_first_hop + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_build_1route_1from_1hops - (JNIEnv *, jclass, jbyteArray, jobjectArray, jlong, jlong, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendError_1invalid_1first_1hop + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ScoreLookUp_free - * Signature: (J)V + * Method: SendError_path_not_found + * Signature: ()J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoreLookUp_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendError_1path_1not_1found + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: ScoreUpdate_free - * Signature: (J)V + * Method: SendError_invalid_message + * Signature: ()J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoreUpdate_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendError_1invalid_1message + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: Score_free - * Signature: (J)V + * Method: SendError_buffer_full + * Signature: ()J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendError_1buffer_1full + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: LockableScore_free - * Signature: (J)V + * Method: SendError_get_node_id_failed + * Signature: ()J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockableScore_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendError_1get_1node_1id_1failed + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: WriteableScore_free - * Signature: (J)V + * Method: SendError_unresolved_introduction_node + * Signature: ()J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WriteableScore_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendError_1unresolved_1introduction_1node + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: MultiThreadedLockableScore_free - * Signature: (J)V + * Method: SendError_blinded_path_advance_failed + * Signature: ()J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendError_1blinded_1path_1advance_1failed + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: MultiThreadedLockableScore_as_LockableScore + * Method: SendError_hash * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1as_1LockableScore - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: MultiThreadedLockableScore_write - * Signature: (J)[B - */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1write +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendError_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: MultiThreadedLockableScore_as_WriteableScore - * Signature: (J)J + * Method: SendError_eq + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1as_1WriteableScore - (JNIEnv *, jclass, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SendError_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: MultiThreadedLockableScore_new - * Signature: (J)J + * Method: CustomOnionMessageHandler_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1new +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageHandler_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: MultiThreadedScoreLockRead_free + * Method: PeeledOnion_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLockRead_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeeledOnion_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: MultiThreadedScoreLockWrite_free - * Signature: (J)V + * Method: PeeledOnion_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLockWrite_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeeledOnion_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: MultiThreadedScoreLockRead_as_ScoreLookUp + * Method: PeeledOnion_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLockRead_1as_1ScoreLookUp +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeeledOnion_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: MultiThreadedScoreLockWrite_write - * Signature: (J)[B + * Method: PeeledOnion_forward + * Signature: (JJ)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLockWrite_1write - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeeledOnion_1forward + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: MultiThreadedScoreLockWrite_as_ScoreUpdate - * Signature: (J)J + * Method: PeeledOnion_receive + * Signature: (JJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLockWrite_1as_1ScoreUpdate - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeeledOnion_1receive + (JNIEnv *, jclass, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelUsage_free - * Signature: (J)V + * Method: create_onion_message_resolving_destination + * Signature: (JJJJJJJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create_1onion_1message_1resolving_1destination + (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelUsage_get_amount_msat - * Signature: (J)J + * Method: create_onion_message + * Signature: (JJJJJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1amount_1msat - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create_1onion_1message + (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelUsage_set_amount_msat - * Signature: (JJ)V + * Method: peel_onion_message + * Signature: (JJJJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1amount_1msat - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_peel_1onion_1message + (JNIEnv *, jclass, jlong, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelUsage_get_inflight_htlc_msat - * Signature: (J)J + * Method: OnionMessenger_new + * Signature: (JJJJJJJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1inflight_1htlc_1msat - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1new + (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelUsage_set_inflight_htlc_msat - * Signature: (JJ)V + * Method: OnionMessenger_new_with_offline_peer_interception + * Signature: (JJJJJJJJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1inflight_1htlc_1msat - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1new_1with_1offline_1peer_1interception + (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelUsage_get_effective_capacity - * Signature: (J)J + * Method: OnionMessenger_send_onion_message + * Signature: (JJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1effective_1capacity - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1send_1onion_1message + (JNIEnv *, jclass, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelUsage_set_effective_capacity - * Signature: (JJ)V + * Method: OnionMessenger_forward_onion_message + * Signature: (JJ[B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1effective_1capacity - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1forward_1onion_1message + (JNIEnv *, jclass, jlong, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ChannelUsage_new + * Method: OnionMessenger_handle_onion_message_response * Signature: (JJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1new +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1handle_1onion_1message_1response (JNIEnv *, jclass, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelUsage_clone_ptr + * Method: OnionMessenger_get_update_future * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1get_1update_1future (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelUsage_clone + * Method: OnionMessenger_as_EventsProvider * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1as_1EventsProvider (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FixedPenaltyScorer_free + * Method: OnionMessenger_as_OnionMessageHandler + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1as_1OnionMessageHandler + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: OffersMessageHandler_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OffersMessageHandler_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FixedPenaltyScorer_clone_ptr + * Method: OffersMessage_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OffersMessage_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: OffersMessage_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OffersMessage_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FixedPenaltyScorer_clone + * Method: OffersMessage_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OffersMessage_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FixedPenaltyScorer_with_penalty + * Method: OffersMessage_invoice_request * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1with_1penalty +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OffersMessage_1invoice_1request (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FixedPenaltyScorer_as_ScoreLookUp + * Method: OffersMessage_invoice * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1as_1ScoreLookUp +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OffersMessage_1invoice (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FixedPenaltyScorer_as_ScoreUpdate + * Method: OffersMessage_invoice_error * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1as_1ScoreUpdate +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OffersMessage_1invoice_1error (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FixedPenaltyScorer_write + * Method: OffersMessage_is_known_type + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OffersMessage_1is_1known_1type + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: OffersMessage_as_OnionMessageContents + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OffersMessage_1as_1OnionMessageContents + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: OffersMessage_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OffersMessage_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FixedPenaltyScorer_read - * Signature: ([BJ)J + * Method: OffersMessage_read + * Signature: ([BJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1read - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OffersMessage_1read + (JNIEnv *, jclass, jbyteArray, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScorer_free + * Method: Packet_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Packet_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScoringFeeParameters_free - * Signature: (J)V + * Method: Packet_get_version + * Signature: (J)B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1free +JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_Packet_1get_1version (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScoringFeeParameters_get_base_penalty_msat - * Signature: (J)J + * Method: Packet_set_version + * Signature: (JB)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1base_1penalty_1msat +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Packet_1set_1version + (JNIEnv *, jclass, jlong, jbyte); + +/* + * Class: org_ldk_impl_bindings + * Method: Packet_get_public_key + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Packet_1get_1public_1key (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScoringFeeParameters_set_base_penalty_msat - * Signature: (JJ)V + * Method: Packet_set_public_key + * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1base_1penalty_1msat - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Packet_1set_1public_1key + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScoringFeeParameters_get_base_penalty_amount_multiplier_msat - * Signature: (J)J + * Method: Packet_get_hop_data + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1base_1penalty_1amount_1multiplier_1msat +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Packet_1get_1hop_1data (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScoringFeeParameters_set_base_penalty_amount_multiplier_msat - * Signature: (JJ)V + * Method: Packet_set_hop_data + * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1base_1penalty_1amount_1multiplier_1msat - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Packet_1set_1hop_1data + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScoringFeeParameters_get_liquidity_penalty_multiplier_msat - * Signature: (J)J + * Method: Packet_get_hmac + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1liquidity_1penalty_1multiplier_1msat +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Packet_1get_1hmac (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScoringFeeParameters_set_liquidity_penalty_multiplier_msat - * Signature: (JJ)V + * Method: Packet_set_hmac + * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1liquidity_1penalty_1multiplier_1msat - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Packet_1set_1hmac + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScoringFeeParameters_get_liquidity_penalty_amount_multiplier_msat + * Method: Packet_new + * Signature: (B[B[B[B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Packet_1new + (JNIEnv *, jclass, jbyte, jbyteArray, jbyteArray, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: Packet_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1liquidity_1penalty_1amount_1multiplier_1msat +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Packet_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScoringFeeParameters_set_liquidity_penalty_amount_multiplier_msat - * Signature: (JJ)V + * Method: Packet_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1liquidity_1penalty_1amount_1multiplier_1msat - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Packet_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_multiplier_msat + * Method: Packet_hash * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1historical_1liquidity_1penalty_1multiplier_1msat +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Packet_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_multiplier_msat - * Signature: (JJ)V + * Method: Packet_eq + * Signature: (JJ)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1historical_1liquidity_1penalty_1multiplier_1msat +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Packet_1eq (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_amount_multiplier_msat - * Signature: (J)J + * Method: Packet_write + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1historical_1liquidity_1penalty_1amount_1multiplier_1msat +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Packet_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_amount_multiplier_msat - * Signature: (JJ)V + * Method: ParsedOnionMessageContents_free + * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1historical_1liquidity_1penalty_1amount_1multiplier_1msat - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScoringFeeParameters_get_anti_probing_penalty_msat + * Method: ParsedOnionMessageContents_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1anti_1probing_1penalty_1msat +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScoringFeeParameters_set_anti_probing_penalty_msat - * Signature: (JJ)V + * Method: ParsedOnionMessageContents_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1anti_1probing_1penalty_1msat - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScoringFeeParameters_get_considered_impossible_penalty_msat + * Method: ParsedOnionMessageContents_offers * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1considered_1impossible_1penalty_1msat +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1offers (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScoringFeeParameters_set_considered_impossible_penalty_msat - * Signature: (JJ)V + * Method: ParsedOnionMessageContents_custom + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1considered_1impossible_1penalty_1msat - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1custom + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScoringFeeParameters_get_linear_success_probability - * Signature: (J)Z + * Method: ParsedOnionMessageContents_as_OnionMessageContents + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1get_1linear_1success_1probability +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1as_1OnionMessageContents (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScoringFeeParameters_set_linear_success_probability - * Signature: (JZ)V + * Method: ParsedOnionMessageContents_write + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1linear_1success_1probability - (JNIEnv *, jclass, jlong, jboolean); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1write + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScoringFeeParameters_clone_ptr + * Method: OnionMessageContents_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScoringFeeParameters_clone + * Method: OnionMessageContents_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScoringFeeParameters_default - * Signature: ()J + * Method: OnionMessageContents_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1default - (JNIEnv *, jclass); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScoringFeeParameters_add_banned - * Signature: (JJ)V + * Method: IntroductionNode_free + * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1add_1banned - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScoringFeeParameters_add_banned_from_list - * Signature: (J[J)V + * Method: IntroductionNode_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1add_1banned_1from_1list - (JNIEnv *, jclass, jlong, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScoringFeeParameters_remove_banned - * Signature: (JJ)V + * Method: IntroductionNode_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1remove_1banned - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScoringFeeParameters_set_manual_penalty - * Signature: (JJJ)V + * Method: IntroductionNode_node_id + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1set_1manual_1penalty - (JNIEnv *, jclass, jlong, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1node_1id + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScoringFeeParameters_remove_manual_penalty - * Signature: (JJ)V + * Method: IntroductionNode_directed_short_channel_id + * Signature: (Lorg/ldk/enums/Direction;J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1remove_1manual_1penalty - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1directed_1short_1channel_1id + (JNIEnv *, jclass, jobject, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScoringFeeParameters_clear_manual_penalties - * Signature: (J)V + * Method: IntroductionNode_hash + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringFeeParameters_1clear_1manual_1penalties +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScoringDecayParameters_free - * Signature: (J)V + * Method: IntroductionNode_eq + * Signature: (JJ)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScoringDecayParameters_get_historical_no_updates_half_life - * Signature: (J)J + * Method: Direction_clone + * Signature: (J)Lorg/ldk/enums/Direction; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1get_1historical_1no_1updates_1half_1life +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Direction_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScoringDecayParameters_set_historical_no_updates_half_life - * Signature: (JJ)V + * Method: Direction_node_one + * Signature: ()Lorg/ldk/enums/Direction; */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1set_1historical_1no_1updates_1half_1life - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Direction_1node_1one + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScoringDecayParameters_get_liquidity_offset_half_life - * Signature: (J)J + * Method: Direction_node_two + * Signature: ()Lorg/ldk/enums/Direction; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1get_1liquidity_1offset_1half_1life - (JNIEnv *, jclass, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Direction_1node_1two + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScoringDecayParameters_set_liquidity_offset_half_life - * Signature: (JJ)V + * Method: Direction_hash + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1set_1liquidity_1offset_1half_1life - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Direction_1hash + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScoringDecayParameters_new - * Signature: (JJ)J + * Method: Direction_eq + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1new +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Direction_1eq (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScoringDecayParameters_clone_ptr - * Signature: (J)J + * Method: NodeIdLookUp_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1clone_1ptr +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeIdLookUp_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScoringDecayParameters_clone - * Signature: (J)J + * Method: EmptyNodeIdLookUp_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1clone +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EmptyNodeIdLookUp_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScoringDecayParameters_default + * Method: EmptyNodeIdLookUp_new * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringDecayParameters_1default +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_EmptyNodeIdLookUp_1new (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScorer_new - * Signature: (JJJ)J + * Method: EmptyNodeIdLookUp_as_NodeIdLookUp + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1new - (JNIEnv *, jclass, jlong, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_EmptyNodeIdLookUp_1as_1NodeIdLookUp + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScorer_debug_log_liquidity_stats + * Method: BlindedHop_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1debug_1log_1liquidity_1stats +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedHop_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScorer_estimated_channel_liquidity_range - * Signature: (JJJ)J + * Method: BlindedHop_get_blinded_node_id + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1estimated_1channel_1liquidity_1range - (JNIEnv *, jclass, jlong, jlong, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BlindedHop_1get_1blinded_1node_1id + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScorer_historical_estimated_channel_liquidity_probabilities - * Signature: (JJJ)J + * Method: BlindedHop_set_blinded_node_id + * Signature: (J[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1historical_1estimated_1channel_1liquidity_1probabilities - (JNIEnv *, jclass, jlong, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedHop_1set_1blinded_1node_1id + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScorer_historical_estimated_payment_success_probability - * Signature: (JJJJJ)J + * Method: BlindedHop_get_encrypted_payload + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1historical_1estimated_1payment_1success_1probability - (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BlindedHop_1get_1encrypted_1payload + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScorer_as_ScoreLookUp + * Method: BlindedHop_set_encrypted_payload + * Signature: (J[B)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedHop_1set_1encrypted_1payload + (JNIEnv *, jclass, jlong, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: BlindedHop_new + * Signature: ([B[B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedHop_1new + (JNIEnv *, jclass, jbyteArray, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: BlindedHop_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1as_1ScoreLookUp +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedHop_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScorer_as_ScoreUpdate + * Method: BlindedHop_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1as_1ScoreUpdate +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedHop_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScorer_as_Score + * Method: BlindedHop_hash * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1as_1Score +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedHop_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScorer_write + * Method: BlindedHop_eq + * Signature: (JJ)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedHop_1eq + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: BlindedHop_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BlindedHop_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ProbabilisticScorer_read - * Signature: ([BJJJ)J + * Method: BlindedHop_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1read - (JNIEnv *, jclass, jbyteArray, jlong, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedHop_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: DelayedPaymentOutputDescriptor_free + * Method: BlindedPayInfo_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: DelayedPaymentOutputDescriptor_get_outpoint - * Signature: (J)J + * Method: BlindedPayInfo_get_fee_base_msat + * Signature: (J)I */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1outpoint +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1fee_1base_1msat (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: DelayedPaymentOutputDescriptor_set_outpoint - * Signature: (JJ)V + * Method: BlindedPayInfo_set_fee_base_msat + * Signature: (JI)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1outpoint - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1fee_1base_1msat + (JNIEnv *, jclass, jlong, jint); /* * Class: org_ldk_impl_bindings - * Method: DelayedPaymentOutputDescriptor_get_per_commitment_point - * Signature: (J)[B + * Method: BlindedPayInfo_get_fee_proportional_millionths + * Signature: (J)I */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1per_1commitment_1point +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1fee_1proportional_1millionths (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: DelayedPaymentOutputDescriptor_set_per_commitment_point - * Signature: (J[B)V + * Method: BlindedPayInfo_set_fee_proportional_millionths + * Signature: (JI)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1per_1commitment_1point - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1fee_1proportional_1millionths + (JNIEnv *, jclass, jlong, jint); /* * Class: org_ldk_impl_bindings - * Method: DelayedPaymentOutputDescriptor_get_to_self_delay + * Method: BlindedPayInfo_get_cltv_expiry_delta * Signature: (J)S */ -JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1to_1self_1delay +JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1cltv_1expiry_1delta (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: DelayedPaymentOutputDescriptor_set_to_self_delay + * Method: BlindedPayInfo_set_cltv_expiry_delta * Signature: (JS)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1to_1self_1delay +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1cltv_1expiry_1delta (JNIEnv *, jclass, jlong, jshort); /* * Class: org_ldk_impl_bindings - * Method: DelayedPaymentOutputDescriptor_get_output + * Method: BlindedPayInfo_get_htlc_minimum_msat * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1output +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1htlc_1minimum_1msat (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: DelayedPaymentOutputDescriptor_set_output + * Method: BlindedPayInfo_set_htlc_minimum_msat * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1output +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1htlc_1minimum_1msat (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: DelayedPaymentOutputDescriptor_get_revocation_pubkey + * Method: BlindedPayInfo_get_htlc_maximum_msat * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1revocation_1pubkey +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1htlc_1maximum_1msat (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: DelayedPaymentOutputDescriptor_set_revocation_pubkey + * Method: BlindedPayInfo_set_htlc_maximum_msat * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1revocation_1pubkey +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1htlc_1maximum_1msat (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: DelayedPaymentOutputDescriptor_get_channel_keys_id - * Signature: (J)[B + * Method: BlindedPayInfo_get_features + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1keys_1id +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1features (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: DelayedPaymentOutputDescriptor_set_channel_keys_id - * Signature: (J[B)V + * Method: BlindedPayInfo_set_features + * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1keys_1id - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1features + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: DelayedPaymentOutputDescriptor_get_channel_value_satoshis - * Signature: (J)J + * Method: BlindedPayInfo_new + * Signature: (IISJJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1value_1satoshis - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1new + (JNIEnv *, jclass, jint, jint, jshort, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: DelayedPaymentOutputDescriptor_set_channel_value_satoshis - * Signature: (JJ)V + * Method: BlindedPayInfo_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1value_1satoshis - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: DelayedPaymentOutputDescriptor_get_channel_transaction_parameters + * Method: BlindedPayInfo_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1transaction_1parameters +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: DelayedPaymentOutputDescriptor_set_channel_transaction_parameters - * Signature: (JJ)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1transaction_1parameters - (JNIEnv *, jclass, jlong, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: DelayedPaymentOutputDescriptor_new - * Signature: (J[BSJJ[BJJ)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1new - (JNIEnv *, jclass, jlong, jbyteArray, jshort, jlong, jlong, jbyteArray, jlong, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: DelayedPaymentOutputDescriptor_clone_ptr - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: DelayedPaymentOutputDescriptor_clone - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: DelayedPaymentOutputDescriptor_hash + * Method: BlindedPayInfo_hash * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1hash +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: DelayedPaymentOutputDescriptor_eq + * Method: BlindedPayInfo_eq * Signature: (JJ)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1eq +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1eq (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: DelayedPaymentOutputDescriptor_write + * Method: BlindedPayInfo_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: DelayedPaymentOutputDescriptor_read + * Method: BlindedPayInfo_read * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1read +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1read (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: StaticPaymentOutputDescriptor_free + * Method: BlindedPaymentPath_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: StaticPaymentOutputDescriptor_get_outpoint + * Method: BlindedPaymentPath_get_payinfo * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1outpoint +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1get_1payinfo (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: StaticPaymentOutputDescriptor_set_outpoint + * Method: BlindedPaymentPath_set_payinfo * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1outpoint +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1set_1payinfo (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: StaticPaymentOutputDescriptor_get_output + * Method: BlindedPaymentPath_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1output +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: StaticPaymentOutputDescriptor_set_output - * Signature: (JJ)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1output - (JNIEnv *, jclass, jlong, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: StaticPaymentOutputDescriptor_get_channel_keys_id - * Signature: (J)[B + * Method: BlindedPaymentPath_clone + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1keys_1id +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: StaticPaymentOutputDescriptor_set_channel_keys_id - * Signature: (J[B)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1keys_1id - (JNIEnv *, jclass, jlong, jbyteArray); - -/* - * Class: org_ldk_impl_bindings - * Method: StaticPaymentOutputDescriptor_get_channel_value_satoshis + * Method: BlindedPaymentPath_hash * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1value_1satoshis +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: StaticPaymentOutputDescriptor_set_channel_value_satoshis - * Signature: (JJ)V + * Method: BlindedPaymentPath_eq + * Signature: (JJ)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1value_1satoshis +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1eq (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: StaticPaymentOutputDescriptor_get_channel_transaction_parameters - * Signature: (J)J + * Method: BlindedPaymentPath_one_hop + * Signature: ([BJSJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1transaction_1parameters - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1one_1hop + (JNIEnv *, jclass, jbyteArray, jlong, jshort, jlong); /* * Class: org_ldk_impl_bindings - * Method: StaticPaymentOutputDescriptor_set_channel_transaction_parameters - * Signature: (JJ)V + * Method: BlindedPaymentPath_new + * Signature: ([J[BJJSJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1transaction_1parameters - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1new + (JNIEnv *, jclass, jlongArray, jbyteArray, jlong, jlong, jshort, jlong); /* * Class: org_ldk_impl_bindings - * Method: StaticPaymentOutputDescriptor_new - * Signature: (JJ[BJJ)J + * Method: BlindedPaymentPath_public_introduction_node_id + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1new - (JNIEnv *, jclass, jlong, jlong, jbyteArray, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1public_1introduction_1node_1id + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: StaticPaymentOutputDescriptor_clone_ptr + * Method: BlindedPaymentPath_introduction_node * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1introduction_1node (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: StaticPaymentOutputDescriptor_clone - * Signature: (J)J + * Method: BlindedPaymentPath_blinding_point + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1blinding_1point (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: StaticPaymentOutputDescriptor_hash - * Signature: (J)J + * Method: BlindedPaymentPath_blinded_hops + * Signature: (J)[J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1hash +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1blinded_1hops (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: StaticPaymentOutputDescriptor_eq - * Signature: (JJ)Z + * Method: BlindedPaymentPath_advance_path_by_one + * Signature: (JJJ)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPaymentPath_1advance_1path_1by_1one + (JNIEnv *, jclass, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: StaticPaymentOutputDescriptor_witness_script - * Signature: (J)J + * Method: PaymentForwardNode_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1witness_1script +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentForwardNode_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: StaticPaymentOutputDescriptor_max_witness_length + * Method: PaymentForwardNode_get_tlvs * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1max_1witness_1length - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: StaticPaymentOutputDescriptor_write - * Signature: (J)[B - */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1write +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentForwardNode_1get_1tlvs (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: StaticPaymentOutputDescriptor_read - * Signature: ([B)J + * Method: PaymentForwardNode_set_tlvs + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentForwardNode_1set_1tlvs + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: SpendableOutputDescriptor_free - * Signature: (J)V + * Method: PaymentForwardNode_get_node_id + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1free +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_PaymentForwardNode_1get_1node_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: SpendableOutputDescriptor_clone_ptr - * Signature: (J)J + * Method: PaymentForwardNode_set_node_id + * Signature: (J[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentForwardNode_1set_1node_1id + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: SpendableOutputDescriptor_clone + * Method: PaymentForwardNode_get_htlc_maximum_msat * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentForwardNode_1get_1htlc_1maximum_1msat (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: SpendableOutputDescriptor_static_output - * Signature: (JJ[B)J + * Method: PaymentForwardNode_set_htlc_maximum_msat + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1static_1output - (JNIEnv *, jclass, jlong, jlong, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentForwardNode_1set_1htlc_1maximum_1msat + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: SpendableOutputDescriptor_delayed_payment_output - * Signature: (J)J + * Method: PaymentForwardNode_new + * Signature: (J[BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1delayed_1payment_1output - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentForwardNode_1new + (JNIEnv *, jclass, jlong, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: SpendableOutputDescriptor_static_payment_output + * Method: PaymentForwardNode_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1static_1payment_1output +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentForwardNode_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: SpendableOutputDescriptor_hash + * Method: PaymentForwardNode_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1hash +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentForwardNode_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: SpendableOutputDescriptor_eq - * Signature: (JJ)Z + * Method: ForwardTlvs_free + * Signature: (J)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: SpendableOutputDescriptor_write - * Signature: (J)[B + * Method: ForwardTlvs_get_short_channel_id + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1write +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1get_1short_1channel_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: SpendableOutputDescriptor_read - * Signature: ([B)J + * Method: ForwardTlvs_set_short_channel_id + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1set_1short_1channel_1id + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: SpendableOutputDescriptor_create_spendable_outputs_psbt - * Signature: ([J[J[BIJ)J + * Method: ForwardTlvs_get_payment_relay + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1create_1spendable_1outputs_1psbt - (JNIEnv *, jclass, jlongArray, jlongArray, jbyteArray, jint, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1get_1payment_1relay + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelDerivationParameters_free - * Signature: (J)V + * Method: ForwardTlvs_set_payment_relay + * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1set_1payment_1relay + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelDerivationParameters_get_value_satoshis + * Method: ForwardTlvs_get_payment_constraints * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1get_1value_1satoshis +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1get_1payment_1constraints (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelDerivationParameters_set_value_satoshis + * Method: ForwardTlvs_set_payment_constraints * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1set_1value_1satoshis +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1set_1payment_1constraints (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelDerivationParameters_get_keys_id - * Signature: (J)[B + * Method: ForwardTlvs_get_features + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1get_1keys_1id +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1get_1features (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelDerivationParameters_set_keys_id - * Signature: (J[B)V + * Method: ForwardTlvs_set_features + * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1set_1keys_1id - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1set_1features + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelDerivationParameters_get_transaction_parameters - * Signature: (J)J + * Method: ForwardTlvs_get_next_blinding_override + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1get_1transaction_1parameters +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1get_1next_1blinding_1override (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelDerivationParameters_set_transaction_parameters - * Signature: (JJ)V + * Method: ForwardTlvs_set_next_blinding_override + * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1set_1transaction_1parameters - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1set_1next_1blinding_1override + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ChannelDerivationParameters_new - * Signature: (J[BJ)J + * Method: ForwardTlvs_new + * Signature: (JJJJ[B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1new - (JNIEnv *, jclass, jlong, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1new + (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ChannelDerivationParameters_clone_ptr + * Method: ForwardTlvs_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelDerivationParameters_clone + * Method: ForwardTlvs_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelDerivationParameters_eq - * Signature: (JJ)Z + * Method: ReceiveTlvs_free + * Signature: (J)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelDerivationParameters_write + * Method: ReceiveTlvs_get_payment_secret * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1get_1payment_1secret (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelDerivationParameters_read - * Signature: ([B)J + * Method: ReceiveTlvs_set_payment_secret + * Signature: (J[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDerivationParameters_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1set_1payment_1secret + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: HTLCDescriptor_free - * Signature: (J)V + * Method: ReceiveTlvs_get_payment_constraints + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1get_1payment_1constraints (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCDescriptor_get_channel_derivation_parameters + * Method: ReceiveTlvs_set_payment_constraints + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1set_1payment_1constraints + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ReceiveTlvs_get_payment_context * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1channel_1derivation_1parameters +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1get_1payment_1context (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCDescriptor_set_channel_derivation_parameters + * Method: ReceiveTlvs_set_payment_context * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1channel_1derivation_1parameters +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1set_1payment_1context (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCDescriptor_get_commitment_txid - * Signature: (J)[B + * Method: ReceiveTlvs_new + * Signature: ([BJJ)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1commitment_1txid - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1new + (JNIEnv *, jclass, jbyteArray, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCDescriptor_set_commitment_txid - * Signature: (J[B)V + * Method: ReceiveTlvs_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1commitment_1txid - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCDescriptor_get_per_commitment_number + * Method: ReceiveTlvs_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1per_1commitment_1number +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCDescriptor_set_per_commitment_number - * Signature: (JJ)V + * Method: PaymentRelay_free + * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1per_1commitment_1number - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCDescriptor_get_per_commitment_point - * Signature: (J)[B + * Method: PaymentRelay_get_cltv_expiry_delta + * Signature: (J)S */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1per_1commitment_1point +JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1get_1cltv_1expiry_1delta (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCDescriptor_set_per_commitment_point - * Signature: (J[B)V + * Method: PaymentRelay_set_cltv_expiry_delta + * Signature: (JS)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1per_1commitment_1point - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1set_1cltv_1expiry_1delta + (JNIEnv *, jclass, jlong, jshort); /* * Class: org_ldk_impl_bindings - * Method: HTLCDescriptor_get_feerate_per_kw + * Method: PaymentRelay_get_fee_proportional_millionths * Signature: (J)I */ -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1feerate_1per_1kw +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1get_1fee_1proportional_1millionths (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCDescriptor_set_feerate_per_kw + * Method: PaymentRelay_set_fee_proportional_millionths * Signature: (JI)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1feerate_1per_1kw +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1set_1fee_1proportional_1millionths (JNIEnv *, jclass, jlong, jint); /* * Class: org_ldk_impl_bindings - * Method: HTLCDescriptor_get_htlc - * Signature: (J)J + * Method: PaymentRelay_get_fee_base_msat + * Signature: (J)I */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1htlc +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1get_1fee_1base_1msat (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCDescriptor_set_htlc - * Signature: (JJ)V + * Method: PaymentRelay_set_fee_base_msat + * Signature: (JI)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1htlc - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1set_1fee_1base_1msat + (JNIEnv *, jclass, jlong, jint); /* * Class: org_ldk_impl_bindings - * Method: HTLCDescriptor_get_preimage + * Method: PaymentRelay_new + * Signature: (SII)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1new + (JNIEnv *, jclass, jshort, jint, jint); + +/* + * Class: org_ldk_impl_bindings + * Method: PaymentRelay_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1preimage +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCDescriptor_set_preimage - * Signature: (JJ)V + * Method: PaymentRelay_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1preimage - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCDescriptor_get_counterparty_sig - * Signature: (J)[B + * Method: PaymentConstraints_free + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1get_1counterparty_1sig +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCDescriptor_set_counterparty_sig - * Signature: (J[B)V + * Method: PaymentConstraints_get_max_cltv_expiry + * Signature: (J)I */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1set_1counterparty_1sig - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1get_1max_1cltv_1expiry + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCDescriptor_new - * Signature: (J[BJ[BIJJ[B)J + * Method: PaymentConstraints_set_max_cltv_expiry + * Signature: (JI)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1new - (JNIEnv *, jclass, jlong, jbyteArray, jlong, jbyteArray, jint, jlong, jlong, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1set_1max_1cltv_1expiry + (JNIEnv *, jclass, jlong, jint); /* * Class: org_ldk_impl_bindings - * Method: HTLCDescriptor_clone_ptr + * Method: PaymentConstraints_get_htlc_minimum_msat * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1get_1htlc_1minimum_1msat (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCDescriptor_clone - * Signature: (J)J + * Method: PaymentConstraints_set_htlc_minimum_msat + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1set_1htlc_1minimum_1msat + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCDescriptor_eq - * Signature: (JJ)Z + * Method: PaymentConstraints_new + * Signature: (IJ)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1new + (JNIEnv *, jclass, jint, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCDescriptor_write - * Signature: (J)[B + * Method: PaymentConstraints_clone_ptr + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1write +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCDescriptor_read - * Signature: ([B)J + * Method: PaymentConstraints_clone + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCDescriptor_outpoint - * Signature: (J)J + * Method: PaymentContext_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1outpoint +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentContext_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCDescriptor_previous_utxo + * Method: PaymentContext_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1previous_1utxo +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentContext_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCDescriptor_unsigned_tx_input + * Method: PaymentContext_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1unsigned_1tx_1input +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentContext_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCDescriptor_tx_output + * Method: PaymentContext_unknown * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1tx_1output +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentContext_1unknown (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCDescriptor_witness_script - * Signature: (J)[B + * Method: PaymentContext_bolt12_offer + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1witness_1script +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentContext_1bolt12_1offer (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCDescriptor_tx_input_witness - * Signature: (J[B[B)[B + * Method: PaymentContext_bolt12_refund + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1tx_1input_1witness - (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentContext_1bolt12_1refund + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCDescriptor_derive_channel_signer - * Signature: (JJ)J + * Method: PaymentContext_eq + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDescriptor_1derive_1channel_1signer +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentContext_1eq (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelSigner_free + * Method: UnknownPaymentContext_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelSigner_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Recipient_clone - * Signature: (J)Lorg/ldk/enums/Recipient; + * Method: UnknownPaymentContext_clone_ptr + * Signature: (J)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Recipient_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Recipient_node - * Signature: ()Lorg/ldk/enums/Recipient; + * Method: UnknownPaymentContext_clone + * Signature: (J)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Recipient_1node - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Recipient_phantom_node - * Signature: ()Lorg/ldk/enums/Recipient; + * Method: UnknownPaymentContext_eq + * Signature: (JJ)Z */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Recipient_1phantom_1node - (JNIEnv *, jclass); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: EntropySource_free + * Method: Bolt12OfferContext_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EntropySource_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeSigner_free - * Signature: (J)V + * Method: Bolt12OfferContext_get_offer_id + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeSigner_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1get_1offer_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OutputSpender_free - * Signature: (J)V + * Method: Bolt12OfferContext_set_offer_id + * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutputSpender_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1set_1offer_1id + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: SignerProvider_free - * Signature: (J)V + * Method: Bolt12OfferContext_get_invoice_request + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignerProvider_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1get_1invoice_1request (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChangeDestinationSource_free - * Signature: (J)V + * Method: Bolt12OfferContext_set_invoice_request + * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChangeDestinationSource_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1set_1invoice_1request + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InMemorySigner_free - * Signature: (J)V + * Method: Bolt12OfferContext_new + * Signature: (JJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1new + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InMemorySigner_get_funding_key - * Signature: (J)[B + * Method: Bolt12OfferContext_clone_ptr + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1funding_1key +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InMemorySigner_set_funding_key - * Signature: (J[B)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1funding_1key - (JNIEnv *, jclass, jlong, jbyteArray); - -/* - * Class: org_ldk_impl_bindings - * Method: InMemorySigner_get_revocation_base_key - * Signature: (J)[B + * Method: Bolt12OfferContext_clone + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1revocation_1base_1key +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InMemorySigner_set_revocation_base_key - * Signature: (J[B)V + * Method: Bolt12OfferContext_eq + * Signature: (JJ)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1revocation_1base_1key - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InMemorySigner_get_payment_key - * Signature: (J)[B + * Method: Bolt12RefundContext_free + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1payment_1key +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InMemorySigner_set_payment_key - * Signature: (J[B)V + * Method: Bolt12RefundContext_new + * Signature: ()J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1payment_1key - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1new + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: InMemorySigner_get_delayed_payment_base_key - * Signature: (J)[B + * Method: Bolt12RefundContext_clone_ptr + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1delayed_1payment_1base_1key +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InMemorySigner_set_delayed_payment_base_key - * Signature: (J[B)V + * Method: Bolt12RefundContext_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1delayed_1payment_1base_1key - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InMemorySigner_get_htlc_base_key - * Signature: (J)[B + * Method: Bolt12RefundContext_eq + * Signature: (JJ)Z */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1htlc_1base_1key - (JNIEnv *, jclass, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InMemorySigner_set_htlc_base_key - * Signature: (J[B)V + * Method: ForwardTlvs_write + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1htlc_1base_1key - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1write + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InMemorySigner_get_commitment_seed + * Method: ReceiveTlvs_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1commitment_1seed +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InMemorySigner_set_commitment_seed - * Signature: (J[B)V + * Method: PaymentRelay_write + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1commitment_1seed - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1write + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InMemorySigner_clone_ptr - * Signature: (J)J + * Method: PaymentRelay_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: InMemorySigner_clone - * Signature: (J)J + * Method: PaymentConstraints_write + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InMemorySigner_new - * Signature: ([B[B[B[B[B[BJ[B[B)J + * Method: PaymentConstraints_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1new - (JNIEnv *, jclass, jbyteArray, jbyteArray, jbyteArray, jbyteArray, jbyteArray, jbyteArray, jlong, jbyteArray, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: InMemorySigner_counterparty_pubkeys - * Signature: (J)J + * Method: PaymentContext_write + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterparty_1pubkeys +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_PaymentContext_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InMemorySigner_counterparty_selected_contest_delay - * Signature: (J)J + * Method: PaymentContext_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterparty_1selected_1contest_1delay - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentContext_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: InMemorySigner_holder_selected_contest_delay - * Signature: (J)J + * Method: UnknownPaymentContext_write + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1holder_1selected_1contest_1delay +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InMemorySigner_is_outbound - * Signature: (J)J + * Method: UnknownPaymentContext_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1is_1outbound - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: InMemorySigner_funding_outpoint - * Signature: (J)J + * Method: Bolt12OfferContext_write + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1funding_1outpoint +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InMemorySigner_get_channel_parameters - * Signature: (J)J + * Method: Bolt12OfferContext_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1channel_1parameters - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: InMemorySigner_channel_type_features - * Signature: (J)J + * Method: Bolt12RefundContext_write + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1channel_1type_1features +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InMemorySigner_sign_counterparty_payment_input - * Signature: (J[BJJ)J + * Method: Bolt12RefundContext_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1counterparty_1payment_1input - (JNIEnv *, jclass, jlong, jbyteArray, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: InMemorySigner_sign_dynamic_p2wsh_input - * Signature: (J[BJJ)J + * Method: BlindedMessagePath_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1dynamic_1p2wsh_1input - (JNIEnv *, jclass, jlong, jbyteArray, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InMemorySigner_as_EntropySource + * Method: BlindedMessagePath_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1EntropySource +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InMemorySigner_as_ChannelSigner + * Method: BlindedMessagePath_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1ChannelSigner +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InMemorySigner_as_EcdsaChannelSigner + * Method: BlindedMessagePath_hash * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1EcdsaChannelSigner +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InMemorySigner_as_WriteableEcdsaChannelSigner - * Signature: (J)J + * Method: BlindedMessagePath_eq + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1WriteableEcdsaChannelSigner - (JNIEnv *, jclass, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InMemorySigner_write + * Method: BlindedMessagePath_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InMemorySigner_read - * Signature: ([BJ)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1read - (JNIEnv *, jclass, jbyteArray, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: KeysManager_free - * Signature: (J)V + * Method: BlindedMessagePath_read + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysManager_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: KeysManager_new - * Signature: ([BJI)J + * Method: BlindedMessagePath_one_hop + * Signature: ([BJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1new - (JNIEnv *, jclass, jbyteArray, jlong, jint); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1one_1hop + (JNIEnv *, jclass, jbyteArray, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: KeysManager_get_node_secret_key - * Signature: (J)[B + * Method: BlindedMessagePath_new + * Signature: ([J[BJJ)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_KeysManager_1get_1node_1secret_1key - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1new + (JNIEnv *, jclass, jlongArray, jbyteArray, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: KeysManager_derive_channel_keys - * Signature: (JJ[B)J + * Method: BlindedMessagePath_use_compact_introduction_node + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1derive_1channel_1keys - (JNIEnv *, jclass, jlong, jlong, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1use_1compact_1introduction_1node + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: KeysManager_sign_spendable_outputs_psbt - * Signature: (J[J[B)J + * Method: BlindedMessagePath_public_introduction_node_id + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1sign_1spendable_1outputs_1psbt - (JNIEnv *, jclass, jlong, jlongArray, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1public_1introduction_1node_1id + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: KeysManager_as_EntropySource + * Method: BlindedMessagePath_introduction_node * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1EntropySource +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1introduction_1node (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: KeysManager_as_NodeSigner - * Signature: (J)J + * Method: BlindedMessagePath_blinding_point + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1NodeSigner +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1blinding_1point (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: KeysManager_as_OutputSpender - * Signature: (J)J + * Method: BlindedMessagePath_blinded_hops + * Signature: (J)[J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1OutputSpender +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1blinded_1hops (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: KeysManager_as_SignerProvider - * Signature: (J)J + * Method: BlindedMessagePath_advance_path_by_one + * Signature: (JJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1SignerProvider - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedMessagePath_1advance_1path_1by_1one + (JNIEnv *, jclass, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: PhantomKeysManager_free + * Method: NextMessageHop_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PhantomKeysManager_as_EntropySource + * Method: NextMessageHop_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1as_1EntropySource +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PhantomKeysManager_as_NodeSigner + * Method: NextMessageHop_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1as_1NodeSigner +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PhantomKeysManager_as_OutputSpender + * Method: NextMessageHop_node_id + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1node_1id + (JNIEnv *, jclass, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: NextMessageHop_short_channel_id * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1as_1OutputSpender +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1short_1channel_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PhantomKeysManager_as_SignerProvider + * Method: NextMessageHop_hash * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1as_1SignerProvider +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PhantomKeysManager_new - * Signature: ([BJI[B)J + * Method: NextMessageHop_eq + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1new - (JNIEnv *, jclass, jbyteArray, jlong, jint, jbyteArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: PhantomKeysManager_derive_channel_keys - * Signature: (JJ[B)J + * Method: MessageForwardNode_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1derive_1channel_1keys - (JNIEnv *, jclass, jlong, jlong, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageForwardNode_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PhantomKeysManager_get_node_secret_key + * Method: MessageForwardNode_get_node_id * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1get_1node_1secret_1key +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_MessageForwardNode_1get_1node_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PhantomKeysManager_get_phantom_node_secret_key - * Signature: (J)[B + * Method: MessageForwardNode_set_node_id + * Signature: (J[B)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1get_1phantom_1node_1secret_1key - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageForwardNode_1set_1node_1id + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: RandomBytes_free - * Signature: (J)V + * Method: MessageForwardNode_get_short_channel_id + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RandomBytes_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageForwardNode_1get_1short_1channel_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RandomBytes_new - * Signature: ([B)J + * Method: MessageForwardNode_set_short_channel_id + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RandomBytes_1new - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageForwardNode_1set_1short_1channel_1id + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: RandomBytes_as_EntropySource - * Signature: (J)J + * Method: MessageForwardNode_new + * Signature: ([BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RandomBytes_1as_1EntropySource - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageForwardNode_1new + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: EcdsaChannelSigner_free - * Signature: (J)V + * Method: MessageForwardNode_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EcdsaChannelSigner_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageForwardNode_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: WriteableEcdsaChannelSigner_clone_ptr + * Method: MessageForwardNode_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_WriteableEcdsaChannelSigner_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageForwardNode_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: WriteableEcdsaChannelSigner_clone + * Method: MessageForwardNode_hash * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_WriteableEcdsaChannelSigner_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageForwardNode_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: WriteableEcdsaChannelSigner_free - * Signature: (J)V + * Method: MessageForwardNode_eq + * Signature: (JJ)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WriteableEcdsaChannelSigner_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_MessageForwardNode_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: OnionMessenger_free + * Method: MessageContext_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageContext_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageRouter_free - * Signature: (J)V + * Method: MessageContext_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageRouter_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageContext_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: DefaultMessageRouter_free - * Signature: (J)V + * Method: MessageContext_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DefaultMessageRouter_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageContext_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: DefaultMessageRouter_new - * Signature: (JJ)J + * Method: MessageContext_offers + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DefaultMessageRouter_1new - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageContext_1offers + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: DefaultMessageRouter_as_MessageRouter - * Signature: (J)J + * Method: MessageContext_custom + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DefaultMessageRouter_1as_1MessageRouter - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageContext_1custom + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: OnionMessagePath_free + * Method: OffersContext_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OffersContext_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OnionMessagePath_get_intermediate_nodes - * Signature: (J)[[B + * Method: OffersContext_clone_ptr + * Signature: (J)J */ -JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1get_1intermediate_1nodes +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OffersContext_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OnionMessagePath_set_intermediate_nodes - * Signature: (J[[B)V + * Method: OffersContext_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1set_1intermediate_1nodes - (JNIEnv *, jclass, jlong, jobjectArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OffersContext_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OnionMessagePath_get_destination + * Method: OffersContext_invoice_request * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1get_1destination +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OffersContext_1invoice_1request (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OnionMessagePath_set_destination - * Signature: (JJ)V + * Method: OffersContext_outbound_payment + * Signature: ([BJ[B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1set_1destination - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OffersContext_1outbound_1payment + (JNIEnv *, jclass, jbyteArray, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: OnionMessagePath_get_first_node_addresses - * Signature: (J)J + * Method: OffersContext_inbound_payment + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1get_1first_1node_1addresses - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OffersContext_1inbound_1payment + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: OnionMessagePath_set_first_node_addresses - * Signature: (JJ)V + * Method: OffersContext_eq + * Signature: (JJ)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1set_1first_1node_1addresses +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OffersContext_1eq (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: OnionMessagePath_new - * Signature: ([[BJJ)J + * Method: MessageContext_write + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1new - (JNIEnv *, jclass, jobjectArray, jlong, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_MessageContext_1write + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OnionMessagePath_clone_ptr - * Signature: (J)J + * Method: MessageContext_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageContext_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: OnionMessagePath_clone - * Signature: (J)J + * Method: OffersContext_write + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1clone +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OffersContext_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OnionMessagePath_first_node - * Signature: (J)[B + * Method: OffersContext_read + * Signature: ([B)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OnionMessagePath_1first_1node - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OffersContext_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: Destination_free + * Method: FundingInfo_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Destination_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingInfo_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Destination_clone_ptr + * Method: FundingInfo_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Destination_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingInfo_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Destination_clone + * Method: FundingInfo_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Destination_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingInfo_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Destination_node + * Method: FundingInfo_tx * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Destination_1node +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingInfo_1tx (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: Destination_blinded_path + * Method: FundingInfo_out_point * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Destination_1blinded_1path +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingInfo_1out_1point (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Destination_hash - * Signature: (J)J + * Method: FundingInfo_eq + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Destination_1hash - (JNIEnv *, jclass, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_FundingInfo_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Destination_eq - * Signature: (JJ)Z + * Method: FundingInfo_write + * Signature: (J)[B */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Destination_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingInfo_1write + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Destination_resolve - * Signature: (JJ)V + * Method: FundingInfo_read + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Destination_1resolve - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingInfo_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: SendSuccess_free + * Method: PaymentPurpose_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SendSuccess_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: SendSuccess_clone_ptr + * Method: PaymentPurpose_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendSuccess_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: SendSuccess_clone + * Method: PaymentPurpose_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendSuccess_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: SendSuccess_buffered - * Signature: ()J + * Method: PaymentPurpose_bolt11_invoice_payment + * Signature: (J[B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendSuccess_1buffered - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1bolt11_1invoice_1payment + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: SendSuccess_buffered_awaiting_connection - * Signature: ([B)J + * Method: PaymentPurpose_bolt12_offer_payment + * Signature: (J[BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendSuccess_1buffered_1awaiting_1connection - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1bolt12_1offer_1payment + (JNIEnv *, jclass, jlong, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: SendSuccess_hash - * Signature: (J)J + * Method: PaymentPurpose_bolt12_refund_payment + * Signature: (J[BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendSuccess_1hash - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1bolt12_1refund_1payment + (JNIEnv *, jclass, jlong, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: SendSuccess_eq - * Signature: (JJ)Z + * Method: PaymentPurpose_spontaneous_payment + * Signature: ([B)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SendSuccess_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1spontaneous_1payment + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: SendError_free - * Signature: (J)V + * Method: PaymentPurpose_eq + * Signature: (JJ)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SendError_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: SendError_clone_ptr + * Method: PaymentPurpose_preimage * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendError_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1preimage (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: SendError_clone - * Signature: (J)J + * Method: PaymentPurpose_write + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendError_1clone +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: SendError_secp256k1 - * Signature: (Lorg/ldk/enums/Secp256k1Error;)J + * Method: PaymentPurpose_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendError_1secp256k1 - (JNIEnv *, jclass, jobject); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: SendError_too_big_packet - * Signature: ()J + * Method: ClaimedHTLC_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendError_1too_1big_1packet - (JNIEnv *, jclass); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: SendError_too_few_blinded_hops - * Signature: ()J + * Method: ClaimedHTLC_get_channel_id + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendError_1too_1few_1blinded_1hops - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1get_1channel_1id + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: SendError_invalid_first_hop - * Signature: ([B)J + * Method: ClaimedHTLC_set_channel_id + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendError_1invalid_1first_1hop - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1set_1channel_1id + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: SendError_path_not_found - * Signature: ()J + * Method: ClaimedHTLC_get_user_channel_id + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendError_1path_1not_1found - (JNIEnv *, jclass); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1get_1user_1channel_1id + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: SendError_invalid_message - * Signature: ()J + * Method: ClaimedHTLC_set_user_channel_id + * Signature: (J[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendError_1invalid_1message - (JNIEnv *, jclass); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1set_1user_1channel_1id + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: SendError_buffer_full - * Signature: ()J + * Method: ClaimedHTLC_get_cltv_expiry + * Signature: (J)I */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendError_1buffer_1full - (JNIEnv *, jclass); +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1get_1cltv_1expiry + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: SendError_get_node_id_failed - * Signature: ()J + * Method: ClaimedHTLC_set_cltv_expiry + * Signature: (JI)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendError_1get_1node_1id_1failed - (JNIEnv *, jclass); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1set_1cltv_1expiry + (JNIEnv *, jclass, jlong, jint); /* * Class: org_ldk_impl_bindings - * Method: SendError_unresolved_introduction_node - * Signature: ()J + * Method: ClaimedHTLC_get_value_msat + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendError_1unresolved_1introduction_1node - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1get_1value_1msat + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: SendError_blinded_path_advance_failed - * Signature: ()J + * Method: ClaimedHTLC_set_value_msat + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendError_1blinded_1path_1advance_1failed - (JNIEnv *, jclass); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1set_1value_1msat + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: SendError_hash + * Method: ClaimedHTLC_get_counterparty_skimmed_fee_msat * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendError_1hash +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1get_1counterparty_1skimmed_1fee_1msat (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: SendError_eq - * Signature: (JJ)Z + * Method: ClaimedHTLC_set_counterparty_skimmed_fee_msat + * Signature: (JJ)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SendError_1eq +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1set_1counterparty_1skimmed_1fee_1msat (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: CustomOnionMessageHandler_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageHandler_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: PeeledOnion_free - * Signature: (J)V + * Method: ClaimedHTLC_new + * Signature: (J[BIJJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeeledOnion_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1new + (JNIEnv *, jclass, jlong, jbyteArray, jint, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: PeeledOnion_clone_ptr + * Method: ClaimedHTLC_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeeledOnion_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PeeledOnion_clone + * Method: ClaimedHTLC_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeeledOnion_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PeeledOnion_forward - * Signature: (JJ)J + * Method: ClaimedHTLC_eq + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeeledOnion_1forward +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1eq (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: PeeledOnion_receive - * Signature: (J[BJ)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeeledOnion_1receive - (JNIEnv *, jclass, jlong, jbyteArray, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: create_onion_message_resolving_destination - * Signature: (JJJJJJJ)J + * Method: ClaimedHTLC_write + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create_1onion_1message_1resolving_1destination - (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong, jlong, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1write + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: create_onion_message - * Signature: (JJJJJJ)J + * Method: ClaimedHTLC_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create_1onion_1message - (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: peel_onion_message - * Signature: (JJJJ)J + * Method: PathFailure_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_peel_1onion_1message - (JNIEnv *, jclass, jlong, jlong, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PathFailure_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OnionMessenger_new - * Signature: (JJJJJJJ)J + * Method: PathFailure_clone_ptr + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1new - (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PathFailure_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OnionMessenger_send_onion_message - * Signature: (JJJJ)J + * Method: PathFailure_clone + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1send_1onion_1message - (JNIEnv *, jclass, jlong, jlong, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PathFailure_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OnionMessenger_as_OnionMessageHandler + * Method: PathFailure_initial_send * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1as_1OnionMessageHandler +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PathFailure_1initial_1send (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OffersMessageHandler_free - * Signature: (J)V + * Method: PathFailure_on_path + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OffersMessageHandler_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PathFailure_1on_1path (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OffersMessage_free - * Signature: (J)V + * Method: PathFailure_eq + * Signature: (JJ)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OffersMessage_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PathFailure_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: OffersMessage_clone_ptr - * Signature: (J)J + * Method: PathFailure_write + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OffersMessage_1clone_1ptr +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_PathFailure_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OffersMessage_clone - * Signature: (J)J + * Method: PathFailure_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OffersMessage_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PathFailure_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: OffersMessage_invoice_request - * Signature: (J)J + * Method: ClosureReason_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OffersMessage_1invoice_1request +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosureReason_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OffersMessage_invoice + * Method: ClosureReason_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OffersMessage_1invoice +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OffersMessage_invoice_error + * Method: ClosureReason_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OffersMessage_1invoice_1error +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OffersMessage_is_known_type - * Signature: (J)Z + * Method: ClosureReason_counterparty_force_closed + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OffersMessage_1is_1known_1type +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1counterparty_1force_1closed (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OffersMessage_as_OnionMessageContents + * Method: ClosureReason_holder_force_closed * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OffersMessage_1as_1OnionMessageContents +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1holder_1force_1closed (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OffersMessage_write - * Signature: (J)[B + * Method: ClosureReason_legacy_cooperative_closure + * Signature: ()J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OffersMessage_1write - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1legacy_1cooperative_1closure + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: OffersMessage_read - * Signature: ([BJJ)J + * Method: ClosureReason_counterparty_initiated_cooperative_closure + * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OffersMessage_1read - (JNIEnv *, jclass, jbyteArray, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1counterparty_1initiated_1cooperative_1closure + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: Packet_free - * Signature: (J)V + * Method: ClosureReason_locally_initiated_cooperative_closure + * Signature: ()J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Packet_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1locally_1initiated_1cooperative_1closure + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: Packet_get_version - * Signature: (J)B + * Method: ClosureReason_commitment_tx_confirmed + * Signature: ()J */ -JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_Packet_1get_1version - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1commitment_1tx_1confirmed + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: Packet_set_version - * Signature: (JB)V + * Method: ClosureReason_funding_timed_out + * Signature: ()J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Packet_1set_1version - (JNIEnv *, jclass, jlong, jbyte); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1funding_1timed_1out + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: Packet_get_public_key - * Signature: (J)[B + * Method: ClosureReason_processing_error + * Signature: (Ljava/lang/String;)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Packet_1get_1public_1key - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1processing_1error + (JNIEnv *, jclass, jstring); /* * Class: org_ldk_impl_bindings - * Method: Packet_set_public_key - * Signature: (J[B)V + * Method: ClosureReason_disconnected_peer + * Signature: ()J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Packet_1set_1public_1key - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1disconnected_1peer + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: Packet_get_hop_data - * Signature: (J)[B + * Method: ClosureReason_outdated_channel_manager + * Signature: ()J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Packet_1get_1hop_1data - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1outdated_1channel_1manager + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: Packet_set_hop_data - * Signature: (J[B)V + * Method: ClosureReason_counterparty_coop_closed_unfunded_channel + * Signature: ()J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Packet_1set_1hop_1data - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1counterparty_1coop_1closed_1unfunded_1channel + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: Packet_get_hmac - * Signature: (J)[B + * Method: ClosureReason_funding_batch_closure + * Signature: ()J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Packet_1get_1hmac - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1funding_1batch_1closure + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: Packet_set_hmac - * Signature: (J[B)V + * Method: ClosureReason_htlcs_timed_out + * Signature: ()J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Packet_1set_1hmac - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1htlcs_1timed_1out + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: Packet_new - * Signature: (B[B[B[B)J + * Method: ClosureReason_peer_feerate_too_low + * Signature: (II)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Packet_1new - (JNIEnv *, jclass, jbyte, jbyteArray, jbyteArray, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1peer_1feerate_1too_1low + (JNIEnv *, jclass, jint, jint); /* * Class: org_ldk_impl_bindings - * Method: Packet_clone_ptr - * Signature: (J)J + * Method: ClosureReason_eq + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Packet_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ClosureReason_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Packet_clone - * Signature: (J)J + * Method: ClosureReason_to_str + * Signature: (J)Ljava/lang/String; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Packet_1clone +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ClosureReason_1to_1str (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Packet_hash - * Signature: (J)J + * Method: ClosureReason_write + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Packet_1hash +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClosureReason_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Packet_eq - * Signature: (JJ)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Packet_1eq - (JNIEnv *, jclass, jlong, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: Packet_write - * Signature: (J)[B + * Method: ClosureReason_read + * Signature: ([B)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Packet_1write - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ParsedOnionMessageContents_free + * Method: HTLCDestination_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ParsedOnionMessageContents_clone_ptr + * Method: HTLCDestination_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ParsedOnionMessageContents_clone + * Method: HTLCDestination_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ParsedOnionMessageContents_offers - * Signature: (J)J + * Method: HTLCDestination_next_hop_channel + * Signature: ([BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1offers - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1next_1hop_1channel + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: ParsedOnionMessageContents_custom + * Method: HTLCDestination_unknown_next_hop * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1custom +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1unknown_1next_1hop (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ParsedOnionMessageContents_as_OnionMessageContents + * Method: HTLCDestination_invalid_forward * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1as_1OnionMessageContents +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1invalid_1forward (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ParsedOnionMessageContents_write - * Signature: (J)[B + * Method: HTLCDestination_invalid_onion + * Signature: ()J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1write - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1invalid_1onion + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: OnionMessageContents_clone_ptr - * Signature: (J)J + * Method: HTLCDestination_failed_payment + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1failed_1payment + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: OnionMessageContents_clone - * Signature: (J)J + * Method: HTLCDestination_eq + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: OnionMessageContents_free - * Signature: (J)V + * Method: HTLCDestination_write + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1free +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NextMessageHop_free - * Signature: (J)V + * Method: HTLCDestination_read + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: NextMessageHop_clone_ptr - * Signature: (J)J + * Method: PaymentFailureReason_clone + * Signature: (J)Lorg/ldk/enums/PaymentFailureReason; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1clone_1ptr +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NextMessageHop_clone - * Signature: (J)J + * Method: PaymentFailureReason_recipient_rejected + * Signature: ()Lorg/ldk/enums/PaymentFailureReason; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1recipient_1rejected + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: NextMessageHop_node_id - * Signature: ([B)J + * Method: PaymentFailureReason_user_abandoned + * Signature: ()Lorg/ldk/enums/PaymentFailureReason; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1node_1id - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1user_1abandoned + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: NextMessageHop_short_channel_id - * Signature: (J)J + * Method: PaymentFailureReason_retries_exhausted + * Signature: ()Lorg/ldk/enums/PaymentFailureReason; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1short_1channel_1id - (JNIEnv *, jclass, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1retries_1exhausted + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: NextMessageHop_hash - * Signature: (J)J + * Method: PaymentFailureReason_payment_expired + * Signature: ()Lorg/ldk/enums/PaymentFailureReason; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1hash - (JNIEnv *, jclass, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1payment_1expired + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: NextMessageHop_eq - * Signature: (JJ)Z + * Method: PaymentFailureReason_route_not_found + * Signature: ()Lorg/ldk/enums/PaymentFailureReason; */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NextMessageHop_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1route_1not_1found + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: BlindedPath_free - * Signature: (J)V + * Method: PaymentFailureReason_unexpected_error + * Signature: ()Lorg/ldk/enums/PaymentFailureReason; */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPath_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1unexpected_1error + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: BlindedPath_get_introduction_node - * Signature: (J)J + * Method: PaymentFailureReason_unknown_required_features + * Signature: ()Lorg/ldk/enums/PaymentFailureReason; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPath_1get_1introduction_1node - (JNIEnv *, jclass, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1unknown_1required_1features + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: BlindedPath_set_introduction_node - * Signature: (JJ)V + * Method: PaymentFailureReason_invoice_request_expired + * Signature: ()Lorg/ldk/enums/PaymentFailureReason; */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPath_1set_1introduction_1node - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1invoice_1request_1expired + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: BlindedPath_get_blinding_point - * Signature: (J)[B + * Method: PaymentFailureReason_invoice_request_rejected + * Signature: ()Lorg/ldk/enums/PaymentFailureReason; */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BlindedPath_1get_1blinding_1point - (JNIEnv *, jclass, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1invoice_1request_1rejected + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: BlindedPath_set_blinding_point - * Signature: (J[B)V + * Method: PaymentFailureReason_eq + * Signature: (JJ)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPath_1set_1blinding_1point - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedPath_get_blinded_hops - * Signature: (J)[J + * Method: PaymentFailureReason_write + * Signature: (J)[B */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_BlindedPath_1get_1blinded_1hops +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedPath_set_blinded_hops - * Signature: (J[J)V + * Method: PaymentFailureReason_read + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPath_1set_1blinded_1hops - (JNIEnv *, jclass, jlong, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: BlindedPath_new - * Signature: (J[B[J)J + * Method: Event_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPath_1new - (JNIEnv *, jclass, jlong, jbyteArray, jlongArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Event_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedPath_clone_ptr + * Method: Event_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPath_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedPath_clone + * Method: Event_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPath_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedPath_hash - * Signature: (J)J + * Method: Event_funding_generation_ready + * Signature: (J[BJ[B[B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPath_1hash - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1funding_1generation_1ready + (JNIEnv *, jclass, jlong, jbyteArray, jlong, jbyteArray, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: BlindedPath_eq - * Signature: (JJ)Z + * Method: Event_funding_tx_broadcast_safe + * Signature: (J[BJ[BJ)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedPath_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1funding_1tx_1broadcast_1safe + (JNIEnv *, jclass, jlong, jbyteArray, jlong, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: IntroductionNode_free - * Signature: (J)V + * Method: Event_payment_claimable + * Signature: ([B[BJJJJJJJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1claimable + (JNIEnv *, jclass, jbyteArray, jbyteArray, jlong, jlong, jlong, jlong, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: IntroductionNode_clone_ptr - * Signature: (J)J + * Method: Event_payment_claimed + * Signature: ([B[BJJ[JJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1claimed + (JNIEnv *, jclass, jbyteArray, jbyteArray, jlong, jlong, jlongArray, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: IntroductionNode_clone - * Signature: (J)J + * Method: Event_connection_needed + * Signature: ([B[J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1connection_1needed + (JNIEnv *, jclass, jbyteArray, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: IntroductionNode_node_id - * Signature: ([B)J + * Method: Event_invoice_received + * Signature: ([BJJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1node_1id - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1invoice_1received + (JNIEnv *, jclass, jbyteArray, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: IntroductionNode_directed_short_channel_id - * Signature: (Lorg/ldk/enums/Direction;J)J + * Method: Event_payment_sent + * Signature: (J[B[BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1directed_1short_1channel_1id - (JNIEnv *, jclass, jobject, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1sent + (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: IntroductionNode_hash - * Signature: (J)J + * Method: Event_payment_failed + * Signature: ([BJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1hash - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1failed + (JNIEnv *, jclass, jbyteArray, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: IntroductionNode_eq - * Signature: (JJ)Z + * Method: Event_payment_path_successful + * Signature: ([BJJ)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_IntroductionNode_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1successful + (JNIEnv *, jclass, jbyteArray, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Direction_clone - * Signature: (J)Lorg/ldk/enums/Direction; + * Method: Event_payment_path_failed + * Signature: (J[BZJJJ)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Direction_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1failed + (JNIEnv *, jclass, jlong, jbyteArray, jboolean, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Direction_node_one - * Signature: ()Lorg/ldk/enums/Direction; + * Method: Event_probe_successful + * Signature: ([B[BJ)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Direction_1node_1one - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1probe_1successful + (JNIEnv *, jclass, jbyteArray, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: Direction_node_two - * Signature: ()Lorg/ldk/enums/Direction; + * Method: Event_probe_failed + * Signature: ([B[BJJ)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Direction_1node_1two - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1probe_1failed + (JNIEnv *, jclass, jbyteArray, jbyteArray, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Direction_hash + * Method: Event_pending_htlcs_forwardable * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Direction_1hash +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1pending_1htlcs_1forwardable (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Direction_eq - * Signature: (JJ)Z + * Method: Event_htlcintercepted + * Signature: ([BJ[BJJ)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Direction_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1htlcintercepted + (JNIEnv *, jclass, jbyteArray, jlong, jbyteArray, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeIdLookUp_free - * Signature: (J)V + * Method: Event_spendable_outputs + * Signature: ([JJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeIdLookUp_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1spendable_1outputs + (JNIEnv *, jclass, jlongArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: EmptyNodeIdLookUp_free - * Signature: (J)V + * Method: Event_payment_forwarded + * Signature: (JJJJJJZJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EmptyNodeIdLookUp_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1forwarded + (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong, jlong, jboolean, jlong); /* * Class: org_ldk_impl_bindings - * Method: EmptyNodeIdLookUp_new - * Signature: ()J + * Method: Event_channel_pending + * Signature: (J[BJ[BJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_EmptyNodeIdLookUp_1new - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1channel_1pending + (JNIEnv *, jclass, jlong, jbyteArray, jlong, jbyteArray, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: EmptyNodeIdLookUp_as_NodeIdLookUp + * Method: Event_channel_ready + * Signature: (J[B[BJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1channel_1ready + (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Event_channel_closed + * Signature: (J[BJ[BJJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1channel_1closed + (JNIEnv *, jclass, jlong, jbyteArray, jlong, jbyteArray, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Event_discard_funding + * Signature: (JJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1discard_1funding + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Event_open_channel_request + * Signature: (J[BJJJZJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1open_1channel_1request + (JNIEnv *, jclass, jlong, jbyteArray, jlong, jlong, jlong, jboolean, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Event_htlchandling_failed + * Signature: (JJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1htlchandling_1failed + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Event_bump_transaction * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_EmptyNodeIdLookUp_1as_1NodeIdLookUp +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1bump_1transaction (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedHop_free - * Signature: (J)V + * Method: Event_onion_message_intercepted + * Signature: ([BJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedHop_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1onion_1message_1intercepted + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedHop_get_blinded_node_id - * Signature: (J)[B + * Method: Event_onion_message_peer_connected + * Signature: ([B)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BlindedHop_1get_1blinded_1node_1id - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1onion_1message_1peer_1connected + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: BlindedHop_set_blinded_node_id - * Signature: (J[B)V + * Method: Event_eq + * Signature: (JJ)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedHop_1set_1blinded_1node_1id - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Event_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedHop_get_encrypted_payload + * Method: Event_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BlindedHop_1get_1encrypted_1payload +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Event_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedHop_set_encrypted_payload - * Signature: (J[B)V + * Method: Event_read + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedHop_1set_1encrypted_1payload - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: BlindedHop_new - * Signature: ([B[B)J + * Method: MessageSendEvent_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedHop_1new - (JNIEnv *, jclass, jbyteArray, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedHop_clone_ptr + * Method: MessageSendEvent_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedHop_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedHop_clone + * Method: MessageSendEvent_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedHop_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedHop_hash - * Signature: (J)J + * Method: MessageSendEvent_send_accept_channel + * Signature: ([BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedHop_1hash - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1accept_1channel + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedHop_eq - * Signature: (JJ)Z + * Method: MessageSendEvent_send_accept_channel_v2 + * Signature: ([BJ)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedHop_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1accept_1channel_1v2 + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedPath_one_hop_for_message + * Method: MessageSendEvent_send_open_channel * Signature: ([BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPath_1one_1hop_1for_1message +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1open_1channel (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedPath_new_for_message - * Signature: ([[BJ)J + * Method: MessageSendEvent_send_open_channel_v2 + * Signature: ([BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPath_1new_1for_1message - (JNIEnv *, jclass, jobjectArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1open_1channel_1v2 + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedPath_one_hop_for_payment - * Signature: ([BJSJ)J + * Method: MessageSendEvent_send_funding_created + * Signature: ([BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPath_1one_1hop_1for_1payment - (JNIEnv *, jclass, jbyteArray, jlong, jshort, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1funding_1created + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedPath_new_for_payment - * Signature: ([J[BJJSJ)J + * Method: MessageSendEvent_send_funding_signed + * Signature: ([BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPath_1new_1for_1payment - (JNIEnv *, jclass, jlongArray, jbyteArray, jlong, jlong, jshort, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1funding_1signed + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedPath_public_introduction_node_id - * Signature: (JJ)J + * Method: MessageSendEvent_send_stfu + * Signature: ([BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPath_1public_1introduction_1node_1id - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1stfu + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedPath_write - * Signature: (J)[B + * Method: MessageSendEvent_send_splice_init + * Signature: ([BJ)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BlindedPath_1write - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1splice_1init + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedPath_read - * Signature: ([B)J + * Method: MessageSendEvent_send_splice_ack + * Signature: ([BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPath_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1splice_1ack + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedHop_write - * Signature: (J)[B + * Method: MessageSendEvent_send_splice_locked + * Signature: ([BJ)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BlindedHop_1write - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1splice_1locked + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedHop_read - * Signature: ([B)J + * Method: MessageSendEvent_send_tx_add_input + * Signature: ([BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedHop_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1add_1input + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: ForwardNode_free - * Signature: (J)V + * Method: MessageSendEvent_send_tx_add_output + * Signature: ([BJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardNode_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1add_1output + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: ForwardNode_get_tlvs - * Signature: (J)J + * Method: MessageSendEvent_send_tx_remove_input + * Signature: ([BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ForwardNode_1get_1tlvs - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1remove_1input + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: ForwardNode_set_tlvs - * Signature: (JJ)V + * Method: MessageSendEvent_send_tx_remove_output + * Signature: ([BJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardNode_1set_1tlvs - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1remove_1output + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: ForwardNode_get_node_id - * Signature: (J)[B + * Method: MessageSendEvent_send_tx_complete + * Signature: ([BJ)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ForwardNode_1get_1node_1id - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1complete + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: ForwardNode_set_node_id - * Signature: (J[B)V + * Method: MessageSendEvent_send_tx_signatures + * Signature: ([BJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardNode_1set_1node_1id - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1signatures + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: ForwardNode_get_htlc_maximum_msat - * Signature: (J)J + * Method: MessageSendEvent_send_tx_init_rbf + * Signature: ([BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ForwardNode_1get_1htlc_1maximum_1msat - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1init_1rbf + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: ForwardNode_set_htlc_maximum_msat - * Signature: (JJ)V + * Method: MessageSendEvent_send_tx_ack_rbf + * Signature: ([BJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardNode_1set_1htlc_1maximum_1msat - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1ack_1rbf + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: ForwardNode_new - * Signature: (J[BJ)J + * Method: MessageSendEvent_send_tx_abort + * Signature: ([BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ForwardNode_1new - (JNIEnv *, jclass, jlong, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1abort + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: ForwardNode_clone_ptr - * Signature: (J)J + * Method: MessageSendEvent_send_channel_ready + * Signature: ([BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ForwardNode_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1ready + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: ForwardNode_clone - * Signature: (J)J + * Method: MessageSendEvent_send_announcement_signatures + * Signature: ([BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ForwardNode_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1announcement_1signatures + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: ForwardTlvs_free - * Signature: (J)V + * Method: MessageSendEvent_update_htlcs + * Signature: ([BJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1update_1htlcs + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: ForwardTlvs_get_short_channel_id - * Signature: (J)J + * Method: MessageSendEvent_send_revoke_and_ack + * Signature: ([BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1get_1short_1channel_1id - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1revoke_1and_1ack + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: ForwardTlvs_set_short_channel_id - * Signature: (JJ)V + * Method: MessageSendEvent_send_closing_signed + * Signature: ([BJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1set_1short_1channel_1id - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1closing_1signed + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: ForwardTlvs_get_payment_relay - * Signature: (J)J + * Method: MessageSendEvent_send_shutdown + * Signature: ([BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1get_1payment_1relay - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1shutdown + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: ForwardTlvs_set_payment_relay - * Signature: (JJ)V + * Method: MessageSendEvent_send_channel_reestablish + * Signature: ([BJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1set_1payment_1relay - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1reestablish + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: ForwardTlvs_get_payment_constraints - * Signature: (J)J + * Method: MessageSendEvent_send_channel_announcement + * Signature: ([BJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1get_1payment_1constraints - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1announcement + (JNIEnv *, jclass, jbyteArray, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ForwardTlvs_set_payment_constraints - * Signature: (JJ)V + * Method: MessageSendEvent_broadcast_channel_announcement + * Signature: (JJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1set_1payment_1constraints +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1channel_1announcement (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ForwardTlvs_get_features + * Method: MessageSendEvent_broadcast_channel_update * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1get_1features +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1channel_1update (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ForwardTlvs_set_features - * Signature: (JJ)V + * Method: MessageSendEvent_broadcast_node_announcement + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1set_1features - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1node_1announcement + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ForwardTlvs_new - * Signature: (JJJJ)J + * Method: MessageSendEvent_send_channel_update + * Signature: ([BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1new - (JNIEnv *, jclass, jlong, jlong, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1update + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: ForwardTlvs_clone_ptr - * Signature: (J)J + * Method: MessageSendEvent_handle_error + * Signature: ([BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1handle_1error + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: ForwardTlvs_clone - * Signature: (J)J + * Method: MessageSendEvent_send_channel_range_query + * Signature: ([BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1range_1query + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: ReceiveTlvs_free - * Signature: (J)V + * Method: MessageSendEvent_send_short_ids_query + * Signature: ([BJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1short_1ids_1query + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: ReceiveTlvs_get_payment_secret - * Signature: (J)[B + * Method: MessageSendEvent_send_reply_channel_range + * Signature: ([BJ)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1get_1payment_1secret - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1reply_1channel_1range + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: ReceiveTlvs_set_payment_secret - * Signature: (J[B)V + * Method: MessageSendEvent_send_gossip_timestamp_filter + * Signature: ([BJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1set_1payment_1secret - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1gossip_1timestamp_1filter + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: ReceiveTlvs_get_payment_constraints - * Signature: (J)J + * Method: MessageSendEventsProvider_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1get_1payment_1constraints +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ReceiveTlvs_set_payment_constraints - * Signature: (JJ)V + * Method: EventsProvider_free + * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1set_1payment_1constraints - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ReceiveTlvs_get_payment_context - * Signature: (J)J + * Method: ReplayEvent_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1get_1payment_1context +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplayEvent_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ReceiveTlvs_set_payment_context - * Signature: (JJ)V + * Method: ReplayEvent_new + * Signature: ()J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1set_1payment_1context - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplayEvent_1new + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: ReceiveTlvs_new - * Signature: ([BJJ)J + * Method: ReplayEvent_clone_ptr + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1new - (JNIEnv *, jclass, jbyteArray, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplayEvent_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ReceiveTlvs_clone_ptr + * Method: ReplayEvent_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplayEvent_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ReceiveTlvs_clone - * Signature: (J)J + * Method: EventHandler_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1clone +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventHandler_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentRelay_free + * Method: AnchorDescriptor_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentRelay_get_cltv_expiry_delta - * Signature: (J)S + * Method: AnchorDescriptor_get_channel_derivation_parameters + * Signature: (J)J */ -JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1get_1cltv_1expiry_1delta +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1get_1channel_1derivation_1parameters (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentRelay_set_cltv_expiry_delta - * Signature: (JS)V + * Method: AnchorDescriptor_set_channel_derivation_parameters + * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1set_1cltv_1expiry_1delta - (JNIEnv *, jclass, jlong, jshort); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1set_1channel_1derivation_1parameters + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentRelay_get_fee_proportional_millionths - * Signature: (J)I + * Method: AnchorDescriptor_get_outpoint + * Signature: (J)J */ -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1get_1fee_1proportional_1millionths +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1get_1outpoint (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentRelay_set_fee_proportional_millionths - * Signature: (JI)V + * Method: AnchorDescriptor_set_outpoint + * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1set_1fee_1proportional_1millionths - (JNIEnv *, jclass, jlong, jint); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1set_1outpoint + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentRelay_get_fee_base_msat - * Signature: (J)I + * Method: AnchorDescriptor_new + * Signature: (JJ)J */ -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1get_1fee_1base_1msat - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1new + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentRelay_set_fee_base_msat - * Signature: (JI)V + * Method: AnchorDescriptor_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1set_1fee_1base_1msat - (JNIEnv *, jclass, jlong, jint); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentRelay_new - * Signature: (SII)J + * Method: AnchorDescriptor_clone + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1new - (JNIEnv *, jclass, jshort, jint, jint); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentRelay_clone_ptr + * Method: AnchorDescriptor_eq + * Signature: (JJ)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1eq + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: AnchorDescriptor_previous_utxo * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1previous_1utxo (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentRelay_clone + * Method: AnchorDescriptor_unsigned_tx_input * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1unsigned_1tx_1input (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentConstraints_free - * Signature: (J)V + * Method: AnchorDescriptor_witness_script + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1free +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1witness_1script (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentConstraints_get_max_cltv_expiry - * Signature: (J)I + * Method: AnchorDescriptor_tx_input_witness + * Signature: (J[B)[B */ -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1get_1max_1cltv_1expiry - (JNIEnv *, jclass, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1tx_1input_1witness + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: PaymentConstraints_set_max_cltv_expiry - * Signature: (JI)V + * Method: AnchorDescriptor_derive_channel_signer + * Signature: (JJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1set_1max_1cltv_1expiry - (JNIEnv *, jclass, jlong, jint); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1derive_1channel_1signer + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentConstraints_get_htlc_minimum_msat + * Method: BumpTransactionEvent_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BumpTransactionEvent_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: BumpTransactionEvent_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1get_1htlc_1minimum_1msat +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BumpTransactionEvent_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentConstraints_set_htlc_minimum_msat - * Signature: (JJ)V + * Method: BumpTransactionEvent_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1set_1htlc_1minimum_1msat - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BumpTransactionEvent_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentConstraints_new - * Signature: (IJ)J + * Method: BumpTransactionEvent_channel_close + * Signature: (J[B[BI[BJJ[J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1new - (JNIEnv *, jclass, jint, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BumpTransactionEvent_1channel_1close + (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray, jint, jbyteArray, jlong, jlong, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: PaymentConstraints_clone_ptr - * Signature: (J)J + * Method: BumpTransactionEvent_htlcresolution + * Signature: (J[B[BI[JI)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BumpTransactionEvent_1htlcresolution + (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray, jint, jlongArray, jint); /* * Class: org_ldk_impl_bindings - * Method: PaymentConstraints_clone - * Signature: (J)J + * Method: BumpTransactionEvent_eq + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BumpTransactionEvent_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentContext_free + * Method: Input_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentContext_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Input_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentContext_clone_ptr + * Method: Input_get_outpoint * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentContext_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Input_1get_1outpoint (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentContext_clone - * Signature: (J)J + * Method: Input_set_outpoint + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentContext_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Input_1set_1outpoint + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentContext_unknown + * Method: Input_get_previous_utxo * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentContext_1unknown +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Input_1get_1previous_1utxo (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentContext_bolt12_offer - * Signature: (J)J + * Method: Input_set_previous_utxo + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentContext_1bolt12_1offer - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Input_1set_1previous_1utxo + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentContext_bolt12_refund + * Method: Input_get_satisfaction_weight * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentContext_1bolt12_1refund +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Input_1get_1satisfaction_1weight (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentContext_eq - * Signature: (JJ)Z + * Method: Input_set_satisfaction_weight + * Signature: (JJ)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentContext_1eq +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Input_1set_1satisfaction_1weight (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnknownPaymentContext_free - * Signature: (J)V + * Method: Input_new + * Signature: (JJJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Input_1new + (JNIEnv *, jclass, jlong, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Input_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Input_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnknownPaymentContext_clone_ptr + * Method: Input_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Input_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnknownPaymentContext_clone + * Method: Input_hash * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Input_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnknownPaymentContext_eq + * Method: Input_eq * Signature: (JJ)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1eq +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Input_1eq (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12OfferContext_free + * Method: Utxo_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Utxo_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12OfferContext_get_offer_id + * Method: Utxo_get_outpoint * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1get_1offer_1id +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Utxo_1get_1outpoint (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12OfferContext_set_offer_id + * Method: Utxo_set_outpoint * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1set_1offer_1id +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Utxo_1set_1outpoint (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12OfferContext_get_invoice_request + * Method: Utxo_get_output * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1get_1invoice_1request +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Utxo_1get_1output (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12OfferContext_set_invoice_request + * Method: Utxo_set_output * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1set_1invoice_1request - (JNIEnv *, jclass, jlong, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: Bolt12OfferContext_new - * Signature: (JJ)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1new +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Utxo_1set_1output (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12OfferContext_clone_ptr - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1clone_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: Bolt12OfferContext_clone + * Method: Utxo_get_satisfaction_weight * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Utxo_1get_1satisfaction_1weight (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12OfferContext_eq - * Signature: (JJ)Z + * Method: Utxo_set_satisfaction_weight + * Signature: (JJ)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1eq +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Utxo_1set_1satisfaction_1weight (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12RefundContext_free - * Signature: (J)V + * Method: Utxo_new + * Signature: (JJJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Utxo_1new + (JNIEnv *, jclass, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12RefundContext_new - * Signature: ()J + * Method: Utxo_clone_ptr + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1new - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Utxo_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12RefundContext_clone_ptr + * Method: Utxo_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Utxo_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12RefundContext_clone + * Method: Utxo_hash * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Utxo_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12RefundContext_eq + * Method: Utxo_eq * Signature: (JJ)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1eq +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Utxo_1eq (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ForwardTlvs_write - * Signature: (J)[B + * Method: Utxo_new_p2pkh + * Signature: (JJ[B)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1write - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Utxo_1new_1p2pkh + (JNIEnv *, jclass, jlong, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ReceiveTlvs_write - * Signature: (J)[B + * Method: CoinSelection_free + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1write +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CoinSelection_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentRelay_write - * Signature: (J)[B + * Method: CoinSelection_get_confirmed_utxos + * Signature: (J)[J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1write +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_CoinSelection_1get_1confirmed_1utxos (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentRelay_read - * Signature: ([B)J + * Method: CoinSelection_set_confirmed_utxos + * Signature: (J[J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentRelay_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CoinSelection_1set_1confirmed_1utxos + (JNIEnv *, jclass, jlong, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: PaymentConstraints_write - * Signature: (J)[B + * Method: CoinSelection_get_change_output + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1write +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CoinSelection_1get_1change_1output (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentConstraints_read - * Signature: ([B)J + * Method: CoinSelection_set_change_output + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentConstraints_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CoinSelection_1set_1change_1output + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentContext_write - * Signature: (J)[B + * Method: CoinSelection_new + * Signature: ([JJ)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_PaymentContext_1write - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CoinSelection_1new + (JNIEnv *, jclass, jlongArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentContext_read - * Signature: ([B)J + * Method: CoinSelection_clone_ptr + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentContext_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CoinSelection_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnknownPaymentContext_write - * Signature: (J)[B + * Method: CoinSelection_clone + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1write +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CoinSelection_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnknownPaymentContext_read - * Signature: ([B)J + * Method: CoinSelectionSource_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CoinSelectionSource_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12OfferContext_write - * Signature: (J)[B + * Method: WalletSource_free + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1write +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WalletSource_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12OfferContext_read - * Signature: ([B)J + * Method: Wallet_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12OfferContext_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Wallet_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12RefundContext_write - * Signature: (J)[B + * Method: Wallet_new + * Signature: (JJ)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1write - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Wallet_1new + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt12RefundContext_read - * Signature: ([B)J + * Method: Wallet_as_CoinSelectionSource + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12RefundContext_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Wallet_1as_1CoinSelectionSource + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentPurpose_free + * Method: BumpTransactionEventHandler_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BumpTransactionEventHandler_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentPurpose_clone_ptr - * Signature: (J)J + * Method: BumpTransactionEventHandler_new + * Signature: (JJJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BumpTransactionEventHandler_1new + (JNIEnv *, jclass, jlong, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentPurpose_clone - * Signature: (J)J + * Method: BumpTransactionEventHandler_handle_event + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BumpTransactionEventHandler_1handle_1event + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentPurpose_bolt11_invoice_payment - * Signature: (J[B)J + * Method: InitFeatures_eq + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1bolt11_1invoice_1payment - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentPurpose_bolt12_offer_payment - * Signature: (J[BJ)J + * Method: NodeFeatures_eq + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1bolt12_1offer_1payment - (JNIEnv *, jclass, jlong, jbyteArray, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentPurpose_bolt12_refund_payment - * Signature: (J[BJ)J + * Method: ChannelFeatures_eq + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1bolt12_1refund_1payment - (JNIEnv *, jclass, jlong, jbyteArray, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentPurpose_spontaneous_payment - * Signature: ([B)J + * Method: Bolt11InvoiceFeatures_eq + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1spontaneous_1payment - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentPurpose_eq + * Method: OfferFeatures_eq * Signature: (JJ)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1eq +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1eq (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentPurpose_preimage - * Signature: (J)J + * Method: InvoiceRequestFeatures_eq + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1preimage - (JNIEnv *, jclass, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentPurpose_write - * Signature: (J)[B + * Method: Bolt12InvoiceFeatures_eq + * Signature: (JJ)Z */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1write - (JNIEnv *, jclass, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentPurpose_read - * Signature: ([B)J + * Method: BlindedHopFeatures_eq + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClaimedHTLC_free - * Signature: (J)V + * Method: ChannelTypeFeatures_eq + * Signature: (JJ)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClaimedHTLC_get_channel_id + * Method: InitFeatures_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1get_1channel_1id +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClaimedHTLC_set_channel_id - * Signature: (JJ)V + * Method: InitFeatures_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1set_1channel_1id - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClaimedHTLC_get_user_channel_id - * Signature: (J)[B + * Method: NodeFeatures_clone_ptr + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1get_1user_1channel_1id +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClaimedHTLC_set_user_channel_id - * Signature: (J[B)V + * Method: NodeFeatures_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1set_1user_1channel_1id - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClaimedHTLC_get_cltv_expiry - * Signature: (J)I + * Method: ChannelFeatures_clone_ptr + * Signature: (J)J */ -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1get_1cltv_1expiry +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClaimedHTLC_set_cltv_expiry - * Signature: (JI)V + * Method: ChannelFeatures_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1set_1cltv_1expiry - (JNIEnv *, jclass, jlong, jint); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClaimedHTLC_get_value_msat + * Method: Bolt11InvoiceFeatures_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1get_1value_1msat +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClaimedHTLC_set_value_msat - * Signature: (JJ)V + * Method: Bolt11InvoiceFeatures_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1set_1value_1msat - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClaimedHTLC_get_counterparty_skimmed_fee_msat + * Method: OfferFeatures_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1get_1counterparty_1skimmed_1fee_1msat +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClaimedHTLC_set_counterparty_skimmed_fee_msat - * Signature: (JJ)V + * Method: OfferFeatures_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1set_1counterparty_1skimmed_1fee_1msat - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClaimedHTLC_new - * Signature: (J[BIJJ)J + * Method: InvoiceRequestFeatures_clone_ptr + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1new - (JNIEnv *, jclass, jlong, jbyteArray, jint, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClaimedHTLC_clone_ptr + * Method: InvoiceRequestFeatures_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClaimedHTLC_clone + * Method: Bolt12InvoiceFeatures_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClaimedHTLC_eq - * Signature: (JJ)Z + * Method: Bolt12InvoiceFeatures_clone + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClaimedHTLC_write - * Signature: (J)[B + * Method: BlindedHopFeatures_clone_ptr + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1write +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClaimedHTLC_read - * Signature: ([B)J + * Method: BlindedHopFeatures_clone + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClaimedHTLC_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PathFailure_free - * Signature: (J)V + * Method: ChannelTypeFeatures_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PathFailure_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PathFailure_clone_ptr + * Method: ChannelTypeFeatures_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PathFailure_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PathFailure_clone + * Method: InitFeatures_hash * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PathFailure_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PathFailure_initial_send + * Method: NodeFeatures_hash * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PathFailure_1initial_1send +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PathFailure_on_path + * Method: ChannelFeatures_hash * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PathFailure_1on_1path +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PathFailure_eq - * Signature: (JJ)Z + * Method: Bolt11InvoiceFeatures_hash + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PathFailure_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1hash + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PathFailure_write - * Signature: (J)[B + * Method: OfferFeatures_hash + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_PathFailure_1write +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PathFailure_read - * Signature: ([B)J + * Method: InvoiceRequestFeatures_hash + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PathFailure_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1hash + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClosureReason_free - * Signature: (J)V + * Method: Bolt12InvoiceFeatures_hash + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosureReason_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClosureReason_clone_ptr + * Method: BlindedHopFeatures_hash * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClosureReason_clone + * Method: ChannelTypeFeatures_hash * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClosureReason_counterparty_force_closed - * Signature: (J)J + * Method: InitFeatures_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1counterparty_1force_1closed +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClosureReason_holder_force_closed - * Signature: ()J + * Method: NodeFeatures_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1holder_1force_1closed - (JNIEnv *, jclass); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClosureReason_legacy_cooperative_closure - * Signature: ()J + * Method: ChannelFeatures_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1legacy_1cooperative_1closure - (JNIEnv *, jclass); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClosureReason_counterparty_initiated_cooperative_closure - * Signature: ()J + * Method: Bolt11InvoiceFeatures_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1counterparty_1initiated_1cooperative_1closure - (JNIEnv *, jclass); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClosureReason_locally_initiated_cooperative_closure - * Signature: ()J + * Method: OfferFeatures_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1locally_1initiated_1cooperative_1closure - (JNIEnv *, jclass); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClosureReason_commitment_tx_confirmed - * Signature: ()J + * Method: InvoiceRequestFeatures_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1commitment_1tx_1confirmed - (JNIEnv *, jclass); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClosureReason_funding_timed_out - * Signature: ()J + * Method: Bolt12InvoiceFeatures_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1funding_1timed_1out - (JNIEnv *, jclass); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClosureReason_processing_error - * Signature: (Ljava/lang/String;)J + * Method: BlindedHopFeatures_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1processing_1error - (JNIEnv *, jclass, jstring); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClosureReason_disconnected_peer - * Signature: ()J + * Method: ChannelTypeFeatures_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1disconnected_1peer - (JNIEnv *, jclass); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClosureReason_outdated_channel_manager - * Signature: ()J + * Method: Bolt11InvoiceFeatures_for_keysend + * Signature: (Z)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1outdated_1channel_1manager - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1for_1keysend + (JNIEnv *, jclass, jboolean); /* * Class: org_ldk_impl_bindings - * Method: ClosureReason_counterparty_coop_closed_unfunded_channel + * Method: ChannelTypeFeatures_only_static_remote_key * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1counterparty_1coop_1closed_1unfunded_1channel +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1only_1static_1remote_1key (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: ClosureReason_funding_batch_closure + * Method: ChannelTypeFeatures_anchors_zero_htlc_fee_and_dependencies * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1funding_1batch_1closure +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1anchors_1zero_1htlc_1fee_1and_1dependencies (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: ClosureReason_htlcs_timed_out + * Method: InitFeatures_empty * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1htlcs_1timed_1out +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1empty (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: ClosureReason_eq - * Signature: (JJ)Z + * Method: InitFeatures_le_flags + * Signature: (J)[B */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ClosureReason_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InitFeatures_1le_1flags + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClosureReason_to_str - * Signature: (J)Ljava/lang/String; + * Method: InitFeatures_supports_any_optional_bits + * Signature: (J)Z */ -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ClosureReason_1to_1str +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1any_1optional_1bits (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClosureReason_write - * Signature: (J)[B + * Method: InitFeatures_requires_unknown_bits_from + * Signature: (JJ)Z */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClosureReason_1write - (JNIEnv *, jclass, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1unknown_1bits_1from + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClosureReason_read - * Signature: ([B)J + * Method: InitFeatures_required_unknown_bits_from + * Signature: (JJ)[J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_InitFeatures_1required_1unknown_1bits_1from + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCDestination_free - * Signature: (J)V + * Method: InitFeatures_requires_unknown_bits + * Signature: (J)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1free +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1unknown_1bits (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCDestination_clone_ptr - * Signature: (J)J + * Method: InitFeatures_supports_unknown_bits + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1clone_1ptr +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1unknown_1bits (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCDestination_clone - * Signature: (J)J + * Method: InitFeatures_set_required_feature_bit + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1required_1feature_1bit + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCDestination_next_hop_channel - * Signature: ([BJ)J + * Method: InitFeatures_set_optional_feature_bit + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1next_1hop_1channel - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1optional_1feature_1bit + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCDestination_unknown_next_hop - * Signature: (J)J + * Method: InitFeatures_set_required_custom_bit + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1unknown_1next_1hop - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1required_1custom_1bit + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCDestination_invalid_forward - * Signature: (J)J + * Method: InitFeatures_set_optional_custom_bit + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1invalid_1forward - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1optional_1custom_1bit + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCDestination_invalid_onion + * Method: NodeFeatures_empty * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1invalid_1onion +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1empty (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: HTLCDestination_failed_payment - * Signature: ([B)J + * Method: NodeFeatures_le_flags + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1failed_1payment - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1le_1flags + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCDestination_eq - * Signature: (JJ)Z + * Method: NodeFeatures_supports_any_optional_bits + * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1any_1optional_1bits + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCDestination_write - * Signature: (J)[B + * Method: NodeFeatures_requires_unknown_bits_from + * Signature: (JJ)Z */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1write - (JNIEnv *, jclass, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1unknown_1bits_1from + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCDestination_read - * Signature: ([B)J + * Method: NodeFeatures_required_unknown_bits_from + * Signature: (JJ)[J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1required_1unknown_1bits_1from + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentFailureReason_clone - * Signature: (J)Lorg/ldk/enums/PaymentFailureReason; + * Method: NodeFeatures_requires_unknown_bits + * Signature: (J)Z */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1clone +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1unknown_1bits (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentFailureReason_recipient_rejected - * Signature: ()Lorg/ldk/enums/PaymentFailureReason; + * Method: NodeFeatures_supports_unknown_bits + * Signature: (J)Z */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1recipient_1rejected - (JNIEnv *, jclass); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1unknown_1bits + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentFailureReason_user_abandoned - * Signature: ()Lorg/ldk/enums/PaymentFailureReason; + * Method: NodeFeatures_set_required_feature_bit + * Signature: (JJ)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1user_1abandoned - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1required_1feature_1bit + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentFailureReason_retries_exhausted - * Signature: ()Lorg/ldk/enums/PaymentFailureReason; + * Method: NodeFeatures_set_optional_feature_bit + * Signature: (JJ)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1retries_1exhausted - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1optional_1feature_1bit + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentFailureReason_payment_expired - * Signature: ()Lorg/ldk/enums/PaymentFailureReason; + * Method: NodeFeatures_set_required_custom_bit + * Signature: (JJ)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1payment_1expired - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1required_1custom_1bit + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentFailureReason_route_not_found - * Signature: ()Lorg/ldk/enums/PaymentFailureReason; + * Method: NodeFeatures_set_optional_custom_bit + * Signature: (JJ)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1route_1not_1found - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1optional_1custom_1bit + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentFailureReason_unexpected_error - * Signature: ()Lorg/ldk/enums/PaymentFailureReason; + * Method: ChannelFeatures_empty + * Signature: ()J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1unexpected_1error +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1empty (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: PaymentFailureReason_eq - * Signature: (JJ)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1eq - (JNIEnv *, jclass, jlong, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: PaymentFailureReason_write + * Method: ChannelFeatures_le_flags * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1le_1flags (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PaymentFailureReason_read - * Signature: ([B)J + * Method: ChannelFeatures_supports_any_optional_bits + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1supports_1any_1optional_1bits + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Event_free - * Signature: (J)V + * Method: ChannelFeatures_requires_unknown_bits_from + * Signature: (JJ)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Event_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1requires_1unknown_1bits_1from + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Event_clone_ptr - * Signature: (J)J + * Method: ChannelFeatures_required_unknown_bits_from + * Signature: (JJ)[J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1required_1unknown_1bits_1from + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Event_clone - * Signature: (J)J + * Method: ChannelFeatures_requires_unknown_bits + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1clone +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1requires_1unknown_1bits (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Event_funding_generation_ready - * Signature: (J[BJ[B[B)J + * Method: ChannelFeatures_supports_unknown_bits + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1funding_1generation_1ready - (JNIEnv *, jclass, jlong, jbyteArray, jlong, jbyteArray, jbyteArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1supports_1unknown_1bits + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Event_payment_claimable - * Signature: ([B[BJJJJJJJ)J + * Method: ChannelFeatures_set_required_feature_bit + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1claimable - (JNIEnv *, jclass, jbyteArray, jbyteArray, jlong, jlong, jlong, jlong, jlong, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1set_1required_1feature_1bit + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Event_payment_claimed - * Signature: ([B[BJJ[JJ)J + * Method: ChannelFeatures_set_optional_feature_bit + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1claimed - (JNIEnv *, jclass, jbyteArray, jbyteArray, jlong, jlong, jlongArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1set_1optional_1feature_1bit + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Event_connection_needed - * Signature: ([B[J)J + * Method: ChannelFeatures_set_required_custom_bit + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1connection_1needed - (JNIEnv *, jclass, jbyteArray, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1set_1required_1custom_1bit + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Event_invoice_request_failed - * Signature: ([B)J + * Method: ChannelFeatures_set_optional_custom_bit + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1invoice_1request_1failed - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1set_1optional_1custom_1bit + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Event_payment_sent - * Signature: (J[B[BJ)J + * Method: Bolt11InvoiceFeatures_empty + * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1sent - (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1empty + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: Event_payment_failed - * Signature: ([B[BJ)J + * Method: Bolt11InvoiceFeatures_le_flags + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1failed - (JNIEnv *, jclass, jbyteArray, jbyteArray, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1le_1flags + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Event_payment_path_successful - * Signature: ([BJJ)J + * Method: Bolt11InvoiceFeatures_supports_any_optional_bits + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1successful - (JNIEnv *, jclass, jbyteArray, jlong, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1supports_1any_1optional_1bits + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Event_payment_path_failed - * Signature: (J[BZJJJ)J + * Method: Bolt11InvoiceFeatures_requires_unknown_bits_from + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1failed - (JNIEnv *, jclass, jlong, jbyteArray, jboolean, jlong, jlong, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1unknown_1bits_1from + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Event_probe_successful - * Signature: ([B[BJ)J + * Method: Bolt11InvoiceFeatures_required_unknown_bits_from + * Signature: (JJ)[J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1probe_1successful - (JNIEnv *, jclass, jbyteArray, jbyteArray, jlong); +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1required_1unknown_1bits_1from + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Event_probe_failed - * Signature: ([B[BJJ)J + * Method: Bolt11InvoiceFeatures_requires_unknown_bits + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1probe_1failed - (JNIEnv *, jclass, jbyteArray, jbyteArray, jlong, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1unknown_1bits + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Event_pending_htlcs_forwardable - * Signature: (J)J + * Method: Bolt11InvoiceFeatures_supports_unknown_bits + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1pending_1htlcs_1forwardable +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1supports_1unknown_1bits (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Event_htlcintercepted - * Signature: ([BJ[BJJ)J + * Method: Bolt11InvoiceFeatures_set_required_feature_bit + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1htlcintercepted - (JNIEnv *, jclass, jbyteArray, jlong, jbyteArray, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1required_1feature_1bit + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Event_spendable_outputs - * Signature: ([JJ)J + * Method: Bolt11InvoiceFeatures_set_optional_feature_bit + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1spendable_1outputs - (JNIEnv *, jclass, jlongArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1optional_1feature_1bit + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Event_payment_forwarded - * Signature: (JJJJJJZJ)J + * Method: Bolt11InvoiceFeatures_set_required_custom_bit + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1forwarded - (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong, jlong, jboolean, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1required_1custom_1bit + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Event_channel_pending - * Signature: (J[BJ[BJJ)J + * Method: Bolt11InvoiceFeatures_set_optional_custom_bit + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1channel_1pending - (JNIEnv *, jclass, jlong, jbyteArray, jlong, jbyteArray, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1optional_1custom_1bit + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Event_channel_ready - * Signature: (J[B[BJ)J + * Method: OfferFeatures_empty + * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1channel_1ready - (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1empty + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: Event_channel_closed - * Signature: (J[BJ[BJJ)J + * Method: OfferFeatures_le_flags + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1channel_1closed - (JNIEnv *, jclass, jlong, jbyteArray, jlong, jbyteArray, jlong, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1le_1flags + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Event_discard_funding - * Signature: (J[B)J + * Method: OfferFeatures_supports_any_optional_bits + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1discard_1funding - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1supports_1any_1optional_1bits + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Event_open_channel_request - * Signature: (J[BJJJ)J + * Method: OfferFeatures_requires_unknown_bits_from + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1open_1channel_1request - (JNIEnv *, jclass, jlong, jbyteArray, jlong, jlong, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1requires_1unknown_1bits_1from + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Event_htlchandling_failed - * Signature: (JJ)J + * Method: OfferFeatures_required_unknown_bits_from + * Signature: (JJ)[J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1htlchandling_1failed +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1required_1unknown_1bits_1from (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Event_bump_transaction - * Signature: (J)J + * Method: OfferFeatures_requires_unknown_bits + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1bump_1transaction +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1requires_1unknown_1bits (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Event_eq - * Signature: (JJ)Z + * Method: OfferFeatures_supports_unknown_bits + * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Event_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1supports_1unknown_1bits + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Event_write - * Signature: (J)[B + * Method: OfferFeatures_set_required_feature_bit + * Signature: (JJ)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Event_1write - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1set_1required_1feature_1bit + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Event_read - * Signature: ([B)J + * Method: OfferFeatures_set_optional_feature_bit + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1set_1optional_1feature_1bit + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_free - * Signature: (J)V + * Method: OfferFeatures_set_required_custom_bit + * Signature: (JJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1set_1required_1custom_1bit + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_clone_ptr - * Signature: (J)J + * Method: OfferFeatures_set_optional_custom_bit + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1set_1optional_1custom_1bit + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InvoiceRequestFeatures_empty + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1empty + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: InvoiceRequestFeatures_le_flags + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1le_1flags (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_clone - * Signature: (J)J + * Method: InvoiceRequestFeatures_supports_any_optional_bits + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1clone +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1supports_1any_1optional_1bits (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_send_accept_channel - * Signature: ([BJ)J + * Method: InvoiceRequestFeatures_requires_unknown_bits_from + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1accept_1channel - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1requires_1unknown_1bits_1from + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_send_accept_channel_v2 - * Signature: ([BJ)J + * Method: InvoiceRequestFeatures_required_unknown_bits_from + * Signature: (JJ)[J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1accept_1channel_1v2 - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1required_1unknown_1bits_1from + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_send_open_channel - * Signature: ([BJ)J + * Method: InvoiceRequestFeatures_requires_unknown_bits + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1open_1channel - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1requires_1unknown_1bits + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_send_open_channel_v2 - * Signature: ([BJ)J + * Method: InvoiceRequestFeatures_supports_unknown_bits + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1open_1channel_1v2 - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1supports_1unknown_1bits + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_send_funding_created - * Signature: ([BJ)J + * Method: InvoiceRequestFeatures_set_required_feature_bit + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1funding_1created - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1set_1required_1feature_1bit + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_send_funding_signed - * Signature: ([BJ)J + * Method: InvoiceRequestFeatures_set_optional_feature_bit + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1funding_1signed - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1set_1optional_1feature_1bit + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_send_stfu - * Signature: ([BJ)J + * Method: InvoiceRequestFeatures_set_required_custom_bit + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1stfu - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1set_1required_1custom_1bit + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_send_splice - * Signature: ([BJ)J + * Method: InvoiceRequestFeatures_set_optional_custom_bit + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1splice - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1set_1optional_1custom_1bit + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_send_splice_ack - * Signature: ([BJ)J + * Method: Bolt12InvoiceFeatures_empty + * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1splice_1ack - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1empty + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_send_splice_locked - * Signature: ([BJ)J + * Method: Bolt12InvoiceFeatures_le_flags + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1splice_1locked - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1le_1flags + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_send_tx_add_input - * Signature: ([BJ)J + * Method: Bolt12InvoiceFeatures_supports_any_optional_bits + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1add_1input - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1supports_1any_1optional_1bits + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_send_tx_add_output - * Signature: ([BJ)J + * Method: Bolt12InvoiceFeatures_requires_unknown_bits_from + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1add_1output - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1requires_1unknown_1bits_1from + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_send_tx_remove_input - * Signature: ([BJ)J + * Method: Bolt12InvoiceFeatures_required_unknown_bits_from + * Signature: (JJ)[J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1remove_1input - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1required_1unknown_1bits_1from + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_send_tx_remove_output - * Signature: ([BJ)J + * Method: Bolt12InvoiceFeatures_requires_unknown_bits + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1remove_1output - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1requires_1unknown_1bits + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_send_tx_complete - * Signature: ([BJ)J + * Method: Bolt12InvoiceFeatures_supports_unknown_bits + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1complete - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1supports_1unknown_1bits + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_send_tx_signatures - * Signature: ([BJ)J + * Method: Bolt12InvoiceFeatures_set_required_feature_bit + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1signatures - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1required_1feature_1bit + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_send_tx_init_rbf - * Signature: ([BJ)J + * Method: Bolt12InvoiceFeatures_set_optional_feature_bit + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1init_1rbf - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1optional_1feature_1bit + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_send_tx_ack_rbf - * Signature: ([BJ)J + * Method: Bolt12InvoiceFeatures_set_required_custom_bit + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1ack_1rbf - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1required_1custom_1bit + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_send_tx_abort - * Signature: ([BJ)J + * Method: Bolt12InvoiceFeatures_set_optional_custom_bit + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1tx_1abort - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1optional_1custom_1bit + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_send_channel_ready - * Signature: ([BJ)J + * Method: BlindedHopFeatures_empty + * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1ready - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1empty + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_send_announcement_signatures - * Signature: ([BJ)J + * Method: BlindedHopFeatures_le_flags + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1announcement_1signatures - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1le_1flags + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_update_htlcs - * Signature: ([BJ)J + * Method: BlindedHopFeatures_supports_any_optional_bits + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1update_1htlcs - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1supports_1any_1optional_1bits + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_send_revoke_and_ack - * Signature: ([BJ)J + * Method: BlindedHopFeatures_requires_unknown_bits_from + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1revoke_1and_1ack - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1requires_1unknown_1bits_1from + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_send_closing_signed - * Signature: ([BJ)J + * Method: BlindedHopFeatures_required_unknown_bits_from + * Signature: (JJ)[J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1closing_1signed - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1required_1unknown_1bits_1from + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_send_shutdown - * Signature: ([BJ)J + * Method: BlindedHopFeatures_requires_unknown_bits + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1shutdown - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1requires_1unknown_1bits + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_send_channel_reestablish - * Signature: ([BJ)J + * Method: BlindedHopFeatures_supports_unknown_bits + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1reestablish - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1supports_1unknown_1bits + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_send_channel_announcement - * Signature: ([BJJ)J + * Method: BlindedHopFeatures_set_required_feature_bit + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1announcement - (JNIEnv *, jclass, jbyteArray, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1set_1required_1feature_1bit + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_broadcast_channel_announcement + * Method: BlindedHopFeatures_set_optional_feature_bit * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1channel_1announcement +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1set_1optional_1feature_1bit (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_broadcast_channel_update + * Method: BlindedHopFeatures_set_required_custom_bit + * Signature: (JJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1set_1required_1custom_1bit + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: BlindedHopFeatures_set_optional_custom_bit + * Signature: (JJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1set_1optional_1custom_1bit + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_empty + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1empty + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_le_flags + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1le_1flags + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_supports_any_optional_bits + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1any_1optional_1bits + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_requires_unknown_bits_from + * Signature: (JJ)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1unknown_1bits_1from + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_required_unknown_bits_from + * Signature: (JJ)[J + */ +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1required_1unknown_1bits_1from + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_requires_unknown_bits + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1unknown_1bits + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_supports_unknown_bits + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1unknown_1bits + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_set_required_feature_bit + * Signature: (JJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1required_1feature_1bit + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_set_optional_feature_bit + * Signature: (JJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1optional_1feature_1bit + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_set_required_custom_bit + * Signature: (JJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1required_1custom_1bit + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_set_optional_custom_bit + * Signature: (JJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1optional_1custom_1bit + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_clear_upfront_shutdown_script * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1channel_1update +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clear_1upfront_1shutdown_1script (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_broadcast_node_announcement + * Method: NodeFeatures_clear_upfront_shutdown_script * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1node_1announcement +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clear_1upfront_1shutdown_1script (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_send_channel_update - * Signature: ([BJ)J + * Method: InitFeatures_clear_shutdown_anysegwit + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1update - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clear_1shutdown_1anysegwit + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_handle_error - * Signature: ([BJ)J + * Method: NodeFeatures_clear_shutdown_anysegwit + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1handle_1error - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clear_1shutdown_1anysegwit + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_send_channel_range_query - * Signature: ([BJ)J + * Method: InitFeatures_clear_wumbo + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1range_1query - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clear_1wumbo + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_send_short_ids_query - * Signature: ([BJ)J + * Method: NodeFeatures_clear_wumbo + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1short_1ids_1query - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clear_1wumbo + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_send_reply_channel_range - * Signature: ([BJ)J + * Method: InitFeatures_clear_scid_privacy + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1reply_1channel_1range - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clear_1scid_1privacy + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_clear_scid_privacy + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clear_1scid_1privacy + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_clear_scid_privacy + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clear_1scid_1privacy + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_clear_anchors_zero_fee_htlc_tx + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clear_1anchors_1zero_1fee_1htlc_1tx + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_clear_anchors_zero_fee_htlc_tx + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clear_1anchors_1zero_1fee_1htlc_1tx + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_clear_anchors_zero_fee_htlc_tx + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clear_1anchors_1zero_1fee_1htlc_1tx + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_clear_route_blinding + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clear_1route_1blinding + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_clear_route_blinding + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clear_1route_1blinding + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_data_loss_protect_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1data_1loss_1protect_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_data_loss_protect_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1data_1loss_1protect_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_supports_data_loss_protect + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1data_1loss_1protect + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_data_loss_protect_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1data_1loss_1protect_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_data_loss_protect_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1data_1loss_1protect_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_supports_data_loss_protect + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1data_1loss_1protect + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_requires_data_loss_protect + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1data_1loss_1protect + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_requires_data_loss_protect + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1data_1loss_1protect + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_initial_routing_sync_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1initial_1routing_1sync_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_initial_routing_sync_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1initial_1routing_1sync_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_initial_routing_sync + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1initial_1routing_1sync + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_upfront_shutdown_script_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1upfront_1shutdown_1script_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_upfront_shutdown_script_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1upfront_1shutdown_1script_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_supports_upfront_shutdown_script + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1upfront_1shutdown_1script + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_upfront_shutdown_script_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1upfront_1shutdown_1script_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_upfront_shutdown_script_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1upfront_1shutdown_1script_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_supports_upfront_shutdown_script + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1upfront_1shutdown_1script + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_requires_upfront_shutdown_script + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1upfront_1shutdown_1script + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_requires_upfront_shutdown_script + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1upfront_1shutdown_1script + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_gossip_queries_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1gossip_1queries_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_gossip_queries_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1gossip_1queries_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_supports_gossip_queries + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1gossip_1queries + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_gossip_queries_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1gossip_1queries_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_gossip_queries_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1gossip_1queries_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_supports_gossip_queries + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1gossip_1queries + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_requires_gossip_queries + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1gossip_1queries + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_requires_gossip_queries + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1gossip_1queries + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_variable_length_onion_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1variable_1length_1onion_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_variable_length_onion_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1variable_1length_1onion_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_supports_variable_length_onion + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1variable_1length_1onion + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_variable_length_onion_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1variable_1length_1onion_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_variable_length_onion_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1variable_1length_1onion_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_supports_variable_length_onion + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1variable_1length_1onion + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceFeatures_set_variable_length_onion_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1variable_1length_1onion_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceFeatures_set_variable_length_onion_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1variable_1length_1onion_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceFeatures_supports_variable_length_onion + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1supports_1variable_1length_1onion + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_requires_variable_length_onion + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1variable_1length_1onion + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_requires_variable_length_onion + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1variable_1length_1onion + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceFeatures_requires_variable_length_onion + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1variable_1length_1onion + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_static_remote_key_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1static_1remote_1key_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_static_remote_key_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1static_1remote_1key_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_supports_static_remote_key + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1static_1remote_1key + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_static_remote_key_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1static_1remote_1key_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_static_remote_key_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1static_1remote_1key_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_supports_static_remote_key + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1static_1remote_1key + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_set_static_remote_key_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1static_1remote_1key_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_set_static_remote_key_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1static_1remote_1key_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_supports_static_remote_key + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1static_1remote_1key + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_requires_static_remote_key + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1static_1remote_1key + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_requires_static_remote_key + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1static_1remote_1key + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_requires_static_remote_key + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1static_1remote_1key + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_payment_secret_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1payment_1secret_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_payment_secret_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1payment_1secret_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_supports_payment_secret + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1payment_1secret + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_payment_secret_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1payment_1secret_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_payment_secret_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1payment_1secret_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_supports_payment_secret + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1payment_1secret + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceFeatures_set_payment_secret_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1payment_1secret_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceFeatures_set_payment_secret_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1payment_1secret_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceFeatures_supports_payment_secret + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1supports_1payment_1secret + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_requires_payment_secret + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1payment_1secret + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_requires_payment_secret + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1payment_1secret + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceFeatures_requires_payment_secret + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1payment_1secret + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_basic_mpp_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1basic_1mpp_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_basic_mpp_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1basic_1mpp_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_supports_basic_mpp + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1basic_1mpp + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_basic_mpp_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1basic_1mpp_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_basic_mpp_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1basic_1mpp_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_supports_basic_mpp + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1basic_1mpp + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceFeatures_set_basic_mpp_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1basic_1mpp_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceFeatures_set_basic_mpp_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1basic_1mpp_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceFeatures_supports_basic_mpp + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1supports_1basic_1mpp + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt12InvoiceFeatures_set_basic_mpp_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1basic_1mpp_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt12InvoiceFeatures_set_basic_mpp_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1basic_1mpp_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt12InvoiceFeatures_supports_basic_mpp + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1supports_1basic_1mpp + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_requires_basic_mpp + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1basic_1mpp + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_requires_basic_mpp + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1basic_1mpp + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceFeatures_requires_basic_mpp + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1basic_1mpp + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt12InvoiceFeatures_requires_basic_mpp + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1requires_1basic_1mpp + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_wumbo_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1wumbo_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_wumbo_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1wumbo_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_supports_wumbo + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1wumbo + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_wumbo_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1wumbo_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_wumbo_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1wumbo_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_supports_wumbo + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1wumbo + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_requires_wumbo + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1wumbo + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_requires_wumbo + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1wumbo + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1anchors_1nonzero_1fee_1htlc_1tx_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_anchors_nonzero_fee_htlc_tx_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1anchors_1nonzero_1fee_1htlc_1tx_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_supports_anchors_nonzero_fee_htlc_tx + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1anchors_1nonzero_1fee_1htlc_1tx + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1anchors_1nonzero_1fee_1htlc_1tx_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1anchors_1nonzero_1fee_1htlc_1tx_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_supports_anchors_nonzero_fee_htlc_tx + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1anchors_1nonzero_1fee_1htlc_1tx + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1anchors_1nonzero_1fee_1htlc_1tx_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1anchors_1nonzero_1fee_1htlc_1tx_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1anchors_1nonzero_1fee_1htlc_1tx + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_requires_anchors_nonzero_fee_htlc_tx + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1anchors_1nonzero_1fee_1htlc_1tx + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_requires_anchors_nonzero_fee_htlc_tx + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1anchors_1nonzero_1fee_1htlc_1tx + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1anchors_1nonzero_1fee_1htlc_1tx + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_anchors_zero_fee_htlc_tx_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_anchors_zero_fee_htlc_tx_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_supports_anchors_zero_fee_htlc_tx + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1anchors_1zero_1fee_1htlc_1tx + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_anchors_zero_fee_htlc_tx_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_anchors_zero_fee_htlc_tx_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_supports_anchors_zero_fee_htlc_tx + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1anchors_1zero_1fee_1htlc_1tx + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1anchors_1zero_1fee_1htlc_1tx + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_requires_anchors_zero_fee_htlc_tx + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1anchors_1zero_1fee_1htlc_1tx + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_requires_anchors_zero_fee_htlc_tx + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1anchors_1zero_1fee_1htlc_1tx + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1anchors_1zero_1fee_1htlc_1tx + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_route_blinding_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1route_1blinding_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_route_blinding_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1route_1blinding_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_supports_route_blinding + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1route_1blinding + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_route_blinding_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1route_1blinding_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_route_blinding_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1route_1blinding_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_supports_route_blinding + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1route_1blinding + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_requires_route_blinding + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1route_1blinding + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_requires_route_blinding + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1route_1blinding + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_shutdown_any_segwit_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1shutdown_1any_1segwit_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_shutdown_any_segwit_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1shutdown_1any_1segwit_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_supports_shutdown_anysegwit + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1shutdown_1anysegwit + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_shutdown_any_segwit_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1shutdown_1any_1segwit_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_shutdown_any_segwit_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1shutdown_1any_1segwit_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_supports_shutdown_anysegwit + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1shutdown_1anysegwit + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_requires_shutdown_anysegwit + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1shutdown_1anysegwit + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_requires_shutdown_anysegwit + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1shutdown_1anysegwit + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_taproot_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1taproot_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_taproot_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1taproot_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_supports_taproot + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1taproot + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_taproot_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1taproot_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_taproot_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1taproot_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_supports_taproot + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1taproot + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_set_taproot_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1taproot_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_set_taproot_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1taproot_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_supports_taproot + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1taproot + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_requires_taproot + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1taproot + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_requires_taproot + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1taproot + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_requires_taproot + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1taproot + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_onion_messages_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1onion_1messages_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_onion_messages_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1onion_1messages_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_supports_onion_messages + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1onion_1messages + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_onion_messages_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1onion_1messages_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_onion_messages_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1onion_1messages_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_supports_onion_messages + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1onion_1messages + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_requires_onion_messages + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1onion_1messages + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_requires_onion_messages + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1onion_1messages + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_channel_type_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1channel_1type_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_channel_type_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1channel_1type_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_supports_channel_type + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1channel_1type + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_channel_type_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1channel_1type_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_channel_type_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1channel_1type_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_supports_channel_type + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1channel_1type + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_requires_channel_type + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1channel_1type + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_requires_channel_type + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1channel_1type + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_scid_privacy_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1scid_1privacy_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_scid_privacy_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1scid_1privacy_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_supports_scid_privacy + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1scid_1privacy + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_scid_privacy_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1scid_1privacy_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_scid_privacy_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1scid_1privacy_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_supports_scid_privacy + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1scid_1privacy + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_set_scid_privacy_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1scid_1privacy_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_set_scid_privacy_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1scid_1privacy_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_supports_scid_privacy + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1scid_1privacy + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_requires_scid_privacy + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1scid_1privacy + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_requires_scid_privacy + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1scid_1privacy + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_requires_scid_privacy + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1scid_1privacy + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceFeatures_set_payment_metadata_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1payment_1metadata_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceFeatures_set_payment_metadata_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1payment_1metadata_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceFeatures_supports_payment_metadata + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1supports_1payment_1metadata + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceFeatures_requires_payment_metadata + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1payment_1metadata + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_zero_conf_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1zero_1conf_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_zero_conf_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1zero_1conf_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_supports_zero_conf + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1zero_1conf + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_zero_conf_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1zero_1conf_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_zero_conf_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1zero_1conf_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_supports_zero_conf + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1zero_1conf + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_set_zero_conf_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1zero_1conf_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_set_zero_conf_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1zero_1conf_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_supports_zero_conf + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1zero_1conf + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_requires_zero_conf + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1zero_1conf + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_requires_zero_conf + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1zero_1conf + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_requires_zero_conf + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1zero_1conf + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_keysend_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1keysend_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_keysend_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1keysend_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_supports_keysend + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1keysend + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_requires_keysend + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1keysend + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_send_gossip_timestamp_filter - * Signature: ([BJ)J + * Method: InitFeatures_set_trampoline_routing_optional + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1gossip_1timestamp_1filter - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1trampoline_1routing_1optional + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageSendEventsProvider_free + * Method: InitFeatures_set_trampoline_routing_required * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1trampoline_1routing_1required (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: EventsProvider_free - * Signature: (J)V + * Method: InitFeatures_supports_trampoline_routing + * Signature: (J)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1free +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1trampoline_1routing (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: EventHandler_free + * Method: NodeFeatures_set_trampoline_routing_optional * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventHandler_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1trampoline_1routing_1optional (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AnchorDescriptor_free + * Method: NodeFeatures_set_trampoline_routing_required * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1trampoline_1routing_1required (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AnchorDescriptor_get_channel_derivation_parameters - * Signature: (J)J + * Method: NodeFeatures_supports_trampoline_routing + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1get_1channel_1derivation_1parameters +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1trampoline_1routing (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AnchorDescriptor_set_channel_derivation_parameters - * Signature: (JJ)V + * Method: Bolt11InvoiceFeatures_set_trampoline_routing_optional + * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1set_1channel_1derivation_1parameters - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1trampoline_1routing_1optional + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AnchorDescriptor_get_outpoint - * Signature: (J)J + * Method: Bolt11InvoiceFeatures_set_trampoline_routing_required + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1get_1outpoint +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1trampoline_1routing_1required (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AnchorDescriptor_set_outpoint - * Signature: (JJ)V + * Method: Bolt11InvoiceFeatures_supports_trampoline_routing + * Signature: (J)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1set_1outpoint - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1supports_1trampoline_1routing + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AnchorDescriptor_new - * Signature: (JJ)J + * Method: InitFeatures_requires_trampoline_routing + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1new - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1trampoline_1routing + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AnchorDescriptor_clone_ptr - * Signature: (J)J + * Method: NodeFeatures_requires_trampoline_routing + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1clone_1ptr +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1trampoline_1routing (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AnchorDescriptor_clone - * Signature: (J)J + * Method: Bolt11InvoiceFeatures_requires_trampoline_routing + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1clone +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1trampoline_1routing (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AnchorDescriptor_eq - * Signature: (JJ)Z + * Method: RoutingFees_free + * Signature: (J)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AnchorDescriptor_previous_utxo - * Signature: (J)J + * Method: RoutingFees_get_base_msat + * Signature: (J)I */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1previous_1utxo +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1base_1msat (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AnchorDescriptor_unsigned_tx_input - * Signature: (J)J + * Method: RoutingFees_set_base_msat + * Signature: (JI)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1unsigned_1tx_1input - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1base_1msat + (JNIEnv *, jclass, jlong, jint); /* * Class: org_ldk_impl_bindings - * Method: AnchorDescriptor_witness_script - * Signature: (J)[B + * Method: RoutingFees_get_proportional_millionths + * Signature: (J)I */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1witness_1script +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1proportional_1millionths (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AnchorDescriptor_tx_input_witness - * Signature: (J[B)[B + * Method: RoutingFees_set_proportional_millionths + * Signature: (JI)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1tx_1input_1witness - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1proportional_1millionths + (JNIEnv *, jclass, jlong, jint); /* * Class: org_ldk_impl_bindings - * Method: AnchorDescriptor_derive_channel_signer - * Signature: (JJ)J + * Method: RoutingFees_new + * Signature: (II)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnchorDescriptor_1derive_1channel_1signer +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1new + (JNIEnv *, jclass, jint, jint); + +/* + * Class: org_ldk_impl_bindings + * Method: RoutingFees_eq + * Signature: (JJ)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RoutingFees_1eq (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: BumpTransactionEvent_free - * Signature: (J)V + * Method: RoutingFees_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BumpTransactionEvent_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BumpTransactionEvent_clone_ptr + * Method: RoutingFees_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BumpTransactionEvent_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BumpTransactionEvent_clone + * Method: RoutingFees_hash * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BumpTransactionEvent_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BumpTransactionEvent_channel_close - * Signature: (J[B[BI[BJJ[J)J + * Method: RouteHint_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BumpTransactionEvent_1channel_1close - (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray, jint, jbyteArray, jlong, jlong, jlongArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BumpTransactionEvent_htlcresolution - * Signature: (J[B[BI[JI)J + * Method: RouteHint_get_a + * Signature: (J)[J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BumpTransactionEvent_1htlcresolution - (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray, jint, jlongArray, jint); +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1a + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BumpTransactionEvent_eq - * Signature: (JJ)Z + * Method: RouteHint_set_a + * Signature: (J[J)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BumpTransactionEvent_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1a + (JNIEnv *, jclass, jlong, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: Input_free - * Signature: (J)V + * Method: RouteHint_new + * Signature: ([J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Input_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1new + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: Input_get_outpoint + * Method: RouteHint_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Input_1get_1outpoint +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Input_set_outpoint - * Signature: (JJ)V + * Method: RouteHint_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Input_1set_1outpoint - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Input_get_previous_utxo + * Method: RouteHint_hash * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Input_1get_1previous_1utxo +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Input_set_previous_utxo - * Signature: (JJ)V + * Method: RouteHint_eq + * Signature: (JJ)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Input_1set_1previous_1utxo +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHint_1eq (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Input_get_satisfaction_weight - * Signature: (J)J + * Method: RouteHintHop_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Input_1get_1satisfaction_1weight +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Input_set_satisfaction_weight - * Signature: (JJ)V + * Method: RouteHintHop_get_src_node_id + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Input_1set_1satisfaction_1weight - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1src_1node_1id + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Input_new - * Signature: (JJJ)J + * Method: RouteHintHop_set_src_node_id + * Signature: (J[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Input_1new - (JNIEnv *, jclass, jlong, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1src_1node_1id + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: Input_clone_ptr + * Method: RouteHintHop_get_short_channel_id * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Input_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1short_1channel_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Input_clone - * Signature: (J)J + * Method: RouteHintHop_set_short_channel_id + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Input_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1short_1channel_1id + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Input_hash + * Method: RouteHintHop_get_fees * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Input_1hash +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1fees (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Input_eq - * Signature: (JJ)Z + * Method: RouteHintHop_set_fees + * Signature: (JJ)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Input_1eq +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1fees (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Utxo_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Utxo_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: Utxo_get_outpoint - * Signature: (J)J + * Method: RouteHintHop_get_cltv_expiry_delta + * Signature: (J)S */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Utxo_1get_1outpoint +JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1cltv_1expiry_1delta (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Utxo_set_outpoint - * Signature: (JJ)V + * Method: RouteHintHop_set_cltv_expiry_delta + * Signature: (JS)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Utxo_1set_1outpoint - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1cltv_1expiry_1delta + (JNIEnv *, jclass, jlong, jshort); /* * Class: org_ldk_impl_bindings - * Method: Utxo_get_output + * Method: RouteHintHop_get_htlc_minimum_msat * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Utxo_1get_1output +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1htlc_1minimum_1msat (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Utxo_set_output + * Method: RouteHintHop_set_htlc_minimum_msat * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Utxo_1set_1output +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1htlc_1minimum_1msat (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Utxo_get_satisfaction_weight + * Method: RouteHintHop_get_htlc_maximum_msat * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Utxo_1get_1satisfaction_1weight +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1htlc_1maximum_1msat (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Utxo_set_satisfaction_weight + * Method: RouteHintHop_set_htlc_maximum_msat * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Utxo_1set_1satisfaction_1weight +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1htlc_1maximum_1msat (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Utxo_new - * Signature: (JJJ)J + * Method: RouteHintHop_new + * Signature: ([BJJSJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Utxo_1new - (JNIEnv *, jclass, jlong, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1new + (JNIEnv *, jclass, jbyteArray, jlong, jlong, jshort, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Utxo_clone_ptr + * Method: RouteHintHop_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Utxo_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Utxo_clone + * Method: RouteHintHop_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Utxo_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Utxo_hash + * Method: RouteHintHop_hash * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Utxo_1hash +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Utxo_eq + * Method: RouteHintHop_eq * Signature: (JJ)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Utxo_1eq +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1eq (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Utxo_new_p2pkh - * Signature: (JJ[B)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Utxo_1new_1p2pkh - (JNIEnv *, jclass, jlong, jlong, jbyteArray); - -/* - * Class: org_ldk_impl_bindings - * Method: CoinSelection_free + * Method: UntrustedString_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CoinSelection_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CoinSelection_get_confirmed_utxos - * Signature: (J)[J - */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_CoinSelection_1get_1confirmed_1utxos +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UntrustedString_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CoinSelection_set_confirmed_utxos - * Signature: (J[J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CoinSelection_1set_1confirmed_1utxos - (JNIEnv *, jclass, jlong, jlongArray); - -/* - * Class: org_ldk_impl_bindings - * Method: CoinSelection_get_change_output - * Signature: (J)J + * Method: UntrustedString_get_a + * Signature: (J)Ljava/lang/String; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CoinSelection_1get_1change_1output +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_UntrustedString_1get_1a (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CoinSelection_set_change_output - * Signature: (JJ)V + * Method: UntrustedString_set_a + * Signature: (JLjava/lang/String;)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CoinSelection_1set_1change_1output - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UntrustedString_1set_1a + (JNIEnv *, jclass, jlong, jstring); /* * Class: org_ldk_impl_bindings - * Method: CoinSelection_new - * Signature: ([JJ)J + * Method: UntrustedString_new + * Signature: (Ljava/lang/String;)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CoinSelection_1new - (JNIEnv *, jclass, jlongArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UntrustedString_1new + (JNIEnv *, jclass, jstring); /* * Class: org_ldk_impl_bindings - * Method: CoinSelection_clone_ptr + * Method: UntrustedString_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CoinSelection_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UntrustedString_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CoinSelection_clone + * Method: UntrustedString_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CoinSelection_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UntrustedString_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CoinSelectionSource_free - * Signature: (J)V + * Method: UntrustedString_eq + * Signature: (JJ)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CoinSelectionSource_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UntrustedString_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: WalletSource_free - * Signature: (J)V + * Method: UntrustedString_hash + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WalletSource_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UntrustedString_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Wallet_free - * Signature: (J)V + * Method: UntrustedString_to_str + * Signature: (J)Ljava/lang/String; */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Wallet_1free +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_UntrustedString_1to_1str (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Wallet_new - * Signature: (JJ)J + * Method: PrintableString_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Wallet_1new - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PrintableString_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Wallet_as_CoinSelectionSource - * Signature: (J)J + * Method: PrintableString_get_a + * Signature: (J)Ljava/lang/String; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Wallet_1as_1CoinSelectionSource +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_PrintableString_1get_1a (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BumpTransactionEventHandler_free - * Signature: (J)V + * Method: PrintableString_set_a + * Signature: (JLjava/lang/String;)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BumpTransactionEventHandler_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PrintableString_1set_1a + (JNIEnv *, jclass, jlong, jstring); /* * Class: org_ldk_impl_bindings - * Method: BumpTransactionEventHandler_new - * Signature: (JJJJ)J + * Method: PrintableString_new + * Signature: (Ljava/lang/String;)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BumpTransactionEventHandler_1new - (JNIEnv *, jclass, jlong, jlong, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PrintableString_1new + (JNIEnv *, jclass, jstring); /* * Class: org_ldk_impl_bindings - * Method: BumpTransactionEventHandler_handle_event - * Signature: (JJ)V + * Method: PrintableString_to_str + * Signature: (J)Ljava/lang/String; */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BumpTransactionEventHandler_1handle_1event - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_PrintableString_1to_1str + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings @@ -52514,10 +55778,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipSync_1none /* * Class: org_ldk_impl_bindings * Method: BackgroundProcessor_start - * Signature: (JJJJJJJJ)J + * Signature: (JJJJJJJJJ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1start - (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong); + (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings @@ -53447,6 +56711,30 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Fallback_1eq JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceSignature_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceSignature_get_a + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceSignature_1get_1a + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceSignature_set_a + * Signature: (J[B)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceSignature_1set_1a + (JNIEnv *, jclass, jlong, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceSignature_new + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceSignature_1new + (JNIEnv *, jclass, jbyteArray); + /* * Class: org_ldk_impl_bindings * Method: Bolt11InvoiceSignature_clone_ptr @@ -53935,6 +57223,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Description_1new JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Description_1into_1inner (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: Description_as_inner + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Description_1as_1inner + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: Description_to_str @@ -54223,78 +57519,6 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1eq JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1to_1str (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: payment_parameters_from_zero_amount_invoice - * Signature: (JJ)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_payment_1parameters_1from_1zero_1amount_1invoice - (JNIEnv *, jclass, jlong, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: payment_parameters_from_invoice - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_payment_1parameters_1from_1invoice - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: create_phantom_invoice - * Signature: (JJLjava/lang/String;I[JJJJLorg/ldk/enums/Currency;JJ)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice - (JNIEnv *, jclass, jlong, jlong, jstring, jint, jlongArray, jlong, jlong, jlong, jobject, jlong, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: create_phantom_invoice_with_description_hash - * Signature: (JJIJ[JJJJLorg/ldk/enums/Currency;JJ)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice_1with_1description_1hash - (JNIEnv *, jclass, jlong, jlong, jint, jlong, jlongArray, jlong, jlong, jlong, jobject, jlong, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: create_invoice_from_channelmanager - * Signature: (JJJLorg/ldk/enums/Currency;JLjava/lang/String;IJ)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager - (JNIEnv *, jclass, jlong, jlong, jlong, jobject, jlong, jstring, jint, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: create_invoice_from_channelmanager_with_description_hash - * Signature: (JJJLorg/ldk/enums/Currency;JJIJ)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1with_1description_1hash - (JNIEnv *, jclass, jlong, jlong, jlong, jobject, jlong, jlong, jint, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch - * Signature: (JJJLorg/ldk/enums/Currency;JJJIJ)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1with_1description_1hash_1and_1duration_1since_1epoch - (JNIEnv *, jclass, jlong, jlong, jlong, jobject, jlong, jlong, jlong, jint, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: create_invoice_from_channelmanager_and_duration_since_epoch - * Signature: (JJJLorg/ldk/enums/Currency;JLjava/lang/String;JIJ)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1and_1duration_1since_1epoch - (JNIEnv *, jclass, jlong, jlong, jlong, jobject, jlong, jstring, jlong, jint, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash - * Signature: (JJJLorg/ldk/enums/Currency;JLjava/lang/String;JI[BJ)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1and_1duration_1since_1epoch_1with_1payment_1hash - (JNIEnv *, jclass, jlong, jlong, jlong, jobject, jlong, jstring, jlong, jint, jbyteArray, jlong); - /* * Class: org_ldk_impl_bindings * Method: SiPrefix_from_str diff --git a/src/main/jni/org_ldk_impl_bindings_LDKAsyncPaymentsMessage.h b/src/main/jni/org_ldk_impl_bindings_LDKAsyncPaymentsMessage.h new file mode 100644 index 00000000..883e370f --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKAsyncPaymentsMessage.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKAsyncPaymentsMessage */ + +#ifndef _Included_org_ldk_impl_bindings_LDKAsyncPaymentsMessage +#define _Included_org_ldk_impl_bindings_LDKAsyncPaymentsMessage +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKAsyncPaymentsMessage + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKAsyncPaymentsMessage_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKBolt12PaymentError.h b/src/main/jni/org_ldk_impl_bindings_LDKBolt12PaymentError.h new file mode 100644 index 00000000..f97e9e91 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKBolt12PaymentError.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKBolt12PaymentError */ + +#ifndef _Included_org_ldk_impl_bindings_LDKBolt12PaymentError +#define _Included_org_ldk_impl_bindings_LDKBolt12PaymentError +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKBolt12PaymentError + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKBolt12PaymentError_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ.h b/src/main/jni/org_ldk_impl_bindings_LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ.h new file mode 100644 index 00000000..868f9c8c --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ */ + +#ifndef _Included_org_ldk_impl_bindings_LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ +#define _Included_org_ldk_impl_bindings_LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C2Tuple_1OffersMessageResponseInstructionZZ_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ.h b/src/main/jni/org_ldk_impl_bindings_LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ.h new file mode 100644 index 00000000..b5c75b5c --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ */ + +#ifndef _Included_org_ldk_impl_bindings_LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ +#define _Included_org_ldk_impl_bindings_LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C2Tuple_1OnionMessageContentsResponseInstructionZZ_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ.h b/src/main/jni/org_ldk_impl_bindings_LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ.h new file mode 100644 index 00000000..d7050494 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ */ + +#ifndef _Included_org_ldk_impl_bindings_LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ +#define _Included_org_ldk_impl_bindings_LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C2Tuple_1ReleaseHeldHtlcResponseInstructionZZ_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKCOption_MessageContextZ.h b/src/main/jni/org_ldk_impl_bindings_LDKCOption_MessageContextZ.h new file mode 100644 index 00000000..2985d35c --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKCOption_MessageContextZ.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKCOption_MessageContextZ */ + +#ifndef _Included_org_ldk_impl_bindings_LDKCOption_MessageContextZ +#define _Included_org_ldk_impl_bindings_LDKCOption_MessageContextZ +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKCOption_MessageContextZ + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1MessageContextZ_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKCOption_NodeAnnouncementInfoZ.h b/src/main/jni/org_ldk_impl_bindings_LDKCOption_NodeAnnouncementInfoZ.h new file mode 100644 index 00000000..19258bf5 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKCOption_NodeAnnouncementInfoZ.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKCOption_NodeAnnouncementInfoZ */ + +#ifndef _Included_org_ldk_impl_bindings_LDKCOption_NodeAnnouncementInfoZ +#define _Included_org_ldk_impl_bindings_LDKCOption_NodeAnnouncementInfoZ +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKCOption_NodeAnnouncementInfoZ + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1NodeAnnouncementInfoZ_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKCOption_OffersContextZ.h b/src/main/jni/org_ldk_impl_bindings_LDKCOption_OffersContextZ.h new file mode 100644 index 00000000..c1985c9e --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKCOption_OffersContextZ.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKCOption_OffersContextZ */ + +#ifndef _Included_org_ldk_impl_bindings_LDKCOption_OffersContextZ +#define _Included_org_ldk_impl_bindings_LDKCOption_OffersContextZ +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKCOption_OffersContextZ + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1OffersContextZ_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKCOption_OffersMessageZ.h b/src/main/jni/org_ldk_impl_bindings_LDKCOption_OffersMessageZ.h deleted file mode 100644 index d083f9ff..00000000 --- a/src/main/jni/org_ldk_impl_bindings_LDKCOption_OffersMessageZ.h +++ /dev/null @@ -1,21 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class org_ldk_impl_bindings_LDKCOption_OffersMessageZ */ - -#ifndef _Included_org_ldk_impl_bindings_LDKCOption_OffersMessageZ -#define _Included_org_ldk_impl_bindings_LDKCOption_OffersMessageZ -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: org_ldk_impl_bindings_LDKCOption_OffersMessageZ - * Method: init - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1OffersMessageZ_init - (JNIEnv *, jclass); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKCOption_SecretKeyZ.h b/src/main/jni/org_ldk_impl_bindings_LDKCOption_SecretKeyZ.h deleted file mode 100644 index a2ef028f..00000000 --- a/src/main/jni/org_ldk_impl_bindings_LDKCOption_SecretKeyZ.h +++ /dev/null @@ -1,21 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class org_ldk_impl_bindings_LDKCOption_SecretKeyZ */ - -#ifndef _Included_org_ldk_impl_bindings_LDKCOption_SecretKeyZ -#define _Included_org_ldk_impl_bindings_LDKCOption_SecretKeyZ -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: org_ldk_impl_bindings_LDKCOption_SecretKeyZ - * Method: init - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1SecretKeyZ_init - (JNIEnv *, jclass); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKFundingInfo.h b/src/main/jni/org_ldk_impl_bindings_LDKFundingInfo.h new file mode 100644 index 00000000..8ec5156e --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKFundingInfo.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKFundingInfo */ + +#ifndef _Included_org_ldk_impl_bindings_LDKFundingInfo +#define _Included_org_ldk_impl_bindings_LDKFundingInfo +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKFundingInfo + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKFundingInfo_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKMessageContext.h b/src/main/jni/org_ldk_impl_bindings_LDKMessageContext.h new file mode 100644 index 00000000..f123f020 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKMessageContext.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKMessageContext */ + +#ifndef _Included_org_ldk_impl_bindings_LDKMessageContext +#define _Included_org_ldk_impl_bindings_LDKMessageContext +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKMessageContext + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageContext_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKMessageSendInstructions.h b/src/main/jni/org_ldk_impl_bindings_LDKMessageSendInstructions.h new file mode 100644 index 00000000..fa0390ab --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKMessageSendInstructions.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKMessageSendInstructions */ + +#ifndef _Included_org_ldk_impl_bindings_LDKMessageSendInstructions +#define _Included_org_ldk_impl_bindings_LDKMessageSendInstructions +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKMessageSendInstructions + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendInstructions_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKNodeAnnouncementInfo.h b/src/main/jni/org_ldk_impl_bindings_LDKNodeAnnouncementInfo.h new file mode 100644 index 00000000..ed21630b --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKNodeAnnouncementInfo.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKNodeAnnouncementInfo */ + +#ifndef _Included_org_ldk_impl_bindings_LDKNodeAnnouncementInfo +#define _Included_org_ldk_impl_bindings_LDKNodeAnnouncementInfo +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKNodeAnnouncementInfo + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNodeAnnouncementInfo_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKOffersContext.h b/src/main/jni/org_ldk_impl_bindings_LDKOffersContext.h new file mode 100644 index 00000000..de5c63b0 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKOffersContext.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKOffersContext */ + +#ifndef _Included_org_ldk_impl_bindings_LDKOffersContext +#define _Included_org_ldk_impl_bindings_LDKOffersContext +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKOffersContext + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKOffersContext_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif